forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 61598093bbdd283a7edc367d900f223070ead8d2
kernel/arch/arm/mach-pxa/cm-x300.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * linux/arch/arm/mach-pxa/cm-x300.c
34 *
....@@ -7,10 +8,6 @@
78 *
89 * Mike Rapoport <mike@compulab.co.il>
910 * Igor Grinberg <grinberg@compulab.co.il>
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 #define pr_fmt(fmt) "%s: " fmt, __func__
1613
....@@ -315,7 +312,6 @@
315312 static struct platform_pwm_backlight_data cm_x300_backlight_data = {
316313 .max_brightness = 100,
317314 .dft_brightness = 100,
318
- .enable_gpio = -1,
319315 };
320316
321317 static struct platform_device cm_x300_backlight_device = {
....@@ -358,13 +354,13 @@
358354 static struct gpiod_lookup_table cm_x300_spi_gpiod_table = {
359355 .dev_id = "spi_gpio",
360356 .table = {
361
- GPIO_LOOKUP("gpio-pxa", GPIO_LCD_SCL,
357
+ GPIO_LOOKUP("pca9555.1", GPIO_LCD_SCL - GPIO_LCD_BASE,
362358 "sck", GPIO_ACTIVE_HIGH),
363
- GPIO_LOOKUP("gpio-pxa", GPIO_LCD_DIN,
359
+ GPIO_LOOKUP("pca9555.1", GPIO_LCD_DIN - GPIO_LCD_BASE,
364360 "mosi", GPIO_ACTIVE_HIGH),
365
- GPIO_LOOKUP("gpio-pxa", GPIO_LCD_DOUT,
361
+ GPIO_LOOKUP("pca9555.1", GPIO_LCD_DOUT - GPIO_LCD_BASE,
366362 "miso", GPIO_ACTIVE_HIGH),
367
- GPIO_LOOKUP("gpio-pxa", GPIO_LCD_CS,
363
+ GPIO_LOOKUP("pca9555.1", GPIO_LCD_CS - GPIO_LCD_BASE,
368364 "cs", GPIO_ACTIVE_HIGH),
369365 { },
370366 },
....@@ -459,9 +455,17 @@
459455 static struct pxamci_platform_data cm_x300_mci_platform_data = {
460456 .detect_delay_ms = 200,
461457 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
462
- .gpio_card_detect = GPIO82_MMC_IRQ,
463
- .gpio_card_ro = GPIO85_MMC_WP,
464
- .gpio_power = -1,
458
+};
459
+
460
+static struct gpiod_lookup_table cm_x300_mci_gpio_table = {
461
+ .dev_id = "pxa2xx-mci.0",
462
+ .table = {
463
+ /* Card detect on GPIO 82 */
464
+ GPIO_LOOKUP("gpio-pxa", GPIO82_MMC_IRQ, "cd", GPIO_ACTIVE_LOW),
465
+ /* Write protect on GPIO 85 */
466
+ GPIO_LOOKUP("gpio-pxa", GPIO85_MMC_WP, "wp", GPIO_ACTIVE_LOW),
467
+ { },
468
+ },
465469 };
466470
467471 /* The second MMC slot of CM-X300 is hardwired to Libertas card and has
....@@ -482,13 +486,11 @@
482486 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
483487 .init = cm_x300_mci2_init,
484488 .exit = cm_x300_mci2_exit,
485
- .gpio_card_detect = -1,
486
- .gpio_card_ro = -1,
487
- .gpio_power = -1,
488489 };
489490
490491 static void __init cm_x300_init_mmc(void)
491492 {
493
+ gpiod_add_lookup_table(&cm_x300_mci_gpio_table);
492494 pxa_set_mci_info(&cm_x300_mci_platform_data);
493495 pxa3xx_set_mci2_info(&cm_x300_mci2_platform_data);
494496 }