diff options
author | Rahul Sharma <rahul.sharma@samsung.com> | 2012-10-04 11:18:54 -0400 |
---|---|---|
committer | Inki Dae <inki.dae@samsung.com> | 2012-10-05 06:15:12 -0400 |
commit | 5a325071a0ac9636f07d6328bafc9e42ce13752c (patch) | |
tree | fc7ee7e2f3a898a04a7f9aab1c14aa3eff7aea7c /drivers | |
parent | aaf8b49e928d58501759e94cc744e97ad9812e68 (diff) |
drm: exynos: hdmi: replace is_v13 with version check in hdmi
This patch removed the is_v13 variable from the hdmi driver context.
It is replaced with condition check for the hdmi version. This cleans
the way for handling further hdmi versions.
Signed-off-by: Rahul Sharma <rahul.sharma@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_hdmi.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c index e3ab840aaff2..89e798b47ded 100644 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c | |||
@@ -47,6 +47,11 @@ | |||
47 | #define MAX_HEIGHT 1080 | 47 | #define MAX_HEIGHT 1080 |
48 | #define get_hdmi_context(dev) platform_get_drvdata(to_platform_device(dev)) | 48 | #define get_hdmi_context(dev) platform_get_drvdata(to_platform_device(dev)) |
49 | 49 | ||
50 | enum hdmi_type { | ||
51 | HDMI_TYPE13, | ||
52 | HDMI_TYPE14, | ||
53 | }; | ||
54 | |||
50 | struct hdmi_resources { | 55 | struct hdmi_resources { |
51 | struct clk *hdmi; | 56 | struct clk *hdmi; |
52 | struct clk *sclk_hdmi; | 57 | struct clk *sclk_hdmi; |
@@ -62,7 +67,6 @@ struct hdmi_context { | |||
62 | struct drm_device *drm_dev; | 67 | struct drm_device *drm_dev; |
63 | bool hpd; | 68 | bool hpd; |
64 | bool powered; | 69 | bool powered; |
65 | bool is_v13; | ||
66 | bool dvi_mode; | 70 | bool dvi_mode; |
67 | struct mutex hdmi_mutex; | 71 | struct mutex hdmi_mutex; |
68 | 72 | ||
@@ -80,6 +84,8 @@ struct hdmi_context { | |||
80 | void *parent_ctx; | 84 | void *parent_ctx; |
81 | 85 | ||
82 | int hpd_gpio; | 86 | int hpd_gpio; |
87 | |||
88 | enum hdmi_type type; | ||
83 | }; | 89 | }; |
84 | 90 | ||
85 | /* HDMI Version 1.3 */ | 91 | /* HDMI Version 1.3 */ |
@@ -1211,7 +1217,7 @@ static void hdmi_v14_regs_dump(struct hdmi_context *hdata, char *prefix) | |||
1211 | 1217 | ||
1212 | static void hdmi_regs_dump(struct hdmi_context *hdata, char *prefix) | 1218 | static void hdmi_regs_dump(struct hdmi_context *hdata, char *prefix) |
1213 | { | 1219 | { |
1214 | if (hdata->is_v13) | 1220 | if (hdata->type == HDMI_TYPE13) |
1215 | hdmi_v13_regs_dump(hdata, prefix); | 1221 | hdmi_v13_regs_dump(hdata, prefix); |
1216 | else | 1222 | else |
1217 | hdmi_v14_regs_dump(hdata, prefix); | 1223 | hdmi_v14_regs_dump(hdata, prefix); |
@@ -1252,7 +1258,7 @@ static int hdmi_v14_conf_index(struct drm_display_mode *mode) | |||
1252 | static int hdmi_conf_index(struct hdmi_context *hdata, | 1258 | static int hdmi_conf_index(struct hdmi_context *hdata, |
1253 | struct drm_display_mode *mode) | 1259 | struct drm_display_mode *mode) |
1254 | { | 1260 | { |
1255 | if (hdata->is_v13) | 1261 | if (hdata->type == HDMI_TYPE13) |
1256 | return hdmi_v13_conf_index(mode); | 1262 | return hdmi_v13_conf_index(mode); |
1257 | 1263 | ||
1258 | return hdmi_v14_conf_index(mode); | 1264 | return hdmi_v14_conf_index(mode); |
@@ -1348,7 +1354,7 @@ static int hdmi_check_timing(void *ctx, void *timing) | |||
1348 | check_timing->yres, check_timing->refresh, | 1354 | check_timing->yres, check_timing->refresh, |
1349 | check_timing->vmode); | 1355 | check_timing->vmode); |
1350 | 1356 | ||
1351 | if (hdata->is_v13) | 1357 | if (hdata->type == HDMI_TYPE13) |
1352 | return hdmi_v13_check_timing(check_timing); | 1358 | return hdmi_v13_check_timing(check_timing); |
1353 | else | 1359 | else |
1354 | return hdmi_v14_check_timing(check_timing); | 1360 | return hdmi_v14_check_timing(check_timing); |
@@ -1414,7 +1420,7 @@ static void hdmi_reg_acr(struct hdmi_context *hdata, u8 *acr) | |||
1414 | hdmi_reg_writeb(hdata, HDMI_ACR_CTS1, acr[2]); | 1420 | hdmi_reg_writeb(hdata, HDMI_ACR_CTS1, acr[2]); |
1415 | hdmi_reg_writeb(hdata, HDMI_ACR_CTS2, acr[1]); | 1421 | hdmi_reg_writeb(hdata, HDMI_ACR_CTS2, acr[1]); |
1416 | 1422 | ||
1417 | if (hdata->is_v13) | 1423 | if (hdata->type == HDMI_TYPE13) |
1418 | hdmi_reg_writeb(hdata, HDMI_V13_ACR_CON, 4); | 1424 | hdmi_reg_writeb(hdata, HDMI_V13_ACR_CON, 4); |
1419 | else | 1425 | else |
1420 | hdmi_reg_writeb(hdata, HDMI_ACR_CON, 4); | 1426 | hdmi_reg_writeb(hdata, HDMI_ACR_CON, 4); |
@@ -1518,7 +1524,7 @@ static void hdmi_conf_reset(struct hdmi_context *hdata) | |||
1518 | { | 1524 | { |
1519 | u32 reg; | 1525 | u32 reg; |
1520 | 1526 | ||
1521 | if (hdata->is_v13) | 1527 | if (hdata->type == HDMI_TYPE13) |
1522 | reg = HDMI_V13_CORE_RSTOUT; | 1528 | reg = HDMI_V13_CORE_RSTOUT; |
1523 | else | 1529 | else |
1524 | reg = HDMI_CORE_RSTOUT; | 1530 | reg = HDMI_CORE_RSTOUT; |
@@ -1550,7 +1556,7 @@ static void hdmi_conf_init(struct hdmi_context *hdata) | |||
1550 | HDMI_VID_PREAMBLE_DIS | HDMI_GUARD_BAND_DIS); | 1556 | HDMI_VID_PREAMBLE_DIS | HDMI_GUARD_BAND_DIS); |
1551 | } | 1557 | } |
1552 | 1558 | ||
1553 | if (hdata->is_v13) { | 1559 | if (hdata->type == HDMI_TYPE13) { |
1554 | /* choose bluescreen (fecal) color */ | 1560 | /* choose bluescreen (fecal) color */ |
1555 | hdmi_reg_writeb(hdata, HDMI_V13_BLUE_SCREEN_0, 0x12); | 1561 | hdmi_reg_writeb(hdata, HDMI_V13_BLUE_SCREEN_0, 0x12); |
1556 | hdmi_reg_writeb(hdata, HDMI_V13_BLUE_SCREEN_1, 0x34); | 1562 | hdmi_reg_writeb(hdata, HDMI_V13_BLUE_SCREEN_1, 0x34); |
@@ -1832,7 +1838,7 @@ static void hdmi_v14_timing_apply(struct hdmi_context *hdata) | |||
1832 | 1838 | ||
1833 | static void hdmi_timing_apply(struct hdmi_context *hdata) | 1839 | static void hdmi_timing_apply(struct hdmi_context *hdata) |
1834 | { | 1840 | { |
1835 | if (hdata->is_v13) | 1841 | if (hdata->type == HDMI_TYPE13) |
1836 | hdmi_v13_timing_apply(hdata); | 1842 | hdmi_v13_timing_apply(hdata); |
1837 | else | 1843 | else |
1838 | hdmi_v14_timing_apply(hdata); | 1844 | hdmi_v14_timing_apply(hdata); |
@@ -1854,7 +1860,7 @@ static void hdmiphy_conf_reset(struct hdmi_context *hdata) | |||
1854 | if (hdata->hdmiphy_port) | 1860 | if (hdata->hdmiphy_port) |
1855 | i2c_master_send(hdata->hdmiphy_port, buffer, 2); | 1861 | i2c_master_send(hdata->hdmiphy_port, buffer, 2); |
1856 | 1862 | ||
1857 | if (hdata->is_v13) | 1863 | if (hdata->type == HDMI_TYPE13) |
1858 | reg = HDMI_V13_PHY_RSTOUT; | 1864 | reg = HDMI_V13_PHY_RSTOUT; |
1859 | else | 1865 | else |
1860 | reg = HDMI_PHY_RSTOUT; | 1866 | reg = HDMI_PHY_RSTOUT; |
@@ -1881,7 +1887,7 @@ static void hdmiphy_conf_apply(struct hdmi_context *hdata) | |||
1881 | } | 1887 | } |
1882 | 1888 | ||
1883 | /* pixel clock */ | 1889 | /* pixel clock */ |
1884 | if (hdata->is_v13) | 1890 | if (hdata->type == HDMI_TYPE13) |
1885 | hdmiphy_data = hdmi_v13_confs[hdata->cur_conf].hdmiphy_data; | 1891 | hdmiphy_data = hdmi_v13_confs[hdata->cur_conf].hdmiphy_data; |
1886 | else | 1892 | else |
1887 | hdmiphy_data = hdmi_confs[hdata->cur_conf].hdmiphy_data; | 1893 | hdmiphy_data = hdmi_confs[hdata->cur_conf].hdmiphy_data; |
@@ -1949,7 +1955,7 @@ static void hdmi_mode_fixup(void *ctx, struct drm_connector *connector, | |||
1949 | 1955 | ||
1950 | drm_mode_set_crtcinfo(adjusted_mode, 0); | 1956 | drm_mode_set_crtcinfo(adjusted_mode, 0); |
1951 | 1957 | ||
1952 | if (hdata->is_v13) | 1958 | if (hdata->type == HDMI_TYPE13) |
1953 | index = hdmi_v13_conf_index(adjusted_mode); | 1959 | index = hdmi_v13_conf_index(adjusted_mode); |
1954 | else | 1960 | else |
1955 | index = hdmi_v14_conf_index(adjusted_mode); | 1961 | index = hdmi_v14_conf_index(adjusted_mode); |
@@ -1963,7 +1969,7 @@ static void hdmi_mode_fixup(void *ctx, struct drm_connector *connector, | |||
1963 | * to adjusted_mode. | 1969 | * to adjusted_mode. |
1964 | */ | 1970 | */ |
1965 | list_for_each_entry(m, &connector->modes, head) { | 1971 | list_for_each_entry(m, &connector->modes, head) { |
1966 | if (hdata->is_v13) | 1972 | if (hdata->type == HDMI_TYPE13) |
1967 | index = hdmi_v13_conf_index(m); | 1973 | index = hdmi_v13_conf_index(m); |
1968 | else | 1974 | else |
1969 | index = hdmi_v14_conf_index(m); | 1975 | index = hdmi_v14_conf_index(m); |
@@ -2244,11 +2250,6 @@ void hdmi_attach_hdmiphy_client(struct i2c_client *hdmiphy) | |||
2244 | hdmi_hdmiphy = hdmiphy; | 2250 | hdmi_hdmiphy = hdmiphy; |
2245 | } | 2251 | } |
2246 | 2252 | ||
2247 | enum hdmi_type { | ||
2248 | HDMI_TYPE13, | ||
2249 | HDMI_TYPE14, | ||
2250 | }; | ||
2251 | |||
2252 | static struct platform_device_id hdmi_driver_types[] = { | 2253 | static struct platform_device_id hdmi_driver_types[] = { |
2253 | { | 2254 | { |
2254 | .name = "s5pv210-hdmi", | 2255 | .name = "s5pv210-hdmi", |
@@ -2272,7 +2273,6 @@ static int __devinit hdmi_probe(struct platform_device *pdev) | |||
2272 | struct s5p_hdmi_platform_data *pdata; | 2273 | struct s5p_hdmi_platform_data *pdata; |
2273 | struct resource *res; | 2274 | struct resource *res; |
2274 | int ret; | 2275 | int ret; |
2275 | enum hdmi_type hdmi_type; | ||
2276 | 2276 | ||
2277 | DRM_DEBUG_KMS("[%d]\n", __LINE__); | 2277 | DRM_DEBUG_KMS("[%d]\n", __LINE__); |
2278 | 2278 | ||
@@ -2303,8 +2303,8 @@ static int __devinit hdmi_probe(struct platform_device *pdev) | |||
2303 | 2303 | ||
2304 | platform_set_drvdata(pdev, drm_hdmi_ctx); | 2304 | platform_set_drvdata(pdev, drm_hdmi_ctx); |
2305 | 2305 | ||
2306 | hdmi_type = platform_get_device_id(pdev)->driver_data; | 2306 | hdata->type = (enum hdmi_type)platform_get_device_id |
2307 | hdata->is_v13 = (hdmi_type == HDMI_TYPE13); | 2307 | (pdev)->driver_data; |
2308 | hdata->hpd_gpio = pdata->hpd_gpio; | 2308 | hdata->hpd_gpio = pdata->hpd_gpio; |
2309 | hdata->dev = dev; | 2309 | hdata->dev = dev; |
2310 | 2310 | ||