Skip to content

Commit

Permalink
[ARM] pxa/akita: use pca953x instead of akita-ioexp
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric Miao authored and Russell King committed Sep 23, 2008
1 parent 4fe3224 commit f72de66
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 285 deletions.
1 change: 0 additions & 1 deletion arch/arm/mach-pxa/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ obj-$(CONFIG_MACH_TRIZEPS4) += trizeps4.o
obj-$(CONFIG_MACH_COLIBRI) += colibri.o
obj-$(CONFIG_PXA_SHARP_C7xx) += corgi.o sharpsl_pm.o corgi_pm.o
obj-$(CONFIG_PXA_SHARP_Cxx00) += spitz.o sharpsl_pm.o spitz_pm.o
obj-$(CONFIG_MACH_AKITA) += akita-ioexp.o
obj-$(CONFIG_MACH_POODLE) += poodle.o
obj-$(CONFIG_MACH_PCM027) += pcm027.o
obj-$(CONFIG_MACH_PCM990_BASEBOARD) += pcm990-baseboard.o
Expand Down
222 changes: 0 additions & 222 deletions arch/arm/mach-pxa/akita-ioexp.c

This file was deleted.

32 changes: 0 additions & 32 deletions arch/arm/mach-pxa/include/mach/akita.h

This file was deleted.

11 changes: 11 additions & 0 deletions arch/arm/mach-pxa/include/mach/spitz.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,17 @@
#define SPITZ_GPIO_BACKLIGHT_ON (SPITZ_SCP2_GPIO_BASE + 7)
#define SPITZ_GPIO_MIC_BIAS (SPITZ_SCP2_GPIO_BASE + 8)

/* Akita IO Expander GPIOs */
#define AKITA_IOEXP_GPIO_BASE (NR_BUILTIN_GPIO + 12)
#define AKITA_GPIO_RESERVED_0 (AKITA_IOEXP_GPIO_BASE + 0)
#define AKITA_GPIO_RESERVED_1 (AKITA_IOEXP_GPIO_BASE + 1)
#define AKITA_GPIO_MIC_BIAS (AKITA_IOEXP_GPIO_BASE + 2)
#define AKITA_GPIO_BACKLIGHT_ON (AKITA_IOEXP_GPIO_BASE + 3)
#define AKITA_GPIO_BACKLIGHT_CONT (AKITA_IOEXP_GPIO_BASE + 4)
#define AKITA_GPIO_AKIN_PULLUP (AKITA_IOEXP_GPIO_BASE + 5)
#define AKITA_GPIO_IR_ON (AKITA_IOEXP_GPIO_BASE + 6)
#define AKITA_GPIO_RESERVED_7 (AKITA_IOEXP_GPIO_BASE + 7)

/* Spitz IRQ Definitions */

#define SPITZ_IRQ_GPIO_KEY_INT IRQ_GPIO(SPITZ_GPIO_KEY_INT)
Expand Down
37 changes: 16 additions & 21 deletions arch/arm/mach-pxa/spitz.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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>

Expand Down Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
{
Expand All @@ -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
Expand Down
13 changes: 4 additions & 9 deletions sound/soc/pxa/spitz.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include <asm/mach-types.h>
#include <mach/pxa-regs.h>
#include <mach/hardware.h>
#include <mach/akita.h>
#include <mach/spitz.h>
#include "../codecs/wm8750.h"
#include "pxa2xx-pcm.h"
Expand Down Expand Up @@ -219,14 +218,10 @@ static int spitz_mic_bias(struct snd_soc_dapm_widget *w,
gpio_set_value(SPITZ_GPIO_MIC_BIAS,
SND_SOC_DAPM_EVENT_ON(event));

if (machine_is_akita()) {
if (SND_SOC_DAPM_EVENT_ON(event))
akita_set_ioexp(&akitaioexp_device.dev,
AKITA_IOEXP_MIC_BIAS);
else
akita_reset_ioexp(&akitaioexp_device.dev,
AKITA_IOEXP_MIC_BIAS);
}
if (machine_is_akita())
gpio_set_value(AKITA_GPIO_MIC_BIAS,
SND_SOC_DAPM_EVENT_ON(event));

return 0;
}

Expand Down

0 comments on commit f72de66

Please sign in to comment.