drm/exynos/hdmi: synchronize sysreg code with mainline 14/93514/6
authorAndrzej Hajda <a.hajda@samsung.com>
Mon, 24 Oct 2016 12:15:12 +0000 (14:15 +0200)
committerInki Dae <inki.dae@samsung.com>
Wed, 16 Nov 2016 23:09:42 +0000 (15:09 -0800)
There are no other users of sysreg besides 5433. The code can be simplified.
The patch synchronizes the code with mainline.

Change-Id: Ie6996e69388b2ea5afece292b56317d60caa91b0
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
drivers/gpu/drm/exynos/exynos_hdmi.c
drivers/gpu/drm/exynos/regs-hdmi.h

index eab5b4fabdb9ece2059dce5c8f10506e667179d1..6983dcdc9ca19d5054a21dca87c81d601f7c81c5 100644 (file)
@@ -121,7 +121,6 @@ struct hdmi_driver_data {
        unsigned int has_sysreg:1;
        unsigned int has_phy_power:1;
        u8 phy_mode_set_done;
-       u32 sysreg_clksel;
        struct string_array_spec clk_gates;
        struct string_array_spec clk_muxes;
 };
@@ -663,7 +662,6 @@ static const struct hdmi_driver_data exynos5430_hdmi_driver_data = {
        .is_apb_phy     = 1,
        .has_sysreg     = 1,
        .has_phy_power  = 1,
-       .sysreg_clksel  = EXYNOS5433_SYSREG_DISP_HDMI_PHY,
        .clk_gates      = INIT_ARRAY_SPEC(hdmi_clk_gates5430),
        .clk_muxes      = INIT_ARRAY_SPEC(hdmi_clk_muxes5430),
        .phy_mode_set_done = HDMIPHY5433_MODE_SET_DONE,
@@ -1580,13 +1578,13 @@ static void hdmi_conf_apply(struct hdmi_context *hdata)
        hdata->applied = true;
 }
 
-static void hdmi_set_refclk(struct hdmi_context *hdata, u32 val)
+static void hdmi_set_refclk(struct hdmi_context *hdata, bool on)
 {
        if (!hdata->sysreg)
                return;
 
-       regmap_update_bits(hdata->sysreg, hdata->drv_data->sysreg_clksel,
-                          SYSREG_HDMI_REFCLK_SEL, val);
+       regmap_update_bits(hdata->sysreg, EXYNOS5433_SYSREG_DISP_HDMI_PHY,
+                          SYSREG_HDMI_REFCLK_INT_CLK, on ? ~0 : 0);
 }
 
 static void hdmi_phy_power(struct hdmi_context *hdata, bool enable)
@@ -1613,7 +1611,7 @@ static void hdmiphy_enable(struct hdmi_context *hdata)
        regmap_update_bits(hdata->pmureg, PMU_HDMI_PHY_CONTROL,
                           PMU_HDMI_PHY_ENABLE_BIT, 1);
 
-       hdmi_set_refclk(hdata, SYSREG_HDMI_REFCLK_INT_CLK);
+       hdmi_set_refclk(hdata, true);
 
        hdmi_clk_enable_gates(hdata);
 
@@ -1694,7 +1692,7 @@ static void hdmi_poweroff(struct hdmi_context *hdata)
        if (!hdata->powered)
                return;
 
-       hdmi_set_refclk(hdata, SYSREG_HDMI_REFCLK_CLKI);
+       hdmi_set_refclk(hdata, false);
 
        /* HDMI System Disable */
        hdmi_reg_writemask(hdata, HDMI_CON_0, 0, HDMI_EN);
index 24b17014875addf8d9d65b852801c163657f912d..ba4f16d3678fdacd2ddd7efb58d5d28983e80278 100644 (file)
 
 #define EXYNOS7420_SYSREG_DISP_HDMI_PHY        0x0838
 #define EXYNOS5433_SYSREG_DISP_HDMI_PHY        0x1008
-#define SYSREG_HDMI_REFCLK_SEL         BIT(0)
-#define SYSREG_HDMI_REFCLK_CLKI                0
 #define SYSREG_HDMI_REFCLK_INT_CLK     1
 
 #endif /* SAMSUNG_REGS_HDMI_H */