Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0fb2970b authored by Russell King's avatar Russell King
Browse files

drm/armada: remove non-component support



Now that the transition of TDA998x to the component helpers is complete,
remove the non-componentised support from the Armada DRM driver.  All
outputs are expected to use the component helpers from now on.

Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 64291f7d
Loading
Loading
Loading
Loading
+0 −9
Original line number Diff line number Diff line
@@ -14,12 +14,3 @@ config DRM_ARMADA
	  This driver provides no built-in acceleration; acceleration is
	  performed by other IP found on the SoC.  This driver provides
	  kernel mode setting and buffer management to userspace.

config DRM_ARMADA_TDA1998X
	bool "Support TDA1998X HDMI output"
	depends on DRM_ARMADA != n
	depends on I2C && DRM_I2C_NXP_TDA998X = y
	default y
	help
	  Support the TDA1998x HDMI output device found on the Solid-Run
	  CuBox.
+1 −2
Original line number Diff line number Diff line
armada-y	:= armada_crtc.o armada_drv.o armada_fb.o armada_fbdev.o \
		   armada_gem.o armada_output.o armada_overlay.o \
		   armada_slave.o
		   armada_gem.o armada_overlay.o
armada-y	+= armada_510.o
armada-$(CONFIG_DEBUG_FS) += armada_debugfs.o

+1 −1
Original line number Diff line number Diff line
@@ -1044,7 +1044,7 @@ static int armada_drm_crtc_create_properties(struct drm_device *dev)
	return 0;
}

