forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 61598093bbdd283a7edc367d900f223070ead8d2
kernel/arch/arm/mach-pxa/z2.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * linux/arch/arm/mach-pxa/z2.c
34 *
....@@ -7,10 +8,6 @@
78 *
89 * Based on research and code by: Ken McGuire
910 * Based on mainstone.c as modified for the Zipit Z2.
10
- *
11
- * This program is free software; you can redistribute it and/or modify
12
- * it under the terms of the GNU General Public License version 2 as
13
- * published by the Free Software Foundation.
1411 */
1512
1613 #include <linux/platform_device.h>
....@@ -27,6 +24,7 @@
2724 #include <linux/power_supply.h>
2825 #include <linux/mtd/physmap.h>
2926 #include <linux/gpio.h>
27
+#include <linux/gpio/machine.h>
3028 #include <linux/gpio_keys.h>
3129 #include <linux/delay.h>
3230 #include <linux/regulator/machine.h>
....@@ -212,13 +210,11 @@
212210 /* Keypad Backlight */
213211 .max_brightness = 1023,
214212 .dft_brightness = 0,
215
- .enable_gpio = -1,
216213 },
217214 [1] = {
218215 /* LCD Backlight */
219216 .max_brightness = 1023,
220217 .dft_brightness = 512,
221
- .enable_gpio = -1,
222218 },
223219 };
224220
....@@ -290,14 +286,21 @@
290286 #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
291287 static struct pxamci_platform_data z2_mci_platform_data = {
292288 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
293
- .gpio_card_detect = GPIO96_ZIPITZ2_SD_DETECT,
294
- .gpio_power = -1,
295
- .gpio_card_ro = -1,
296289 .detect_delay_ms = 200,
290
+};
291
+
292
+static struct gpiod_lookup_table z2_mci_gpio_table = {
293
+ .dev_id = "pxa2xx-mci.0",
294
+ .table = {
295
+ GPIO_LOOKUP("gpio-pxa", GPIO96_ZIPITZ2_SD_DETECT,
296
+ "cd", GPIO_ACTIVE_LOW),
297
+ { },
298
+ },
297299 };
298300
299301 static void __init z2_mmc_init(void)
300302 {
303
+ gpiod_add_lookup_table(&z2_mci_gpio_table);
301304 pxa_set_mci_info(&z2_mci_platform_data);
302305 }
303306 #else
....@@ -599,12 +602,12 @@
599602 },
600603 };
601604
602
-static struct pxa2xx_spi_master pxa_ssp1_master_info = {
605
+static struct pxa2xx_spi_controller pxa_ssp1_master_info = {
603606 .num_chipselect = 1,
604607 .enable_dma = 1,
605608 };
606609
607
-static struct pxa2xx_spi_master pxa_ssp2_master_info = {
610
+static struct pxa2xx_spi_controller pxa_ssp2_master_info = {
608611 .num_chipselect = 1,
609612 };
610613