aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/omap2/dss/Kconfig5
-rw-r--r--drivers/video/omap2/dss/core.c2
-rw-r--r--drivers/video/omap2/dss/dispc.c48
-rw-r--r--drivers/video/omap2/dss/dss.c40
-rw-r--r--drivers/video/omap2/dss/dss_features.c64
-rw-r--r--drivers/video/omap2/dss/dss_features.h5
-rw-r--r--drivers/video/omap2/dss/hdmi.c3
-rw-r--r--drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c2
8 files changed, 110 insertions, 59 deletions
diff --git a/drivers/video/omap2/dss/Kconfig b/drivers/video/omap2/dss/Kconfig
index 7052487495cd..50e880260d8c 100644
--- a/drivers/video/omap2/dss/Kconfig
+++ b/drivers/video/omap2/dss/Kconfig
@@ -1,6 +1,5 @@
1menuconfig OMAP2_DSS 1menuconfig OMAP2_DSS
2 tristate "OMAP2+ Display Subsystem support" 2 tristate "OMAP2+ Display Subsystem support"
3 depends on ARCH_OMAP2PLUS
4 help 3 help
5 OMAP2+ Display Subsystem support. 4 OMAP2+ Display Subsystem support.
6 5
@@ -72,7 +71,6 @@ config OMAP2_DSS_VENC
72 71
73config OMAP4_DSS_HDMI 72config OMAP4_DSS_HDMI
74 bool "HDMI support" 73 bool "HDMI support"
75 depends on ARCH_OMAP4
76 default y 74 default y
77 help 75 help
78 HDMI Interface. This adds the High Definition Multimedia Interface. 76 HDMI Interface. This adds the High Definition Multimedia Interface.
@@ -80,11 +78,9 @@ config OMAP4_DSS_HDMI
80 78
81config OMAP4_DSS_HDMI_AUDIO 79config OMAP4_DSS_HDMI_AUDIO
82 bool 80 bool
83 depends on OMAP4_DSS_HDMI
84 81
85config OMAP2_DSS_SDI 82config OMAP2_DSS_SDI
86 bool "SDI support" 83 bool "SDI support"
87 depends on ARCH_OMAP3
88 default n 84 default n
89 help 85 help
90 SDI (Serial Display Interface) support. 86 SDI (Serial Display Interface) support.
@@ -94,7 +90,6 @@ config OMAP2_DSS_SDI
94 90
95config OMAP2_DSS_DSI 91config OMAP2_DSS_DSI
96 bool "DSI support" 92 bool "DSI support"
97 depends on ARCH_OMAP3 || ARCH_OMAP4 || ARCH_OMAP5
98 default n 93 default n
99 help 94 help
100 MIPI DSI (Display Serial Interface) support. 95 MIPI DSI (Display Serial Interface) support.
diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index d1ed2b4a5a2e..00aa026e307c 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -232,7 +232,7 @@ static int __init omap_dss_probe(struct platform_device *pdev)
232 232
233 core.pdev = pdev; 233 core.pdev = pdev;
234 234
235 dss_features_init(); 235 dss_features_init(pdata->version);
236 236
237 dss_apply_init(); 237 dss_apply_init();
238 238
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 7456000f6999..a85228930b0d 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -36,8 +36,7 @@
36#include <linux/interrupt.h> 36#include <linux/interrupt.h>
37#include <linux/platform_device.h> 37#include <linux/platform_device.h>
38#include <linux/pm_runtime.h> 38#include <linux/pm_runtime.h>
39 39#include <linux/sizes.h>
40#include <plat/cpu.h>
41 40
42#include <video/omapdss.h> 41#include <video/omapdss.h>
43 42
@@ -3353,7 +3352,7 @@ static void dispc_dump_regs(struct seq_file *s)
3353 3352
3354#define DISPC_REG(i, name) name(i) 3353#define DISPC_REG(i, name) name(i)
3355#define DUMPREG(i, r) seq_printf(s, "%s(%s)%*s %08x\n", #r, p_names[i], \ 3354#define DUMPREG(i, r) seq_printf(s, "%s(%s)%*s %08x\n", #r, p_names[i], \
3356 48 - strlen(#r) - strlen(p_names[i]), " ", \ 3355 (int)(48 - strlen(#r) - strlen(p_names[i])), " ", \
3357 dispc_read_reg(DISPC_REG(i, r))) 3356 dispc_read_reg(DISPC_REG(i, r)))
3358 3357
3359 p_names = mgr_names; 3358 p_names = mgr_names;
@@ -3430,7 +3429,7 @@ static void dispc_dump_regs(struct seq_file *s)
3430#define DISPC_REG(plane, name, i) name(plane, i) 3429#define DISPC_REG(plane, name, i) name(plane, i)
3431#define DUMPREG(plane, name, i) \ 3430#define DUMPREG(plane, name, i) \
3432 seq_printf(s, "%s_%d(%s)%*s %08x\n", #name, i, p_names[plane], \ 3431 seq_printf(s, "%s_%d(%s)%*s %08x\n", #name, i, p_names[plane], \
3433 46 - strlen(#name) - strlen(p_names[plane]), " ", \ 3432 (int)(46 - strlen(#name) - strlen(p_names[plane])), " ", \
3434 dispc_read_reg(DISPC_REG(plane, name, i))) 3433 dispc_read_reg(DISPC_REG(plane, name, i)))
3435 3434
3436 /* Video pipeline coefficient registers */ 3435 /* Video pipeline coefficient registers */
@@ -4032,29 +4031,44 @@ static const struct dispc_features omap44xx_dispc_feats __initconst = {
4032 .gfx_fifo_workaround = true, 4031 .gfx_fifo_workaround = true,
4033}; 4032};
4034 4033
4035static int __init dispc_init_features(struct device *dev) 4034static int __init dispc_init_features(struct platform_device *pdev)
4036{ 4035{
4036 struct omap_dss_board_info *pdata = pdev->dev.platform_data;
4037 const struct dispc_features *src; 4037 const struct dispc_features *src;
4038 struct dispc_features *dst; 4038 struct dispc_features *dst;
4039 4039
4040 dst = devm_kzalloc(dev, sizeof(*dst), GFP_KERNEL); 4040 dst = devm_kzalloc(&pdev->dev, sizeof(*dst), GFP_KERNEL);
4041 if (!dst) { 4041 if (!dst) {
4042 dev_err(dev, "Failed to allocate DISPC Features\n"); 4042 dev_err(&pdev->dev, "Failed to allocate DISPC Features\n");
4043 return -ENOMEM; 4043 return -ENOMEM;
4044 } 4044 }
4045 4045
4046 if (cpu_is_omap24xx()) { 4046 switch (pdata->version) {
4047 case OMAPDSS_VER_OMAP24xx:
4047 src = &omap24xx_dispc_feats; 4048 src = &omap24xx_dispc_feats;
4048 } else if (cpu_is_omap34xx()) { 4049 break;
4049 if (omap_rev() < OMAP3430_REV_ES3_0) 4050
4050 src = &omap34xx_rev1_0_dispc_feats; 4051 case OMAPDSS_VER_OMAP34xx_ES1:
4051 else 4052 src = &omap34xx_rev1_0_dispc_feats;
4052 src = &omap34xx_rev3_0_dispc_feats; 4053 break;
4053 } else if (cpu_is_omap44xx()) { 4054
4055 case OMAPDSS_VER_OMAP34xx_ES3:
4056 case OMAPDSS_VER_OMAP3630:
4057 case OMAPDSS_VER_AM35xx:
4058 src = &omap34xx_rev3_0_dispc_feats;
4059 break;
4060
4061 case OMAPDSS_VER_OMAP4430_ES1:
4062 case OMAPDSS_VER_OMAP4430_ES2:
4063 case OMAPDSS_VER_OMAP4:
4054 src = &omap44xx_dispc_feats; 4064 src = &omap44xx_dispc_feats;
4055 } else if (soc_is_omap54xx()) { 4065 break;
4066
4067 case OMAPDSS_VER_OMAP5:
4056 src = &omap44xx_dispc_feats; 4068 src = &omap44xx_dispc_feats;
4057 } else { 4069 break;
4070
4071 default:
4058 return -ENODEV; 4072 return -ENODEV;
4059 } 4073 }
4060 4074
@@ -4074,7 +4088,7 @@ static int __init omap_dispchw_probe(struct platform_device *pdev)
4074 4088
4075 dispc.pdev = pdev; 4089 dispc.pdev = pdev;
4076 4090
4077 r = dispc_init_features(&dispc.pdev->dev); 4091 r = dispc_init_features(dispc.pdev);
4078 if (r) 4092 if (r)
4079 return r; 4093 return r;
4080 4094
diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index 3954742d46d3..37ee465c1a0e 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -32,11 +32,10 @@
32#include <linux/platform_device.h> 32#include <linux/platform_device.h>
33#include <linux/pm_runtime.h> 33#include <linux/pm_runtime.h>
34#include <linux/gfp.h> 34#include <linux/gfp.h>
35#include <linux/sizes.h>
35 36
36#include <video/omapdss.h> 37#include <video/omapdss.h>
37 38
38#include <plat/cpu.h>
39
40#include "dss.h" 39#include "dss.h"
41#include "dss_features.h" 40#include "dss_features.h"
42 41
@@ -792,29 +791,46 @@ static const struct dss_features omap54xx_dss_feats __initconst = {
792 .dpi_select_source = &dss_dpi_select_source_omap5, 791 .dpi_select_source = &dss_dpi_select_source_omap5,
793}; 792};
794 793
795static int __init dss_init_features(struct device *dev) 794static int __init dss_init_features(struct platform_device *pdev)
796{ 795{
796 struct omap_dss_board_info *pdata = pdev->dev.platform_data;
797 const struct dss_features *src; 797 const struct dss_features *src;
798 struct dss_features *dst; 798 struct dss_features *dst;
799 799
800 dst = devm_kzalloc(dev, sizeof(*dst), GFP_KERNEL); 800 dst = devm_kzalloc(&pdev->dev, sizeof(*dst), GFP_KERNEL);
801 if (!dst) { 801 if (!dst) {
802 dev_err(dev, "Failed to allocate local DSS Features\n"); 802 dev_err(&pdev->dev, "Failed to allocate local DSS Features\n");
803 return -ENOMEM; 803 return -ENOMEM;
804 } 804 }
805 805
806 if (cpu_is_omap24xx()) 806 switch (pdata->version) {
807 case OMAPDSS_VER_OMAP24xx:
807 src = &omap24xx_dss_feats; 808 src = &omap24xx_dss_feats;
808 else if (cpu_is_omap34xx()) 809 break;
810
811 case OMAPDSS_VER_OMAP34xx_ES1:
812 case OMAPDSS_VER_OMAP34xx_ES3:
813 case OMAPDSS_VER_AM35xx:
809 src = &omap34xx_dss_feats; 814 src = &omap34xx_dss_feats;
810 else if (cpu_is_omap3630()) 815 break;
816
817 case OMAPDSS_VER_OMAP3630:
811 src = &omap3630_dss_feats; 818 src = &omap3630_dss_feats;
812 else if (cpu_is_omap44xx()) 819 break;
820
821 case OMAPDSS_VER_OMAP4430_ES1:
822 case OMAPDSS_VER_OMAP4430_ES2:
823 case OMAPDSS_VER_OMAP4:
813 src = &omap44xx_dss_feats; 824 src = &omap44xx_dss_feats;
814 else if (soc_is_omap54xx()) 825 break;
826
827 case OMAPDSS_VER_OMAP5:
815 src = &omap54xx_dss_feats; 828 src = &omap54xx_dss_feats;
816 else 829 break;
830
831 default:
817 return -ENODEV; 832 return -ENODEV;
833 }
818 834
819 memcpy(dst, src, sizeof(*dst)); 835 memcpy(dst, src, sizeof(*dst));
820 dss.feat = dst; 836 dss.feat = dst;
@@ -831,7 +847,7 @@ static int __init omap_dsshw_probe(struct platform_device *pdev)
831 847
832 dss.pdev = pdev; 848 dss.pdev = pdev;
833 849
834 r = dss_init_features(&dss.pdev->dev); 850 r = dss_init_features(dss.pdev);
835 if (r) 851 if (r)
836 return r; 852 return r;
837 853
diff --git a/drivers/video/omap2/dss/dss_features.c b/drivers/video/omap2/dss/dss_features.c
index acbc1e1efba3..3e8287c8709d 100644
--- a/drivers/video/omap2/dss/dss_features.c
+++ b/drivers/video/omap2/dss/dss_features.c
@@ -23,7 +23,6 @@
23#include <linux/slab.h> 23#include <linux/slab.h>
24 24
25#include <video/omapdss.h> 25#include <video/omapdss.h>
26#include <plat/cpu.h>
27 26
28#include "dss.h" 27#include "dss.h"
29#include "dss_features.h" 28#include "dss_features.h"
@@ -825,10 +824,20 @@ static const struct ti_hdmi_ip_ops omap4_hdmi_functions = {
825 824
826}; 825};
827 826
828void dss_init_hdmi_ip_ops(struct hdmi_ip_data *ip_data) 827void dss_init_hdmi_ip_ops(struct hdmi_ip_data *ip_data,
828 enum omapdss_version version)
829{ 829{
830 if (cpu_is_omap44xx()) 830 switch (version) {
831 case OMAPDSS_VER_OMAP4430_ES1:
832 case OMAPDSS_VER_OMAP4430_ES2:
833 case OMAPDSS_VER_OMAP4:
831 ip_data->ops = &omap4_hdmi_functions; 834 ip_data->ops = &omap4_hdmi_functions;
835 break;
836 default:
837 ip_data->ops = NULL;
838 }
839
840 WARN_ON(ip_data->ops == NULL);
832} 841}
833#endif 842#endif
834 843
@@ -929,29 +938,44 @@ bool dss_feat_rotation_type_supported(enum omap_dss_rotation_type rot_type)
929 return omap_current_dss_features->supported_rotation_types & rot_type; 938 return omap_current_dss_features->supported_rotation_types & rot_type;
930} 939}
931 940
932void dss_features_init(void) 941void dss_features_init(enum omapdss_version version)
933{ 942{
934 if (cpu_is_omap24xx()) 943 switch (version) {
944 case OMAPDSS_VER_OMAP24xx:
935 omap_current_dss_features = &omap2_dss_features; 945 omap_current_dss_features = &omap2_dss_features;
936 else if (cpu_is_omap3630()) 946 break;
947
948 case OMAPDSS_VER_OMAP34xx_ES1:
949 case OMAPDSS_VER_OMAP34xx_ES3:
950 omap_current_dss_features = &omap3430_dss_features;
951 break;
952
953 case OMAPDSS_VER_OMAP3630:
937 omap_current_dss_features = &omap3630_dss_features; 954 omap_current_dss_features = &omap3630_dss_features;
938 else if (cpu_is_omap34xx()) { 955 break;
939 if (soc_is_am35xx()) { 956
940 omap_current_dss_features = &am35xx_dss_features; 957 case OMAPDSS_VER_OMAP4430_ES1:
941 } else {
942 omap_current_dss_features = &omap3430_dss_features;
943 }
944 }
945 else if (omap_rev() == OMAP4430_REV_ES1_0)
946 omap_current_dss_features = &omap4430_es1_0_dss_features; 958 omap_current_dss_features = &omap4430_es1_0_dss_features;
947 else if (omap_rev() == OMAP4430_REV_ES2_0 || 959 break;
948 omap_rev() == OMAP4430_REV_ES2_1 || 960
949 omap_rev() == OMAP4430_REV_ES2_2) 961 case OMAPDSS_VER_OMAP4430_ES2:
950 omap_current_dss_features = &omap4430_es2_0_1_2_dss_features; 962 omap_current_dss_features = &omap4430_es2_0_1_2_dss_features;
951 else if (cpu_is_omap44xx()) 963 break;
964
965 case OMAPDSS_VER_OMAP4:
952 omap_current_dss_features = &omap4_dss_features; 966 omap_current_dss_features = &omap4_dss_features;
953 else if (soc_is_omap54xx()) 967 break;
968
969 case OMAPDSS_VER_OMAP5:
954 omap_current_dss_features = &omap5_dss_features; 970 omap_current_dss_features = &omap5_dss_features;
955 else 971 break;
972
973 case OMAPDSS_VER_AM35xx:
974 omap_current_dss_features = &am35xx_dss_features;
975 break;
976
977 default:
956 DSSWARN("Unsupported OMAP version"); 978 DSSWARN("Unsupported OMAP version");
979 break;
980 }
957} 981}
diff --git a/drivers/video/omap2/dss/dss_features.h b/drivers/video/omap2/dss/dss_features.h
index 9218113b5e88..fc492ef72a51 100644
--- a/drivers/video/omap2/dss/dss_features.h
+++ b/drivers/video/omap2/dss/dss_features.h
@@ -123,8 +123,9 @@ bool dss_feat_rotation_type_supported(enum omap_dss_rotation_type rot_type);
123 123
124bool dss_has_feature(enum dss_feat_id id); 124bool dss_has_feature(enum dss_feat_id id);
125void dss_feat_get_reg_field(enum dss_feat_reg_field id, u8 *start, u8 *end); 125void dss_feat_get_reg_field(enum dss_feat_reg_field id, u8 *start, u8 *end);
126void dss_features_init(void); 126void dss_features_init(enum omapdss_version version);
127#if defined(CONFIG_OMAP4_DSS_HDMI) 127#if defined(CONFIG_OMAP4_DSS_HDMI)
128void dss_init_hdmi_ip_ops(struct hdmi_ip_data *ip_data); 128void dss_init_hdmi_ip_ops(struct hdmi_ip_data *ip_data,
129 enum omapdss_version version);
129#endif 130#endif
130#endif 131#endif
diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c
index a48a7dd75b33..adcc906d12f8 100644
--- a/drivers/video/omap2/dss/hdmi.c
+++ b/drivers/video/omap2/dss/hdmi.c
@@ -323,6 +323,7 @@ static void hdmi_runtime_put(void)
323 323
324static int __init hdmi_init_display(struct omap_dss_device *dssdev) 324static int __init hdmi_init_display(struct omap_dss_device *dssdev)
325{ 325{
326 struct omap_dss_board_info *pdata = hdmi.pdev->dev.platform_data;
326 int r; 327 int r;
327 328
328 struct gpio gpios[] = { 329 struct gpio gpios[] = {
@@ -333,7 +334,7 @@ static int __init hdmi_init_display(struct omap_dss_device *dssdev)
333 334
334 DSSDBG("init_display\n"); 335 DSSDBG("init_display\n");
335 336
336 dss_init_hdmi_ip_ops(&hdmi.ip_data); 337 dss_init_hdmi_ip_ops(&hdmi.ip_data, pdata->version);
337 338
338 if (hdmi.vdda_hdmi_dac_reg == NULL) { 339 if (hdmi.vdda_hdmi_dac_reg == NULL) {
339 struct regulator *reg; 340 struct regulator *reg;
diff --git a/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c b/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c
index c23b85a20cdc..a6efff257aa2 100644
--- a/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c
+++ b/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c
@@ -899,7 +899,7 @@ void ti_hdmi_4xxx_core_dump(struct hdmi_ip_data *ip_data, struct seq_file *s)
899#define DUMPCOREAV(r) seq_printf(s, "%-35s %08x\n", #r,\ 899#define DUMPCOREAV(r) seq_printf(s, "%-35s %08x\n", #r,\
900 hdmi_read_reg(hdmi_av_base(ip_data), r)) 900 hdmi_read_reg(hdmi_av_base(ip_data), r))
901#define DUMPCOREAV2(i, r) seq_printf(s, "%s[%d]%*s %08x\n", #r, i, \ 901#define DUMPCOREAV2(i, r) seq_printf(s, "%s[%d]%*s %08x\n", #r, i, \
902 (i < 10) ? 32 - strlen(#r) : 31 - strlen(#r), " ", \ 902 (i < 10) ? 32 - (int)strlen(#r) : 31 - (int)strlen(#r), " ", \
903 hdmi_read_reg(hdmi_av_base(ip_data), CORE_REG(i, r))) 903 hdmi_read_reg(hdmi_av_base(ip_data), CORE_REG(i, r)))
904 904
905 DUMPCORE(HDMI_CORE_SYS_VND_IDL); 905 DUMPCORE(HDMI_CORE_SYS_VND_IDL);