diff mbox series

[3/3] drm/bridge: tc358767: disable main link PHYs on main link disable

Message ID 20220706132812.2171250-3-l.stach@pengutronix.de (mailing list archive)
State New, archived
Headers show
Series [1/3] drm/bridge: tc358767: don't fixup mode sync polarity | expand

Commit Message

Lucas Stach July 6, 2022, 1:28 p.m. UTC
Disable the main link PHYs and put them into reset when the main link
is disabled. When the PHYs stay enabled while the rest of the DP link
circuits are disabled there is some noise on the data lanes, which some
displays try to lock onto, waking them up from their low power state.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
 drivers/gpu/drm/bridge/tc358767.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Comments

Robert Foss July 6, 2022, 1:42 p.m. UTC | #1
On Wed, 6 Jul 2022 at 15:28, Lucas Stach <l.stach@pengutronix.de> wrote:
>
> Disable the main link PHYs and put them into reset when the main link
> is disabled. When the PHYs stay enabled while the rest of the DP link
> circuits are disabled there is some noise on the data lanes, which some
> displays try to lock onto, waking them up from their low power state.
>
> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
> ---
>  drivers/gpu/drm/bridge/tc358767.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c
> index fd4936215b55..615b4988bf34 100644
> --- a/drivers/gpu/drm/bridge/tc358767.c
> +++ b/drivers/gpu/drm/bridge/tc358767.c
> @@ -1249,7 +1249,13 @@ static int tc_main_link_disable(struct tc_data *tc)
>         if (ret)
>                 return ret;
>
> -       return regmap_write(tc->regmap, DP0CTL, 0);
> +       ret = regmap_write(tc->regmap, DP0CTL, 0);
> +       if (ret)
> +               return ret;
> +
> +       return regmap_update_bits(tc->regmap, DP_PHY_CTRL,
> +                                 PHY_M0_RST | PHY_M1_RST | PHY_M0_EN,
> +                                 PHY_M0_RST | PHY_M1_RST);
>  }
>
>  static int tc_dsi_rx_enable(struct tc_data *tc)
> --
> 2.30.2
>

Reviewed-by: Robert Foss <robert.foss@linaro.org>
Marek Vasut July 22, 2022, 1:14 a.m. UTC | #2
On 7/6/22 15:28, Lucas Stach wrote:
> Disable the main link PHYs and put them into reset when the main link
> is disabled. When the PHYs stay enabled while the rest of the DP link
> circuits are disabled there is some noise on the data lanes, which some
> displays try to lock onto, waking them up from their low power state.
> 
> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>

Reviewed-by: Marek Vasut <marex@denx.de>
Tested-by: Marek Vasut <marex@denx.de>
Marek Vasut Aug. 9, 2022, 8:48 p.m. UTC | #3
On 7/6/22 15:42, Robert Foss wrote:
> On Wed, 6 Jul 2022 at 15:28, Lucas Stach <l.stach@pengutronix.de> wrote:
>>
>> Disable the main link PHYs and put them into reset when the main link
>> is disabled. When the PHYs stay enabled while the rest of the DP link
>> circuits are disabled there is some noise on the data lanes, which some
>> displays try to lock onto, waking them up from their low power state.
>>
>> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
>> ---
>>   drivers/gpu/drm/bridge/tc358767.c | 8 +++++++-
>>   1 file changed, 7 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c
>> index fd4936215b55..615b4988bf34 100644
>> --- a/drivers/gpu/drm/bridge/tc358767.c
>> +++ b/drivers/gpu/drm/bridge/tc358767.c
>> @@ -1249,7 +1249,13 @@ static int tc_main_link_disable(struct tc_data *tc)
>>          if (ret)
>>                  return ret;
>>
>> -       return regmap_write(tc->regmap, DP0CTL, 0);
>> +       ret = regmap_write(tc->regmap, DP0CTL, 0);
>> +       if (ret)
>> +               return ret;
>> +
>> +       return regmap_update_bits(tc->regmap, DP_PHY_CTRL,
>> +                                 PHY_M0_RST | PHY_M1_RST | PHY_M0_EN,
>> +                                 PHY_M0_RST | PHY_M1_RST);
>>   }
>>
>>   static int tc_dsi_rx_enable(struct tc_data *tc)
>> --
>> 2.30.2
>>
> 
> Reviewed-by: Robert Foss <robert.foss@linaro.org>

Do you want me to apply this ?
diff mbox series

Patch

diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c
index fd4936215b55..615b4988bf34 100644
--- a/drivers/gpu/drm/bridge/tc358767.c
+++ b/drivers/gpu/drm/bridge/tc358767.c
@@ -1249,7 +1249,13 @@  static int tc_main_link_disable(struct tc_data *tc)
 	if (ret)
 		return ret;
 
-	return regmap_write(tc->regmap, DP0CTL, 0);
+	ret = regmap_write(tc->regmap, DP0CTL, 0);
+	if (ret)
+		return ret;
+
+	return regmap_update_bits(tc->regmap, DP_PHY_CTRL,
+				  PHY_M0_RST | PHY_M1_RST | PHY_M0_EN,
+				  PHY_M0_RST | PHY_M1_RST);
 }
 
 static int tc_dsi_rx_enable(struct tc_data *tc)