aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/imote2.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-pxa/imote2.c')
-rw-r--r--arch/arm/mach-pxa/imote2.c54
1 files changed, 35 insertions, 19 deletions
diff --git a/arch/arm/mach-pxa/imote2.c b/arch/arm/mach-pxa/imote2.c
index 2121309b2474..961807dc6467 100644
--- a/arch/arm/mach-pxa/imote2.c
+++ b/arch/arm/mach-pxa/imote2.c
@@ -22,6 +22,7 @@
22#include <linux/spi/spi.h> 22#include <linux/spi/spi.h>
23#include <linux/i2c.h> 23#include <linux/i2c.h>
24#include <linux/mfd/da903x.h> 24#include <linux/mfd/da903x.h>
25#include <linux/sht15.h>
25 26
26#include <asm/mach-types.h> 27#include <asm/mach-types.h>
27#include <asm/mach/arch.h> 28#include <asm/mach/arch.h>
@@ -29,7 +30,7 @@
29#include <asm/mach/flash.h> 30#include <asm/mach/flash.h>
30 31
31#include <mach/pxa27x.h> 32#include <mach/pxa27x.h>
32#include <mach/i2c.h> 33#include <plat/i2c.h>
33#include <mach/udc.h> 34#include <mach/udc.h>
34#include <mach/mmc.h> 35#include <mach/mmc.h>
35#include <mach/pxa2xx_spi.h> 36#include <mach/pxa2xx_spi.h>
@@ -102,6 +103,10 @@ static unsigned long imote2_pin_config[] __initdata = {
102 GPIO96_GPIO, /* accelerometer interrupt */ 103 GPIO96_GPIO, /* accelerometer interrupt */
103 GPIO99_GPIO, /* ADC interrupt */ 104 GPIO99_GPIO, /* ADC interrupt */
104 105
106 /* SHT15 */
107 GPIO100_GPIO,
108 GPIO98_GPIO,
109
105 /* Connector pins specified as gpios */ 110 /* Connector pins specified as gpios */
106 GPIO94_GPIO, /* large basic connector pin 14 */ 111 GPIO94_GPIO, /* large basic connector pin 14 */
107 GPIO10_GPIO, /* large basic connector pin 23 */ 112 GPIO10_GPIO, /* large basic connector pin 23 */
@@ -112,6 +117,26 @@ static unsigned long imote2_pin_config[] __initdata = {
112 GPIO105_GPIO, /* blue led */ 117 GPIO105_GPIO, /* blue led */
113}; 118};
114 119
120static struct sht15_platform_data platform_data_sht15 = {
121 .gpio_data = 100,
122 .gpio_sck = 98,
123};
124
125static struct platform_device sht15 = {
126 .name = "sht15",
127 .id = -1,
128 .dev = {
129 .platform_data = &platform_data_sht15,
130 },
131};
132
133static struct regulator_consumer_supply imote2_sensor_3_con[] = {
134 {
135 .dev = &sht15.dev,
136 .supply = "vcc",
137 },
138};
139
115static struct gpio_led imote2_led_pins[] = { 140static struct gpio_led imote2_led_pins[] = {
116 { 141 {
117 .name = "imote2:red", 142 .name = "imote2:red",
@@ -257,6 +282,8 @@ static struct regulator_init_data imote2_ldo_init_data[] = {
257 .min_uV = 2800000, 282 .min_uV = 2800000,
258 .max_uV = 3000000, 283 .max_uV = 3000000,
259 }, 284 },
285 .num_consumer_supplies = ARRAY_SIZE(imote2_sensor_3_con),
286 .consumer_supplies = imote2_sensor_3_con,
260 }, 287 },
261 [vcc_pxa_pll] = { /* 1.17V - 1.43V, default 1.3V*/ 288 [vcc_pxa_pll] = { /* 1.17V - 1.43V, default 1.3V*/
262 .constraints = { 289 .constraints = {
@@ -412,7 +439,7 @@ static struct platform_device imote2_flash_device = {
412 */ 439 */
413static struct i2c_board_info __initdata imote2_i2c_board_info[] = { 440static struct i2c_board_info __initdata imote2_i2c_board_info[] = {
414 { /* UCAM sensor board */ 441 { /* UCAM sensor board */
415 .type = "max1238", 442 .type = "max1239",
416 .addr = 0x35, 443 .addr = 0x35,
417 }, { /* ITS400 Sensor board only */ 444 }, { /* ITS400 Sensor board only */
418 .type = "max1363", 445 .type = "max1363",
@@ -432,6 +459,9 @@ static struct i2c_board_info __initdata imote2_i2c_board_info[] = {
432 .type = "tmp175", 459 .type = "tmp175",
433 .addr = 0x4A, 460 .addr = 0x4A,
434 .irq = IRQ_GPIO(96), 461 .irq = IRQ_GPIO(96),
462 }, { /* IMB400 Multimedia board */
463 .type = "wm8940",
464 .addr = 0x1A,
435 }, 465 },
436}; 466};
437 467
@@ -456,25 +486,12 @@ static struct pxa2xx_spi_master pxa_ssp_master_2_info = {
456 .num_chipselect = 1, 486 .num_chipselect = 1,
457}; 487};
458 488
459/* Patch posted by Eric Miao <eric.miao@marvell.com> will remove
460 * the need for these functions.
461 */
462static void spi1control(u32 command)
463{
464 gpio_set_value(24, command & PXA2XX_CS_ASSERT ? 0 : 1);
465};
466
467static void spi3control(u32 command)
468{
469 gpio_set_value(39, command & PXA2XX_CS_ASSERT ? 0 : 1);
470};
471
472static struct pxa2xx_spi_chip staccel_chip_info = { 489static struct pxa2xx_spi_chip staccel_chip_info = {
473 .tx_threshold = 8, 490 .tx_threshold = 8,
474 .rx_threshold = 8, 491 .rx_threshold = 8,
475 .dma_burst_size = 8, 492 .dma_burst_size = 8,
476 .timeout = 235, 493 .timeout = 235,
477 .cs_control = spi1control, 494 .gpio_cs = 24,
478}; 495};
479 496
480static struct pxa2xx_spi_chip cc2420_info = { 497static struct pxa2xx_spi_chip cc2420_info = {
@@ -482,7 +499,7 @@ static struct pxa2xx_spi_chip cc2420_info = {
482 .rx_threshold = 8, 499 .rx_threshold = 8,
483 .dma_burst_size = 8, 500 .dma_burst_size = 8,
484 .timeout = 235, 501 .timeout = 235,
485 .cs_control = spi3control, 502 .gpio_cs = 39,
486}; 503};
487 504
488static struct spi_board_info spi_board_info[] __initdata = { 505static struct spi_board_info spi_board_info[] __initdata = {
@@ -521,6 +538,7 @@ static struct pxa2xx_udc_mach_info imote2_udc_info __initdata = {
521static struct platform_device *imote2_devices[] = { 538static struct platform_device *imote2_devices[] = {
522 &imote2_flash_device, 539 &imote2_flash_device,
523 &imote2_leds, 540 &imote2_leds,
541 &sht15,
524}; 542};
525 543
526static struct i2c_pxa_platform_data i2c_pwr_pdata = { 544static struct i2c_pxa_platform_data i2c_pwr_pdata = {
@@ -538,8 +556,6 @@ static void __init imote2_init(void)
538 /* SPI chip select directions - all other directions should 556 /* SPI chip select directions - all other directions should
539 * be handled by drivers.*/ 557 * be handled by drivers.*/
540 gpio_direction_output(37, 0); 558 gpio_direction_output(37, 0);
541 gpio_direction_output(24, 0);
542 gpio_direction_output(39, 0);
543 559
544 platform_add_devices(imote2_devices, ARRAY_SIZE(imote2_devices)); 560 platform_add_devices(imote2_devices, ARRAY_SIZE(imote2_devices));
545 561