Skip to contentSkip to conversation

lontium-lt9611: check a different register bit for HDMI sensing

PATCH Applied Peter Collingbourne 5 participants 7 messages Nov 17, 2021 – Nov 30, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lontium-lt9611: check a different register bit for HDMI sensing

It has been observed that with certain monitors such as the HP Z27n, the register 0x825e reads a value of 0x79 when the HDMI cable is connected and 0x78 when it is disconnected, i.e. bit 0 appears to correspond to the HDMI connection status and bit 2 is never set. Therefore, change the driver to check bit 0 instead of bit 2.

---
N.B. I don't currently have easy access to a monitor that works with the existing driver, so it would be great if people with monitors that currently work could test this patch to make sure that it doesn't introduce any regressions. Otherwise I will change it to check both bits.

 drivers/gpu/drm/bridge/lontium-lt9611.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/bridge/lontium-lt9611.c +2 -2
index 29b1ce2140ab..71f1db802916 100644
@@ -586,7 +586,7 @@ lt9611_connector_detect(struct drm_connector *connector, bool force)
 	int connected = 0;
 
 	regmap_read(lt9611->regmap, 0x825e, &reg_val);
-	connected  = (reg_val & BIT(2));
+	connected  = (reg_val & BIT(0));
 
 	lt9611->status = connected ?  connector_status_connected :
 				connector_status_disconnected;
@@ -926,7 +926,7 @@ static enum drm_connector_status lt9611_bridge_detect(struct drm_bridge *bridge)
 	int connected;
 
 	regmap_read(lt9611->regmap, 0x825e, &reg_val);
-	connected  = reg_val & BIT(2);
+	connected  = reg_val & BIT(0);
 
 	lt9611->status = connected ?  connector_status_connected :
 				connector_status_disconnected;
Signature · 1 line
2.34.0.rc1.387.gb447b232ab-goog
#1 lore raw
Quoted 7 lines · Peter Collingbourne

It has been observed that with certain monitors such as the HP Z27n, the register 0x825e reads a value of 0x79 when the HDMI cable is connected and 0x78 when it is disconnected, i.e. bit 0 appears to correspond to the HDMI connection status and bit 2 is never set. Therefore, change the driver to check bit 0 instead of bit 2.

Quoted 8 lines

---
N.B. I don't currently have easy access to a monitor that works with the existing driver, so it would be great if people with monitors that currently work could test this patch to make sure that it doesn't introduce any regressions. Otherwise I will change it to check both bits.

So very interesting! I gave this a spin with my monitors and it works fine.

Vinod: Can you check the datasheet to see if the wrong bit is being used here?

thanks
-john

#2 lore raw

Hi John,

Quoted 17 lines · John Stultz
Quoted 7 lines · Peter Collingbourne

It has been observed that with certain monitors such as the HP Z27n, the register 0x825e reads a value of 0x79 when the HDMI cable is connected and 0x78 when it is disconnected, i.e. bit 0 appears to correspond to the HDMI connection status and bit 2 is never set. Therefore, change the driver to check bit 0 instead of bit 2.

Quoted 8 lines

---
N.B. I don't currently have easy access to a monitor that works with the existing driver, so it would be great if people with monitors that currently work could test this patch to make sure that it doesn't introduce any regressions. Otherwise I will change it to check both bits.

Quoted 3 lines

So very interesting! I gave this a spin with my monitors and it works fine.

Vinod: Can you check the datasheet to see if the wrong bit is being used here?

