Commit e742a17c authored by Maxime Ripard's avatar Maxime Ripard

drm/sun4i: tcon: Reduce the scope of the LVDS error a bit

The current logic to deal with old DT missing the LVDS properties doesn't
take into account whether the LVDS output is supported in the first place,
resulting in spurious error messages on SoCs where it doesn't even matter.

Introduce a new TCON flag to list if LVDS is supported at all to prevent
this from happening.
Reviewed-by: default avatarChen-Yu Tsai <wens@csie.org>
Signed-off-by: default avatarMaxime Ripard <maxime.ripard@bootlin.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180221125703.4595-1-maxime.ripard@bootlin.com
parent f3e5feeb
...@@ -875,12 +875,13 @@ static int sun4i_tcon_bind(struct device *dev, struct device *master, ...@@ -875,12 +875,13 @@ static int sun4i_tcon_bind(struct device *dev, struct device *master,
return ret; return ret;
} }
if (tcon->quirks->supports_lvds) {
/* /*
* This can only be made optional since we've had DT nodes * This can only be made optional since we've had DT
* without the LVDS reset properties. * nodes without the LVDS reset properties.
* *
* If the property is missing, just disable LVDS, and print a * If the property is missing, just disable LVDS, and
* warning. * print a warning.
*/ */
tcon->lvds_rst = devm_reset_control_get_optional(dev, "lvds"); tcon->lvds_rst = devm_reset_control_get_optional(dev, "lvds");
if (IS_ERR(tcon->lvds_rst)) { if (IS_ERR(tcon->lvds_rst)) {
...@@ -894,11 +895,11 @@ static int sun4i_tcon_bind(struct device *dev, struct device *master, ...@@ -894,11 +895,11 @@ static int sun4i_tcon_bind(struct device *dev, struct device *master,
} }
/* /*
* This can only be made optional since we've had DT nodes * This can only be made optional since we've had DT
* without the LVDS reset properties. * nodes without the LVDS reset properties.
* *
* If the property is missing, just disable LVDS, and print a * If the property is missing, just disable LVDS, and
* warning. * print a warning.
*/ */
if (tcon->quirks->has_lvds_alt) { if (tcon->quirks->has_lvds_alt) {
tcon->lvds_pll = devm_clk_get(dev, "lvds-alt"); tcon->lvds_pll = devm_clk_get(dev, "lvds-alt");
...@@ -914,14 +915,17 @@ static int sun4i_tcon_bind(struct device *dev, struct device *master, ...@@ -914,14 +915,17 @@ static int sun4i_tcon_bind(struct device *dev, struct device *master,
} }
} }
if (!has_lvds_rst || (tcon->quirks->has_lvds_alt && !has_lvds_alt)) { if (!has_lvds_rst ||
dev_warn(dev, (tcon->quirks->has_lvds_alt && !has_lvds_alt)) {
"Missing LVDS properties, Please upgrade your DT\n"); dev_warn(dev, "Missing LVDS properties, Please upgrade your DT\n");
dev_warn(dev, "LVDS output disabled\n"); dev_warn(dev, "LVDS output disabled\n");
can_lvds = false; can_lvds = false;
} else { } else {
can_lvds = true; can_lvds = true;
} }
} else {
can_lvds = false;
}
ret = sun4i_tcon_init_clocks(dev, tcon); ret = sun4i_tcon_init_clocks(dev, tcon);
if (ret) { if (ret) {
...@@ -1139,7 +1143,7 @@ static const struct sun4i_tcon_quirks sun8i_a33_quirks = { ...@@ -1139,7 +1143,7 @@ static const struct sun4i_tcon_quirks sun8i_a33_quirks = {
}; };
static const struct sun4i_tcon_quirks sun8i_a83t_lcd_quirks = { static const struct sun4i_tcon_quirks sun8i_a83t_lcd_quirks = {
/* nothing is supported */ .supports_lvds = true,
}; };
static const struct sun4i_tcon_quirks sun8i_v3s_quirks = { static const struct sun4i_tcon_quirks sun8i_v3s_quirks = {
......
...@@ -175,6 +175,7 @@ struct sun4i_tcon_quirks { ...@@ -175,6 +175,7 @@ struct sun4i_tcon_quirks {
bool has_channel_1; /* a33 does not have channel 1 */ bool has_channel_1; /* a33 does not have channel 1 */
bool has_lvds_alt; /* Does the LVDS clock have a parent other than the TCON clock? */ bool has_lvds_alt; /* Does the LVDS clock have a parent other than the TCON clock? */
bool needs_de_be_mux; /* sun6i needs mux to select backend */ bool needs_de_be_mux; /* sun6i needs mux to select backend */
bool supports_lvds; /* Does the TCON support an LVDS output? */
/* callback to handle tcon muxing options */ /* callback to handle tcon muxing options */
int (*set_mux)(struct sun4i_tcon *, const struct drm_encoder *); int (*set_mux)(struct sun4i_tcon *, const struct drm_encoder *);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment