From a2520846589ee9821f9f50744cece84f2853518a Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Mon, 25 May 2009 16:50:12 +0000 Subject: [ARM] pxa/imote2: add board config for SHT15 humidity sensor Signed-off-by: Jonathan Cameron Signed-off-by: Eric Miao --- arch/arm/mach-pxa/imote2.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'arch/arm/mach-pxa') diff --git a/arch/arm/mach-pxa/imote2.c b/arch/arm/mach-pxa/imote2.c index 3ef98d43d30..f022247f9ed 100644 --- a/arch/arm/mach-pxa/imote2.c +++ b/arch/arm/mach-pxa/imote2.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -102,6 +103,10 @@ static unsigned long imote2_pin_config[] __initdata = { GPIO96_GPIO, /* accelerometer interrupt */ GPIO99_GPIO, /* ADC interrupt */ + /* SHT15 */ + GPIO100_GPIO, + GPIO98_GPIO, + /* Connector pins specified as gpios */ GPIO94_GPIO, /* large basic connector pin 14 */ GPIO10_GPIO, /* large basic connector pin 23 */ @@ -112,6 +117,26 @@ static unsigned long imote2_pin_config[] __initdata = { GPIO105_GPIO, /* blue led */ }; +static struct sht15_platform_data platform_data_sht15 = { + .gpio_data = 100, + .gpio_sck = 98, +}; + +static struct platform_device sht15 = { + .name = "sht15", + .id = -1, + .dev = { + .platform_data = &platform_data_sht15, + }, +}; + +static struct regulator_consumer_supply imote2_sensor_3_con[] = { + { + .dev = &sht15.dev, + .supply = "vcc", + }, +}; + static struct gpio_led imote2_led_pins[] = { { .name = "imote2:red", @@ -257,6 +282,8 @@ static struct regulator_init_data imote2_ldo_init_data[] = { .min_uV = 2800000, .max_uV = 3000000, }, + .num_consumer_supplies = ARRAY_SIZE(imote2_sensor_3_con), + .consumer_supplies = imote2_sensor_3_con, }, [vcc_pxa_pll] = { /* 1.17V - 1.43V, default 1.3V*/ .constraints = { @@ -508,6 +535,7 @@ static struct pxa2xx_udc_mach_info imote2_udc_info __initdata = { static struct platform_device *imote2_devices[] = { &imote2_flash_device, &imote2_leds, + &sht15, }; static struct i2c_pxa_platform_data i2c_pwr_pdata = { -- cgit v1.2.3