diff options
author | Tony Lindgren <tony@atomide.com> | 2012-01-20 08:31:52 -0500 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2012-01-20 08:31:52 -0500 |
commit | 967809bd7faf71ddc29c8081e0f21db8b201a0f4 (patch) | |
tree | 256bcce2b13a45b573b02ef73dcebe1f08a03593 /drivers/input | |
parent | dcd6c92267155e70a94b3927bce681ce74b80d1f (diff) | |
parent | 8d09a1bb3147ddbcf0a9483021ca699c54c54732 (diff) |
Merge branch 'omap1-part2' into omap1
Conflicts:
drivers/leds/leds-ams-delta.c
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/serio/ams_delta_serio.c | 54 |
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..0571e2ec358b 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) | |||
92 | static int ams_delta_serio_open(struct serio *serio) | 92 | static 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) | |||
101 | static void ams_delta_serio_close(struct serio *serio) | 100 | static 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 | ||
106 | static 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 | |||
107 | static int __init ams_delta_serio_init(void) | 129 | static 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; |
160 | gpio_clk: | 175 | gpio: |
161 | gpio_free(AMS_DELTA_GPIO_PIN_KEYBRD_CLK); | 176 | gpio_free_array(ams_delta_gpios, |
162 | gpio_data: | 177 | ARRAY_SIZE(ams_delta_gpios)); |
163 | gpio_free(AMS_DELTA_GPIO_PIN_KEYBRD_DATA); | ||
164 | serio: | 178 | serio: |
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 | } |
177 | module_exit(ams_delta_serio_exit); | 191 | module_exit(ams_delta_serio_exit); |