int armada_drm_crtc_create(struct drm_device *drm, struct device *dev,
static int armada_drm_crtc_create(struct drm_device *drm, struct device *dev,
	struct resource *res, int irq, const struct armada_variant *variant,
	struct device_node *port)
{
+0 −4
Original line number Diff line number Diff line
@@ -75,10 +75,6 @@ struct armada_crtc {
};
#define drm_to_armada_crtc(c) container_of(c, struct armada_crtc, crtc)

struct device_node;
int armada_drm_crtc_create(struct drm_device *, struct device *,
	struct resource *, int, const struct armada_variant *,
	struct device_node *);
void armada_drm_crtc_gamma_set(struct drm_crtc *, u16, u16, u16, int);
void armada_drm_crtc_gamma_get(struct drm_crtc *, u16 *, u16 *, u16 *, int);
void armada_drm_crtc_disable_irq(struct armada_crtc *, u32);
+17 −108
Original line number Diff line number Diff line
@@ -18,47 +18,6 @@
#include <drm/armada_drm.h>
#include "armada_ioctlP.h"

#ifdef CONFIG_DRM_ARMADA_TDA1998X
#include <drm/i2c/tda998x.h>
#include "armada_slave.h"

static struct tda998x_encoder_params params = {
	/* With 0x24, there is no translation between vp_out and int_vp
	FB	LCD out	Pins	VIP	Int Vp
	R:23:16	R:7:0	VPC7:0	7:0	7:0[R]
	G:15:8	G:15:8	VPB7:0	23:16	23:16[G]
	B:7:0	B:23:16	VPA7:0	15:8	15:8[B]
	*/
	.swap_a = 2,
	.swap_b = 3,
	.swap_c = 4,
	.swap_d = 5,
	.swap_e = 0,
	.swap_f = 1,
	.audio_cfg = BIT(2),
	.audio_frame[1] = 1,
	.audio_format = AFMT_SPDIF,
	.audio_sample_rate = 44100,
};

static const struct armada_drm_slave_config tda19988_config = {
	.i2c_adapter_id = 0,
	.crtcs = 1 << 0, /* Only LCD0 at the moment */
	.polled = DRM_CONNECTOR_POLL_CONNECT | DRM_CONNECTOR_POLL_DISCONNECT,
	.interlace_allowed = true,
	.info = {
		.type = "tda998x",
		.addr = 0x70,
		.platform_data = &params,
	},
};
#endif

static bool is_componentized(struct device *dev)
{
	return dev->of_node || dev->platform_data;
}

static void armada_drm_unref_work(struct work_struct *work)
{
	struct armada_private *priv =
@@ -91,16 +50,11 @@ void armada_drm_queue_unref_work(struct drm_device *dev,

static int armada_drm_load(struct drm_device *dev, unsigned long flags)
{
	const struct platform_device_id *id;
	const struct armada_variant *variant;
	struct armada_private *priv;
	struct resource *res[ARRAY_SIZE(priv->dcrtc)];
	struct resource *mem = NULL;
	int ret, n, i;
	int ret, n;

	memset(res, 0, sizeof(res));

	for (n = i = 0; ; n++) {
	for (n = 0; ; n++) {
		struct resource *r = platform_get_resource(dev->platformdev,
							   IORESOURCE_MEM, n);
		if (!r)
@@ -109,8 +63,6 @@ static int armada_drm_load(struct drm_device *dev, unsigned long flags)
		/* Resources above 64K are graphics memory */
		if (resource_size(r) > SZ_64K)
			mem = r;
		else if (i < ARRAY_SIZE(priv->dcrtc))
			res[i++] = r;
		else
			return -EINVAL;
	}
@@ -131,13 +83,6 @@ static int armada_drm_load(struct drm_device *dev, unsigned long flags)
	platform_set_drvdata(dev->platformdev, dev);
	dev->dev_private = priv;

	/* Get the implementation specific driver data. */
	id = platform_get_device_id(dev->platformdev);
	if (!id)
		return -ENXIO;

	variant = (const struct armada_variant *)id->driver_data;

	INIT_WORK(&priv->fb_unref_work, armada_drm_unref_work);
	INIT_KFIFO(priv->fb_unref);

@@ -157,34 +102,9 @@ static int armada_drm_load(struct drm_device *dev, unsigned long flags)
	dev->mode_config.funcs = &armada_drm_mode_config_funcs;
	drm_mm_init(&priv->linear, mem->start, resource_size(mem));

	/* Create all LCD controllers */
	for (n = 0; n < ARRAY_SIZE(priv->dcrtc); n++) {
		int irq;

		if (!res[n])
			break;

		irq = platform_get_irq(dev->platformdev, n);
		if (irq < 0)
			goto err_kms;

		ret = armada_drm_crtc_create(dev, dev->dev, res[n], irq,
					     variant, NULL);
		if (ret)
			goto err_kms;
	}

	if (is_componentized(dev->dev)) {
	ret = component_bind_all(dev->dev, dev);
	if (ret)
		goto err_kms;
	} else {
#ifdef CONFIG_DRM_ARMADA_TDA1998X
		ret = armada_drm_connector_slave_create(dev, &tda19988_config);
		if (ret)
			goto err_kms;
#endif
	}

	ret = drm_vblank_init(dev, dev->mode_config.num_crtc);
	if (ret)
@@ -202,7 +122,6 @@ static int armada_drm_load(struct drm_device *dev, unsigned long flags)
	return 0;

 err_comp:
	if (is_componentized(dev->dev))
	component_unbind_all(dev->dev, dev);
 err_kms:
	drm_mode_config_cleanup(dev);
@@ -219,7 +138,6 @@ static int armada_drm_unload(struct drm_device *dev)
	drm_kms_helper_poll_fini(dev);
	armada_fbdev_fini(dev);

	if (is_componentized(dev->dev))
	component_unbind_all(dev->dev, dev);

	drm_mode_config_cleanup(dev);
@@ -435,7 +353,6 @@ static const struct component_master_ops armada_master_ops = {

static int armada_drm_probe(struct platform_device *pdev)
{
	if (is_componentized(&pdev->dev)) {
	struct component_match *match = NULL;
	int ret;

@@ -443,29 +360,21 @@ static int armada_drm_probe(struct platform_device *pdev)
	if (ret < 0)
		return ret;

		return component_master_add_with_match(&pdev->dev,
				&armada_master_ops, match);
	} else {
		return drm_platform_init(&armada_drm_driver, pdev);
	}
	return component_master_add_with_match(&pdev->dev, &armada_master_ops,
					       match);
}

static int armada_drm_remove(struct platform_device *pdev)
{
	if (is_componentized(&pdev->dev))
	component_master_del(&pdev->dev, &armada_master_ops);
	else
		drm_put_dev(platform_get_drvdata(pdev));
	return 0;
}

static const struct platform_device_id armada_drm_platform_ids[] = {
	{
		.name		= "armada-drm",
		.driver_data	= (unsigned long)&armada510_ops,
	}, {
		.name		= "armada-510-drm",
		.driver_data	= (unsigned long)&armada510_ops,
	},
	{ },
};
Loading