diff options
author | Philipp Tomsich <philipp.tomsich@theobroma-systems.com> | 2017-04-28 18:33:58 +0200 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2017-05-10 13:37:21 -0600 |
commit | 26e2e404b71bb1f538247817ded404ecf86e9cca (patch) | |
tree | cec1f7ec825e08e844a260e4d0f6590ab3ee27aa | |
parent | ffc1fac549d72ce85205dcdde9af9dfe0f04fd76 (diff) | |
download | u-boot-26e2e404b71bb1f538247817ded404ecf86e9cca.tar.gz |
rockchip: pinctrl: rk3399: add support for the HDMI I2C pins
To add HDMI support for the RK3399, this commit provides the needed
pinctrl functionality to configure the HDMI I2C pins (used for reading
the screen's EDID).
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
-rw-r--r-- | arch/arm/include/asm/arch-rockchip/grf_rk3399.h | 2 | ||||
-rw-r--r-- | drivers/pinctrl/rockchip/pinctrl_rk3399.c | 26 |
2 files changed, 28 insertions, 0 deletions
diff --git a/arch/arm/include/asm/arch-rockchip/grf_rk3399.h b/arch/arm/include/asm/arch-rockchip/grf_rk3399.h index 2e0e7fe58c..7df25fd31d 100644 --- a/arch/arm/include/asm/arch-rockchip/grf_rk3399.h +++ b/arch/arm/include/asm/arch-rockchip/grf_rk3399.h @@ -440,9 +440,11 @@ enum { GRF_GPIO4C0_SEL_SHIFT = 0, GRF_GPIO4C0_SEL_MASK = 3 << GRF_GPIO4C0_SEL_SHIFT, GRF_UART2DGBB_SIN = 2, + GRF_HDMII2C_SCL = 3, GRF_GPIO4C1_SEL_SHIFT = 2, GRF_GPIO4C1_SEL_MASK = 3 << GRF_GPIO4C1_SEL_SHIFT, GRF_UART2DGBB_SOUT = 2, + GRF_HDMII2C_SDA = 3, GRF_GPIO4C2_SEL_SHIFT = 4, GRF_GPIO4C2_SEL_MASK = 3 << GRF_GPIO4C2_SEL_SHIFT, GRF_PWM_0 = 1, diff --git a/drivers/pinctrl/rockchip/pinctrl_rk3399.c b/drivers/pinctrl/rockchip/pinctrl_rk3399.c index c09cd826f6..d93b90310b 100644 --- a/drivers/pinctrl/rockchip/pinctrl_rk3399.c +++ b/drivers/pinctrl/rockchip/pinctrl_rk3399.c @@ -265,6 +265,23 @@ static void pinctrl_rk3399_gmac_config(struct rk3399_grf_regs *grf, int mmc_id) } #endif +#if !defined(CONFIG_SPL_BUILD) +static void pinctrl_rk3399_hdmi_config(struct rk3399_grf_regs *grf, int hdmi_id) +{ + switch (hdmi_id) { + case PERIPH_ID_HDMI: + rk_clrsetreg(&grf->gpio4c_iomux, + GRF_GPIO4C0_SEL_MASK | GRF_GPIO4C1_SEL_MASK, + (GRF_HDMII2C_SCL << GRF_GPIO4C0_SEL_SHIFT) | + (GRF_HDMII2C_SDA << GRF_GPIO4C1_SEL_SHIFT)); + break; + default: + debug("%s: hdmi_id = %d unsupported\n", __func__, hdmi_id); + break; + } +} +#endif + static int rk3399_pinctrl_request(struct udevice *dev, int func, int flags) { struct rk3399_pinctrl_priv *priv = dev_get_priv(dev); @@ -314,6 +331,11 @@ static int rk3399_pinctrl_request(struct udevice *dev, int func, int flags) pinctrl_rk3399_gmac_config(priv->grf, func); break; #endif +#if !defined(CONFIG_SPL_BUILD) + case PERIPH_ID_HDMI: + pinctrl_rk3399_hdmi_config(priv->grf, func); + break; +#endif default: return -EINVAL; } @@ -360,6 +382,10 @@ static int rk3399_pinctrl_get_periph_id(struct udevice *dev, case 12: return PERIPH_ID_GMAC; #endif +#if !defined(CONFIG_SPL_BUILD) + case 23: + return PERIPH_ID_HDMI; +#endif } #endif return -ENOENT; |