.. | .. |
---|
30 | 30 | #include <linux/gpio_keys.h> |
---|
31 | 31 | #include <linux/input.h> |
---|
32 | 32 | #include <linux/gpio.h> |
---|
| 33 | +#include <linux/gpio/machine.h> |
---|
33 | 34 | #include <linux/power/gpio-charger.h> |
---|
34 | 35 | |
---|
35 | 36 | #include <video/sa1100fb.h> |
---|
.. | .. |
---|
131 | 132 | /* |
---|
132 | 133 | * Collie AC IN |
---|
133 | 134 | */ |
---|
| 135 | +static struct gpiod_lookup_table collie_power_gpiod_table = { |
---|
| 136 | + .dev_id = "gpio-charger", |
---|
| 137 | + .table = { |
---|
| 138 | + GPIO_LOOKUP("gpio", COLLIE_GPIO_AC_IN, |
---|
| 139 | + NULL, GPIO_ACTIVE_HIGH), |
---|
| 140 | + { }, |
---|
| 141 | + }, |
---|
| 142 | +}; |
---|
| 143 | + |
---|
134 | 144 | static char *collie_ac_supplied_to[] = { |
---|
135 | 145 | "main-battery", |
---|
136 | 146 | "backup-battery", |
---|
137 | 147 | }; |
---|
138 | 148 | |
---|
139 | | - |
---|
140 | 149 | static struct gpio_charger_platform_data collie_power_data = { |
---|
141 | 150 | .name = "charger", |
---|
142 | 151 | .type = POWER_SUPPLY_TYPE_MAINS, |
---|
143 | | - .gpio = COLLIE_GPIO_AC_IN, |
---|
144 | 152 | .supplied_to = collie_ac_supplied_to, |
---|
145 | 153 | .num_supplicants = ARRAY_SIZE(collie_ac_supplied_to), |
---|
146 | 154 | }; |
---|
.. | .. |
---|
386 | 394 | |
---|
387 | 395 | platform_scoop_config = &collie_pcmcia_config; |
---|
388 | 396 | |
---|
| 397 | + gpiod_add_lookup_table(&collie_power_gpiod_table); |
---|
| 398 | + |
---|
389 | 399 | ret = platform_add_devices(devices, ARRAY_SIZE(devices)); |
---|
390 | 400 | if (ret) { |
---|
391 | 401 | printk(KERN_WARNING "collie: Unable to register LoCoMo device\n"); |
---|