aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/serio
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-03-27 19:27:28 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-03-27 19:27:28 -0400
commit1bfecd935849a45b6b47d9f011e1c278ff880512 (patch)
tree23c08a9c103c92e5a4a4cd3311823426c9d2bdf9 /drivers/input/serio
parent281b05392fc2cb26209b4d85abaf4889ab1991f3 (diff)
parenta754a87ce8b17024358c1be8ee0232ef09a7055f (diff)
Merge tag 'boards' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull "ARM: board specific updates" from Arnd Bergmann/Olof Johansson: "These changes are all specific to one board only. We're trying to keep the number of board files low, but generally board level updates are ok on platforms that are working on moving towards DT based probing, which will eventually lead to removing them. The board-ams-delta.c board file gets a conflict between the removal of ams_delta_config and the addition of a lot of other data. The Kconfig file has two changes in the same line, and in exynos, the power domain cleanup conflicts with the addition of the image sensor device. Signed-off-by: Arnd Bergmann <arnd@arndb.de> [olof: Amended a fix for a mismerge to board-omap4panda.c] Signed-off-by: Olof Johansson <olof@lixom.net>" Fixed up some fairly trivial conflicts manually. * tag 'boards' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (82 commits) i.MX35-PDK: Add Camera support ARM : mx35: 3ds-board: add framebuffer device pxa/hx4700: Remove pcmcia platform_device structure ARM: pxa/hx4700: Reduce sleep mode battery discharge by 35% ARM: pxa/hx4700: Remove unwanted request for GPIO105 ARM: EXYNOS: support Exynos4210-bus Devfreq driver on Nuri board ARM: EXYNOS: Register JPEG on nuri ARM: EXYNOS: Register JPEG on universal_c210 ARM: S5PV210: Enable JPEG on SMDKV210 ARM: S5PV210: Add JPEG board definition ARM: EXYNOS: Enable JPEG on Origen ARM: EXYNOS: Enable JPEG on SMDKV310 ARM: EXYNOS: Add __init attribute to universal_camera_init() ARM: EXYNOS: Add __init attribute to nuri_camera_init() ARM: S5PV210: Enable FIMC on SMDKC110 ARM: S5PV210: Enable FIMC on SMDKV210 ARM: S5PV210: Enable MFC on SMDKC110 ARM: S5PV210: Enable MFC on SMDKV210 ARM: EXYNOS: Enable G2D on SMDKV310 ARM: tegra: update defconfig ...
Diffstat (limited to 'drivers/input/serio')
-rw-r--r--drivers/input/serio/ams_delta_serio.c54
1 files changed, 34 insertions, 20 deletions
diff --git a/drivers/input/serio/ams_delta_serio.c b/drivers/input/serio/ams_delta_serio.c
index d4d08bd9205b..bd5b10eeeb40 100644
--- a/drivers/input/serio/ams_delta_serio.c
+++ b/drivers/input/serio/ams_delta_serio.c
@@ -92,8 +92,7 @@ static irqreturn_t ams_delta_serio_interrupt(int irq, void *dev_id)
92static int ams_delta_serio_open(struct serio *serio) 92static int ams_delta_serio_open(struct serio *serio)
93{ 93{
94 /* enable keyboard */ 94 /* enable keyboard */
95 ams_delta_latch2_write(AMD_DELTA_LATCH2_KEYBRD_PWR, 95 gpio_set_value(AMS_DELTA_GPIO_PIN_KEYBRD_PWR, 1);
96 AMD_DELTA_LATCH2_KEYBRD_PWR);
97 96
98 return 0; 97 return 0;
99} 98}
@@ -101,9 +100,32 @@ static int ams_delta_serio_open(struct serio *serio)
101static void ams_delta_serio_close(struct serio *serio) 100static void ams_delta_serio_close(struct serio *serio)
102{ 101{
103 /* disable keyboard */ 102 /* disable keyboard */
104 ams_delta_latch2_write(AMD_DELTA_LATCH2_KEYBRD_PWR, 0); 103 gpio_set_value(AMS_DELTA_GPIO_PIN_KEYBRD_PWR, 0);
105} 104}
106 105
106static const struct gpio ams_delta_gpios[] __initconst_or_module = {
107 {
108 .gpio = AMS_DELTA_GPIO_PIN_KEYBRD_DATA,
109 .flags = GPIOF_DIR_IN,
110 .label = "serio-data",
111 },
112 {
113 .gpio = AMS_DELTA_GPIO_PIN_KEYBRD_CLK,
114 .flags = GPIOF_DIR_IN,
115 .label = "serio-clock",
116 },
117 {
118 .gpio = AMS_DELTA_GPIO_PIN_KEYBRD_PWR,
119 .flags = GPIOF_OUT_INIT_LOW,
120 .label = "serio-power",
121 },
122 {
123 .gpio = AMS_DELTA_GPIO_PIN_KEYBRD_DATAOUT,
124 .flags = GPIOF_OUT_INIT_LOW,
125 .label = "serio-dataout",
126 },
127};
128
107static int __init ams_delta_serio_init(void) 129static int __init ams_delta_serio_init(void)
108{ 130{
109 int err; 131 int err;
@@ -123,19 +145,12 @@ static int __init ams_delta_serio_init(void)
123 strlcpy(ams_delta_serio->phys, "GPIO/serio0", 145 strlcpy(ams_delta_serio->phys, "GPIO/serio0",
124 sizeof(ams_delta_serio->phys)); 146 sizeof(ams_delta_serio->phys));
125 147
126 err = gpio_request(AMS_DELTA_GPIO_PIN_KEYBRD_DATA, "serio-data"); 148 err = gpio_request_array(ams_delta_gpios,
149 ARRAY_SIZE(ams_delta_gpios));
127 if (err) { 150 if (err) {
128 pr_err("ams_delta_serio: Couldn't request gpio pin for data\n"); 151 pr_err("ams_delta_serio: Couldn't request gpio pins\n");
129 goto serio; 152 goto serio;
130 } 153 }
131 gpio_direction_input(AMS_DELTA_GPIO_PIN_KEYBRD_DATA);
132
133 err = gpio_request(AMS_DELTA_GPIO_PIN_KEYBRD_CLK, "serio-clock");
134 if (err) {
135 pr_err("ams_delta_serio: couldn't request gpio pin for clock\n");
136 goto gpio_data;
137 }
138 gpio_direction_input(AMS_DELTA_GPIO_PIN_KEYBRD_CLK);
139 154
140 err = request_irq(gpio_to_irq(AMS_DELTA_GPIO_PIN_KEYBRD_CLK), 155 err = request_irq(gpio_to_irq(AMS_DELTA_GPIO_PIN_KEYBRD_CLK),
141 ams_delta_serio_interrupt, IRQ_TYPE_EDGE_RISING, 156 ams_delta_serio_interrupt, IRQ_TYPE_EDGE_RISING,
@@ -143,7 +158,7 @@ static int __init ams_delta_serio_init(void)
143 if (err < 0) { 158 if (err < 0) {
144 pr_err("ams_delta_serio: couldn't request gpio interrupt %d\n", 159 pr_err("ams_delta_serio: couldn't request gpio interrupt %d\n",
145 gpio_to_irq(AMS_DELTA_GPIO_PIN_KEYBRD_CLK)); 160 gpio_to_irq(AMS_DELTA_GPIO_PIN_KEYBRD_CLK));
146 goto gpio_clk; 161 goto gpio;
147 } 162 }
148 /* 163 /*
149 * Since GPIO register handling for keyboard clock pin is performed 164 * Since GPIO register handling for keyboard clock pin is performed
@@ -157,10 +172,9 @@ static int __init ams_delta_serio_init(void)
157 dev_info(&ams_delta_serio->dev, "%s\n", ams_delta_serio->name); 172 dev_info(&ams_delta_serio->dev, "%s\n", ams_delta_serio->name);
158 173
159 return 0; 174 return 0;
160gpio_clk: 175gpio:
161 gpio_free(AMS_DELTA_GPIO_PIN_KEYBRD_CLK); 176 gpio_free_array(ams_delta_gpios,
162gpio_data: 177 ARRAY_SIZE(ams_delta_gpios));
163 gpio_free(AMS_DELTA_GPIO_PIN_KEYBRD_DATA);
164serio: 178serio:
165 kfree(ams_delta_serio); 179 kfree(ams_delta_serio);
166 return err; 180 return err;
@@ -171,7 +185,7 @@ static void __exit ams_delta_serio_exit(void)
171{ 185{
172 serio_unregister_port(ams_delta_serio); 186 serio_unregister_port(ams_delta_serio);
173 free_irq(OMAP_GPIO_IRQ(AMS_DELTA_GPIO_PIN_KEYBRD_CLK), 0); 187 free_irq(OMAP_GPIO_IRQ(AMS_DELTA_GPIO_PIN_KEYBRD_CLK), 0);
174 gpio_free(AMS_DELTA_GPIO_PIN_KEYBRD_CLK); 188 gpio_free_array(ams_delta_gpios,
175 gpio_free(AMS_DELTA_GPIO_PIN_KEYBRD_DATA); 189 ARRAY_SIZE(ams_delta_gpios));
176} 190}
177module_exit(ams_delta_serio_exit); 191module_exit(ams_delta_serio_exit);