aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/spitz.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-pxa/spitz.c')
-rw-r--r--arch/arm/mach-pxa/spitz.c78
1 files changed, 7 insertions, 71 deletions
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c
index 5a45fe340a10..dda310fe71c8 100644
--- a/arch/arm/mach-pxa/spitz.c
+++ b/arch/arm/mach-pxa/spitz.c
@@ -13,19 +13,11 @@
13 */ 13 */
14 14
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/init.h>
17#include <linux/platform_device.h> 16#include <linux/platform_device.h>
18#include <linux/delay.h> 17#include <linux/delay.h>
19#include <linux/major.h>
20#include <linux/fs.h>
21#include <linux/interrupt.h>
22#include <linux/gpio.h> 18#include <linux/gpio.h>
23#include <linux/leds.h> 19#include <linux/leds.h>
24#include <linux/mmc/host.h>
25#include <linux/mtd/physmap.h> 20#include <linux/mtd/physmap.h>
26#include <linux/pm.h>
27#include <linux/backlight.h>
28#include <linux/io.h>
29#include <linux/i2c.h> 21#include <linux/i2c.h>
30#include <linux/i2c/pca953x.h> 22#include <linux/i2c/pca953x.h>
31#include <linux/spi/spi.h> 23#include <linux/spi/spi.h>
@@ -34,31 +26,22 @@
34#include <linux/mtd/sharpsl.h> 26#include <linux/mtd/sharpsl.h>
35 27
36#include <asm/setup.h> 28#include <asm/setup.h>
37#include <asm/memory.h>
38#include <asm/mach-types.h> 29#include <asm/mach-types.h>
39#include <mach/hardware.h>
40#include <asm/irq.h>
41#include <asm/system.h>
42
43#include <asm/mach/arch.h> 30#include <asm/mach/arch.h>
44#include <asm/mach/map.h> 31#include <asm/mach/sharpsl_param.h>
45#include <asm/mach/irq.h> 32#include <asm/hardware/scoop.h>
33
46 34
47#include <mach/pxa27x.h> 35#include <mach/pxa27x.h>
48#include <mach/pxa27x-udc.h> 36#include <mach/pxa27x-udc.h>
49#include <mach/reset.h> 37#include <mach/reset.h>
50#include <mach/i2c.h> 38#include <plat/i2c.h>
51#include <mach/irda.h> 39#include <mach/irda.h>
52#include <mach/mmc.h> 40#include <mach/mmc.h>
53#include <mach/ohci.h> 41#include <mach/ohci.h>
54#include <mach/udc.h>
55#include <mach/pxafb.h> 42#include <mach/pxafb.h>
56#include <mach/pxa2xx_spi.h> 43#include <mach/pxa2xx_spi.h>
57#include <mach/spitz.h> 44#include <mach/spitz.h>
58#include <mach/sharpsl.h>
59
60#include <asm/mach/sharpsl_param.h>
61#include <asm/hardware/scoop.h>
62 45
63#include "generic.h" 46#include "generic.h"
64#include "devices.h" 47#include "devices.h"
@@ -317,13 +300,8 @@ static struct ads7846_platform_data spitz_ads7846_info = {
317 .wait_for_sync = spitz_wait_for_hsync, 300 .wait_for_sync = spitz_wait_for_hsync,
318}; 301};
319 302
320static void spitz_ads7846_cs(u32 command)
321{
322 gpio_set_value(SPITZ_GPIO_ADS7846_CS, !(command == PXA2XX_CS_ASSERT));
323}
324
325static struct pxa2xx_spi_chip spitz_ads7846_chip = { 303static struct pxa2xx_spi_chip spitz_ads7846_chip = {
326 .cs_control = spitz_ads7846_cs, 304 .gpio_cs = SPITZ_GPIO_ADS7846_CS,
327}; 305};
328 306
329static void spitz_bl_kick_battery(void) 307static void spitz_bl_kick_battery(void)
@@ -347,22 +325,12 @@ static struct corgi_lcd_platform_data spitz_lcdcon_info = {
347 .kick_battery = spitz_bl_kick_battery, 325 .kick_battery = spitz_bl_kick_battery,
348}; 326};
349 327
350static void spitz_lcdcon_cs(u32 command)
351{
352 gpio_set_value(SPITZ_GPIO_LCDCON_CS, !(command == PXA2XX_CS_ASSERT));
353}
354
355static struct pxa2xx_spi_chip spitz_lcdcon_chip = { 328static struct pxa2xx_spi_chip spitz_lcdcon_chip = {
356 .cs_control = spitz_lcdcon_cs, 329 .gpio_cs = SPITZ_GPIO_LCDCON_CS,
357}; 330};
358 331
359static void spitz_max1111_cs(u32 command)
360{
361 gpio_set_value(SPITZ_GPIO_MAX1111_CS, !(command == PXA2XX_CS_ASSERT));
362}
363
364static struct pxa2xx_spi_chip spitz_max1111_chip = { 332static struct pxa2xx_spi_chip spitz_max1111_chip = {
365 .cs_control = spitz_max1111_cs, 333 .gpio_cs = SPITZ_GPIO_MAX1111_CS,
366}; 334};
367 335
368static struct spi_board_info spitz_spi_devices[] = { 336static struct spi_board_info spitz_spi_devices[] = {
@@ -392,30 +360,6 @@ static struct spi_board_info spitz_spi_devices[] = {
392 360
393static void __init spitz_init_spi(void) 361static void __init spitz_init_spi(void)
394{ 362{
395 int err;
396
397 err = gpio_request(SPITZ_GPIO_ADS7846_CS, "ADS7846_CS");
398 if (err)
399 return;
400
401 err = gpio_request(SPITZ_GPIO_LCDCON_CS, "LCDCON_CS");
402 if (err)
403 goto err_free_1;
404
405 err = gpio_request(SPITZ_GPIO_MAX1111_CS, "MAX1111_CS");
406 if (err)
407 goto err_free_2;
408
409 err = gpio_direction_output(SPITZ_GPIO_ADS7846_CS, 1);
410 if (err)
411 goto err_free_3;
412 err = gpio_direction_output(SPITZ_GPIO_LCDCON_CS, 1);
413 if (err)
414 goto err_free_3;
415 err = gpio_direction_output(SPITZ_GPIO_MAX1111_CS, 1);
416 if (err)
417 goto err_free_3;
418
419 if (machine_is_akita()) { 363 if (machine_is_akita()) {
420 spitz_lcdcon_info.gpio_backlight_cont = AKITA_GPIO_BACKLIGHT_CONT; 364 spitz_lcdcon_info.gpio_backlight_cont = AKITA_GPIO_BACKLIGHT_CONT;
421 spitz_lcdcon_info.gpio_backlight_on = AKITA_GPIO_BACKLIGHT_ON; 365 spitz_lcdcon_info.gpio_backlight_on = AKITA_GPIO_BACKLIGHT_ON;
@@ -423,14 +367,6 @@ static void __init spitz_init_spi(void)
423 367
424 pxa2xx_set_spi_info(2, &spitz_spi_info); 368 pxa2xx_set_spi_info(2, &spitz_spi_info);
425 spi_register_board_info(ARRAY_AND_SIZE(spitz_spi_devices)); 369 spi_register_board_info(ARRAY_AND_SIZE(spitz_spi_devices));
426 return;
427
428err_free_3:
429 gpio_free(SPITZ_GPIO_MAX1111_CS);
430err_free_2:
431 gpio_free(SPITZ_GPIO_LCDCON_CS);
432err_free_1:
433 gpio_free(SPITZ_GPIO_ADS7846_CS);
434} 370}
435#else 371#else
436static inline void spitz_init_spi(void) {} 372static inline void spitz_init_spi(void) {}