aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/spitz.c
diff options
context:
space:
mode:
authorEric Miao <eric.miao@marvell.com>2008-09-06 08:46:23 +0800
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-09-23 22:04:40 +0100
commitf72de6638b8e55283739de174b57c0ae4203c446 (patch)
tree6e3daf24ca74b0b4921747bddbf3a95bcaa2236b /arch/arm/mach-pxa/spitz.c
parent4fe3224fffc56b13fe54e0fa479b64db83d8b125 (diff)
downloadkernel_samsung_smdk4412-f72de6638b8e55283739de174b57c0ae4203c446.zip
kernel_samsung_smdk4412-f72de6638b8e55283739de174b57c0ae4203c446.tar.gz
kernel_samsung_smdk4412-f72de6638b8e55283739de174b57c0ae4203c446.tar.bz2
[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.c37
1 files changed, 16 insertions, 21 deletions
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c
index 993a132..1d8654d 100644
--- a/arch/arm/mach-pxa/spitz.c
+++ b/arch/arm/mach-pxa/spitz.c
@@ -24,6 +24,8 @@
#include <linux/mmc/host.h>
#include <linux/pm.h>
#include <linux/backlight.h>
+#include <linux/i2c.h>
+#include <linux/i2c/pca953x.h>
#include <linux/spi/spi.h>
#include <linux/spi/ads7846.h>
#include <linux/spi/corgi_lcd.h>
@@ -52,7 +54,6 @@
#include <mach/udc.h>
#include <mach/pxafb.h>
#include <mach/pxa2xx_spi.h>
-#include <mach/akita.h>
#include <mach/spitz.h>
#include <mach/sharpsl.h>
@@ -313,16 +314,8 @@ static void spitz_notify_intensity(int intensity)
}
if (machine_is_akita()) {
- /* Bit 5 is via IO-Expander */
- if (intensity & 0x0020)
- akita_reset_ioexp(&akitaioexp_device.dev, AKITA_IOEXP_BACKLIGHT_CONT);
- else
- akita_set_ioexp(&akitaioexp_device.dev, AKITA_IOEXP_BACKLIGHT_CONT);
-
- if (intensity)
- akita_set_ioexp(&akitaioexp_device.dev, AKITA_IOEXP_BACKLIGHT_ON);
- else
- akita_reset_ioexp(&akitaioexp_device.dev, AKITA_IOEXP_BACKLIGHT_ON);
+ gpio_set_value(AKITA_GPIO_BACKLIGHT_CONT, !(intensity & 0x20));
+ gpio_set_value(AKITA_GPIO_BACKLIGHT_ON, intensity);
return;
}
}
@@ -565,10 +558,7 @@ static void spitz_irda_transceiver_mode(struct device *dev, int mode)
#ifdef CONFIG_MACH_AKITA
static void akita_irda_transceiver_mode(struct device *dev, int mode)
{
- if (mode & IR_OFF)
- akita_set_ioexp(&akitaioexp_device.dev, AKITA_IOEXP_IR_ON);
- else
- akita_reset_ioexp(&akitaioexp_device.dev, AKITA_IOEXP_IR_ON);
+ gpio_set_value(AKITA_GPIO_IR_ON, mode & IR_OFF);
pxa2xx_transceiver_mode(dev, mode);
}
#endif
@@ -679,12 +669,17 @@ static void __init spitz_init(void)
/*
* Akita IO Expander
*/
-struct platform_device akitaioexp_device = {
- .name = "akita-ioexp",
- .id = -1,
+static struct pca953x_platform_data akita_ioexp = {
+ .gpio_base = AKITA_IOEXP_GPIO_BASE,
};
-EXPORT_SYMBOL_GPL(akitaioexp_device);
+static struct i2c_board_info akita_i2c_board_info[] = {
+ {
+ .type = "max7310",
+ .addr = 0x18,
+ .platform_data = &akita_ioexp,
+ },
+};
static void __init akita_init(void)
{
@@ -694,9 +689,9 @@ static void __init akita_init(void)
spitz_pcmcia_config.num_devs = 1;
platform_scoop_config = &spitz_pcmcia_config;
- platform_device_register(&akitaioexp_device);
+ pxa_set_i2c_info(NULL);
+ i2c_register_board_info(0, ARRAY_AND_SIZE(akita_i2c_board_info));
- spitzscoop_device.dev.parent = &akitaioexp_device.dev;
common_init();
}
#endif