diff mbox series

[4/4] drm/bridge: sii902x: pixel clock unit is 10kHz instead of 1kHz

Message ID 538ba3bce4c287d8e137003cc3c4e13e570ea8fe.1551090126.git.jsarha@ti.com
State Superseded
Headers show
Series drm/bridge: sii902x: HDMI-audio support and some fixes | expand

Commit Message

Jyri Sarha Feb. 25, 2019, 11:23 a.m. UTC
The pixel clock unit in the first two registers (0x00 and 0x01) of
sii9022 is 10kHz, not 1kHz as in struct drm_display_mode. Division by
10 fixes the issue.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
 drivers/gpu/drm/bridge/sii902x.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Andrzej Hajda Feb. 25, 2019, 1:01 p.m. UTC | #1
On 25.02.2019 12:23, Jyri Sarha wrote:
> The pixel clock unit in the first two registers (0x00 and 0x01) of
> sii9022 is 10kHz, not 1kHz as in struct drm_display_mode. Division by
> 10 fixes the issue.
>
> Signed-off-by: Jyri Sarha <jsarha@ti.com>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>

 --
Regards
Andrzej
> ---
>  drivers/gpu/drm/bridge/sii902x.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/bridge/sii902x.c b/drivers/gpu/drm/bridge/sii902x.c
> index f296a33c57c7..9cf0dbb6c764 100644
> --- a/drivers/gpu/drm/bridge/sii902x.c
> +++ b/drivers/gpu/drm/bridge/sii902x.c
> @@ -358,10 +358,11 @@ static void sii902x_bridge_mode_set(struct drm_bridge *bridge,
>  	struct regmap *regmap = sii902x->regmap;
>  	u8 buf[HDMI_INFOFRAME_SIZE(AVI)];
>  	struct hdmi_avi_infoframe frame;
> +	u16 pixel_clock_10kHz = adj->clock / 10;
>  	int ret;
>  
> -	buf[0] = adj->clock;
> -	buf[1] = adj->clock >> 8;
> +	buf[0] = pixel_clock_10kHz & 0xFF;
> +	buf[1] = pixel_clock_10kHz >> 8;
>  	buf[2] = adj->vrefresh;
>  	buf[3] = 0x00;
>  	buf[4] = adj->hdisplay;
diff mbox series

Patch

diff --git a/drivers/gpu/drm/bridge/sii902x.c b/drivers/gpu/drm/bridge/sii902x.c
index f296a33c57c7..9cf0dbb6c764 100644
--- a/drivers/gpu/drm/bridge/sii902x.c
+++ b/drivers/gpu/drm/bridge/sii902x.c
@@ -358,10 +358,11 @@  static void sii902x_bridge_mode_set(struct drm_bridge *bridge,
 	struct regmap *regmap = sii902x->regmap;
 	u8 buf[HDMI_INFOFRAME_SIZE(AVI)];
 	struct hdmi_avi_infoframe frame;
+	u16 pixel_clock_10kHz = adj->clock / 10;
 	int ret;
 
-	buf[0] = adj->clock;
-	buf[1] = adj->clock >> 8;
+	buf[0] = pixel_clock_10kHz & 0xFF;
+	buf[1] = pixel_clock_10kHz >> 8;
 	buf[2] = adj->vrefresh;
 	buf[3] = 0x00;
 	buf[4] = adj->hdisplay;