aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/pcm990-baseboard.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-pxa/pcm990-baseboard.c')
-rw-r--r--arch/arm/mach-pxa/pcm990-baseboard.c131
1 files changed, 99 insertions, 32 deletions
diff --git a/arch/arm/mach-pxa/pcm990-baseboard.c b/arch/arm/mach-pxa/pcm990-baseboard.c
index 49d951db0f3d..5d87c7c866e4 100644
--- a/arch/arm/mach-pxa/pcm990-baseboard.c
+++ b/arch/arm/mach-pxa/pcm990-baseboard.c
@@ -24,6 +24,7 @@
24#include <linux/platform_device.h> 24#include <linux/platform_device.h>
25#include <linux/ide.h> 25#include <linux/ide.h>
26#include <linux/i2c.h> 26#include <linux/i2c.h>
27#include <linux/pwm_backlight.h>
27 28
28#include <media/soc_camera.h> 29#include <media/soc_camera.h>
29 30
@@ -33,12 +34,103 @@
33#include <asm/mach/map.h> 34#include <asm/mach/map.h>
34#include <asm/arch/pxa-regs.h> 35#include <asm/arch/pxa-regs.h>
35#include <asm/arch/pxa2xx-gpio.h> 36#include <asm/arch/pxa2xx-gpio.h>
37#include <asm/arch/audio.h>
36#include <asm/arch/mmc.h> 38#include <asm/arch/mmc.h>
37#include <asm/arch/ohci.h> 39#include <asm/arch/ohci.h>
38#include <asm/arch/pcm990_baseboard.h> 40#include <asm/arch/pcm990_baseboard.h>
41#include <asm/arch/pxafb.h>
42
43#include "devices.h"
39 44
40/* 45/*
41 * The PCM-990 development baseboard uses PCM-027's hardeware in the 46 * pcm990_lcd_power - control power supply to the LCD
47 * @on: 0 = switch off, 1 = switch on
48 *
49 * Called by the pxafb driver
50 */
51#ifndef CONFIG_PCM990_DISPLAY_NONE
52static void pcm990_lcd_power(int on, struct fb_var_screeninfo *var)
53{
54 if (on) {
55 /* enable LCD-Latches
56 * power on LCD
57 */
58 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG3) =
59 PCM990_CTRL_LCDPWR + PCM990_CTRL_LCDON;
60 } else {
61 /* disable LCD-Latches
62 * power off LCD
63 */
64 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG3) = 0x00;
65 }
66}
67#endif
68
69#if defined(CONFIG_PCM990_DISPLAY_SHARP)
70static struct pxafb_mode_info fb_info_sharp_lq084v1dg21 = {
71 .pixclock = 28000,
72 .xres = 640,
73 .yres = 480,
74 .bpp = 16,
75 .hsync_len = 20,
76 .left_margin = 103,
77 .right_margin = 47,
78 .vsync_len = 6,
79 .upper_margin = 28,
80 .lower_margin = 5,
81 .sync = 0,
82 .cmap_greyscale = 0,
83};
84
85static struct pxafb_mach_info pcm990_fbinfo __initdata = {
86 .modes = &fb_info_sharp_lq084v1dg21,
87 .num_modes = 1,
88 .lccr0 = LCCR0_PAS,
89 .lccr3 = LCCR3_PCP,
90 .pxafb_lcd_power = pcm990_lcd_power,
91};
92#elif defined(CONFIG_PCM990_DISPLAY_NEC)
93struct pxafb_mode_info fb_info_nec_nl6448bc20_18d = {
94 .pixclock = 39720,
95 .xres = 640,
96 .yres = 480,
97 .bpp = 16,
98 .hsync_len = 32,
99 .left_margin = 16,
100 .right_margin = 48,
101 .vsync_len = 2,
102 .upper_margin = 12,
103 .lower_margin = 17,
104 .sync = 0,
105 .cmap_greyscale = 0,
106};
107
108static struct pxafb_mach_info pcm990_fbinfo __initdata = {
109 .modes = &fb_info_nec_nl6448bc20_18d,
110 .num_modes = 1,
111 .lccr0 = LCCR0_Act,
112 .lccr3 = LCCR3_PixFlEdg,
113 .pxafb_lcd_power = pcm990_lcd_power,
114};
115#endif
116
117static struct platform_pwm_backlight_data pcm990_backlight_data = {
118 .pwm_id = 0,
119 .max_brightness = 1023,
120 .dft_brightness = 1023,
121 .pwm_period_ns = 78770,
122};
123
124static struct platform_device pcm990_backlight_device = {
125 .name = "pwm-backlight",
126 .dev = {
127 .parent = &pxa27x_device_pwm0.dev,
128 .platform_data = &pcm990_backlight_data,
129 },
130};
131
132/*
133 * The PCM-990 development baseboard uses PCM-027's hardware in the
42 * following way: 134 * following way:
43 * 135 *
44 * - LCD support is in use 136 * - LCD support is in use
@@ -333,36 +425,6 @@ static struct i2c_board_info __initdata pcm990_i2c_devices[] = {
333#endif /* CONFIG_VIDEO_PXA27x ||CONFIG_VIDEO_PXA27x_MODULE */ 425#endif /* CONFIG_VIDEO_PXA27x ||CONFIG_VIDEO_PXA27x_MODULE */
334 426
335/* 427/*
336 * AC97 support
337 * Note: The connected AC97 mixer also reports interrupts at PCM990_AC97_IRQ
338 */
339static struct resource pxa27x_ac97_resources[] = {
340 [0] = {
341 .start = 0x40500000,
342 .end = 0x40500000 + 0xfff,
343 .flags = IORESOURCE_MEM,
344 },
345 [1] = {
346 .start = IRQ_AC97,
347 .end = IRQ_AC97,
348 .flags = IORESOURCE_IRQ,
349 },
350};
351
352static u64 pxa_ac97_dmamask = 0xffffffffUL;
353
354static struct platform_device pxa27x_device_ac97 = {
355 .name = "pxa2xx-ac97",
356 .id = -1,
357 .dev = {
358 .dma_mask = &pxa_ac97_dmamask,
359 .coherent_dma_mask = 0xffffffff,
360 },
361 .num_resources = ARRAY_SIZE(pxa27x_ac97_resources),
362 .resource = pxa27x_ac97_resources,
363};
364
365/*
366 * enable generic access to the base board control CPLDs U6 and U7 428 * enable generic access to the base board control CPLDs U6 and U7
367 */ 429 */
368static struct map_desc pcm990_io_desc[] __initdata = { 430static struct map_desc pcm990_io_desc[] __initdata = {
@@ -393,7 +455,11 @@ void __init pcm990_baseboard_init(void)
393 /* register CPLD's IRQ controller */ 455 /* register CPLD's IRQ controller */
394 pcm990_init_irq(); 456 pcm990_init_irq();
395 457
396 platform_device_register(&pxa27x_device_ac97); 458#ifndef CONFIG_PCM990_DISPLAY_NONE
459 set_pxa_fb_info(&pcm990_fbinfo);
460#endif
461 pxa_gpio_mode(GPIO16_PWM0_MD);
462 platform_device_register(&pcm990_backlight_device);
397 463
398 /* MMC */ 464 /* MMC */
399 pxa_set_mci_info(&pcm990_mci_platform_data); 465 pxa_set_mci_info(&pcm990_mci_platform_data);
@@ -402,6 +468,7 @@ void __init pcm990_baseboard_init(void)
402 pxa_set_ohci_info(&pcm990_ohci_platform_data); 468 pxa_set_ohci_info(&pcm990_ohci_platform_data);
403 469
404 pxa_set_i2c_info(NULL); 470 pxa_set_i2c_info(NULL);
471 pxa_set_ac97_info(NULL);
405 472
406#if defined(CONFIG_VIDEO_PXA27x) || defined(CONFIG_VIDEO_PXA27x_MODULE) 473#if defined(CONFIG_VIDEO_PXA27x) || defined(CONFIG_VIDEO_PXA27x_MODULE)
407 pxa_set_camera_info(&pcm990_pxacamera_platform_data); 474 pxa_set_camera_info(&pcm990_pxacamera_platform_data);