aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/hx4700.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-07-25 15:38:42 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-07-25 15:38:42 -0400
commitae4c42e4e4d76d003f8ca551fe1aef93ff9a4b21 (patch)
tree2bff2e4f4456077e7d7c589c8c28824f12dfa21c /arch/arm/mach-pxa/hx4700.c
parentdd58ecba48edf14be1a5f70120fcd3002277a74a (diff)
parentab2a0e0d135490729e384c1826d118f92e88cae8 (diff)
Merge branch 'next/cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/linux-arm-soc
* 'next/cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/linux-arm-soc: (133 commits) ARM: EXYNOS4: Change devname for FIMD clkdev ARM: S3C64XX: Cleanup mach/regs-fb.h from mach-s3c64xx ARM: S5PV210: Cleanup mach/regs-fb.h from mach-s5pv210 ARM: S5PC100: Cleanup mach/regs-fb.h from mach-s5pc100 ARM: S3C24XX: Use generic s3c_set_platdata for devices ARM: S3C64XX: Use generic s3c_set_platdata for OneNAND ARM: SAMSUNG: Use generic s3c_set_platdata for NAND ARM: SAMSUNG: Use generic s3c_set_platdata for USB OHCI ARM: SAMSUNG: Use generic s3c_set_platdata for HWMON ARM: SAMSUNG: Use generic s3c_set_platdata for FB ARM: SAMSUNG: Use generic s3c_set_platdata for TS ARM: S3C64XX: Add PWM backlight support on SMDK6410 ARM: S5P64X0: Add PWM backlight support on SMDK6450 ARM: S5P64X0: Add PWM backlight support on SMDK6440 ARM: S5PC100: Add PWM backlight support on SMDKC100 ARM: S5PV210: Add PWM backlight support on SMDKV210 ARM: EXYNOS4: Add PWM backlight support on SMDKC210 ARM: EXYNOS4: Add PWM backlight support on SMDKV310 ARM: SAMSUNG: Create a common infrastructure for PWM backlight support clocksource: convert 32-bit down counting clocksource on S5PV210/S5P64X0 ... Fix up trivial conflict in arch/arm/mach-imx/mach-scb9328.c
Diffstat (limited to 'arch/arm/mach-pxa/hx4700.c')
-rw-r--r--arch/arm/mach-pxa/hx4700.c70
1 files changed, 19 insertions, 51 deletions
diff --git a/arch/arm/mach-pxa/hx4700.c b/arch/arm/mach-pxa/hx4700.c
index f941a495a4a8..99960a1814e0 100644
--- a/arch/arm/mach-pxa/hx4700.c
+++ b/arch/arm/mach-pxa/hx4700.c
@@ -135,42 +135,6 @@ static unsigned long hx4700_pin_config[] __initdata = {
135 GPIO66_GPIO, /* nSDIO_IRQ */ 135 GPIO66_GPIO, /* nSDIO_IRQ */
136}; 136};
137 137
138#define HX4700_GPIO_IN(num, _desc) \
139 { .gpio = (num), .dir = 0, .desc = (_desc) }
140#define HX4700_GPIO_OUT(num, _init, _desc) \
141 { .gpio = (num), .dir = 1, .init = (_init), .desc = (_desc) }
142struct gpio_ress {
143 unsigned gpio : 8;
144 unsigned dir : 1;
145 unsigned init : 1;
146 char *desc;
147};
148
149static int hx4700_gpio_request(struct gpio_ress *gpios, int size)
150{
151 int i, rc = 0;
152 int gpio;
153 int dir;
154
155 for (i = 0; (!rc) && (i < size); i++) {
156 gpio = gpios[i].gpio;
157 dir = gpios[i].dir;
158 rc = gpio_request(gpio, gpios[i].desc);
159 if (rc) {
160 pr_err("Error requesting GPIO %d(%s) : %d\n",
161 gpio, gpios[i].desc, rc);
162 continue;
163 }
164 if (dir)
165 gpio_direction_output(gpio, gpios[i].init);
166 else
167 gpio_direction_input(gpio);
168 }
169 while ((rc) && (--i >= 0))
170 gpio_free(gpios[i].gpio);
171 return rc;
172}
173
174/* 138/*
175 * IRDA 139 * IRDA
176 */ 140 */
@@ -829,26 +793,30 @@ static struct platform_device *devices[] __initdata = {
829 &pcmcia, 793 &pcmcia,
830}; 794};
831 795
832static struct gpio_ress global_gpios[] = { 796static struct gpio global_gpios[] = {
833 HX4700_GPIO_IN(GPIO12_HX4700_ASIC3_IRQ, "ASIC3_IRQ"), 797 { GPIO12_HX4700_ASIC3_IRQ, GPIOF_IN, "ASIC3_IRQ" },
834 HX4700_GPIO_IN(GPIO13_HX4700_W3220_IRQ, "W3220_IRQ"), 798 { GPIO13_HX4700_W3220_IRQ, GPIOF_IN, "W3220_IRQ" },
835 HX4700_GPIO_IN(GPIO14_HX4700_nWLAN_IRQ, "WLAN_IRQ"), 799 { GPIO14_HX4700_nWLAN_IRQ, GPIOF_IN, "WLAN_IRQ" },
836 HX4700_GPIO_OUT(GPIO59_HX4700_LCD_PC1, 1, "LCD_PC1"), 800 { GPIO59_HX4700_LCD_PC1, GPIOF_OUT_INIT_HIGH, "LCD_PC1" },
837 HX4700_GPIO_OUT(GPIO62_HX4700_LCD_nRESET, 1, "LCD_RESET"), 801 { GPIO62_HX4700_LCD_nRESET, GPIOF_OUT_INIT_HIGH, "LCD_RESET" },
838 HX4700_GPIO_OUT(GPIO70_HX4700_LCD_SLIN1, 1, "LCD_SLIN1"), 802 { GPIO70_HX4700_LCD_SLIN1, GPIOF_OUT_INIT_HIGH, "LCD_SLIN1" },
839 HX4700_GPIO_OUT(GPIO84_HX4700_LCD_SQN, 1, "LCD_SQN"), 803 { GPIO84_HX4700_LCD_SQN, GPIOF_OUT_INIT_HIGH, "LCD_SQN" },
840 HX4700_GPIO_OUT(GPIO110_HX4700_LCD_LVDD_3V3_ON, 1, "LCD_LVDD"), 804 { GPIO110_HX4700_LCD_LVDD_3V3_ON, GPIOF_OUT_INIT_HIGH, "LCD_LVDD" },
841 HX4700_GPIO_OUT(GPIO111_HX4700_LCD_AVDD_3V3_ON, 1, "LCD_AVDD"), 805 { GPIO111_HX4700_LCD_AVDD_3V3_ON, GPIOF_OUT_INIT_HIGH, "LCD_AVDD" },
842 HX4700_GPIO_OUT(GPIO32_HX4700_RS232_ON, 1, "RS232_ON"), 806 { GPIO32_HX4700_RS232_ON, GPIOF_OUT_INIT_HIGH, "RS232_ON" },
843 HX4700_GPIO_OUT(GPIO71_HX4700_ASIC3_nRESET, 1, "ASIC3_nRESET"), 807 { GPIO71_HX4700_ASIC3_nRESET, GPIOF_OUT_INIT_HIGH, "ASIC3_nRESET" },
844 HX4700_GPIO_OUT(GPIO82_HX4700_EUART_RESET, 1, "EUART_RESET"), 808 { GPIO82_HX4700_EUART_RESET, GPIOF_OUT_INIT_HIGH, "EUART_RESET" },
845 HX4700_GPIO_OUT(GPIO105_HX4700_nIR_ON, 1, "nIR_EN"), 809 { GPIO105_HX4700_nIR_ON, GPIOF_OUT_INIT_HIGH, "nIR_EN" },
846}; 810};
847 811
848static void __init hx4700_init(void) 812static void __init hx4700_init(void)
849{ 813{
814 int ret;
815
850 pxa2xx_mfp_config(ARRAY_AND_SIZE(hx4700_pin_config)); 816 pxa2xx_mfp_config(ARRAY_AND_SIZE(hx4700_pin_config));
851 hx4700_gpio_request(ARRAY_AND_SIZE(global_gpios)); 817 ret = gpio_request_array(ARRAY_AND_SIZE(global_gpios));
818 if (ret)
819 pr_err ("hx4700: Failed to request GPIOs.\n");
852 820
853 pxa_set_ffuart_info(NULL); 821 pxa_set_ffuart_info(NULL);
854 pxa_set_btuart_info(NULL); 822 pxa_set_btuart_info(NULL);