|
31 | 31 | #include <linux/platform_device.h> |
32 | 32 | #include <linux/string.h> |
33 | 33 | #include <linux/seq_file.h> |
| 34 | +#include <linux/sys_soc.h> |
34 | 35 | #include <sound/asound.h> |
35 | 36 | #include <sound/asoundef.h> |
36 | 37 |
|
@@ -757,10 +758,10 @@ int hdmi4_audio_config(struct hdmi_core_data *core, struct hdmi_wp_data *wp, |
757 | 758 | /* Audio clock regeneration settings */ |
758 | 759 | acore.n = n; |
759 | 760 | acore.cts = cts; |
760 | | - if (dss_has_feature(FEAT_HDMI_CTS_SWMODE)) { |
| 761 | + if (core->cts_swmode) { |
761 | 762 | acore.aud_par_busclk = 0; |
762 | 763 | 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; |
764 | 765 | } else { |
765 | 766 | acore.aud_par_busclk = (((128 * 31) - 1) << 8); |
766 | 767 | 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 | 885 | hdmi_wp_audio_core_req_enable(wp, false); |
885 | 886 | } |
886 | 887 |
|
| 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 | + |
887 | 915 | int hdmi4_core_init(struct platform_device *pdev, struct hdmi_core_data *core) |
888 | 916 | { |
| 917 | + const struct hdmi4_features *features; |
889 | 918 | struct resource *res; |
890 | 919 |
|
| 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 | + |
891 | 924 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "core"); |
892 | 925 | core->base = devm_ioremap_resource(&pdev->dev, res); |
893 | 926 | if (IS_ERR(core->base)) |
|
0 commit comments