Commit 2c9fc9bf authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Tomi Valkeinen

drm: omapdrm: Move FEAT_HDMI_* features to hdmi4 driver

The FEAT_HDMI_* features are specific to the HDMI4, move them from the
omap_dss_features structure to the hdmi4 driver.
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent 44d8ca10
...@@ -240,7 +240,6 @@ static const enum dss_feat_id omap4430_es2_0_1_2_dss_feat_list[] = { ...@@ -240,7 +240,6 @@ static const enum dss_feat_id omap4430_es2_0_1_2_dss_feat_list[] = {
FEAT_MGR_LCD2, FEAT_MGR_LCD2,
FEAT_CORE_CLK_DIV, FEAT_CORE_CLK_DIV,
FEAT_LCD_CLK_SRC, FEAT_LCD_CLK_SRC,
FEAT_HDMI_CTS_SWMODE,
FEAT_HANDLE_UV_SEPARATE, FEAT_HANDLE_UV_SEPARATE,
FEAT_ATTR2, FEAT_ATTR2,
FEAT_CPR, FEAT_CPR,
...@@ -255,8 +254,6 @@ static const enum dss_feat_id omap4_dss_feat_list[] = { ...@@ -255,8 +254,6 @@ static const enum dss_feat_id omap4_dss_feat_list[] = {
FEAT_MGR_LCD2, FEAT_MGR_LCD2,
FEAT_CORE_CLK_DIV, FEAT_CORE_CLK_DIV,
FEAT_LCD_CLK_SRC, FEAT_LCD_CLK_SRC,
FEAT_HDMI_CTS_SWMODE,
FEAT_HDMI_AUDIO_USE_MCLK,
FEAT_HANDLE_UV_SEPARATE, FEAT_HANDLE_UV_SEPARATE,
FEAT_ATTR2, FEAT_ATTR2,
FEAT_CPR, FEAT_CPR,
...@@ -272,8 +269,6 @@ static const enum dss_feat_id omap5_dss_feat_list[] = { ...@@ -272,8 +269,6 @@ static const enum dss_feat_id omap5_dss_feat_list[] = {
FEAT_MGR_LCD3, FEAT_MGR_LCD3,
FEAT_CORE_CLK_DIV, FEAT_CORE_CLK_DIV,
FEAT_LCD_CLK_SRC, FEAT_LCD_CLK_SRC,
FEAT_HDMI_CTS_SWMODE,
FEAT_HDMI_AUDIO_USE_MCLK,
FEAT_HANDLE_UV_SEPARATE, FEAT_HANDLE_UV_SEPARATE,
FEAT_ATTR2, FEAT_ATTR2,
FEAT_CPR, FEAT_CPR,
......
...@@ -40,8 +40,6 @@ enum dss_feat_id { ...@@ -40,8 +40,6 @@ enum dss_feat_id {
FEAT_CORE_CLK_DIV, FEAT_CORE_CLK_DIV,
FEAT_LCD_CLK_SRC, FEAT_LCD_CLK_SRC,
FEAT_DPI_USES_VDDS_DSI, FEAT_DPI_USES_VDDS_DSI,
FEAT_HDMI_CTS_SWMODE,
FEAT_HDMI_AUDIO_USE_MCLK,
FEAT_HANDLE_UV_SEPARATE, FEAT_HANDLE_UV_SEPARATE,
FEAT_ATTR2, FEAT_ATTR2,
FEAT_CPR, FEAT_CPR,
......
...@@ -261,6 +261,8 @@ struct hdmi_phy_data { ...@@ -261,6 +261,8 @@ struct hdmi_phy_data {
struct hdmi_core_data { struct hdmi_core_data {
void __iomem *base; void __iomem *base;
bool cts_swmode;
bool audio_use_mclk;
}; };
static inline void hdmi_write_reg(void __iomem *base_addr, const u32 idx, static inline void hdmi_write_reg(void __iomem *base_addr, const u32 idx,
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/sys_soc.h>
#include <sound/asound.h> #include <sound/asound.h>
#include <sound/asoundef.h> #include <sound/asoundef.h>
...@@ -757,10 +758,10 @@ int hdmi4_audio_config(struct hdmi_core_data *core, struct hdmi_wp_data *wp, ...@@ -757,10 +758,10 @@ int hdmi4_audio_config(struct hdmi_core_data *core, struct hdmi_wp_data *wp,
/* Audio clock regeneration settings */ /* Audio clock regeneration settings */
acore.n = n; acore.n = n;
acore.cts = cts; acore.cts = cts;
if (dss_has_feature(FEAT_HDMI_CTS_SWMODE)) { if (core->cts_swmode) {
acore.aud_par_busclk = 0; acore.aud_par_busclk = 0;
acore.cts_mode = HDMI_AUDIO_CTS_MODE_SW; acore.cts_mode = HDMI_AUDIO_CTS_MODE_SW;
acore.use_mclk = dss_has_feature(FEAT_HDMI_AUDIO_USE_MCLK); acore.use_mclk = core->audio_use_mclk;
} else { } else {
acore.aud_par_busclk = (((128 * 31) - 1) << 8); acore.aud_par_busclk = (((128 * 31) - 1) << 8);
acore.cts_mode = HDMI_AUDIO_CTS_MODE_HW; acore.cts_mode = HDMI_AUDIO_CTS_MODE_HW;
...@@ -884,10 +885,42 @@ void hdmi4_audio_stop(struct hdmi_core_data *core, struct hdmi_wp_data *wp) ...@@ -884,10 +885,42 @@ void hdmi4_audio_stop(struct hdmi_core_data *core, struct hdmi_wp_data *wp)
hdmi_wp_audio_core_req_enable(wp, false); hdmi_wp_audio_core_req_enable(wp, false);
} }
struct hdmi4_features {
bool cts_swmode;
bool audio_use_mclk;
};
static const struct hdmi4_features hdmi4_es1_features = {
.cts_swmode = false,
.audio_use_mclk = false,
};
static const struct hdmi4_features hdmi4_es2_features = {
.cts_swmode = true,
.audio_use_mclk = false,
};
static const struct hdmi4_features hdmi4_es3_features = {
.cts_swmode = true,
.audio_use_mclk = true,
};
static const struct soc_device_attribute hdmi4_soc_devices[] = {
{ .family = "OMAP4", .revision = "ES1.?", .data = &hdmi4_es1_features },
{ .family = "OMAP4", .revision = "ES2.?", .data = &hdmi4_es2_features },
{ .family = "OMAP4", .data = &hdmi4_es3_features },
{ /* sentinel */ }
};
int hdmi4_core_init(struct platform_device *pdev, struct hdmi_core_data *core) int hdmi4_core_init(struct platform_device *pdev, struct hdmi_core_data *core)
{ {
const struct hdmi4_features *features;
struct resource *res; struct resource *res;
features = soc_device_match(hdmi4_soc_devices)->data;
core->cts_swmode = features->cts_swmode;
core->audio_use_mclk = features->audio_use_mclk;
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "core"); res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "core");
core->base = devm_ioremap_resource(&pdev->dev, res); core->base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(core->base)) if (IS_ERR(core->base))
......
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