forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 61598093bbdd283a7edc367d900f223070ead8d2
kernel/arch/arm/mach-pxa/colibri-pxa270-income.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * linux/arch/arm/mach-pxa/income.c
34 *
....@@ -6,15 +7,11 @@
67 * Copyright (C) 2010
78 * Marek Vasut <marek.vasut@gmail.com>
89 * Pavel Revak <palo@bielyvlk.sk>
9
- *
10
- * This program is free software; you can redistribute it and/or modify
11
- * it under the terms of the GNU General Public License version 2 as
12
- * published by the Free Software Foundation.
1310 */
1411
1512 #include <linux/bitops.h>
1613 #include <linux/delay.h>
17
-#include <linux/gpio.h>
14
+#include <linux/gpio/machine.h>
1815 #include <linux/init.h>
1916 #include <linux/interrupt.h>
2017 #include <linux/leds.h>
....@@ -51,14 +48,25 @@
5148 #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
5249 static struct pxamci_platform_data income_mci_platform_data = {
5350 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
54
- .gpio_power = -1,
55
- .gpio_card_detect = GPIO0_INCOME_SD_DETECT,
56
- .gpio_card_ro = GPIO0_INCOME_SD_RO,
5751 .detect_delay_ms = 200,
52
+};
53
+
54
+static struct gpiod_lookup_table income_mci_gpio_table = {
55
+ .dev_id = "pxa2xx-mci.0",
56
+ .table = {
57
+ /* Card detect on GPIO 0 */
58
+ GPIO_LOOKUP("gpio-pxa", GPIO0_INCOME_SD_DETECT,
59
+ "cd", GPIO_ACTIVE_LOW),
60
+ /* Write protect on GPIO 1 */
61
+ GPIO_LOOKUP("gpio-pxa", GPIO0_INCOME_SD_RO,
62
+ "wp", GPIO_ACTIVE_LOW),
63
+ { },
64
+ },
5865 };
5966
6067 static void __init income_mmc_init(void)
6168 {
69
+ gpiod_add_lookup_table(&income_mci_gpio_table);
6270 pxa_set_mci_info(&income_mci_platform_data);
6371 }
6472 #else
....@@ -194,7 +202,6 @@
194202 static struct platform_pwm_backlight_data income_backlight_data = {
195203 .max_brightness = 0x3ff,
196204 .dft_brightness = 0x1ff,
197
- .enable_gpio = -1,
198205 };
199206
200207 static struct platform_device income_backlight = {