[kirkwood] Add Seagate Dockstar support
[openwrt.git] / target / linux / omap24xx / patches-2.6.35 / 700-video-omap.patch
1 Index: linux-2.6.35/drivers/video/omap/dispc.c
2 ===================================================================
3 --- linux-2.6.35.orig/drivers/video/omap/dispc.c        2010-08-08 12:56:09.000000000 +0200
4 +++ linux-2.6.35/drivers/video/omap/dispc.c     2010-08-08 12:57:42.000000000 +0200
5 @@ -190,6 +190,11 @@ static struct {
6         struct omapfb_color_key color_key;
7  } dispc;
8  
9 +struct platform_device omapdss_device = {
10 +       .name           = "omapdss",
11 +       .id             = -1,
12 +};
13 +
14  static void enable_lcd_clocks(int enable);
15  
16  static void inline dispc_write_reg(int idx, u32 val)
17 @@ -916,20 +921,20 @@ static irqreturn_t omap_dispc_irq_handle
18  
19  static int get_dss_clocks(void)
20  {
21 -       dispc.dss_ick = clk_get(&dispc.fbdev->dssdev->dev, "ick");
22 +       dispc.dss_ick = clk_get(&omapdss_device.dev, "ick");
23         if (IS_ERR(dispc.dss_ick)) {
24                 dev_err(dispc.fbdev->dev, "can't get ick\n");
25                 return PTR_ERR(dispc.dss_ick);
26         }
27  
28 -       dispc.dss1_fck = clk_get(&dispc.fbdev->dssdev->dev, "dss1_fck");
29 +       dispc.dss1_fck = clk_get(&omapdss_device.dev, "dss1_fck");
30         if (IS_ERR(dispc.dss1_fck)) {
31                 dev_err(dispc.fbdev->dev, "can't get dss1_fck\n");
32                 clk_put(dispc.dss_ick);
33                 return PTR_ERR(dispc.dss1_fck);
34         }
35  
36 -       dispc.dss_54m_fck = clk_get(&dispc.fbdev->dssdev->dev, "tv_fck");
37 +       dispc.dss_54m_fck = clk_get(&omapdss_device.dev, "tv_fck");
38         if (IS_ERR(dispc.dss_54m_fck)) {
39                 dev_err(dispc.fbdev->dev, "can't get tv_fck\n");
40                 clk_put(dispc.dss_ick);
41 @@ -1381,6 +1386,12 @@ static int omap_dispc_init(struct omapfb
42         int skip_init = 0;
43         int i;
44  
45 +       r = platform_device_register(&omapdss_device);
46 +       if (r) {
47 +               dev_err(fbdev->dev, "can't register omapdss device\n");
48 +               return r;
49 +       }
50 +
51         memset(&dispc, 0, sizeof(dispc));
52  
53         dispc.base = ioremap(DISPC_BASE, SZ_1K);
54 @@ -1524,6 +1535,7 @@ static void omap_dispc_cleanup(void)
55         free_irq(INT_24XX_DSS_IRQ, dispc.fbdev);
56         put_dss_clocks();
57         iounmap(dispc.base);
58 +       platform_device_unregister(&omapdss_device);
59  }
60  
61  const struct lcd_ctrl omap2_int_ctrl = {
62 Index: linux-2.6.35/drivers/video/omap/lcd_htcherald.c
63 ===================================================================
64 --- linux-2.6.35.orig/drivers/video/omap/lcd_htcherald.c        2010-08-08 12:56:09.000000000 +0200
65 +++ linux-2.6.35/drivers/video/omap/lcd_htcherald.c     2010-08-08 12:57:43.000000000 +0200
66 @@ -115,12 +115,12 @@ struct platform_driver htcherald_panel_d
67         },
68  };
69  
70 -static int __init htcherald_panel_drv_init(void)
71 +static int htcherald_panel_drv_init(void)
72  {
73         return platform_driver_register(&htcherald_panel_driver);
74  }
75  
76 -static void __exit htcherald_panel_drv_cleanup(void)
77 +static void htcherald_panel_drv_cleanup(void)
78  {
79         platform_driver_unregister(&htcherald_panel_driver);
80  }
81 Index: linux-2.6.35/drivers/video/omap/lcd_mipid.c
82 ===================================================================
83 --- linux-2.6.35.orig/drivers/video/omap/lcd_mipid.c    2010-08-08 12:56:09.000000000 +0200
84 +++ linux-2.6.35/drivers/video/omap/lcd_mipid.c 2010-08-08 12:57:44.000000000 +0200
85 @@ -551,9 +551,9 @@ static int mipid_detect(struct mipid_dev
86                 md->esd_check = ls041y3_esd_check;
87                 break;
88         default:
89 -               md->panel.name = "unknown";
90 -               dev_err(&md->spi->dev, "invalid display ID\n");
91 -               return -ENODEV;
92 +               dev_err(&md->spi->dev, "FIXME: LCD panel detection failed! ID: %02x%02x%02x\n", display_id[0], display_id[1], display_id[2]);
93 +               md->panel.name = "ls041y3";
94 +               md->esd_check = ls041y3_esd_check;
95         }
96  
97         md->revision = display_id[1];
98 Index: linux-2.6.35/drivers/video/omap/omapfb.h
99 ===================================================================
100 --- linux-2.6.35.orig/drivers/video/omap/omapfb.h       2010-08-08 12:56:09.000000000 +0200
101 +++ linux-2.6.35/drivers/video/omap/omapfb.h    2010-08-08 12:57:45.000000000 +0200
102 @@ -203,8 +203,6 @@ struct omapfb_device {
103  
104         struct omapfb_mem_desc          mem_desc;
105         struct fb_info                  *fb_info[OMAPFB_PLANE_NUM];
106 -
107 -       struct platform_device  *dssdev;        /* dummy dev for clocks */
108  };
109  
110  #ifdef CONFIG_ARCH_OMAP1
111 @@ -226,4 +224,6 @@ extern int  omapfb_update_window_async(s
112                                        void (*callback)(void *),
113                                        void *callback_data);
114  
115 +extern struct platform_device omapdss_device;
116 +
117  #endif /* __OMAPFB_H */
118 Index: linux-2.6.35/drivers/video/omap/omapfb_main.c
119 ===================================================================
120 --- linux-2.6.35.orig/drivers/video/omap/omapfb_main.c  2010-08-08 12:56:09.000000000 +0200
121 +++ linux-2.6.35/drivers/video/omap/omapfb_main.c       2010-08-08 12:57:46.000000000 +0200
122 @@ -84,19 +84,6 @@ static struct caps_table_struct color_ca
123         { 1 << OMAPFB_COLOR_YUY422,     "YUY422", },
124  };
125  
126 -static void omapdss_release(struct device *dev)
127 -{
128 -}
129 -
130 -/* dummy device for clocks */
131 -static struct platform_device omapdss_device = {
132 -       .name           = "omapdss",
133 -       .id             = -1,
134 -       .dev            = {
135 -               .release = omapdss_release,
136 -       },
137 -};
138 -
139  /*
140   * ---------------------------------------------------------------------------
141   * LCD panel
142 @@ -1715,7 +1702,6 @@ static int omapfb_do_probe(struct platfo
143  
144         fbdev->dev = &pdev->dev;
145         fbdev->panel = panel;
146 -       fbdev->dssdev = &omapdss_device;
147         platform_set_drvdata(pdev, fbdev);
148  
149         mutex_init(&fbdev->rqueue_mutex);
150 @@ -1830,16 +1816,8 @@ cleanup:
151  
152  static int omapfb_probe(struct platform_device *pdev)
153  {
154 -       int r;
155 -
156         BUG_ON(fbdev_pdev != NULL);
157  
158 -       r = platform_device_register(&omapdss_device);
159 -       if (r) {
160 -               dev_err(&pdev->dev, "can't register omapdss device\n");
161 -               return r;
162 -       }
163 -
164         /* Delay actual initialization until the LCD is registered */
165         fbdev_pdev = pdev;
166         if (fbdev_panel != NULL)
167 @@ -1867,9 +1845,6 @@ static int omapfb_remove(struct platform
168         fbdev->state = OMAPFB_DISABLED;
169         omapfb_free_resources(fbdev, saved_state);
170  
171 -       platform_device_unregister(&omapdss_device);
172 -       fbdev->dssdev = NULL;
173 -
174         return 0;
175  }
176  
177 ---
178  drivers/video/omap/rfbi.c |    4 ++--
179  1 file changed, 2 insertions(+), 2 deletions(-)
180
181 --- linux-2.6.35.orig/drivers/video/omap/rfbi.c
182 +++ linux-2.6.35/drivers/video/omap/rfbi.c
183 @@ -84,13 +84,13 @@ static inline u32 rfbi_read_reg(int idx)
184  
185  static int rfbi_get_clocks(void)
186  {
187 -       rfbi.dss_ick = clk_get(&rfbi.fbdev->dssdev->dev, "ick");
188 +       rfbi.dss_ick = clk_get(&omapdss_device.dev, "ick");
189         if (IS_ERR(rfbi.dss_ick)) {
190                 dev_err(rfbi.fbdev->dev, "can't get ick\n");
191                 return PTR_ERR(rfbi.dss_ick);
192         }
193  
194 -       rfbi.dss1_fck = clk_get(&rfbi.fbdev->dssdev->dev, "dss1_fck");
195 +       rfbi.dss1_fck = clk_get(&omapdss_device.dev, "dss1_fck");
196         if (IS_ERR(rfbi.dss1_fck)) {
197                 dev_err(rfbi.fbdev->dev, "can't get dss1_fck\n");
198                 clk_put(rfbi.dss_ick);