Well the document I have does not list this register :(

I have asked Lontium folks about this register description, will update if I hear back. Meanwhile we can get this patch tested with different monitors.

Thanks

Signature · 1 line
~Vinod
#3 lore raw
In reply to Peter Collingbourne

Dmitry,

May be this is the reason of my HP monitor not working in RB5.

Regards,
Anibal

Quoted 48 lines · Peter Collingbourne

It has been observed that with certain monitors such as the HP Z27n, the register 0x825e reads a value of 0x79 when the HDMI cable is connected and 0x78 when it is disconnected, i.e. bit 0 appears to correspond to the HDMI connection status and bit 2 is never set. Therefore, change the driver to check bit 0 instead of bit 2.

Link:
https://linux-review.googlesource.com/id/I7e76411127e1ce4988a3f6d0c8ba5f1c3d880c23
---
N.B. I don't currently have easy access to a monitor that works with the existing driver, so it would be great if people with monitors that currently work could test this patch to make sure that it doesn't introduce any regressions. Otherwise I will change it to check both bits.

 drivers/gpu/drm/bridge/lontium-lt9611.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/bridge/lontium-lt9611.c +1 -1
index 29b1ce2140ab..71f1db802916 100644
@@ -586,7 +586,7 @@ lt9611_connector_detect(struct drm_connector
 *connector, bool force)
        int connected = 0;
 
        regmap_read(lt9611->regmap, 0x825e, &reg_val);
-       connected  = (reg_val & BIT(2));
+       connected  = (reg_val & BIT(0));
 
        lt9611->status = connected ?  connector_status_connected :
                                connector_status_disconnected;
drivers/gpu/drm/bridge/lontium-lt9611.c +1 -1
@@ -926,7 +926,7 @@ static enum drm_connector_status
 lt9611_bridge_detect(struct drm_bridge *bridge)
        int connected;
 
        regmap_read(lt9611->regmap, 0x825e, &reg_val);
-       connected  = reg_val & BIT(2);
+       connected  = reg_val & BIT(0);
 
        lt9611->status = connected ?  connector_status_connected :
                                connector_status_disconnected;

--
2.34.0.rc1.387.gb447b232ab-goog

#4 lore raw
Quoted 3 lines · Anibal Limon

Dmitry,

May be this is the reason of my HP monitor not working in RB5.

Rb5 has Lt9611UXC

Quoted 55 lines

Regards,
Anibal

Quoted 48 lines · Peter Collingbourne

It has been observed that with certain monitors such as the HP Z27n, the register 0x825e reads a value of 0x79 when the HDMI cable is connected and 0x78 when it is disconnected, i.e. bit 0 appears to correspond to the HDMI connection status and bit 2 is never set. Therefore, change the driver to check bit 0 instead of bit 2.

Link:
https://linux-review.googlesource.com/id/I7e76411127e1ce4988a3f6d0c8ba5f1c3d880c23
---
N.B. I don't currently have easy access to a monitor that works with the existing driver, so it would be great if people with monitors that currently work could test this patch to make sure that it doesn't introduce any regressions. Otherwise I will change it to check both bits.

 drivers/gpu/drm/bridge/lontium-lt9611.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/bridge/lontium-lt9611.c +1 -1
index 29b1ce2140ab..71f1db802916 100644
@@ -586,7 +586,7 @@ lt9611_connector_detect(struct drm_connector
 *connector, bool force)
        int connected = 0;
 
        regmap_read(lt9611->regmap, 0x825e, &reg_val);
-       connected  = (reg_val & BIT(2));
+       connected  = (reg_val & BIT(0));
 
        lt9611->status = connected ?  connector_status_connected :
                                connector_status_disconnected;
drivers/gpu/drm/bridge/lontium-lt9611.c +1 -1
@@ -926,7 +926,7 @@ static enum drm_connector_status
 lt9611_bridge_detect(struct drm_bridge *bridge)
        int connected;
 
        regmap_read(lt9611->regmap, 0x825e, &reg_val);
-       connected  = reg_val & BIT(2);
+       connected  = reg_val & BIT(0);
 
        lt9611->status = connected ?  connector_status_connected :
                                connector_status_disconnected;

--
2.34.0.rc1.387.gb447b232ab-goog

Signature · 1 line
~Vinod
Reviewed-by on v1 1/1
#5 lore raw
In reply to Peter Collingbourne
Quoted 5 lines · Peter Collingbourne

It has been observed that with certain monitors such as the HP Z27n, the register 0x825e reads a value of 0x79 when the HDMI cable is connected and 0x78 when it is disconnected, i.e. bit 0 appears to correspond to the HDMI connection status and bit 2 is never set. Therefore, change the driver to check bit 0 instead of bit 2.

So we have got limited information on this but BIT-2 seems to be related to HPD and empirical data from various monitors supports this, so this seems the right thing to do.

Signature · 1 line
~Vinod
Applied
#6 lore raw
Quoted 8 lines · Vinod Koul
Quoted 5 lines · Peter Collingbourne

It has been observed that with certain monitors such as the HP Z27n, the register 0x825e reads a value of 0x79 when the HDMI cable is connected and 0x78 when it is disconnected, i.e. bit 0 appears to correspond to the HDMI connection status and bit 2 is never set. Therefore, change the driver to check bit 0 instead of bit 2.

Quoted 6 lines

So we have got limited information on this but BIT-2 seems to be related to HPD and empirical data from various monitors supports this, so this seems the right thing to do.

Applied to drm-misc-next