aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Szyprowski <m.szyprowski@samsung.com>2014-07-01 04:10:07 -0400
committerInki Dae <daeinki@gmail.com>2014-08-03 03:52:14 -0400
commitff830c961d44cd0b3cf483a6c7a5a175c3419427 (patch)
tree29e3400f81205103c65f320d9393893a58dfbe39
parent05fdf98742e41e89816d115decaf478c28477ab9 (diff)
drm/exynos: hdmi: enable exynos 4210 and 4x12 soc support
Configuration sets for Exynos 4210 and 4x12 SoC were already defined in Exynos HDMI and Mixed drivers, but they lacked proper linking to device tree 'compatible' values. This patch fixes this issue adding support for following compatible values: samsung,exynos4210-mixer, samsung,exynos4212-mixer and samsung,exynos4210-hdmi. It also corrects access to sclk_mixer clock, which is available only on Exynos 4210. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
-rw-r--r--Documentation/devicetree/bindings/video/exynos_mixer.txt5
-rw-r--r--drivers/gpu/drm/exynos/exynos_hdmi.c10
-rw-r--r--drivers/gpu/drm/exynos/exynos_mixer.c51
3 files changed, 49 insertions, 17 deletions
diff --git a/Documentation/devicetree/bindings/video/exynos_mixer.txt b/Documentation/devicetree/bindings/video/exynos_mixer.txt
index 7bfde9c9d658..08b394b1edbf 100644
--- a/Documentation/devicetree/bindings/video/exynos_mixer.txt
+++ b/Documentation/devicetree/bindings/video/exynos_mixer.txt
@@ -4,8 +4,9 @@ Required properties:
4- compatible: value should be one of the following: 4- compatible: value should be one of the following:
5 1) "samsung,exynos5-mixer" <DEPRECATED> 5 1) "samsung,exynos5-mixer" <DEPRECATED>
6 2) "samsung,exynos4210-mixer" 6 2) "samsung,exynos4210-mixer"
7 3) "samsung,exynos5250-mixer" 7 3) "samsung,exynos4212-mixer"
8 4) "samsung,exynos5420-mixer" 8 4) "samsung,exynos5250-mixer"
9 5) "samsung,exynos5420-mixer"
9 10
10- reg: physical base address of the mixer and length of memory mapped 11- reg: physical base address of the mixer and length of memory mapped
11 region. 12 region.
diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
index 9ec787f8529a..fd8141f43b35 100644
--- a/drivers/gpu/drm/exynos/exynos_hdmi.c
+++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
@@ -593,6 +593,13 @@ static struct hdmi_driver_data exynos4212_hdmi_driver_data = {
593 .is_apb_phy = 0, 593 .is_apb_phy = 0,
594}; 594};
595 595
596static struct hdmi_driver_data exynos4210_hdmi_driver_data = {
597 .type = HDMI_TYPE13,
598 .phy_confs = hdmiphy_v13_configs,
599 .phy_conf_count = ARRAY_SIZE(hdmiphy_v13_configs),
600 .is_apb_phy = 0,
601};
602
596static struct hdmi_driver_data exynos5_hdmi_driver_data = { 603static struct hdmi_driver_data exynos5_hdmi_driver_data = {
597 .type = HDMI_TYPE14, 604 .type = HDMI_TYPE14,
598 .phy_confs = hdmiphy_v13_configs, 605 .phy_confs = hdmiphy_v13_configs,
@@ -2276,6 +2283,9 @@ static struct of_device_id hdmi_match_types[] = {
2276 .compatible = "samsung,exynos5-hdmi", 2283 .compatible = "samsung,exynos5-hdmi",
2277 .data = &exynos5_hdmi_driver_data, 2284 .data = &exynos5_hdmi_driver_data,
2278 }, { 2285 }, {
2286 .compatible = "samsung,exynos4210-hdmi",
2287 .data = &exynos4210_hdmi_driver_data,
2288 }, {
2279 .compatible = "samsung,exynos4212-hdmi", 2289 .compatible = "samsung,exynos4212-hdmi",
2280 .data = &exynos4212_hdmi_driver_data, 2290 .data = &exynos4212_hdmi_driver_data,
2281 }, { 2291 }, {
diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
index 7529946d0a74..9d0c21a50a86 100644
--- a/drivers/gpu/drm/exynos/exynos_mixer.c
+++ b/drivers/gpu/drm/exynos/exynos_mixer.c
@@ -76,7 +76,7 @@ struct mixer_resources {
76 struct clk *vp; 76 struct clk *vp;
77 struct clk *sclk_mixer; 77 struct clk *sclk_mixer;
78 struct clk *sclk_hdmi; 78 struct clk *sclk_hdmi;
79 struct clk *sclk_dac; 79 struct clk *mout_mixer;
80}; 80};
81 81
82enum mixer_version_id { 82enum mixer_version_id {
@@ -93,6 +93,7 @@ struct mixer_context {
93 bool interlace; 93 bool interlace;
94 bool powered; 94 bool powered;
95 bool vp_enabled; 95 bool vp_enabled;
96 bool has_sclk;
96 u32 int_en; 97 u32 int_en;
97 98
98 struct mutex mixer_mutex; 99 struct mutex mixer_mutex;
@@ -106,6 +107,7 @@ struct mixer_context {
106struct mixer_drv_data { 107struct mixer_drv_data {
107 enum mixer_version_id version; 108 enum mixer_version_id version;
108 bool is_vp_enabled; 109 bool is_vp_enabled;
110 bool has_sclk;
109}; 111};
110 112
111static const u8 filter_y_horiz_tap8[] = { 113static const u8 filter_y_horiz_tap8[] = {
@@ -809,19 +811,23 @@ static int vp_resources_init(struct mixer_context *mixer_ctx)
809 dev_err(dev, "failed to get clock 'vp'\n"); 811 dev_err(dev, "failed to get clock 'vp'\n");
810 return -ENODEV; 812 return -ENODEV;
811 } 813 }
812 mixer_res->sclk_mixer = devm_clk_get(dev, "sclk_mixer");
813 if (IS_ERR(mixer_res->sclk_mixer)) {
814 dev_err(dev, "failed to get clock 'sclk_mixer'\n");
815 return -ENODEV;
816 }
817 mixer_res->sclk_dac = devm_clk_get(dev, "sclk_dac");
818 if (IS_ERR(mixer_res->sclk_dac)) {
819 dev_err(dev, "failed to get clock 'sclk_dac'\n");
820 return -ENODEV;
821 }
822 814
823 if (mixer_res->sclk_hdmi) 815 if (mixer_ctx->has_sclk) {
824 clk_set_parent(mixer_res->sclk_mixer, mixer_res->sclk_hdmi); 816 mixer_res->sclk_mixer = devm_clk_get(dev, "sclk_mixer");
817 if (IS_ERR(mixer_res->sclk_mixer)) {
818 dev_err(dev, "failed to get clock 'sclk_mixer'\n");
819 return -ENODEV;
820 }
821 mixer_res->mout_mixer = devm_clk_get(dev, "mout_mixer");
822 if (IS_ERR(mixer_res->mout_mixer)) {
823 dev_err(dev, "failed to get clock 'mout_mixer'\n");
824 return -ENODEV;
825 }
826
827 if (mixer_res->sclk_hdmi && mixer_res->mout_mixer)
828 clk_set_parent(mixer_res->mout_mixer,
829 mixer_res->sclk_hdmi);
830 }
825 831
826 res = platform_get_resource(mixer_ctx->pdev, IORESOURCE_MEM, 1); 832 res = platform_get_resource(mixer_ctx->pdev, IORESOURCE_MEM, 1);
827 if (res == NULL) { 833 if (res == NULL) {
@@ -1082,7 +1088,8 @@ static void mixer_poweron(struct exynos_drm_manager *mgr)
1082 clk_prepare_enable(res->mixer); 1088 clk_prepare_enable(res->mixer);
1083 if (ctx->vp_enabled) { 1089 if (ctx->vp_enabled) {
1084 clk_prepare_enable(res->vp); 1090 clk_prepare_enable(res->vp);
1085 clk_prepare_enable(res->sclk_mixer); 1091 if (ctx->has_sclk)
1092 clk_prepare_enable(res->sclk_mixer);
1086 } 1093 }
1087 1094
1088 mutex_lock(&ctx->mixer_mutex); 1095 mutex_lock(&ctx->mixer_mutex);
@@ -1121,7 +1128,8 @@ static void mixer_poweroff(struct exynos_drm_manager *mgr)
1121 clk_disable_unprepare(res->mixer); 1128 clk_disable_unprepare(res->mixer);
1122 if (ctx->vp_enabled) { 1129 if (ctx->vp_enabled) {
1123 clk_disable_unprepare(res->vp); 1130 clk_disable_unprepare(res->vp);
1124 clk_disable_unprepare(res->sclk_mixer); 1131 if (ctx->has_sclk)
1132 clk_disable_unprepare(res->sclk_mixer);
1125 } 1133 }
1126 1134
1127 pm_runtime_put_sync(ctx->dev); 1135 pm_runtime_put_sync(ctx->dev);
@@ -1189,9 +1197,15 @@ static struct mixer_drv_data exynos5250_mxr_drv_data = {
1189 .is_vp_enabled = 0, 1197 .is_vp_enabled = 0,
1190}; 1198};
1191 1199
1200static struct mixer_drv_data exynos4212_mxr_drv_data = {
1201 .version = MXR_VER_0_0_0_16,
1202 .is_vp_enabled = 1,
1203};
1204
1192static struct mixer_drv_data exynos4210_mxr_drv_data = { 1205static struct mixer_drv_data exynos4210_mxr_drv_data = {
1193 .version = MXR_VER_0_0_0_16, 1206 .version = MXR_VER_0_0_0_16,
1194 .is_vp_enabled = 1, 1207 .is_vp_enabled = 1,
1208 .has_sclk = 1,
1195}; 1209};
1196 1210
1197static struct platform_device_id mixer_driver_types[] = { 1211static struct platform_device_id mixer_driver_types[] = {
@@ -1208,6 +1222,12 @@ static struct platform_device_id mixer_driver_types[] = {
1208 1222
1209static struct of_device_id mixer_match_types[] = { 1223static struct of_device_id mixer_match_types[] = {
1210 { 1224 {
1225 .compatible = "samsung,exynos4210-mixer",
1226 .data = &exynos4210_mxr_drv_data,
1227 }, {
1228 .compatible = "samsung,exynos4212-mixer",
1229 .data = &exynos4212_mxr_drv_data,
1230 }, {
1211 .compatible = "samsung,exynos5-mixer", 1231 .compatible = "samsung,exynos5-mixer",
1212 .data = &exynos5250_mxr_drv_data, 1232 .data = &exynos5250_mxr_drv_data,
1213 }, { 1233 }, {
@@ -1251,6 +1271,7 @@ static int mixer_bind(struct device *dev, struct device *manager, void *data)
1251 ctx->pdev = pdev; 1271 ctx->pdev = pdev;
1252 ctx->dev = dev; 1272 ctx->dev = dev;
1253 ctx->vp_enabled = drv->is_vp_enabled; 1273 ctx->vp_enabled = drv->is_vp_enabled;
1274 ctx->has_sclk = drv->has_sclk;
1254 ctx->mxr_ver = drv->version; 1275 ctx->mxr_ver = drv->version;
1255 init_waitqueue_head(&ctx->wait_vsync_queue); 1276 init_waitqueue_head(&ctx->wait_vsync_queue);
1256 atomic_set(&ctx->wait_vsync_event, 0); 1277 atomic_set(&ctx->wait_vsync_event, 0);