Commit ff830c96 authored by Marek Szyprowski's avatar Marek Szyprowski Committed by Inki Dae

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: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: default avatarInki Dae <inki.dae@samsung.com>
parent 05fdf987
...@@ -4,8 +4,9 @@ Required properties: ...@@ -4,8 +4,9 @@ Required properties:
- compatible: value should be one of the following: - compatible: value should be one of the following:
1) "samsung,exynos5-mixer" <DEPRECATED> 1) "samsung,exynos5-mixer" <DEPRECATED>
2) "samsung,exynos4210-mixer" 2) "samsung,exynos4210-mixer"
3) "samsung,exynos5250-mixer" 3) "samsung,exynos4212-mixer"
4) "samsung,exynos5420-mixer" 4) "samsung,exynos5250-mixer"
5) "samsung,exynos5420-mixer"
- reg: physical base address of the mixer and length of memory mapped - reg: physical base address of the mixer and length of memory mapped
region. region.
......
...@@ -593,6 +593,13 @@ static struct hdmi_driver_data exynos4212_hdmi_driver_data = { ...@@ -593,6 +593,13 @@ static struct hdmi_driver_data exynos4212_hdmi_driver_data = {
.is_apb_phy = 0, .is_apb_phy = 0,
}; };
static struct hdmi_driver_data exynos4210_hdmi_driver_data = {
.type = HDMI_TYPE13,
.phy_confs = hdmiphy_v13_configs,
.phy_conf_count = ARRAY_SIZE(hdmiphy_v13_configs),
.is_apb_phy = 0,
};
static struct hdmi_driver_data exynos5_hdmi_driver_data = { static struct hdmi_driver_data exynos5_hdmi_driver_data = {
.type = HDMI_TYPE14, .type = HDMI_TYPE14,
.phy_confs = hdmiphy_v13_configs, .phy_confs = hdmiphy_v13_configs,
...@@ -2275,6 +2282,9 @@ static struct of_device_id hdmi_match_types[] = { ...@@ -2275,6 +2282,9 @@ static struct of_device_id hdmi_match_types[] = {
{ {
.compatible = "samsung,exynos5-hdmi", .compatible = "samsung,exynos5-hdmi",
.data = &exynos5_hdmi_driver_data, .data = &exynos5_hdmi_driver_data,
}, {
.compatible = "samsung,exynos4210-hdmi",
.data = &exynos4210_hdmi_driver_data,
}, { }, {
.compatible = "samsung,exynos4212-hdmi", .compatible = "samsung,exynos4212-hdmi",
.data = &exynos4212_hdmi_driver_data, .data = &exynos4212_hdmi_driver_data,
......
...@@ -76,7 +76,7 @@ struct mixer_resources { ...@@ -76,7 +76,7 @@ struct mixer_resources {
struct clk *vp; struct clk *vp;
struct clk *sclk_mixer; struct clk *sclk_mixer;
struct clk *sclk_hdmi; struct clk *sclk_hdmi;
struct clk *sclk_dac; struct clk *mout_mixer;
}; };
enum mixer_version_id { enum mixer_version_id {
...@@ -93,6 +93,7 @@ struct mixer_context { ...@@ -93,6 +93,7 @@ struct mixer_context {
bool interlace; bool interlace;
bool powered; bool powered;
bool vp_enabled; bool vp_enabled;
bool has_sclk;
u32 int_en; u32 int_en;
struct mutex mixer_mutex; struct mutex mixer_mutex;
...@@ -106,6 +107,7 @@ struct mixer_context { ...@@ -106,6 +107,7 @@ struct mixer_context {
struct mixer_drv_data { struct mixer_drv_data {
enum mixer_version_id version; enum mixer_version_id version;
bool is_vp_enabled; bool is_vp_enabled;
bool has_sclk;
}; };
static const u8 filter_y_horiz_tap8[] = { static const u8 filter_y_horiz_tap8[] = {
...@@ -809,19 +811,23 @@ static int vp_resources_init(struct mixer_context *mixer_ctx) ...@@ -809,19 +811,23 @@ static int vp_resources_init(struct mixer_context *mixer_ctx)
dev_err(dev, "failed to get clock 'vp'\n"); dev_err(dev, "failed to get clock 'vp'\n");
return -ENODEV; return -ENODEV;
} }
mixer_res->sclk_mixer = devm_clk_get(dev, "sclk_mixer");
if (IS_ERR(mixer_res->sclk_mixer)) {
dev_err(dev, "failed to get clock 'sclk_mixer'\n");
return -ENODEV;
}
mixer_res->sclk_dac = devm_clk_get(dev, "sclk_dac");
if (IS_ERR(mixer_res->sclk_dac)) {
dev_err(dev, "failed to get clock 'sclk_dac'\n");
return -ENODEV;
}
if (mixer_res->sclk_hdmi) if (mixer_ctx->has_sclk) {
clk_set_parent(mixer_res->sclk_mixer, mixer_res->sclk_hdmi); mixer_res->sclk_mixer = devm_clk_get(dev, "sclk_mixer");
if (IS_ERR(mixer_res->sclk_mixer)) {
dev_err(dev, "failed to get clock 'sclk_mixer'\n");
return -ENODEV;
}
mixer_res->mout_mixer = devm_clk_get(dev, "mout_mixer");
if (IS_ERR(mixer_res->mout_mixer)) {
dev_err(dev, "failed to get clock 'mout_mixer'\n");
return -ENODEV;
}
if (mixer_res->sclk_hdmi && mixer_res->mout_mixer)
clk_set_parent(mixer_res->mout_mixer,
mixer_res->sclk_hdmi);
}
res = platform_get_resource(mixer_ctx->pdev, IORESOURCE_MEM, 1); res = platform_get_resource(mixer_ctx->pdev, IORESOURCE_MEM, 1);
if (res == NULL) { if (res == NULL) {
...@@ -1082,7 +1088,8 @@ static void mixer_poweron(struct exynos_drm_manager *mgr) ...@@ -1082,7 +1088,8 @@ static void mixer_poweron(struct exynos_drm_manager *mgr)
clk_prepare_enable(res->mixer); clk_prepare_enable(res->mixer);
if (ctx->vp_enabled) { if (ctx->vp_enabled) {
clk_prepare_enable(res->vp); clk_prepare_enable(res->vp);
clk_prepare_enable(res->sclk_mixer); if (ctx->has_sclk)
clk_prepare_enable(res->sclk_mixer);
} }
mutex_lock(&ctx->mixer_mutex); mutex_lock(&ctx->mixer_mutex);
...@@ -1121,7 +1128,8 @@ static void mixer_poweroff(struct exynos_drm_manager *mgr) ...@@ -1121,7 +1128,8 @@ static void mixer_poweroff(struct exynos_drm_manager *mgr)
clk_disable_unprepare(res->mixer); clk_disable_unprepare(res->mixer);
if (ctx->vp_enabled) { if (ctx->vp_enabled) {
clk_disable_unprepare(res->vp); clk_disable_unprepare(res->vp);
clk_disable_unprepare(res->sclk_mixer); if (ctx->has_sclk)
clk_disable_unprepare(res->sclk_mixer);
} }
pm_runtime_put_sync(ctx->dev); pm_runtime_put_sync(ctx->dev);
...@@ -1189,9 +1197,15 @@ static struct mixer_drv_data exynos5250_mxr_drv_data = { ...@@ -1189,9 +1197,15 @@ static struct mixer_drv_data exynos5250_mxr_drv_data = {
.is_vp_enabled = 0, .is_vp_enabled = 0,
}; };
static struct mixer_drv_data exynos4212_mxr_drv_data = {
.version = MXR_VER_0_0_0_16,
.is_vp_enabled = 1,
};
static struct mixer_drv_data exynos4210_mxr_drv_data = { static struct mixer_drv_data exynos4210_mxr_drv_data = {
.version = MXR_VER_0_0_0_16, .version = MXR_VER_0_0_0_16,
.is_vp_enabled = 1, .is_vp_enabled = 1,
.has_sclk = 1,
}; };
static struct platform_device_id mixer_driver_types[] = { static struct platform_device_id mixer_driver_types[] = {
...@@ -1208,6 +1222,12 @@ static struct platform_device_id mixer_driver_types[] = { ...@@ -1208,6 +1222,12 @@ static struct platform_device_id mixer_driver_types[] = {
static struct of_device_id mixer_match_types[] = { static struct of_device_id mixer_match_types[] = {
{ {
.compatible = "samsung,exynos4210-mixer",
.data = &exynos4210_mxr_drv_data,
}, {
.compatible = "samsung,exynos4212-mixer",
.data = &exynos4212_mxr_drv_data,
}, {
.compatible = "samsung,exynos5-mixer", .compatible = "samsung,exynos5-mixer",
.data = &exynos5250_mxr_drv_data, .data = &exynos5250_mxr_drv_data,
}, { }, {
...@@ -1251,6 +1271,7 @@ static int mixer_bind(struct device *dev, struct device *manager, void *data) ...@@ -1251,6 +1271,7 @@ static int mixer_bind(struct device *dev, struct device *manager, void *data)
ctx->pdev = pdev; ctx->pdev = pdev;
ctx->dev = dev; ctx->dev = dev;
ctx->vp_enabled = drv->is_vp_enabled; ctx->vp_enabled = drv->is_vp_enabled;
ctx->has_sclk = drv->has_sclk;
ctx->mxr_ver = drv->version; ctx->mxr_ver = drv->version;
init_waitqueue_head(&ctx->wait_vsync_queue); init_waitqueue_head(&ctx->wait_vsync_queue);
atomic_set(&ctx->wait_vsync_event, 0); atomic_set(&ctx->wait_vsync_event, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment