Created
October 7, 2017 16:15
-
-
Save phhusson/fffeb89ae7b179d685a9386b9dd44a1c to your computer and use it in GitHub Desktop.
Enable CEC on rk3399-firefly on mainline
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts b/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts | |
index f6fbcc05073e..da373ddad74b 100644 | |
--- a/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts | |
+++ b/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts | |
@@ -257,6 +261,8 @@ | |
&hdmi { | |
ddc-i2c-bus = <&i2c3>; | |
+ pinctrl-names = "default"; | |
+ pinctrl-0 = <&hdmi_cec>; | |
status = "okay"; | |
}; | |
diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi b/arch/arm64/boot/dts/rockchip/rk3399.dtsi | |
index ab7629c5b856..a65f7f744a40 100644 | |
--- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi | |
+++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi | |
@@ -1601,8 +1601,12 @@ | |
compatible = "rockchip,rk3399-dw-hdmi"; | |
reg = <0x0 0xff940000 0x0 0x20000>; | |
interrupts = <GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH 0>; | |
- clocks = <&cru PCLK_HDMI_CTRL>, <&cru SCLK_HDMI_SFR>, <&cru PLL_VPLL>, <&cru PCLK_VIO_GRF>; | |
- clock-names = "iahb", "isfr", "vpll", "grf"; | |
+ clocks = <&cru PCLK_HDMI_CTRL>, | |
+ <&cru SCLK_HDMI_SFR>, | |
+ <&cru PLL_VPLL>, | |
+ <&cru PCLK_VIO_GRF>, | |
+ <&cru SCLK_HDMI_CEC>; | |
+ clock-names = "iahb", "isfr", "vpll", "grf", "cec"; | |
power-domains = <&power RK3399_PD_HDCP>; | |
reg-io-width = <4>; | |
rockchip,grf = <&grf>; | |
diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | |
index 1eb02a82fd91..417f82483f9d 100644 | |
--- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | |
+++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | |
@@ -48,6 +48,7 @@ struct rockchip_hdmi { | |
const struct rockchip_hdmi_chip_data *chip_data; | |
struct clk *vpll_clk; | |
struct clk *grf_clk; | |
+ struct clk *cec_clk; | |
}; | |
#define to_rockchip_hdmi(x) container_of(x, struct rockchip_hdmi, x) | |
@@ -182,6 +183,12 @@ static int rockchip_hdmi_parse_dt(struct rockchip_hdmi *hdmi) | |
return PTR_ERR(hdmi->vpll_clk); | |
} | |
+ hdmi->cec_clk = devm_clk_get(hdmi->dev, "cec"); | |
+ if (!IS_ERR(hdmi->cec_clk)) { | |
+ clk_prepare_enable(hdmi->cec_clk); | |
+ } | |
+ | |
+ | |
hdmi->grf_clk = devm_clk_get(hdmi->dev, "grf"); | |
if (PTR_ERR(hdmi->grf_clk) == -ENOENT) { | |
hdmi->grf_clk = NULL; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment