From debd15ced9937f1581096f36374c62b463e7df74 Mon Sep 17 00:00:00 2001 From: "Liviu Dudau (ARM)" Date: Mon, 23 Nov 2015 16:52:40 +0100 Subject: drm/i2c: tda998x: unregister the connector in the unbind function tda998x uses drm_connector_register() in the .bind function that needs to be balanced with a drm_connector_unregister() in the .unbind. Otherwise dangling sysfs entries are left behind and future rebinds will fail. Signed-off-by: Liviu Dudau Signed-off-by: Russell King --- drivers/gpu/drm/i2c/tda998x_drv.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/gpu/drm/i2c') diff --git a/drivers/gpu/drm/i2c/tda998x_drv.c b/drivers/gpu/drm/i2c/tda998x_drv.c index 896b6aaf8c4d..cdbd83b95770 100644 --- a/drivers/gpu/drm/i2c/tda998x_drv.c +++ b/drivers/gpu/drm/i2c/tda998x_drv.c @@ -1472,6 +1472,7 @@ static void tda998x_unbind(struct device *dev, struct device *master, { struct tda998x_priv *priv = dev_get_drvdata(dev); + drm_connector_unregister(&priv->connector); drm_connector_cleanup(&priv->connector); drm_encoder_cleanup(&priv->encoder); tda998x_destroy(priv); -- cgit v1.2.3 From e4618c467d9ea600cc1412b32ad520f22b8b4833 Mon Sep 17 00:00:00 2001 From: "Liviu Dudau (ARM)" Date: Mon, 23 Nov 2015 16:52:41 +0100 Subject: drm/i2c: tda998x: increase the supported dotclock frequency to 165MHz for TDA19988 Spec sheet states that the TDA19988 supports up to 165MHz dotclock speeds. Without this change modes higher than 1080p are un-attainable. Signed-off-by: Liviu Dudau Signed-off-by: Russell King --- drivers/gpu/drm/i2c/tda998x_drv.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'drivers/gpu/drm/i2c') diff --git a/drivers/gpu/drm/i2c/tda998x_drv.c b/drivers/gpu/drm/i2c/tda998x_drv.c index cdbd83b95770..1ae779581630 100644 --- a/drivers/gpu/drm/i2c/tda998x_drv.c +++ b/drivers/gpu/drm/i2c/tda998x_drv.c @@ -878,7 +878,10 @@ tda998x_encoder_mode_fixup(struct drm_encoder *encoder, static int tda998x_connector_mode_valid(struct drm_connector *connector, struct drm_display_mode *mode) { - if (mode->clock > 150000) + /* TDA19988 dotclock can go up to 165MHz */ + struct tda998x_priv *priv = conn_to_tda998x_priv(connector); + + if (mode->clock > ((priv->rev == TDA19988) ? 165000 : 150000)) return MODE_CLOCK_HIGH; if (mode->htotal >= BIT(13)) return MODE_BAD_HVALUE; -- cgit v1.2.3 From 9736e988d32807d5a186c722928a97f37346fec8 Mon Sep 17 00:00:00 2001 From: "Liviu Dudau (ARM)" Date: Mon, 23 Nov 2015 16:52:42 +0100 Subject: drm/i2c: tda998x: Add support for atomic modesetting When used with a DRIVER_ATOMIC enabled CRTC driver, the tda998x will cause crashes due to missing atomic operations. Fill the drm_connector_funcs struct with the atomic versions of the required functions and add the atomic modeset specific callbacks. Signed-off-by: Liviu Dudau Signed-off-by: Russell King --- drivers/gpu/drm/i2c/tda998x_drv.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'drivers/gpu/drm/i2c') diff --git a/drivers/gpu/drm/i2c/tda998x_drv.c b/drivers/gpu/drm/i2c/tda998x_drv.c index 1ae779581630..0fddb0a2d5b3 100644 --- a/drivers/gpu/drm/i2c/tda998x_drv.c +++ b/drivers/gpu/drm/i2c/tda998x_drv.c @@ -22,6 +22,7 @@ #include #include +#include #include #include #include @@ -1396,10 +1397,13 @@ static void tda998x_connector_destroy(struct drm_connector *connector) } static const struct drm_connector_funcs tda998x_connector_funcs = { - .dpms = drm_helper_connector_dpms, + .dpms = drm_atomic_helper_connector_dpms, + .reset = drm_atomic_helper_connector_reset, .fill_modes = drm_helper_probe_single_connector_modes, .detect = tda998x_connector_detect, .destroy = tda998x_connector_destroy, + .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, + .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, }; static int tda998x_bind(struct device *dev, struct device *master, void *data) -- cgit v1.2.3