aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/poodle.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-pxa/poodle.c')
-rw-r--r--arch/arm/mach-pxa/poodle.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c
index 036bbde4d221..9352d4a34837 100644
--- a/arch/arm/mach-pxa/poodle.c
+++ b/arch/arm/mach-pxa/poodle.c
@@ -22,6 +22,7 @@
22#include <linux/delay.h> 22#include <linux/delay.h>
23#include <linux/mtd/physmap.h> 23#include <linux/mtd/physmap.h>
24#include <linux/gpio.h> 24#include <linux/gpio.h>
25#include <linux/i2c.h>
25#include <linux/spi/spi.h> 26#include <linux/spi/spi.h>
26#include <linux/spi/ads7846.h> 27#include <linux/spi/ads7846.h>
27#include <linux/mtd/sharpsl.h> 28#include <linux/mtd/sharpsl.h>
@@ -39,7 +40,7 @@
39#include <mach/pxa25x.h> 40#include <mach/pxa25x.h>
40#include <mach/mmc.h> 41#include <mach/mmc.h>
41#include <mach/udc.h> 42#include <mach/udc.h>
42#include <mach/i2c.h> 43#include <plat/i2c.h>
43#include <mach/irda.h> 44#include <mach/irda.h>
44#include <mach/poodle.h> 45#include <mach/poodle.h>
45#include <mach/pxafb.h> 46#include <mach/pxafb.h>
@@ -214,13 +215,8 @@ static struct ads7846_platform_data poodle_ads7846_info = {
214 .gpio_pendown = POODLE_GPIO_TP_INT, 215 .gpio_pendown = POODLE_GPIO_TP_INT,
215}; 216};
216 217
217static void ads7846_cs(u32 command)
218{
219 gpio_set_value(POODLE_GPIO_TP_CS, !(command == PXA2XX_CS_ASSERT));
220}
221
222static struct pxa2xx_spi_chip poodle_ads7846_chip = { 218static struct pxa2xx_spi_chip poodle_ads7846_chip = {
223 .cs_control = ads7846_cs, 219 .gpio_cs = POODLE_GPIO_TP_CS,
224}; 220};
225 221
226static struct spi_board_info poodle_spi_devices[] = { 222static struct spi_board_info poodle_spi_devices[] = {
@@ -236,14 +232,6 @@ static struct spi_board_info poodle_spi_devices[] = {
236 232
237static void __init poodle_init_spi(void) 233static void __init poodle_init_spi(void)
238{ 234{
239 int err;
240
241 err = gpio_request(POODLE_GPIO_TP_CS, "ADS7846_CS");
242 if (err)
243 return;
244
245 gpio_direction_output(POODLE_GPIO_TP_CS, 1);
246
247 pxa2xx_set_spi_info(1, &poodle_spi_info); 235 pxa2xx_set_spi_info(1, &poodle_spi_info);
248 spi_register_board_info(ARRAY_AND_SIZE(poodle_spi_devices)); 236 spi_register_board_info(ARRAY_AND_SIZE(poodle_spi_devices));
249} 237}
@@ -499,6 +487,10 @@ static struct platform_device *devices[] __initdata = {
499 &sharpsl_rom_device, 487 &sharpsl_rom_device,
500}; 488};
501 489
490static struct i2c_board_info __initdata poodle_i2c_devices[] = {
491 { I2C_BOARD_INFO("wm8731", 0x1b) },
492};
493
502static void poodle_poweroff(void) 494static void poodle_poweroff(void)
503{ 495{
504 arm_machine_restart('h', NULL); 496 arm_machine_restart('h', NULL);
@@ -532,6 +524,7 @@ static void __init poodle_init(void)
532 pxa_set_mci_info(&poodle_mci_platform_data); 524 pxa_set_mci_info(&poodle_mci_platform_data);
533 pxa_set_ficp_info(&poodle_ficp_platform_data); 525 pxa_set_ficp_info(&poodle_ficp_platform_data);
534 pxa_set_i2c_info(NULL); 526 pxa_set_i2c_info(NULL);
527 i2c_register_board_info(0, ARRAY_AND_SIZE(poodle_i2c_devices));
535 poodle_init_spi(); 528 poodle_init_spi();
536} 529}
537 530