Skip to content

Commit 2c9fc9b

Browse files
pinchartltomba
authored andcommitted
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: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
1 parent 44d8ca1 commit 2c9fc9b

4 files changed

Lines changed: 37 additions & 9 deletions

File tree

‎drivers/gpu/drm/omapdrm/dss/dss_features.c‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,6 @@ static const enum dss_feat_id omap4430_es2_0_1_2_dss_feat_list[] = {
240240
FEAT_MGR_LCD2,
241241
FEAT_CORE_CLK_DIV,
242242
FEAT_LCD_CLK_SRC,
243-
FEAT_HDMI_CTS_SWMODE,
244243
FEAT_HANDLE_UV_SEPARATE,
245244
FEAT_ATTR2,
246245
FEAT_CPR,
@@ -255,8 +254,6 @@ static const enum dss_feat_id omap4_dss_feat_list[] = {
255254
FEAT_MGR_LCD2,
256255
FEAT_CORE_CLK_DIV,
257256
FEAT_LCD_CLK_SRC,
258-
FEAT_HDMI_CTS_SWMODE,
259-
FEAT_HDMI_AUDIO_USE_MCLK,
260257
FEAT_HANDLE_UV_SEPARATE,
261258
FEAT_ATTR2,
262259
FEAT_CPR,
@@ -272,8 +269,6 @@ static const enum dss_feat_id omap5_dss_feat_list[] = {
272269
FEAT_MGR_LCD3,
273270
FEAT_CORE_CLK_DIV,
274271
FEAT_LCD_CLK_SRC,
275-
FEAT_HDMI_CTS_SWMODE,
276-
FEAT_HDMI_AUDIO_USE_MCLK,
277272
FEAT_HANDLE_UV_SEPARATE,
278273
FEAT_ATTR2,
279274
FEAT_CPR,

‎drivers/gpu/drm/omapdrm/dss/dss_features.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ enum dss_feat_id {
4040
FEAT_CORE_CLK_DIV,
4141
FEAT_LCD_CLK_SRC,
4242
FEAT_DPI_USES_VDDS_DSI,
43-
FEAT_HDMI_CTS_SWMODE,
44-
FEAT_HDMI_AUDIO_USE_MCLK,
4543
FEAT_HANDLE_UV_SEPARATE,
4644
FEAT_ATTR2,
4745
FEAT_CPR,

‎drivers/gpu/drm/omapdrm/dss/hdmi.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,8 @@ struct hdmi_phy_data {
261261

262262
struct hdmi_core_data {
263263
void __iomem *base;
264+
bool cts_swmode;
265+
bool audio_use_mclk;
264266
};
265267

266268
static inline void hdmi_write_reg(void __iomem *base_addr, const u32 idx,

‎drivers/gpu/drm/omapdrm/dss/hdmi4_core.c‎

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include <linux/platform_device.h>
3232
#include <linux/string.h>
3333
#include <linux/seq_file.h>
34+
#include <linux/sys_soc.h>
3435
#include <sound/asound.h>
3536
#include <sound/asoundef.h>
3637

@@ -757,10 +758,10 @@ int hdmi4_audio_config(struct hdmi_core_data *core, struct hdmi_wp_data *wp,
757758
/* Audio clock regeneration settings */
758759
acore.n = n;
759760
acore.cts = cts;
760-
if (dss_has_feature(FEAT_HDMI_CTS_SWMODE)) {
761+
if (core->cts_swmode) {
761762
acore.aud_par_busclk = 0;
762763
acore.cts_mode = HDMI_AUDIO_CTS_MODE_SW;
763-
acore.use_mclk = dss_has_feature(FEAT_HDMI_AUDIO_USE_MCLK);
764+
acore.use_mclk = core->audio_use_mclk;
764765
} else {
765766
acore.aud_par_busclk = (((128 * 31) - 1) << 8);
766767
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)
884885
hdmi_wp_audio_core_req_enable(wp, false);
885886
}
886887

888+
struct hdmi4_features {
889+
bool cts_swmode;
890+
bool audio_use_mclk;
891+
};
892+
893+
static const struct hdmi4_features hdmi4_es1_features = {
894+
.cts_swmode = false,
895+
.audio_use_mclk = false,
896+
};
897+
898+
static const struct hdmi4_features hdmi4_es2_features = {
899+
.cts_swmode = true,
900+
.audio_use_mclk = false,
901+
};
902+
903+
static const struct hdmi4_features hdmi4_es3_features = {
904+
.cts_swmode = true,
905+
.audio_use_mclk = true,
906+
};
907+
908+
static const struct soc_device_attribute hdmi4_soc_devices[] = {
909+
{ .family = "OMAP4", .revision = "ES1.?", .data = &hdmi4_es1_features },
910+
{ .family = "OMAP4", .revision = "ES2.?", .data = &hdmi4_es2_features },
911+
{ .family = "OMAP4", .data = &hdmi4_es3_features },
912+
{ /* sentinel */ }
913+
};
914+
887915
int hdmi4_core_init(struct platform_device *pdev, struct hdmi_core_data *core)
888916
{
917+
const struct hdmi4_features *features;
889918
struct resource *res;
890919

920+
features = soc_device_match(hdmi4_soc_devices)->data;
921+
core->cts_swmode = features->cts_swmode;
922+
core->audio_use_mclk = features->audio_use_mclk;
923+
891924
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "core");
892925
core->base = devm_ioremap_resource(&pdev->dev, res);
893926
if (IS_ERR(core->base))

0 commit comments

Comments
 (0)