diff options
author | Eric Miao <eric.miao@marvell.com> | 2008-09-05 20:46:23 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-09-23 17:04:40 -0400 |
commit | f72de6638b8e55283739de174b57c0ae4203c446 (patch) | |
tree | 6e3daf24ca74b0b4921747bddbf3a95bcaa2236b /arch/arm/mach-pxa/spitz.c | |
parent | 4fe3224fffc56b13fe54e0fa479b64db83d8b125 (diff) |
[ARM] pxa/akita: use pca953x instead of akita-ioexp
Use generic pca953x which provides gpiolib interface instead of
akita-specific akita-ioexp with non-standard interface to pins.
Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Eric Miao <eric.miao@marvell.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-pxa/spitz.c')
-rw-r--r-- | arch/arm/mach-pxa/spitz.c | 37 |
1 files changed, 16 insertions, 21 deletions
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c index 993a132ff978..1d8654d2fb96 100644 --- a/arch/arm/mach-pxa/spitz.c +++ b/arch/arm/mach-pxa/spitz.c | |||
@@ -24,6 +24,8 @@ | |||
24 | #include <linux/mmc/host.h> | 24 | #include <linux/mmc/host.h> |
25 | #include <linux/pm.h> | 25 | #include <linux/pm.h> |
26 | #include <linux/backlight.h> | 26 | #include <linux/backlight.h> |
27 | #include <linux/i2c.h> | ||
28 | #include <linux/i2c/pca953x.h> | ||
27 | #include <linux/spi/spi.h> | 29 | #include <linux/spi/spi.h> |
28 | #include <linux/spi/ads7846.h> | 30 | #include <linux/spi/ads7846.h> |
29 | #include <linux/spi/corgi_lcd.h> | 31 | #include <linux/spi/corgi_lcd.h> |
@@ -52,7 +54,6 @@ | |||
52 | #include <mach/udc.h> | 54 | #include <mach/udc.h> |
53 | #include <mach/pxafb.h> | 55 | #include <mach/pxafb.h> |
54 | #include <mach/pxa2xx_spi.h> | 56 | #include <mach/pxa2xx_spi.h> |
55 | #include <mach/akita.h> | ||
56 | #include <mach/spitz.h> | 57 | #include <mach/spitz.h> |
57 | #include <mach/sharpsl.h> | 58 | #include <mach/sharpsl.h> |
58 | 59 | ||
@@ -313,16 +314,8 @@ static void spitz_notify_intensity(int intensity) | |||
313 | } | 314 | } |
314 | 315 | ||
315 | if (machine_is_akita()) { | 316 | if (machine_is_akita()) { |
316 | /* Bit 5 is via IO-Expander */ | 317 | gpio_set_value(AKITA_GPIO_BACKLIGHT_CONT, !(intensity & 0x20)); |
317 | if (intensity & 0x0020) | 318 | gpio_set_value(AKITA_GPIO_BACKLIGHT_ON, intensity); |
318 | akita_reset_ioexp(&akitaioexp_device.dev, AKITA_IOEXP_BACKLIGHT_CONT); | ||
319 | else | ||
320 | akita_set_ioexp(&akitaioexp_device.dev, AKITA_IOEXP_BACKLIGHT_CONT); | ||
321 | |||
322 | if (intensity) | ||
323 | akita_set_ioexp(&akitaioexp_device.dev, AKITA_IOEXP_BACKLIGHT_ON); | ||
324 | else | ||
325 | akita_reset_ioexp(&akitaioexp_device.dev, AKITA_IOEXP_BACKLIGHT_ON); | ||
326 | return; | 319 | return; |
327 | } | 320 | } |
328 | } | 321 | } |
@@ -565,10 +558,7 @@ static void spitz_irda_transceiver_mode(struct device *dev, int mode) | |||
565 | #ifdef CONFIG_MACH_AKITA | 558 | #ifdef CONFIG_MACH_AKITA |
566 | static void akita_irda_transceiver_mode(struct device *dev, int mode) | 559 | static void akita_irda_transceiver_mode(struct device *dev, int mode) |
567 | { | 560 | { |
568 | if (mode & IR_OFF) | 561 | gpio_set_value(AKITA_GPIO_IR_ON, mode & IR_OFF); |
569 | akita_set_ioexp(&akitaioexp_device.dev, AKITA_IOEXP_IR_ON); | ||
570 | else | ||
571 | akita_reset_ioexp(&akitaioexp_device.dev, AKITA_IOEXP_IR_ON); | ||
572 | pxa2xx_transceiver_mode(dev, mode); | 562 | pxa2xx_transceiver_mode(dev, mode); |
573 | } | 563 | } |
574 | #endif | 564 | #endif |
@@ -679,12 +669,17 @@ static void __init spitz_init(void) | |||
679 | /* | 669 | /* |
680 | * Akita IO Expander | 670 | * Akita IO Expander |
681 | */ | 671 | */ |
682 | struct platform_device akitaioexp_device = { | 672 | static struct pca953x_platform_data akita_ioexp = { |
683 | .name = "akita-ioexp", | 673 | .gpio_base = AKITA_IOEXP_GPIO_BASE, |
684 | .id = -1, | ||
685 | }; | 674 | }; |
686 | 675 | ||
687 | EXPORT_SYMBOL_GPL(akitaioexp_device); | 676 | static struct i2c_board_info akita_i2c_board_info[] = { |
677 | { | ||
678 | .type = "max7310", | ||
679 | .addr = 0x18, | ||
680 | .platform_data = &akita_ioexp, | ||
681 | }, | ||
682 | }; | ||
688 | 683 | ||
689 | static void __init akita_init(void) | 684 | static void __init akita_init(void) |
690 | { | 685 | { |
@@ -694,9 +689,9 @@ static void __init akita_init(void) | |||
694 | spitz_pcmcia_config.num_devs = 1; | 689 | spitz_pcmcia_config.num_devs = 1; |
695 | platform_scoop_config = &spitz_pcmcia_config; | 690 | platform_scoop_config = &spitz_pcmcia_config; |
696 | 691 | ||
697 | platform_device_register(&akitaioexp_device); | 692 | pxa_set_i2c_info(NULL); |
693 | i2c_register_board_info(0, ARRAY_AND_SIZE(akita_i2c_board_info)); | ||
698 | 694 | ||
699 | spitzscoop_device.dev.parent = &akitaioexp_device.dev; | ||
700 | common_init(); | 695 | common_init(); |
701 | } | 696 | } |
702 | #endif | 697 | #endif |