diff options
Diffstat (limited to 'drivers/video/omap2')
| -rw-r--r-- | drivers/video/omap2/dss/core.c | 2 | ||||
| -rw-r--r-- | drivers/video/omap2/dss/dispc.c | 43 | ||||
| -rw-r--r-- | drivers/video/omap2/dss/dss.c | 39 | ||||
| -rw-r--r-- | drivers/video/omap2/dss/dss_features.c | 64 | ||||
| -rw-r--r-- | drivers/video/omap2/dss/dss_features.h | 5 | ||||
| -rw-r--r-- | drivers/video/omap2/dss/hdmi.c | 3 |
6 files changed, 105 insertions, 51 deletions
diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c index b2af72dc20bd..d94ef9e31a35 100644 --- a/drivers/video/omap2/dss/core.c +++ b/drivers/video/omap2/dss/core.c | |||
| @@ -237,7 +237,7 @@ static int __init omap_dss_probe(struct platform_device *pdev) | |||
| 237 | 237 | ||
| 238 | core.pdev = pdev; | 238 | core.pdev = pdev; |
| 239 | 239 | ||
| 240 | dss_features_init(); | 240 | dss_features_init(pdata->version); |
| 241 | 241 | ||
| 242 | dss_apply_init(); | 242 | dss_apply_init(); |
| 243 | 243 | ||
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c index b43477a5fae8..a5ab354f267a 100644 --- a/drivers/video/omap2/dss/dispc.c +++ b/drivers/video/omap2/dss/dispc.c | |||
| @@ -37,8 +37,6 @@ | |||
| 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 | ||
| 40 | #include <plat/cpu.h> | ||
| 41 | |||
| 42 | #include <video/omapdss.h> | 40 | #include <video/omapdss.h> |
| 43 | 41 | ||
| 44 | #include "dss.h" | 42 | #include "dss.h" |
| @@ -4042,29 +4040,44 @@ static const struct dispc_features omap44xx_dispc_feats __initconst = { | |||
| 4042 | .gfx_fifo_workaround = true, | 4040 | .gfx_fifo_workaround = true, |
| 4043 | }; | 4041 | }; |
| 4044 | 4042 | ||
| 4045 | static int __init dispc_init_features(struct device *dev) | 4043 | static int __init dispc_init_features(struct platform_device *pdev) |
| 4046 | { | 4044 | { |
| 4045 | struct omap_dss_board_info *pdata = pdev->dev.platform_data; | ||
| 4047 | const struct dispc_features *src; | 4046 | const struct dispc_features *src; |
| 4048 | struct dispc_features *dst; | 4047 | struct dispc_features *dst; |
| 4049 | 4048 | ||
| 4050 | dst = devm_kzalloc(dev, sizeof(*dst), GFP_KERNEL); | 4049 | dst = devm_kzalloc(&pdev->dev, sizeof(*dst), GFP_KERNEL); |
| 4051 | if (!dst) { | 4050 | if (!dst) { |
| 4052 | dev_err(dev, "Failed to allocate DISPC Features\n"); | 4051 | dev_err(&pdev->dev, "Failed to allocate DISPC Features\n"); |
| 4053 | return -ENOMEM; | 4052 | return -ENOMEM; |
| 4054 | } | 4053 | } |
| 4055 | 4054 | ||
| 4056 | if (cpu_is_omap24xx()) { | 4055 | switch (pdata->version) { |
| 4056 | case OMAPDSS_VER_OMAP24xx: | ||
| 4057 | src = &omap24xx_dispc_feats; | 4057 | src = &omap24xx_dispc_feats; |
| 4058 | } else if (cpu_is_omap34xx()) { | 4058 | break; |
| 4059 | if (omap_rev() < OMAP3430_REV_ES3_0) | 4059 | |
| 4060 | src = &omap34xx_rev1_0_dispc_feats; | 4060 | case OMAPDSS_VER_OMAP34xx_ES1: |
| 4061 | else | 4061 | src = &omap34xx_rev1_0_dispc_feats; |
| 4062 | src = &omap34xx_rev3_0_dispc_feats; | 4062 | break; |
| 4063 | } else if (cpu_is_omap44xx()) { | 4063 | |
| 4064 | case OMAPDSS_VER_OMAP34xx_ES3: | ||
| 4065 | case OMAPDSS_VER_OMAP3630: | ||
| 4066 | case OMAPDSS_VER_AM35xx: | ||
| 4067 | src = &omap34xx_rev3_0_dispc_feats; | ||
| 4068 | break; | ||
| 4069 | |||
| 4070 | case OMAPDSS_VER_OMAP4430_ES1: | ||
| 4071 | case OMAPDSS_VER_OMAP4430_ES2: | ||
| 4072 | case OMAPDSS_VER_OMAP4: | ||
| 4064 | src = &omap44xx_dispc_feats; | 4073 | src = &omap44xx_dispc_feats; |
| 4065 | } else if (soc_is_omap54xx()) { | 4074 | break; |
| 4075 | |||
| 4076 | case OMAPDSS_VER_OMAP5: | ||
| 4066 | src = &omap44xx_dispc_feats; | 4077 | src = &omap44xx_dispc_feats; |
| 4067 | } else { | 4078 | break; |
| 4079 | |||
| 4080 | default: | ||
| 4068 | return -ENODEV; | 4081 | return -ENODEV; |
| 4069 | } | 4082 | } |
| 4070 | 4083 | ||
| @@ -4084,7 +4097,7 @@ static int __init omap_dispchw_probe(struct platform_device *pdev) | |||
| 4084 | 4097 | ||
| 4085 | dispc.pdev = pdev; | 4098 | dispc.pdev = pdev; |
| 4086 | 4099 | ||
| 4087 | r = dispc_init_features(&dispc.pdev->dev); | 4100 | r = dispc_init_features(dispc.pdev); |
| 4088 | if (r) | 4101 | if (r) |
| 4089 | return r; | 4102 | return r; |
| 4090 | 4103 | ||
diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c index 2ab1c3e96553..363852a0f764 100644 --- a/drivers/video/omap2/dss/dss.c +++ b/drivers/video/omap2/dss/dss.c | |||
| @@ -35,8 +35,6 @@ | |||
| 35 | 35 | ||
| 36 | #include <video/omapdss.h> | 36 | #include <video/omapdss.h> |
| 37 | 37 | ||
| 38 | #include <plat/cpu.h> | ||
| 39 | |||
| 40 | #include "dss.h" | 38 | #include "dss.h" |
| 41 | #include "dss_features.h" | 39 | #include "dss_features.h" |
| 42 | 40 | ||
| @@ -792,29 +790,46 @@ static const struct dss_features omap54xx_dss_feats __initconst = { | |||
| 792 | .dpi_select_source = &dss_dpi_select_source_omap5, | 790 | .dpi_select_source = &dss_dpi_select_source_omap5, |
| 793 | }; | 791 | }; |
| 794 | 792 | ||
| 795 | static int __init dss_init_features(struct device *dev) | 793 | static int __init dss_init_features(struct platform_device *pdev) |
| 796 | { | 794 | { |
| 795 | struct omap_dss_board_info *pdata = pdev->dev.platform_data; | ||
| 797 | const struct dss_features *src; | 796 | const struct dss_features *src; |
| 798 | struct dss_features *dst; | 797 | struct dss_features *dst; |
| 799 | 798 | ||
| 800 | dst = devm_kzalloc(dev, sizeof(*dst), GFP_KERNEL); | 799 | dst = devm_kzalloc(&pdev->dev, sizeof(*dst), GFP_KERNEL); |
| 801 | if (!dst) { | 800 | if (!dst) { |
| 802 | dev_err(dev, "Failed to allocate local DSS Features\n"); | 801 | dev_err(&pdev->dev, "Failed to allocate local DSS Features\n"); |
| 803 | return -ENOMEM; | 802 | return -ENOMEM; |
| 804 | } | 803 | } |
| 805 | 804 | ||
| 806 | if (cpu_is_omap24xx()) | 805 | switch (pdata->version) { |
| 806 | case OMAPDSS_VER_OMAP24xx: | ||
| 807 | src = &omap24xx_dss_feats; | 807 | src = &omap24xx_dss_feats; |
| 808 | else if (cpu_is_omap34xx()) | 808 | break; |
| 809 | |||
| 810 | case OMAPDSS_VER_OMAP34xx_ES1: | ||
| 811 | case OMAPDSS_VER_OMAP34xx_ES3: | ||
| 812 | case OMAPDSS_VER_AM35xx: | ||
| 809 | src = &omap34xx_dss_feats; | 813 | src = &omap34xx_dss_feats; |
| 810 | else if (cpu_is_omap3630()) | 814 | break; |
| 815 | |||
| 816 | case OMAPDSS_VER_OMAP3630: | ||
| 811 | src = &omap3630_dss_feats; | 817 | src = &omap3630_dss_feats; |
| 812 | else if (cpu_is_omap44xx()) | 818 | break; |
| 819 | |||
| 820 | case OMAPDSS_VER_OMAP4430_ES1: | ||
| 821 | case OMAPDSS_VER_OMAP4430_ES2: | ||
| 822 | case OMAPDSS_VER_OMAP4: | ||
| 813 | src = &omap44xx_dss_feats; | 823 | src = &omap44xx_dss_feats; |
| 814 | else if (soc_is_omap54xx()) | 824 | break; |
| 825 | |||
| 826 | case OMAPDSS_VER_OMAP5: | ||
| 815 | src = &omap54xx_dss_feats; | 827 | src = &omap54xx_dss_feats; |
| 816 | else | 828 | break; |
| 829 | |||
| 830 | default: | ||
| 817 | return -ENODEV; | 831 | return -ENODEV; |
| 832 | } | ||
| 818 | 833 | ||
| 819 | memcpy(dst, src, sizeof(*dst)); | 834 | memcpy(dst, src, sizeof(*dst)); |
| 820 | dss.feat = dst; | 835 | dss.feat = dst; |
| @@ -831,7 +846,7 @@ static int __init omap_dsshw_probe(struct platform_device *pdev) | |||
| 831 | 846 | ||
| 832 | dss.pdev = pdev; | 847 | dss.pdev = pdev; |
| 833 | 848 | ||
| 834 | r = dss_init_features(&dss.pdev->dev); | 849 | r = dss_init_features(dss.pdev); |
| 835 | if (r) | 850 | if (r) |
| 836 | return r; | 851 | return r; |
| 837 | 852 | ||
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 | ||
| 828 | void dss_init_hdmi_ip_ops(struct hdmi_ip_data *ip_data) | 827 | void 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 | ||
| 932 | void dss_features_init(void) | 941 | void 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 | ||
| 124 | bool dss_has_feature(enum dss_feat_id id); | 124 | bool dss_has_feature(enum dss_feat_id id); |
| 125 | void dss_feat_get_reg_field(enum dss_feat_reg_field id, u8 *start, u8 *end); | 125 | void dss_feat_get_reg_field(enum dss_feat_reg_field id, u8 *start, u8 *end); |
| 126 | void dss_features_init(void); | 126 | void dss_features_init(enum omapdss_version version); |
| 127 | #if defined(CONFIG_OMAP4_DSS_HDMI) | 127 | #if defined(CONFIG_OMAP4_DSS_HDMI) |
| 128 | void dss_init_hdmi_ip_ops(struct hdmi_ip_data *ip_data); | 128 | void 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 | ||
| 324 | static int __init hdmi_init_display(struct omap_dss_device *dssdev) | 324 | static 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; |
