aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-12-15 16:03:48 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-15 16:03:48 -0500
commit2b8318881ddbcb67c5e8d2178b42284749442222 (patch)
treeb43ded0118bb7a6d9f89f6875c18d7ef447ba3be /arch/arm/mach-shmobile
parente81d372ff9f694e13fa46e8b5aaed505c7fd2a1f (diff)
parente7f5c9a16ea2648a3e85af8e34191026bf3dcb62 (diff)
Merge tag 'fbdev-for-3.8' of git://gitorious.org/linux-omap-dss2/linux
Pull fbdev changes from Tomi Valkeinen: "OMAPDSS changes, including: - use dynanic debug prints - OMAP platform dependency removals - Creation of compat-layer, helping us to improve omapdrm - Misc cleanups, aiming to make omadss more in line with the upcoming common display framework Exynos DP changes for the 3.8 merge window: - Device Tree support for Samsung Exynos DP - SW Link training is cleaned up. - HPD interrupt is supported. Samsung Framebuffer changes for the 3.8 merge window: - The bit definitions of header file are updated. - Some minor typos are fixed. - Some minor bugs of s3c_fb_check_var() are fixed. FB related changes for SH Mobile, Freescale DIU Add support for the Solomon SSD1307 OLED Controller" * tag 'fbdev-for-3.8' of git://gitorious.org/linux-omap-dss2/linux: (191 commits) OMAPDSS: fix TV-out issue with DSI PLL Revert "OMAPFB: simplify locking" OMAPFB: remove silly loop in fb2display() OMAPFB: fix error handling in omapfb_find_best_mode() OMAPFB: use devm_kzalloc to allocate omapfb2_device OMAPDSS: DISPC: remove dispc fck uses OMAPDSS: DISPC: get dss clock rate from dss driver drivers/video/console/softcursor.c: remove redundant NULL check before kfree() drivers/video: add support for the Solomon SSD1307 OLED Controller OMAPDSS: use omapdss_compat_init() in other drivers OMAPDSS: export dispc functions OMAPDSS: export dss_feat functions OMAPDSS: export dss_mgr_ops functions OMAPDSS: separate compat files in the Makefile OMAPDSS: move display sysfs init to compat layer OMAPDSS: DPI: use dispc's check_timings OMAPDSS: DISPC: add dispc_ovl_check() OMAPDSS: move irq handling to dispc-compat OMAPDSS: move omap_dispc_wait_for_irq_interruptible_timeout to dispc-compat.c OMAPDSS: move blocking mgr enable/disable to compat layer ... Conflicts: arch/arm/mach-davinci/devices-da8xx.c arch/arm/plat-omap/common.c drivers/media/platform/omap/omap_vout.c
Diffstat (limited to 'arch/arm/mach-shmobile')
-rw-r--r--arch/arm/mach-shmobile/board-ag5evm.c198
-rw-r--r--arch/arm/mach-shmobile/board-ap4evb.c4
-rw-r--r--arch/arm/mach-shmobile/board-mackerel.c6
3 files changed, 107 insertions, 101 deletions
diff --git a/arch/arm/mach-shmobile/board-ag5evm.c b/arch/arm/mach-shmobile/board-ag5evm.c
index 25eb88a923e6..032d10817e79 100644
--- a/arch/arm/mach-shmobile/board-ag5evm.c
+++ b/arch/arm/mach-shmobile/board-ag5evm.c
@@ -213,95 +213,6 @@ static struct platform_device irda_device = {
213 .num_resources = ARRAY_SIZE(irda_resources), 213 .num_resources = ARRAY_SIZE(irda_resources),
214}; 214};
215 215
216static unsigned char lcd_backlight_seq[3][2] = {
217 { 0x04, 0x07 },
218 { 0x23, 0x80 },
219 { 0x03, 0x01 },
220};
221
222static void lcd_backlight_on(void)
223{
224 struct i2c_adapter *a;
225 struct i2c_msg msg;
226 int k;
227
228 a = i2c_get_adapter(1);
229 for (k = 0; a && k < 3; k++) {
230 msg.addr = 0x6d;
231 msg.buf = &lcd_backlight_seq[k][0];
232 msg.len = 2;
233 msg.flags = 0;
234 if (i2c_transfer(a, &msg, 1) != 1)
235 break;
236 }
237}
238
239static void lcd_backlight_reset(void)
240{
241 gpio_set_value(GPIO_PORT235, 0);
242 mdelay(24);
243 gpio_set_value(GPIO_PORT235, 1);
244}
245
246/* LCDC0 */
247static const struct fb_videomode lcdc0_modes[] = {
248 {
249 .name = "R63302(QHD)",
250 .xres = 544,
251 .yres = 961,
252 .left_margin = 72,
253 .right_margin = 600,
254 .hsync_len = 16,
255 .upper_margin = 8,
256 .lower_margin = 8,
257 .vsync_len = 2,
258 .sync = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_HOR_HIGH_ACT,
259 },
260};
261
262static struct sh_mobile_lcdc_info lcdc0_info = {
263 .clock_source = LCDC_CLK_PERIPHERAL,
264 .ch[0] = {
265 .chan = LCDC_CHAN_MAINLCD,
266 .interface_type = RGB24,
267 .clock_divider = 1,
268 .flags = LCDC_FLAGS_DWPOL,
269 .fourcc = V4L2_PIX_FMT_RGB565,
270 .lcd_modes = lcdc0_modes,
271 .num_modes = ARRAY_SIZE(lcdc0_modes),
272 .panel_cfg = {
273 .width = 44,
274 .height = 79,
275 .display_on = lcd_backlight_on,
276 .display_off = lcd_backlight_reset,
277 },
278 }
279};
280
281static struct resource lcdc0_resources[] = {
282 [0] = {
283 .name = "LCDC0",
284 .start = 0xfe940000, /* P4-only space */
285 .end = 0xfe943fff,
286 .flags = IORESOURCE_MEM,
287 },
288 [1] = {
289 .start = intcs_evt2irq(0x580),
290 .flags = IORESOURCE_IRQ,
291 },
292};
293
294static struct platform_device lcdc0_device = {
295 .name = "sh_mobile_lcdc_fb",
296 .num_resources = ARRAY_SIZE(lcdc0_resources),
297 .resource = lcdc0_resources,
298 .id = 0,
299 .dev = {
300 .platform_data = &lcdc0_info,
301 .coherent_dma_mask = ~0,
302 },
303};
304
305/* MIPI-DSI */ 216/* MIPI-DSI */
306static struct resource mipidsi0_resources[] = { 217static struct resource mipidsi0_resources[] = {
307 [0] = { 218 [0] = {
@@ -358,7 +269,7 @@ sh_mipi_set_dot_clock_pck_err:
358 269
359static struct sh_mipi_dsi_info mipidsi0_info = { 270static struct sh_mipi_dsi_info mipidsi0_info = {
360 .data_format = MIPI_RGB888, 271 .data_format = MIPI_RGB888,
361 .lcd_chan = &lcdc0_info.ch[0], 272 .channel = LCDC_CHAN_MAINLCD,
362 .lane = 2, 273 .lane = 2,
363 .vsynw_offset = 20, 274 .vsynw_offset = 20,
364 .clksrc = 1, 275 .clksrc = 1,
@@ -378,6 +289,109 @@ static struct platform_device mipidsi0_device = {
378 }, 289 },
379}; 290};
380 291
292static unsigned char lcd_backlight_seq[3][2] = {
293 { 0x04, 0x07 },
294 { 0x23, 0x80 },
295 { 0x03, 0x01 },
296};
297
298static int lcd_backlight_set_brightness(int brightness)
299{
300 struct i2c_adapter *adap;
301 struct i2c_msg msg;
302 unsigned int i;
303 int ret;
304
305 if (brightness == 0) {
306 /* Reset the chip */
307 gpio_set_value(GPIO_PORT235, 0);
308 mdelay(24);
309 gpio_set_value(GPIO_PORT235, 1);
310 return 0;
311 }
312
313 adap = i2c_get_adapter(1);
314 if (adap == NULL)
315 return -ENODEV;
316
317 for (i = 0; i < ARRAY_SIZE(lcd_backlight_seq); i++) {
318 msg.addr = 0x6d;
319 msg.buf = &lcd_backlight_seq[i][0];
320 msg.len = 2;
321 msg.flags = 0;
322
323 ret = i2c_transfer(adap, &msg, 1);
324 if (ret < 0)
325 break;
326 }
327
328 i2c_put_adapter(adap);
329 return ret < 0 ? ret : 0;
330}
331
332/* LCDC0 */
333static const struct fb_videomode lcdc0_modes[] = {
334 {
335 .name = "R63302(QHD)",
336 .xres = 544,
337 .yres = 961,
338 .left_margin = 72,
339 .right_margin = 600,
340 .hsync_len = 16,
341 .upper_margin = 8,
342 .lower_margin = 8,
343 .vsync_len = 2,
344 .sync = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_HOR_HIGH_ACT,
345 },
346};
347
348static struct sh_mobile_lcdc_info lcdc0_info = {
349 .clock_source = LCDC_CLK_PERIPHERAL,
350 .ch[0] = {
351 .chan = LCDC_CHAN_MAINLCD,
352 .interface_type = RGB24,
353 .clock_divider = 1,
354 .flags = LCDC_FLAGS_DWPOL,
355 .fourcc = V4L2_PIX_FMT_RGB565,
356 .lcd_modes = lcdc0_modes,
357 .num_modes = ARRAY_SIZE(lcdc0_modes),
358 .panel_cfg = {
359 .width = 44,
360 .height = 79,
361 },
362 .bl_info = {
363 .name = "sh_mobile_lcdc_bl",
364 .max_brightness = 1,
365 .set_brightness = lcd_backlight_set_brightness,
366 },
367 .tx_dev = &mipidsi0_device,
368 }
369};
370
371static struct resource lcdc0_resources[] = {
372 [0] = {
373 .name = "LCDC0",
374 .start = 0xfe940000, /* P4-only space */
375 .end = 0xfe943fff,
376 .flags = IORESOURCE_MEM,
377 },
378 [1] = {
379 .start = intcs_evt2irq(0x580),
380 .flags = IORESOURCE_IRQ,
381 },
382};
383
384static struct platform_device lcdc0_device = {
385 .name = "sh_mobile_lcdc_fb",
386 .num_resources = ARRAY_SIZE(lcdc0_resources),
387 .resource = lcdc0_resources,
388 .id = 0,
389 .dev = {
390 .platform_data = &lcdc0_info,
391 .coherent_dma_mask = ~0,
392 },
393};
394
381/* Fixed 2.8V regulators to be used by SDHI0 */ 395/* Fixed 2.8V regulators to be used by SDHI0 */
382static struct regulator_consumer_supply fixed2v8_power_consumers[] = 396static struct regulator_consumer_supply fixed2v8_power_consumers[] =
383{ 397{
@@ -531,8 +545,8 @@ static struct platform_device *ag5evm_devices[] __initdata = {
531 &fsi_device, 545 &fsi_device,
532 &mmc_device, 546 &mmc_device,
533 &irda_device, 547 &irda_device,
534 &lcdc0_device,
535 &mipidsi0_device, 548 &mipidsi0_device,
549 &lcdc0_device,
536 &sdhi0_device, 550 &sdhi0_device,
537 &sdhi1_device, 551 &sdhi1_device,
538}; 552};
@@ -621,7 +635,7 @@ static void __init ag5evm_init(void)
621 /* LCD backlight controller */ 635 /* LCD backlight controller */
622 gpio_request(GPIO_PORT235, NULL); /* RESET */ 636 gpio_request(GPIO_PORT235, NULL); /* RESET */
623 gpio_direction_output(GPIO_PORT235, 0); 637 gpio_direction_output(GPIO_PORT235, 0);
624 lcd_backlight_reset(); 638 lcd_backlight_set_brightness(0);
625 639
626 /* enable SDHI0 on CN15 [SD I/F] */ 640 /* enable SDHI0 on CN15 [SD I/F] */
627 gpio_request(GPIO_FN_SDHIWP0, NULL); 641 gpio_request(GPIO_FN_SDHIWP0, NULL);
diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
index 40657854e3ad..99ef190d0909 100644
--- a/arch/arm/mach-shmobile/board-ap4evb.c
+++ b/arch/arm/mach-shmobile/board-ap4evb.c
@@ -552,11 +552,9 @@ static struct resource mipidsi0_resources[] = {
552 }, 552 },
553}; 553};
554 554
555static struct sh_mobile_lcdc_info lcdc_info;
556
557static struct sh_mipi_dsi_info mipidsi0_info = { 555static struct sh_mipi_dsi_info mipidsi0_info = {
558 .data_format = MIPI_RGB888, 556 .data_format = MIPI_RGB888,
559 .lcd_chan = &lcdc_info.ch[0], 557 .channel = LCDC_CHAN_MAINLCD,
560 .lane = 2, 558 .lane = 2,
561 .vsynw_offset = 17, 559 .vsynw_offset = 17,
562 .phyctrl = 0x6 << 8, 560 .phyctrl = 0x6 << 8,
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
index 3f56e70795b7..2fed62f66045 100644
--- a/arch/arm/mach-shmobile/board-mackerel.c
+++ b/arch/arm/mach-shmobile/board-mackerel.c
@@ -370,11 +370,6 @@ static int mackerel_set_brightness(int brightness)
370 return 0; 370 return 0;
371} 371}
372 372
373static int mackerel_get_brightness(void)
374{
375 return gpio_get_value(GPIO_PORT31);
376}
377
378static const struct sh_mobile_meram_cfg lcd_meram_cfg = { 373static const struct sh_mobile_meram_cfg lcd_meram_cfg = {
379 .icb[0] = { 374 .icb[0] = {
380 .meram_size = 0x40, 375 .meram_size = 0x40,
@@ -403,7 +398,6 @@ static struct sh_mobile_lcdc_info lcdc_info = {
403 .name = "sh_mobile_lcdc_bl", 398 .name = "sh_mobile_lcdc_bl",
404 .max_brightness = 1, 399 .max_brightness = 1,
405 .set_brightness = mackerel_set_brightness, 400 .set_brightness = mackerel_set_brightness,
406 .get_brightness = mackerel_get_brightness,
407 }, 401 },
408 .meram_cfg = &lcd_meram_cfg, 402 .meram_cfg = &lcd_meram_cfg,
409 } 403 }