From 0bf189abc52b89bfcfa9782543de7f5e90263fe5 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Tue, 8 May 2012 16:25:10 +0800 Subject: ARM: pxa: Use REGULATOR_SUPPLY macro Signed-off-by: Axel Lin Cc: Eric Miao Tested-by: Paul Parsons Acked-by: Philipp Zabel Acked-by: Robert Jarzmik Acked-by: Marek Vasut Acked-by: Jonathan Cameron Signed-off-by: Haojian Zhuang --- arch/arm/mach-pxa/balloon3.c | 4 +--- arch/arm/mach-pxa/cm-x300.c | 4 +--- arch/arm/mach-pxa/em-x270.c | 5 +---- arch/arm/mach-pxa/hx4700.c | 13 ++++--------- arch/arm/mach-pxa/magician.c | 8 ++------ arch/arm/mach-pxa/mioa701.c | 4 +--- arch/arm/mach-pxa/palm27x.c | 4 +--- arch/arm/mach-pxa/spitz.c | 4 +--- arch/arm/mach-pxa/stargate2.c | 5 +---- arch/arm/mach-pxa/vpac270.c | 4 +--- arch/arm/mach-pxa/z2.c | 4 +--- 11 files changed, 15 insertions(+), 44 deletions(-) diff --git a/arch/arm/mach-pxa/balloon3.c b/arch/arm/mach-pxa/balloon3.c index c35456f02acb..56e8cebeb7d5 100644 --- a/arch/arm/mach-pxa/balloon3.c +++ b/arch/arm/mach-pxa/balloon3.c @@ -732,9 +732,7 @@ static inline void balloon3_nand_init(void) {} #if defined(CONFIG_REGULATOR_MAX1586) || \ defined(CONFIG_REGULATOR_MAX1586_MODULE) static struct regulator_consumer_supply balloon3_max1587a_consumers[] = { - { - .supply = "vcc_core", - } + REGULATOR_SUPPLY("vcc_core", NULL), }; static struct regulator_init_data balloon3_max1587a_v3_info = { diff --git a/arch/arm/mach-pxa/cm-x300.c b/arch/arm/mach-pxa/cm-x300.c index 313274016277..3e4e9fe2d462 100644 --- a/arch/arm/mach-pxa/cm-x300.c +++ b/arch/arm/mach-pxa/cm-x300.c @@ -713,9 +713,7 @@ struct da9030_battery_info cm_x300_battery_info = { }; static struct regulator_consumer_supply buck2_consumers[] = { - { - .supply = "vcc_core", - }, + REGULATOR_SUPPLY("vcc_core", NULL), }; static struct regulator_init_data buck2_data = { diff --git a/arch/arm/mach-pxa/em-x270.c b/arch/arm/mach-pxa/em-x270.c index 16ec557b8e43..a3a4a38d4972 100644 --- a/arch/arm/mach-pxa/em-x270.c +++ b/arch/arm/mach-pxa/em-x270.c @@ -1085,10 +1085,7 @@ static void __init em_x270_userspace_consumers_init(void) /* DA9030 related initializations */ #define REGULATOR_CONSUMER(_name, _dev_name, _supply) \ static struct regulator_consumer_supply _name##_consumers[] = { \ - { \ - .dev_name = _dev_name, \ - .supply = _supply, \ - }, \ + REGULATOR_SUPPLY(_supply, _dev_name), \ } REGULATOR_CONSUMER(ldo3, "reg-userspace-consumer.0", "vcc gps"); diff --git a/arch/arm/mach-pxa/hx4700.c b/arch/arm/mach-pxa/hx4700.c index b83b95a29503..88f0f51ad6d5 100644 --- a/arch/arm/mach-pxa/hx4700.c +++ b/arch/arm/mach-pxa/hx4700.c @@ -680,12 +680,8 @@ static struct platform_device power_supply = { */ static struct regulator_consumer_supply bq24022_consumers[] = { - { - .supply = "vbus_draw", - }, - { - .supply = "ac_draw", - }, + REGULATOR_SUPPLY("vbus_draw", NULL), + REGULATOR_SUPPLY("ac_draw", NULL), }; static struct regulator_init_data bq24022_init_data = { @@ -764,9 +760,8 @@ static struct platform_device strataflash = { * Maxim MAX1587A on PI2C */ -static struct regulator_consumer_supply max1587a_consumer = { - .supply = "vcc_core", -}; +static struct regulator_consumer_supply max1587a_consumer = + REGULATOR_SUPPLY("vcc_core", NULL); static struct regulator_init_data max1587a_v3_info = { .constraints = { diff --git a/arch/arm/mach-pxa/magician.c b/arch/arm/mach-pxa/magician.c index 8de0651d7efb..2db697cd2b4e 100644 --- a/arch/arm/mach-pxa/magician.c +++ b/arch/arm/mach-pxa/magician.c @@ -579,12 +579,8 @@ static struct platform_device power_supply = { */ static struct regulator_consumer_supply bq24022_consumers[] = { - { - .supply = "vbus_draw", - }, - { - .supply = "ac_draw", - }, + REGULATOR_SUPPLY("vbus_draw", NULL), + REGULATOR_SUPPLY("ac_draw", NULL), }; static struct regulator_init_data bq24022_init_data = { diff --git a/arch/arm/mach-pxa/mioa701.c b/arch/arm/mach-pxa/mioa701.c index 061d57009cee..6745149aa9d5 100644 --- a/arch/arm/mach-pxa/mioa701.c +++ b/arch/arm/mach-pxa/mioa701.c @@ -581,9 +581,7 @@ static struct wm97xx_pdata mioa701_wm97xx_pdata = { * Voltage regulation */ static struct regulator_consumer_supply max1586_consumers[] = { - { - .supply = "vcc_core", - } + REGULATOR_SUPPLY("vcc_core", NULL), }; static struct regulator_init_data max1586_v3_info = { diff --git a/arch/arm/mach-pxa/palm27x.c b/arch/arm/mach-pxa/palm27x.c index fbc10d7b95d1..dad71cfa34c8 100644 --- a/arch/arm/mach-pxa/palm27x.c +++ b/arch/arm/mach-pxa/palm27x.c @@ -429,9 +429,7 @@ void __init palm27x_power_init(int ac, int usb) #if defined(CONFIG_REGULATOR_MAX1586) || \ defined(CONFIG_REGULATOR_MAX1586_MODULE) static struct regulator_consumer_supply palm27x_max1587a_consumers[] = { - { - .supply = "vcc_core", - } + REGULATOR_SUPPLY("vcc_core", NULL), }; static struct regulator_init_data palm27x_max1587a_v3_info = { diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c index df2ab0fb2ace..363d91b44ecb 100644 --- a/arch/arm/mach-pxa/spitz.c +++ b/arch/arm/mach-pxa/spitz.c @@ -877,9 +877,7 @@ static struct i2c_board_info spitz_i2c_devs[] = { }; static struct regulator_consumer_supply isl6271a_consumers[] = { - { - .supply = "vcc_core", - } + REGULATOR_SUPPLY("vcc_core", NULL), }; static struct regulator_init_data isl6271a_info[] = { diff --git a/arch/arm/mach-pxa/stargate2.c b/arch/arm/mach-pxa/stargate2.c index 4cd645e29b64..30b1b0b3c7f7 100644 --- a/arch/arm/mach-pxa/stargate2.c +++ b/arch/arm/mach-pxa/stargate2.c @@ -151,10 +151,7 @@ static struct platform_device sht15 = { }; static struct regulator_consumer_supply stargate2_sensor_3_con[] = { - { - .dev_name = "sht15", - .supply = "vcc", - }, + REGULATOR_SUPPLY("vcc", "sht15"), }; enum stargate2_ldos{ diff --git a/arch/arm/mach-pxa/vpac270.c b/arch/arm/mach-pxa/vpac270.c index c57ab636ea9c..e1740acd15f1 100644 --- a/arch/arm/mach-pxa/vpac270.c +++ b/arch/arm/mach-pxa/vpac270.c @@ -640,9 +640,7 @@ static inline void vpac270_ide_init(void) {} #if defined(CONFIG_REGULATOR_MAX1586) || \ defined(CONFIG_REGULATOR_MAX1586_MODULE) static struct regulator_consumer_supply vpac270_max1587a_consumers[] = { - { - .supply = "vcc_core", - } + REGULATOR_SUPPLY("vcc_core", NULL), }; static struct regulator_init_data vpac270_max1587a_v3_info = { diff --git a/arch/arm/mach-pxa/z2.c b/arch/arm/mach-pxa/z2.c index fa8619970841..b9320cb8a11f 100644 --- a/arch/arm/mach-pxa/z2.c +++ b/arch/arm/mach-pxa/z2.c @@ -615,9 +615,7 @@ static inline void z2_spi_init(void) {} #if defined(CONFIG_REGULATOR_TPS65023) || \ defined(CONFIG_REGULATOR_TPS65023_MODULE) static struct regulator_consumer_supply z2_tps65021_consumers[] = { - { - .supply = "vcc_core", - } + REGULATOR_SUPPLY("vcc_core", NULL), }; static struct regulator_init_data z2_tps65021_info[] = { -- cgit v1.2.3 From b2596c682814b39f0dd16e19e3be8fc8581643bd Mon Sep 17 00:00:00 2001 From: Paul Parsons Date: Sat, 12 May 2012 12:31:02 +0100 Subject: ARM: pxa: hx4700: Add Synaptics NavPoint touchpad This patch adds the Synaptics NavPoint touchpad to the hx4700 platform: 1. Change GPIO23_SSP1_SCLK value in hx4700_pin_config[] from an output to an input, since the NavPoint is connected to SSP in SPI slave mode. 2. Add GPIO102_GPIO (NavPoint power) to hx4700_pin_config[]. 3. Add navpoint platform_device to devices[]. Signed-off-by: Paul Parsons Cc: Philipp Zabel Signed-off-by: Haojian Zhuang --- arch/arm/mach-pxa/hx4700.c | 24 +++++++++++++++++++++++- arch/arm/mach-pxa/include/mach/mfp-pxa27x.h | 1 + 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-pxa/hx4700.c b/arch/arm/mach-pxa/hx4700.c index 88f0f51ad6d5..865f6d37372e 100644 --- a/arch/arm/mach-pxa/hx4700.c +++ b/arch/arm/mach-pxa/hx4700.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -113,7 +114,7 @@ static unsigned long hx4700_pin_config[] __initdata = { GPIO113_I2S_SYSCLK, /* SSP 1 (NavPoint) */ - GPIO23_SSP1_SCLK, + GPIO23_SSP1_SCLK_IN, GPIO24_SSP1_SFRM, GPIO25_SSP1_TXD, GPIO26_SSP1_RXD, @@ -129,6 +130,9 @@ static unsigned long hx4700_pin_config[] __initdata = { GPIO13_GPIO, /* W3220_IRQ */ GPIO14_GPIO, /* nWLAN_IRQ */ + /* HX4700 specific output GPIOs */ + GPIO102_GPIO | MFP_LPM_DRIVE_LOW, /* SYNAPTICS_POWER_ON */ + GPIO10_GPIO, /* GSM_IRQ */ GPIO13_GPIO, /* CPLD_IRQ */ GPIO107_GPIO, /* DS1WM_IRQ */ @@ -182,6 +186,23 @@ static struct platform_device gpio_keys = { .id = -1, }; +/* + * Synaptics NavPoint connected to SSP1 + */ + +static struct navpoint_platform_data navpoint_platform_data = { + .port = 1, + .gpio = GPIO102_HX4700_SYNAPTICS_POWER_ON, +}; + +static struct platform_device navpoint = { + .name = "navpoint", + .id = -1, + .dev = { + .platform_data = &navpoint_platform_data, + }, +}; + /* * ASIC3 */ @@ -823,6 +844,7 @@ static struct platform_device audio = { static struct platform_device *devices[] __initdata = { &asic3, &gpio_keys, + &navpoint, &backlight, &w3220, &hx4700_lcd, diff --git a/arch/arm/mach-pxa/include/mach/mfp-pxa27x.h b/arch/arm/mach-pxa/include/mach/mfp-pxa27x.h index a65867209aa0..a611ad3153c7 100644 --- a/arch/arm/mach-pxa/include/mach/mfp-pxa27x.h +++ b/arch/arm/mach-pxa/include/mach/mfp-pxa27x.h @@ -208,6 +208,7 @@ #define GPIO113_I2S_SYSCLK MFP_CFG_OUT(GPIO113, AF1, DRIVE_LOW) /* SSP 1 */ +#define GPIO23_SSP1_SCLK_IN MFP_CFG_IN(GPIO23, AF2) #define GPIO23_SSP1_SCLK MFP_CFG_OUT(GPIO23, AF2, DRIVE_LOW) #define GPIO29_SSP1_SCLK MFP_CFG_IN(GPIO29, AF3) #define GPIO27_SSP1_SYSCLK MFP_CFG_OUT(GPIO27, AF1, DRIVE_LOW) -- cgit v1.2.3