diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-06-01 19:57:51 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-06-01 19:57:51 -0400 |
commit | 804ce9866d56130032c9c8afc90a1297b7deed56 (patch) | |
tree | 6dd70984f411d2a3624d3f8db7facc3d6396b9ad /arch/arm/mach-omap2 | |
parent | f5e7e844a571124ffc117d4696787d6afc4fc5ae (diff) | |
parent | c895305e806b4346006d3cfba2b432d52268ecd3 (diff) |
Merge tag 'fbdev-updates-for-3.5' of git://github.com/schandinat/linux-2.6
Pull fbdev updates from Florian Tobias Schandinat:
- driver for AUO-K1900 and AUO-K1901 epaper controller
- large updates for OMAP (e.g. decouple HDMI audio and video)
- some updates for Exynos and SH Mobile
- various other small fixes and cleanups
* tag 'fbdev-updates-for-3.5' of git://github.com/schandinat/linux-2.6: (130 commits)
video: bfin_adv7393fb: Fix cleanup code
video: exynos_dp: reduce delay time when configuring video setting
video: exynos_dp: move sw reset prioir to enabling sw defined function
video: exynos_dp: use devm_ functions
fb: handle NULL pointers in framebuffer release
OMAPDSS: HDMI: OMAP4: Update IRQ flags for the HPD IRQ request
OMAPDSS: Apply VENC timings even if panel is disabled
OMAPDSS: VENC/DISPC: Delay dividing Y resolution for managers connected to VENC
OMAPDSS: DISPC: Support rotation through TILER
OMAPDSS: VRFB: remove compiler warnings when CONFIG_BUG=n
OMAPFB: remove compiler warnings when CONFIG_BUG=n
OMAPDSS: remove compiler warnings when CONFIG_BUG=n
OMAPDSS: DISPC: fix usage of dispc_ovl_set_accu_uv
OMAPDSS: use DSI_FIFO_BUG workaround only for manual update displays
OMAPDSS: DSI: Support command mode interleaving during video mode blanking periods
OMAPDSS: DISPC: Update Accumulator configuration for chroma plane
drivers/video: fsl-diu-fb: don't initialize the THRESHOLDS registers
video: exynos mipi dsi: support reverse panel type
video: exynos mipi dsi: Properly interpret the interrupt source flags
video: exynos mipi dsi: Avoid races in probe()
...
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r-- | arch/arm/mach-omap2/display.c | 196 |
1 files changed, 166 insertions, 30 deletions
diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c index db5a88a36c63..54d49ddb9b81 100644 --- a/arch/arm/mach-omap2/display.c +++ b/arch/arm/mach-omap2/display.c | |||
@@ -180,16 +180,133 @@ static void omap_dsi_disable_pads(int dsi_id, unsigned lane_mask) | |||
180 | omap4_dsi_mux_pads(dsi_id, 0); | 180 | omap4_dsi_mux_pads(dsi_id, 0); |
181 | } | 181 | } |
182 | 182 | ||
183 | static int omap_dss_set_min_bus_tput(struct device *dev, unsigned long tput) | ||
184 | { | ||
185 | return omap_pm_set_min_bus_tput(dev, OCP_INITIATOR_AGENT, tput); | ||
186 | } | ||
187 | |||
188 | static struct platform_device *create_dss_pdev(const char *pdev_name, | ||
189 | int pdev_id, const char *oh_name, void *pdata, int pdata_len, | ||
190 | struct platform_device *parent) | ||
191 | { | ||
192 | struct platform_device *pdev; | ||
193 | struct omap_device *od; | ||
194 | struct omap_hwmod *ohs[1]; | ||
195 | struct omap_hwmod *oh; | ||
196 | int r; | ||
197 | |||
198 | oh = omap_hwmod_lookup(oh_name); | ||
199 | if (!oh) { | ||
200 | pr_err("Could not look up %s\n", oh_name); | ||
201 | r = -ENODEV; | ||
202 | goto err; | ||
203 | } | ||
204 | |||
205 | pdev = platform_device_alloc(pdev_name, pdev_id); | ||
206 | if (!pdev) { | ||
207 | pr_err("Could not create pdev for %s\n", pdev_name); | ||
208 | r = -ENOMEM; | ||
209 | goto err; | ||
210 | } | ||
211 | |||
212 | if (parent != NULL) | ||
213 | pdev->dev.parent = &parent->dev; | ||
214 | |||
215 | if (pdev->id != -1) | ||
216 | dev_set_name(&pdev->dev, "%s.%d", pdev->name, pdev->id); | ||
217 | else | ||
218 | dev_set_name(&pdev->dev, "%s", pdev->name); | ||
219 | |||
220 | ohs[0] = oh; | ||
221 | od = omap_device_alloc(pdev, ohs, 1, NULL, 0); | ||
222 | if (!od) { | ||
223 | pr_err("Could not alloc omap_device for %s\n", pdev_name); | ||
224 | r = -ENOMEM; | ||
225 | goto err; | ||
226 | } | ||
227 | |||
228 | r = platform_device_add_data(pdev, pdata, pdata_len); | ||
229 | if (r) { | ||
230 | pr_err("Could not set pdata for %s\n", pdev_name); | ||
231 | goto err; | ||
232 | } | ||
233 | |||
234 | r = omap_device_register(pdev); | ||
235 | if (r) { | ||
236 | pr_err("Could not register omap_device for %s\n", pdev_name); | ||
237 | goto err; | ||
238 | } | ||
239 | |||
240 | return pdev; | ||
241 | |||
242 | err: | ||
243 | return ERR_PTR(r); | ||
244 | } | ||
245 | |||
246 | static struct platform_device *create_simple_dss_pdev(const char *pdev_name, | ||
247 | int pdev_id, void *pdata, int pdata_len, | ||
248 | struct platform_device *parent) | ||
249 | { | ||
250 | struct platform_device *pdev; | ||
251 | int r; | ||
252 | |||
253 | pdev = platform_device_alloc(pdev_name, pdev_id); | ||
254 | if (!pdev) { | ||
255 | pr_err("Could not create pdev for %s\n", pdev_name); | ||
256 | r = -ENOMEM; | ||
257 | goto err; | ||
258 | } | ||
259 | |||
260 | if (parent != NULL) | ||
261 | pdev->dev.parent = &parent->dev; | ||
262 | |||
263 | if (pdev->id != -1) | ||
264 | dev_set_name(&pdev->dev, "%s.%d", pdev->name, pdev->id); | ||
265 | else | ||
266 | dev_set_name(&pdev->dev, "%s", pdev->name); | ||
267 | |||
268 | r = platform_device_add_data(pdev, pdata, pdata_len); | ||
269 | if (r) { | ||
270 | pr_err("Could not set pdata for %s\n", pdev_name); | ||
271 | goto err; | ||
272 | } | ||
273 | |||
274 | r = omap_device_register(pdev); | ||
275 | if (r) { | ||
276 | pr_err("Could not register omap_device for %s\n", pdev_name); | ||
277 | goto err; | ||
278 | } | ||
279 | |||
280 | return pdev; | ||
281 | |||
282 | err: | ||
283 | return ERR_PTR(r); | ||
284 | } | ||
285 | |||
183 | int __init omap_display_init(struct omap_dss_board_info *board_data) | 286 | int __init omap_display_init(struct omap_dss_board_info *board_data) |
184 | { | 287 | { |
185 | int r = 0; | 288 | int r = 0; |
186 | struct omap_hwmod *oh; | ||
187 | struct platform_device *pdev; | 289 | struct platform_device *pdev; |
188 | int i, oh_count; | 290 | int i, oh_count; |
189 | struct omap_display_platform_data pdata; | ||
190 | const struct omap_dss_hwmod_data *curr_dss_hwmod; | 291 | const struct omap_dss_hwmod_data *curr_dss_hwmod; |
292 | struct platform_device *dss_pdev; | ||
293 | |||
294 | /* create omapdss device */ | ||
295 | |||
296 | board_data->dsi_enable_pads = omap_dsi_enable_pads; | ||
297 | board_data->dsi_disable_pads = omap_dsi_disable_pads; | ||
298 | board_data->get_context_loss_count = omap_pm_get_dev_context_loss_count; | ||
299 | board_data->set_min_bus_tput = omap_dss_set_min_bus_tput; | ||
300 | |||
301 | omap_display_device.dev.platform_data = board_data; | ||
302 | |||
303 | r = platform_device_register(&omap_display_device); | ||
304 | if (r < 0) { | ||
305 | pr_err("Unable to register omapdss device\n"); | ||
306 | return r; | ||
307 | } | ||
191 | 308 | ||
192 | memset(&pdata, 0, sizeof(pdata)); | 309 | /* create devices for dss hwmods */ |
193 | 310 | ||
194 | if (cpu_is_omap24xx()) { | 311 | if (cpu_is_omap24xx()) { |
195 | curr_dss_hwmod = omap2_dss_hwmod_data; | 312 | curr_dss_hwmod = omap2_dss_hwmod_data; |
@@ -202,39 +319,58 @@ int __init omap_display_init(struct omap_dss_board_info *board_data) | |||
202 | oh_count = ARRAY_SIZE(omap4_dss_hwmod_data); | 319 | oh_count = ARRAY_SIZE(omap4_dss_hwmod_data); |
203 | } | 320 | } |
204 | 321 | ||
205 | if (board_data->dsi_enable_pads == NULL) | 322 | /* |
206 | board_data->dsi_enable_pads = omap_dsi_enable_pads; | 323 | * First create the pdev for dss_core, which is used as a parent device |
207 | if (board_data->dsi_disable_pads == NULL) | 324 | * by the other dss pdevs. Note: dss_core has to be the first item in |
208 | board_data->dsi_disable_pads = omap_dsi_disable_pads; | 325 | * the hwmod list. |
209 | 326 | */ | |
210 | pdata.board_data = board_data; | 327 | dss_pdev = create_dss_pdev(curr_dss_hwmod[0].dev_name, |
211 | pdata.board_data->get_context_loss_count = | 328 | curr_dss_hwmod[0].id, |
212 | omap_pm_get_dev_context_loss_count; | 329 | curr_dss_hwmod[0].oh_name, |
213 | 330 | board_data, sizeof(*board_data), | |
214 | for (i = 0; i < oh_count; i++) { | 331 | NULL); |
215 | oh = omap_hwmod_lookup(curr_dss_hwmod[i].oh_name); | 332 | |
216 | if (!oh) { | 333 | if (IS_ERR(dss_pdev)) { |
217 | pr_err("Could not look up %s\n", | 334 | pr_err("Could not build omap_device for %s\n", |
218 | curr_dss_hwmod[i].oh_name); | 335 | curr_dss_hwmod[0].oh_name); |
219 | return -ENODEV; | 336 | |
337 | return PTR_ERR(dss_pdev); | ||
338 | } | ||
339 | |||
340 | for (i = 1; i < oh_count; i++) { | ||
341 | pdev = create_dss_pdev(curr_dss_hwmod[i].dev_name, | ||
342 | curr_dss_hwmod[i].id, | ||
343 | curr_dss_hwmod[i].oh_name, | ||
344 | board_data, sizeof(*board_data), | ||
345 | dss_pdev); | ||
346 | |||
347 | if (IS_ERR(pdev)) { | ||
348 | pr_err("Could not build omap_device for %s\n", | ||
349 | curr_dss_hwmod[i].oh_name); | ||
350 | |||
351 | return PTR_ERR(pdev); | ||
220 | } | 352 | } |
353 | } | ||
221 | 354 | ||
222 | pdev = omap_device_build(curr_dss_hwmod[i].dev_name, | 355 | /* Create devices for DPI and SDI */ |
223 | curr_dss_hwmod[i].id, oh, &pdata, | ||
224 | sizeof(struct omap_display_platform_data), | ||
225 | NULL, 0, 0); | ||
226 | 356 | ||
227 | if (WARN((IS_ERR(pdev)), "Could not build omap_device for %s\n", | 357 | pdev = create_simple_dss_pdev("omapdss_dpi", -1, |
228 | curr_dss_hwmod[i].oh_name)) | 358 | board_data, sizeof(*board_data), dss_pdev); |
229 | return -ENODEV; | 359 | if (IS_ERR(pdev)) { |
360 | pr_err("Could not build platform_device for omapdss_dpi\n"); | ||
361 | return PTR_ERR(pdev); | ||
230 | } | 362 | } |
231 | omap_display_device.dev.platform_data = board_data; | ||
232 | 363 | ||
233 | r = platform_device_register(&omap_display_device); | 364 | if (cpu_is_omap34xx()) { |
234 | if (r < 0) | 365 | pdev = create_simple_dss_pdev("omapdss_sdi", -1, |
235 | printk(KERN_ERR "Unable to register OMAP-Display device\n"); | 366 | board_data, sizeof(*board_data), dss_pdev); |
367 | if (IS_ERR(pdev)) { | ||
368 | pr_err("Could not build platform_device for omapdss_sdi\n"); | ||
369 | return PTR_ERR(pdev); | ||
370 | } | ||
371 | } | ||
236 | 372 | ||
237 | return r; | 373 | return 0; |
238 | } | 374 | } |
239 | 375 | ||
240 | static void dispc_disable_outputs(void) | 376 | static void dispc_disable_outputs(void) |