hc
2023-12-06 08f87f769b595151be1afeff53e144f543faa614
kernel/arch/arm/mach-pxa/palmtx.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Hardware definitions for PalmTX
34 *
....@@ -9,12 +10,7 @@
910 * Jan Herman <2hp@seznam.cz>
1011 * Michal Hrusecky
1112 *
12
- * This program is free software; you can redistribute it and/or modify
13
- * it under the terms of the GNU General Public License version 2 as
14
- * published by the Free Software Foundation.
15
- *
1613 * (find more info at www.hackndev.com)
17
- *
1814 */
1915
2016 #include <linux/platform_device.h>
....@@ -27,9 +23,7 @@
2723 #include <linux/gpio.h>
2824 #include <linux/wm97xx.h>
2925 #include <linux/power_supply.h>
30
-#include <linux/usb/gpio_vbus.h>
31
-#include <linux/mtd/rawnand.h>
32
-#include <linux/mtd/partitions.h>
26
+#include <linux/mtd/platnand.h>
3327 #include <linux/mtd/mtd.h>
3428 #include <linux/mtd/physmap.h>
3529
....@@ -247,11 +241,10 @@
247241 ******************************************************************************/
248242 #if defined(CONFIG_MTD_NAND_PLATFORM) || \
249243 defined(CONFIG_MTD_NAND_PLATFORM_MODULE)
250
-static void palmtx_nand_cmd_ctl(struct mtd_info *mtd, int cmd,
251
- unsigned int ctrl)
244
+static void palmtx_nand_cmd_ctl(struct nand_chip *this, int cmd,
245
+ unsigned int ctrl)
252246 {
253
- struct nand_chip *this = mtd_to_nand(mtd);
254
- char __iomem *nandaddr = this->IO_ADDR_W;
247
+ char __iomem *nandaddr = this->legacy.IO_ADDR_W;
255248
256249 if (cmd == NAND_CMD_NONE)
257250 return;
....@@ -339,6 +332,19 @@
339332 iotable_init(palmtx_io_desc, ARRAY_SIZE(palmtx_io_desc));
340333 }
341334
335
+static struct gpiod_lookup_table palmtx_mci_gpio_table = {
336
+ .dev_id = "pxa2xx-mci.0",
337
+ .table = {
338
+ GPIO_LOOKUP("gpio-pxa", GPIO_NR_PALMTX_SD_DETECT_N,
339
+ "cd", GPIO_ACTIVE_LOW),
340
+ GPIO_LOOKUP("gpio-pxa", GPIO_NR_PALMTX_SD_READONLY,
341
+ "wp", GPIO_ACTIVE_LOW),
342
+ GPIO_LOOKUP("gpio-pxa", GPIO_NR_PALMTX_SD_POWER,
343
+ "power", GPIO_ACTIVE_HIGH),
344
+ { },
345
+ },
346
+};
347
+
342348 static void __init palmtx_init(void)
343349 {
344350 pxa2xx_mfp_config(ARRAY_AND_SIZE(palmtx_pin_config));
....@@ -346,8 +352,7 @@
346352 pxa_set_btuart_info(NULL);
347353 pxa_set_stuart_info(NULL);
348354
349
- palm27x_mmc_init(GPIO_NR_PALMTX_SD_DETECT_N, GPIO_NR_PALMTX_SD_READONLY,
350
- GPIO_NR_PALMTX_SD_POWER, 0);
355
+ palm27x_mmc_init(&palmtx_mci_gpio_table);
351356 palm27x_pm_init(PALMTX_STR_BASE);
352357 palm27x_lcd_init(-1, &palm_320x480_lcd_mode);
353358 palm27x_udc_init(GPIO_NR_PALMTX_USB_DETECT_N,