aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2/dss/dss.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/omap2/dss/dss.c')
-rw-r--r--drivers/video/omap2/dss/dss.c39
1 files changed, 27 insertions, 12 deletions
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
795static int __init dss_init_features(struct device *dev) 793static 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