hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/arch/arm/mach-sa1100/collie.c
....@@ -30,6 +30,7 @@
3030 #include <linux/gpio_keys.h>
3131 #include <linux/input.h>
3232 #include <linux/gpio.h>
33
+#include <linux/gpio/machine.h>
3334 #include <linux/power/gpio-charger.h>
3435
3536 #include <video/sa1100fb.h>
....@@ -131,16 +132,23 @@
131132 /*
132133 * Collie AC IN
133134 */
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
+
134144 static char *collie_ac_supplied_to[] = {
135145 "main-battery",
136146 "backup-battery",
137147 };
138148
139
-
140149 static struct gpio_charger_platform_data collie_power_data = {
141150 .name = "charger",
142151 .type = POWER_SUPPLY_TYPE_MAINS,
143
- .gpio = COLLIE_GPIO_AC_IN,
144152 .supplied_to = collie_ac_supplied_to,
145153 .num_supplicants = ARRAY_SIZE(collie_ac_supplied_to),
146154 };
....@@ -386,6 +394,8 @@
386394
387395 platform_scoop_config = &collie_pcmcia_config;
388396
397
+ gpiod_add_lookup_table(&collie_power_gpiod_table);
398
+
389399 ret = platform_add_devices(devices, ARRAY_SIZE(devices));
390400 if (ret) {
391401 printk(KERN_WARNING "collie: Unable to register LoCoMo device\n");