diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-07-08 12:24:01 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-07-08 12:24:01 -0400 |
commit | 622f8061a68d3f7a576c20a47b7f3bae7c8cfbef (patch) | |
tree | b9fa9f4d92d80eaae27f5a6f6cb2ff8b5d007024 | |
parent | 6c96895e999f5c44a95a5cad6a6e32e7bd6e28b6 (diff) | |
parent | dd4da3a55f99efbfd46674ebefdcc2878a57ef2a (diff) |
Merge branch 'sh/for-2.6.31' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6
* 'sh/for-2.6.31' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6:
serial: sh-sci: fix sci interrupt handler
video: hitfb: Move over to dev_pm_ops.
video: hitfb: Convert to framebuffer_alloc().
video: sh_mobile_lcdcfb: Convert to framebuffer_alloc().
sh: add r8a66597 usb0 host to the se7724 board
usb: allow sh7724 to enable on-chip r8a66597
sh-sci: update receive error handling for muxed irqs
sh: define PERF_COUNTER_INDEX_OFFSET.
-rw-r--r-- | arch/sh/boards/mach-se/7724/setup.c | 38 | ||||
-rw-r--r-- | arch/sh/include/asm/perf_counter.h | 2 | ||||
-rw-r--r-- | drivers/serial/sh-sci.c | 11 | ||||
-rw-r--r-- | drivers/usb/host/Kconfig | 4 | ||||
-rw-r--r-- | drivers/video/hitfb.c | 66 | ||||
-rw-r--r-- | drivers/video/sh_mobile_lcdcfb.c | 40 |
6 files changed, 116 insertions, 45 deletions
diff --git a/arch/sh/boards/mach-se/7724/setup.c b/arch/sh/boards/mach-se/7724/setup.c index c050a8d76dfd..8fed45a2fb85 100644 --- a/arch/sh/boards/mach-se/7724/setup.c +++ b/arch/sh/boards/mach-se/7724/setup.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/smc91x.h> | 19 | #include <linux/smc91x.h> |
20 | #include <linux/gpio.h> | 20 | #include <linux/gpio.h> |
21 | #include <linux/input.h> | 21 | #include <linux/input.h> |
22 | #include <linux/usb/r8a66597.h> | ||
22 | #include <video/sh_mobile_lcdc.h> | 23 | #include <video/sh_mobile_lcdc.h> |
23 | #include <media/sh_mobile_ceu.h> | 24 | #include <media/sh_mobile_ceu.h> |
24 | #include <asm/io.h> | 25 | #include <asm/io.h> |
@@ -302,6 +303,34 @@ static struct platform_device sh_eth_device = { | |||
302 | .resource = sh_eth_resources, | 303 | .resource = sh_eth_resources, |
303 | }; | 304 | }; |
304 | 305 | ||
306 | static struct r8a66597_platdata sh7724_usb0_host_data = { | ||
307 | }; | ||
308 | |||
309 | static struct resource sh7724_usb0_host_resources[] = { | ||
310 | [0] = { | ||
311 | .start = 0xa4d80000, | ||
312 | .end = 0xa4d800ff, | ||
313 | .flags = IORESOURCE_MEM, | ||
314 | }, | ||
315 | [1] = { | ||
316 | .start = 65, | ||
317 | .end = 65, | ||
318 | .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW, | ||
319 | }, | ||
320 | }; | ||
321 | |||
322 | static struct platform_device sh7724_usb0_host_device = { | ||
323 | .name = "r8a66597_hcd", | ||
324 | .id = 0, | ||
325 | .dev = { | ||
326 | .dma_mask = NULL, /* not use dma */ | ||
327 | .coherent_dma_mask = 0xffffffff, | ||
328 | .platform_data = &sh7724_usb0_host_data, | ||
329 | }, | ||
330 | .num_resources = ARRAY_SIZE(sh7724_usb0_host_resources), | ||
331 | .resource = sh7724_usb0_host_resources, | ||
332 | }; | ||
333 | |||
305 | static struct platform_device *ms7724se_devices[] __initdata = { | 334 | static struct platform_device *ms7724se_devices[] __initdata = { |
306 | &heartbeat_device, | 335 | &heartbeat_device, |
307 | &smc91x_eth_device, | 336 | &smc91x_eth_device, |
@@ -311,6 +340,7 @@ static struct platform_device *ms7724se_devices[] __initdata = { | |||
311 | &ceu1_device, | 340 | &ceu1_device, |
312 | &keysc_device, | 341 | &keysc_device, |
313 | &sh_eth_device, | 342 | &sh_eth_device, |
343 | &sh7724_usb0_host_device, | ||
314 | }; | 344 | }; |
315 | 345 | ||
316 | #define EEPROM_OP 0xBA206000 | 346 | #define EEPROM_OP 0xBA206000 |
@@ -364,6 +394,7 @@ static void __init sh_eth_init(void) | |||
364 | #define SW4140 0xBA201000 | 394 | #define SW4140 0xBA201000 |
365 | #define FPGA_OUT 0xBA200400 | 395 | #define FPGA_OUT 0xBA200400 |
366 | #define PORT_HIZA 0xA4050158 | 396 | #define PORT_HIZA 0xA4050158 |
397 | #define PORT_MSELCRB 0xA4050182 | ||
367 | 398 | ||
368 | #define SW41_A 0x0100 | 399 | #define SW41_A 0x0100 |
369 | #define SW41_B 0x0200 | 400 | #define SW41_B 0x0200 |
@@ -373,6 +404,7 @@ static void __init sh_eth_init(void) | |||
373 | #define SW41_F 0x2000 | 404 | #define SW41_F 0x2000 |
374 | #define SW41_G 0x4000 | 405 | #define SW41_G 0x4000 |
375 | #define SW41_H 0x8000 | 406 | #define SW41_H 0x8000 |
407 | |||
376 | static int __init devices_setup(void) | 408 | static int __init devices_setup(void) |
377 | { | 409 | { |
378 | u16 sw = ctrl_inw(SW4140); /* select camera, monitor */ | 410 | u16 sw = ctrl_inw(SW4140); /* select camera, monitor */ |
@@ -385,6 +417,12 @@ static int __init devices_setup(void) | |||
385 | (1 << 14)), /* RMII */ | 417 | (1 << 14)), /* RMII */ |
386 | FPGA_OUT); | 418 | FPGA_OUT); |
387 | 419 | ||
420 | /* turn on USB clocks, use external clock */ | ||
421 | ctrl_outw((ctrl_inw(PORT_MSELCRB) & ~0xc000) | 0x8000, PORT_MSELCRB); | ||
422 | |||
423 | /* enable USB0 port */ | ||
424 | ctrl_outw(0x0600, 0xa40501d4); | ||
425 | |||
388 | /* enable IRQ 0,1,2 */ | 426 | /* enable IRQ 0,1,2 */ |
389 | gpio_request(GPIO_FN_INTC_IRQ0, NULL); | 427 | gpio_request(GPIO_FN_INTC_IRQ0, NULL); |
390 | gpio_request(GPIO_FN_INTC_IRQ1, NULL); | 428 | gpio_request(GPIO_FN_INTC_IRQ1, NULL); |
diff --git a/arch/sh/include/asm/perf_counter.h b/arch/sh/include/asm/perf_counter.h index 61c2b40c802c..d8e6bb9c0ccc 100644 --- a/arch/sh/include/asm/perf_counter.h +++ b/arch/sh/include/asm/perf_counter.h | |||
@@ -4,4 +4,6 @@ | |||
4 | /* SH only supports software counters through this interface. */ | 4 | /* SH only supports software counters through this interface. */ |
5 | static inline void set_perf_counter_pending(void) {} | 5 | static inline void set_perf_counter_pending(void) {} |
6 | 6 | ||
7 | #define PERF_COUNTER_INDEX_OFFSET 0 | ||
8 | |||
7 | #endif /* __ASM_SH_PERF_COUNTER_H */ | 9 | #endif /* __ASM_SH_PERF_COUNTER_H */ |
diff --git a/drivers/serial/sh-sci.c b/drivers/serial/sh-sci.c index 66f52674ca0c..8e2feb563347 100644 --- a/drivers/serial/sh-sci.c +++ b/drivers/serial/sh-sci.c | |||
@@ -707,24 +707,25 @@ static irqreturn_t sci_br_interrupt(int irq, void *ptr) | |||
707 | 707 | ||
708 | static irqreturn_t sci_mpxed_interrupt(int irq, void *ptr) | 708 | static irqreturn_t sci_mpxed_interrupt(int irq, void *ptr) |
709 | { | 709 | { |
710 | unsigned short ssr_status, scr_status; | 710 | unsigned short ssr_status, scr_status, err_enabled; |
711 | struct uart_port *port = ptr; | 711 | struct uart_port *port = ptr; |
712 | irqreturn_t ret = IRQ_NONE; | 712 | irqreturn_t ret = IRQ_NONE; |
713 | 713 | ||
714 | ssr_status = sci_in(port, SCxSR); | 714 | ssr_status = sci_in(port, SCxSR); |
715 | scr_status = sci_in(port, SCSCR); | 715 | scr_status = sci_in(port, SCSCR); |
716 | err_enabled = scr_status & (SCI_CTRL_FLAGS_REIE | SCI_CTRL_FLAGS_RIE); | ||
716 | 717 | ||
717 | /* Tx Interrupt */ | 718 | /* Tx Interrupt */ |
718 | if ((ssr_status & 0x0020) && (scr_status & SCI_CTRL_FLAGS_TIE)) | 719 | if ((ssr_status & SCxSR_TDxE(port)) && (scr_status & SCI_CTRL_FLAGS_TIE)) |
719 | ret = sci_tx_interrupt(irq, ptr); | 720 | ret = sci_tx_interrupt(irq, ptr); |
720 | /* Rx Interrupt */ | 721 | /* Rx Interrupt */ |
721 | if ((ssr_status & 0x0002) && (scr_status & SCI_CTRL_FLAGS_RIE)) | 722 | if ((ssr_status & SCxSR_RDxF(port)) && (scr_status & SCI_CTRL_FLAGS_RIE)) |
722 | ret = sci_rx_interrupt(irq, ptr); | 723 | ret = sci_rx_interrupt(irq, ptr); |
723 | /* Error Interrupt */ | 724 | /* Error Interrupt */ |
724 | if ((ssr_status & 0x0080) && (scr_status & SCI_CTRL_FLAGS_REIE)) | 725 | if ((ssr_status & SCxSR_ERRORS(port)) && err_enabled) |
725 | ret = sci_er_interrupt(irq, ptr); | 726 | ret = sci_er_interrupt(irq, ptr); |
726 | /* Break Interrupt */ | 727 | /* Break Interrupt */ |
727 | if ((ssr_status & 0x0010) && (scr_status & SCI_CTRL_FLAGS_REIE)) | 728 | if ((ssr_status & SCxSR_BRK(port)) && err_enabled) |
728 | ret = sci_br_interrupt(irq, ptr); | 729 | ret = sci_br_interrupt(irq, ptr); |
729 | 730 | ||
730 | return ret; | 731 | return ret; |
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig index 1576a0520adf..0c03471f0d41 100644 --- a/drivers/usb/host/Kconfig +++ b/drivers/usb/host/Kconfig | |||
@@ -337,10 +337,10 @@ config USB_R8A66597_HCD | |||
337 | 337 | ||
338 | config SUPERH_ON_CHIP_R8A66597 | 338 | config SUPERH_ON_CHIP_R8A66597 |
339 | boolean "Enable SuperH on-chip R8A66597 USB" | 339 | boolean "Enable SuperH on-chip R8A66597 USB" |
340 | depends on USB_R8A66597_HCD && (CPU_SUBTYPE_SH7366 || CPU_SUBTYPE_SH7723) | 340 | depends on USB_R8A66597_HCD && (CPU_SUBTYPE_SH7366 || CPU_SUBTYPE_SH7723 || CPU_SUBTYPE_SH7724) |
341 | help | 341 | help |
342 | This driver enables support for the on-chip R8A66597 in the | 342 | This driver enables support for the on-chip R8A66597 in the |
343 | SH7366 and SH7723 processors. | 343 | SH7366, SH7723 and SH7724 processors. |
344 | 344 | ||
345 | config USB_WHCI_HCD | 345 | config USB_WHCI_HCD |
346 | tristate "Wireless USB Host Controller Interface (WHCI) driver (EXPERIMENTAL)" | 346 | tristate "Wireless USB Host Controller Interface (WHCI) driver (EXPERIMENTAL)" |
diff --git a/drivers/video/hitfb.c b/drivers/video/hitfb.c index 020db7fc9153..e7116a6d82d3 100644 --- a/drivers/video/hitfb.c +++ b/drivers/video/hitfb.c | |||
@@ -44,9 +44,6 @@ static struct fb_fix_screeninfo hitfb_fix __initdata = { | |||
44 | .accel = FB_ACCEL_NONE, | 44 | .accel = FB_ACCEL_NONE, |
45 | }; | 45 | }; |
46 | 46 | ||
47 | static u32 pseudo_palette[16]; | ||
48 | static struct fb_info fb_info; | ||
49 | |||
50 | static inline void hitfb_accel_wait(void) | 47 | static inline void hitfb_accel_wait(void) |
51 | { | 48 | { |
52 | while (fb_readw(HD64461_GRCFGR) & HD64461_GRCFGR_ACCSTATUS) ; | 49 | while (fb_readw(HD64461_GRCFGR) & HD64461_GRCFGR_ACCSTATUS) ; |
@@ -331,6 +328,8 @@ static struct fb_ops hitfb_ops = { | |||
331 | static int __init hitfb_probe(struct platform_device *dev) | 328 | static int __init hitfb_probe(struct platform_device *dev) |
332 | { | 329 | { |
333 | unsigned short lcdclor, ldr3, ldvndr; | 330 | unsigned short lcdclor, ldr3, ldvndr; |
331 | struct fb_info *info; | ||
332 | int ret; | ||
334 | 333 | ||
335 | if (fb_get_options("hitfb", NULL)) | 334 | if (fb_get_options("hitfb", NULL)) |
336 | return -ENODEV; | 335 | return -ENODEV; |
@@ -384,32 +383,53 @@ static int __init hitfb_probe(struct platform_device *dev) | |||
384 | break; | 383 | break; |
385 | } | 384 | } |
386 | 385 | ||
387 | fb_info.fbops = &hitfb_ops; | 386 | info = framebuffer_alloc(sizeof(u32) * 16, &dev->dev); |
388 | fb_info.var = hitfb_var; | 387 | if (unlikely(!info)) |
389 | fb_info.fix = hitfb_fix; | 388 | return -ENOMEM; |
390 | fb_info.pseudo_palette = pseudo_palette; | 389 | |
391 | fb_info.flags = FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN | | 390 | info->fbops = &hitfb_ops; |
391 | info->var = hitfb_var; | ||
392 | info->fix = hitfb_fix; | ||
393 | info->pseudo_palette = info->par; | ||
394 | info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN | | ||
392 | FBINFO_HWACCEL_FILLRECT | FBINFO_HWACCEL_COPYAREA; | 395 | FBINFO_HWACCEL_FILLRECT | FBINFO_HWACCEL_COPYAREA; |
393 | 396 | ||
394 | fb_info.screen_base = (void *)hitfb_fix.smem_start; | 397 | info->screen_base = (void *)hitfb_fix.smem_start; |
395 | 398 | ||
396 | fb_alloc_cmap(&fb_info.cmap, 256, 0); | 399 | ret = fb_alloc_cmap(&info->cmap, 256, 0); |
400 | if (unlikely(ret < 0)) | ||
401 | goto err_fb; | ||
397 | 402 | ||
398 | if (register_framebuffer(&fb_info) < 0) | 403 | ret = register_framebuffer(info); |
399 | return -EINVAL; | 404 | if (unlikely(ret < 0)) |
405 | goto err; | ||
406 | |||
407 | platform_set_drvdata(dev, info); | ||
400 | 408 | ||
401 | printk(KERN_INFO "fb%d: %s frame buffer device\n", | 409 | printk(KERN_INFO "fb%d: %s frame buffer device\n", |
402 | fb_info.node, fb_info.fix.id); | 410 | info->node, info->fix.id); |
411 | |||
403 | return 0; | 412 | return 0; |
413 | |||
414 | err: | ||
415 | fb_dealloc_cmap(&info->cmap); | ||
416 | err_fb: | ||
417 | framebuffer_release(info); | ||
418 | return ret; | ||
404 | } | 419 | } |
405 | 420 | ||
406 | static int __exit hitfb_remove(struct platform_device *dev) | 421 | static int __exit hitfb_remove(struct platform_device *dev) |
407 | { | 422 | { |
408 | return unregister_framebuffer(&fb_info); | 423 | struct fb_info *info = platform_get_drvdata(dev); |
424 | |||
425 | unregister_framebuffer(info); | ||
426 | fb_dealloc_cmap(&info->cmap); | ||
427 | framebuffer_release(info); | ||
428 | |||
429 | return 0; | ||
409 | } | 430 | } |
410 | 431 | ||
411 | #ifdef CONFIG_PM | 432 | static int hitfb_suspend(struct device *dev) |
412 | static int hitfb_suspend(struct platform_device *dev, pm_message_t state) | ||
413 | { | 433 | { |
414 | u16 v; | 434 | u16 v; |
415 | 435 | ||
@@ -421,7 +441,7 @@ static int hitfb_suspend(struct platform_device *dev, pm_message_t state) | |||
421 | return 0; | 441 | return 0; |
422 | } | 442 | } |
423 | 443 | ||
424 | static int hitfb_resume(struct platform_device *dev) | 444 | static int hitfb_resume(struct device *dev) |
425 | { | 445 | { |
426 | u16 v; | 446 | u16 v; |
427 | 447 | ||
@@ -435,17 +455,19 @@ static int hitfb_resume(struct platform_device *dev) | |||
435 | 455 | ||
436 | return 0; | 456 | return 0; |
437 | } | 457 | } |
438 | #endif | 458 | |
459 | static struct dev_pm_ops hitfb_dev_pm_ops = { | ||
460 | .suspend = hitfb_suspend, | ||
461 | .resume = hitfb_resume, | ||
462 | }; | ||
439 | 463 | ||
440 | static struct platform_driver hitfb_driver = { | 464 | static struct platform_driver hitfb_driver = { |
441 | .probe = hitfb_probe, | 465 | .probe = hitfb_probe, |
442 | .remove = __exit_p(hitfb_remove), | 466 | .remove = __exit_p(hitfb_remove), |
443 | #ifdef CONFIG_PM | ||
444 | .suspend = hitfb_suspend, | ||
445 | .resume = hitfb_resume, | ||
446 | #endif | ||
447 | .driver = { | 467 | .driver = { |
448 | .name = "hitfb", | 468 | .name = "hitfb", |
469 | .owner = THIS_MODULE, | ||
470 | .pm = &hitfb_dev_pm_ops, | ||
449 | }, | 471 | }, |
450 | }; | 472 | }; |
451 | 473 | ||
diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c index da983b720f08..8f24564f77b0 100644 --- a/drivers/video/sh_mobile_lcdcfb.c +++ b/drivers/video/sh_mobile_lcdcfb.c | |||
@@ -31,7 +31,7 @@ struct sh_mobile_lcdc_chan { | |||
31 | unsigned long enabled; /* ME and SE in LDCNT2R */ | 31 | unsigned long enabled; /* ME and SE in LDCNT2R */ |
32 | struct sh_mobile_lcdc_chan_cfg cfg; | 32 | struct sh_mobile_lcdc_chan_cfg cfg; |
33 | u32 pseudo_palette[PALETTE_NR]; | 33 | u32 pseudo_palette[PALETTE_NR]; |
34 | struct fb_info info; | 34 | struct fb_info *info; |
35 | dma_addr_t dma_handle; | 35 | dma_addr_t dma_handle; |
36 | struct fb_deferred_io defio; | 36 | struct fb_deferred_io defio; |
37 | struct scatterlist *sglist; | 37 | struct scatterlist *sglist; |
@@ -442,22 +442,22 @@ static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv) | |||
442 | /* set bpp format in PKF[4:0] */ | 442 | /* set bpp format in PKF[4:0] */ |
443 | tmp = lcdc_read_chan(ch, LDDFR); | 443 | tmp = lcdc_read_chan(ch, LDDFR); |
444 | tmp &= ~(0x0001001f); | 444 | tmp &= ~(0x0001001f); |
445 | tmp |= (priv->ch[k].info.var.bits_per_pixel == 16) ? 3 : 0; | 445 | tmp |= (ch->info->var.bits_per_pixel == 16) ? 3 : 0; |
446 | lcdc_write_chan(ch, LDDFR, tmp); | 446 | lcdc_write_chan(ch, LDDFR, tmp); |
447 | 447 | ||
448 | /* point out our frame buffer */ | 448 | /* point out our frame buffer */ |
449 | lcdc_write_chan(ch, LDSA1R, ch->info.fix.smem_start); | 449 | lcdc_write_chan(ch, LDSA1R, ch->info->fix.smem_start); |
450 | 450 | ||
451 | /* set line size */ | 451 | /* set line size */ |
452 | lcdc_write_chan(ch, LDMLSR, ch->info.fix.line_length); | 452 | lcdc_write_chan(ch, LDMLSR, ch->info->fix.line_length); |
453 | 453 | ||
454 | /* setup deferred io if SYS bus */ | 454 | /* setup deferred io if SYS bus */ |
455 | tmp = ch->cfg.sys_bus_cfg.deferred_io_msec; | 455 | tmp = ch->cfg.sys_bus_cfg.deferred_io_msec; |
456 | if (ch->ldmt1r_value & (1 << 12) && tmp) { | 456 | if (ch->ldmt1r_value & (1 << 12) && tmp) { |
457 | ch->defio.deferred_io = sh_mobile_lcdc_deferred_io; | 457 | ch->defio.deferred_io = sh_mobile_lcdc_deferred_io; |
458 | ch->defio.delay = msecs_to_jiffies(tmp); | 458 | ch->defio.delay = msecs_to_jiffies(tmp); |
459 | ch->info.fbdefio = &ch->defio; | 459 | ch->info->fbdefio = &ch->defio; |
460 | fb_deferred_io_init(&ch->info); | 460 | fb_deferred_io_init(ch->info); |
461 | 461 | ||
462 | /* one-shot mode */ | 462 | /* one-shot mode */ |
463 | lcdc_write_chan(ch, LDSM1R, 1); | 463 | lcdc_write_chan(ch, LDSM1R, 1); |
@@ -503,12 +503,12 @@ static void sh_mobile_lcdc_stop(struct sh_mobile_lcdc_priv *priv) | |||
503 | * flush frame, and wait for frame end interrupt | 503 | * flush frame, and wait for frame end interrupt |
504 | * clean up deferred io and enable clock | 504 | * clean up deferred io and enable clock |
505 | */ | 505 | */ |
506 | if (ch->info.fbdefio) { | 506 | if (ch->info->fbdefio) { |
507 | ch->frame_end = 0; | 507 | ch->frame_end = 0; |
508 | schedule_delayed_work(&ch->info.deferred_work, 0); | 508 | schedule_delayed_work(&ch->info->deferred_work, 0); |
509 | wait_event(ch->frame_end_wait, ch->frame_end); | 509 | wait_event(ch->frame_end_wait, ch->frame_end); |
510 | fb_deferred_io_cleanup(&ch->info); | 510 | fb_deferred_io_cleanup(ch->info); |
511 | ch->info.fbdefio = NULL; | 511 | ch->info->fbdefio = NULL; |
512 | sh_mobile_lcdc_clk_on(priv); | 512 | sh_mobile_lcdc_clk_on(priv); |
513 | } | 513 | } |
514 | 514 | ||
@@ -817,9 +817,16 @@ static int __init sh_mobile_lcdc_probe(struct platform_device *pdev) | |||
817 | priv->base = ioremap_nocache(res->start, (res->end - res->start) + 1); | 817 | priv->base = ioremap_nocache(res->start, (res->end - res->start) + 1); |
818 | 818 | ||
819 | for (i = 0; i < j; i++) { | 819 | for (i = 0; i < j; i++) { |
820 | info = &priv->ch[i].info; | ||
821 | cfg = &priv->ch[i].cfg; | 820 | cfg = &priv->ch[i].cfg; |
822 | 821 | ||
822 | priv->ch[i].info = framebuffer_alloc(0, &pdev->dev); | ||
823 | if (!priv->ch[i].info) { | ||
824 | dev_err(&pdev->dev, "unable to allocate fb_info\n"); | ||
825 | error = -ENOMEM; | ||
826 | break; | ||
827 | } | ||
828 | |||
829 | info = priv->ch[i].info; | ||
823 | info->fbops = &sh_mobile_lcdc_ops; | 830 | info->fbops = &sh_mobile_lcdc_ops; |
824 | info->var.xres = info->var.xres_virtual = cfg->lcd_cfg.xres; | 831 | info->var.xres = info->var.xres_virtual = cfg->lcd_cfg.xres; |
825 | info->var.yres = info->var.yres_virtual = cfg->lcd_cfg.yres; | 832 | info->var.yres = info->var.yres_virtual = cfg->lcd_cfg.yres; |
@@ -872,7 +879,7 @@ static int __init sh_mobile_lcdc_probe(struct platform_device *pdev) | |||
872 | for (i = 0; i < j; i++) { | 879 | for (i = 0; i < j; i++) { |
873 | struct sh_mobile_lcdc_chan *ch = priv->ch + i; | 880 | struct sh_mobile_lcdc_chan *ch = priv->ch + i; |
874 | 881 | ||
875 | info = &ch->info; | 882 | info = ch->info; |
876 | 883 | ||
877 | if (info->fbdefio) { | 884 | if (info->fbdefio) { |
878 | priv->ch->sglist = vmalloc(sizeof(struct scatterlist) * | 885 | priv->ch->sglist = vmalloc(sizeof(struct scatterlist) * |
@@ -915,15 +922,15 @@ static int sh_mobile_lcdc_remove(struct platform_device *pdev) | |||
915 | int i; | 922 | int i; |
916 | 923 | ||
917 | for (i = 0; i < ARRAY_SIZE(priv->ch); i++) | 924 | for (i = 0; i < ARRAY_SIZE(priv->ch); i++) |
918 | if (priv->ch[i].info.dev) | 925 | if (priv->ch[i].info->dev) |
919 | unregister_framebuffer(&priv->ch[i].info); | 926 | unregister_framebuffer(priv->ch[i].info); |
920 | 927 | ||
921 | sh_mobile_lcdc_stop(priv); | 928 | sh_mobile_lcdc_stop(priv); |
922 | 929 | ||
923 | for (i = 0; i < ARRAY_SIZE(priv->ch); i++) { | 930 | for (i = 0; i < ARRAY_SIZE(priv->ch); i++) { |
924 | info = &priv->ch[i].info; | 931 | info = priv->ch[i].info; |
925 | 932 | ||
926 | if (!info->device) | 933 | if (!info || !info->device) |
927 | continue; | 934 | continue; |
928 | 935 | ||
929 | if (priv->ch[i].sglist) | 936 | if (priv->ch[i].sglist) |
@@ -932,6 +939,7 @@ static int sh_mobile_lcdc_remove(struct platform_device *pdev) | |||
932 | dma_free_coherent(&pdev->dev, info->fix.smem_len, | 939 | dma_free_coherent(&pdev->dev, info->fix.smem_len, |
933 | info->screen_base, priv->ch[i].dma_handle); | 940 | info->screen_base, priv->ch[i].dma_handle); |
934 | fb_dealloc_cmap(&info->cmap); | 941 | fb_dealloc_cmap(&info->cmap); |
942 | framebuffer_release(info); | ||
935 | } | 943 | } |
936 | 944 | ||
937 | #ifdef CONFIG_HAVE_CLK | 945 | #ifdef CONFIG_HAVE_CLK |