Skip to content

Commit 9d0ec51

Browse files
cristiccvinodkoul
authored andcommitted
phy: rockchip: samsung-hdptx: Add high color depth management
Add support for 8-bit, 10-bit, 12-bit and 16-bit color depth setup. Reviewed-by: Dmitry Baryshkov <[email protected]> Signed-off-by: Cristian Ciocaltea <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 45b14bd commit 9d0ec51

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

drivers/phy/rockchip/phy-rockchip-samsung-hdptx.c

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1028,6 +1028,9 @@ static int rk_hdptx_ropll_tmds_cmn_config(struct rk_hdptx_phy *hdptx)
10281028
regmap_update_bits(hdptx->regmap, CMN_REG(0086), PLL_PCG_POSTDIV_SEL_MASK,
10291029
FIELD_PREP(PLL_PCG_POSTDIV_SEL_MASK, cfg->pms_sdiv));
10301030

1031+
regmap_update_bits(hdptx->regmap, CMN_REG(0086), PLL_PCG_CLK_SEL_MASK,
1032+
FIELD_PREP(PLL_PCG_CLK_SEL_MASK, (hdptx->hdmi_cfg.bpc - 8) >> 1));
1033+
10311034
regmap_update_bits(hdptx->regmap, CMN_REG(0086), PLL_PCG_CLK_EN_MASK,
10321035
FIELD_PREP(PLL_PCG_CLK_EN_MASK, 0x1));
10331036

@@ -1427,7 +1430,8 @@ static int rk_hdptx_phy_power_on(struct phy *phy)
14271430
hdptx->hdmi_cfg.tmds_char_rate *= 100;
14281431
}
14291432

1430-
dev_dbg(hdptx->dev, "%s rate=%llu\n", __func__, hdptx->hdmi_cfg.tmds_char_rate);
1433+
dev_dbg(hdptx->dev, "%s rate=%llu bpc=%u\n", __func__,
1434+
hdptx->hdmi_cfg.tmds_char_rate, hdptx->hdmi_cfg.bpc);
14311435
}
14321436

14331437
ret = rk_hdptx_phy_consumer_get(hdptx);
@@ -1492,6 +1496,19 @@ static int rk_hdptx_phy_verify_hdmi_config(struct rk_hdptx_phy *hdptx,
14921496
!rk_hdptx_phy_clk_pll_calc(hdmi->tmds_char_rate, NULL))
14931497
return -EINVAL;
14941498

1499+
if (!hdmi->bpc)
1500+
hdmi->bpc = 8;
1501+
1502+
switch (hdmi->bpc) {
1503+
case 8:
1504+
case 10:
1505+
case 12:
1506+
case 16:
1507+
break;
1508+
default:
1509+
return -EINVAL;
1510+
};
1511+
14951512
return 0;
14961513
}
14971514

@@ -1764,6 +1781,9 @@ static int rk_hdptx_phy_configure(struct phy *phy, union phy_configure_opts *opt
17641781
hdptx->hdmi_cfg = opts->hdmi;
17651782
hdptx->restrict_rate_change = true;
17661783
}
1784+
1785+
dev_dbg(hdptx->dev, "%s rate=%llu bpc=%u\n", __func__,
1786+
hdptx->hdmi_cfg.tmds_char_rate, hdptx->hdmi_cfg.bpc);
17671787
return ret;
17681788
}
17691789

@@ -1972,6 +1992,7 @@ static int rk_hdptx_phy_probe(struct platform_device *pdev)
19721992
return -ENOMEM;
19731993

19741994
hdptx->dev = dev;
1995+
hdptx->hdmi_cfg.bpc = 8;
19751996

19761997
regs = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
19771998
if (IS_ERR(regs))

0 commit comments

Comments
 (0)