forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 748e4f3d702def1a4bff191e0cf93b6a05340f01
kernel/arch/arm/mach-pxa/palmld.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Hardware definitions for Palm LifeDrive
34 *
....@@ -6,12 +7,7 @@
67 * Based on work of:
78 * Alex Osborne <ato@meshy.org>
89 *
9
- * This program is free software; you can redistribute it and/or modify
10
- * it under the terms of the GNU General Public License version 2 as
11
- * published by the Free Software Foundation.
12
- *
1310 * (find more info at www.hackndev.com)
14
- *
1511 */
1612
1713 #include <linux/platform_device.h>
....@@ -288,8 +284,20 @@
288284 .id = -1,
289285 };
290286
287
+static struct gpiod_lookup_table palmld_ide_gpio_table = {
288
+ .dev_id = "pata_palmld",
289
+ .table = {
290
+ GPIO_LOOKUP("gpio-pxa", GPIO_NR_PALMLD_IDE_PWEN,
291
+ "power", GPIO_ACTIVE_HIGH),
292
+ GPIO_LOOKUP("gpio-pxa", GPIO_NR_PALMLD_IDE_RESET,
293
+ "reset", GPIO_ACTIVE_LOW),
294
+ { },
295
+ },
296
+};
297
+
291298 static void __init palmld_ide_init(void)
292299 {
300
+ gpiod_add_lookup_table(&palmld_ide_gpio_table);
293301 platform_device_register(&palmld_ide_device);
294302 }
295303 #else
....@@ -320,6 +328,19 @@
320328 iotable_init(palmld_io_desc, ARRAY_SIZE(palmld_io_desc));
321329 }
322330
331
+static struct gpiod_lookup_table palmld_mci_gpio_table = {
332
+ .dev_id = "pxa2xx-mci.0",
333
+ .table = {
334
+ GPIO_LOOKUP("gpio-pxa", GPIO_NR_PALMLD_SD_DETECT_N,
335
+ "cd", GPIO_ACTIVE_LOW),
336
+ GPIO_LOOKUP("gpio-pxa", GPIO_NR_PALMLD_SD_READONLY,
337
+ "wp", GPIO_ACTIVE_LOW),
338
+ GPIO_LOOKUP("gpio-pxa", GPIO_NR_PALMLD_SD_POWER,
339
+ "power", GPIO_ACTIVE_HIGH),
340
+ { },
341
+ },
342
+};
343
+
323344 static void __init palmld_init(void)
324345 {
325346 pxa2xx_mfp_config(ARRAY_AND_SIZE(palmld_pin_config));
....@@ -327,8 +348,7 @@
327348 pxa_set_btuart_info(NULL);
328349 pxa_set_stuart_info(NULL);
329350
330
- palm27x_mmc_init(GPIO_NR_PALMLD_SD_DETECT_N, GPIO_NR_PALMLD_SD_READONLY,
331
- GPIO_NR_PALMLD_SD_POWER, 0);
351
+ palm27x_mmc_init(&palmld_mci_gpio_table);
332352 palm27x_pm_init(PALMLD_STR_BASE);
333353 palm27x_lcd_init(-1, &palm_320x480_lcd_mode);
334354 palm27x_irda_init(GPIO_NR_PALMLD_IR_DISABLE);