hc
2023-12-06 08f87f769b595151be1afeff53e144f543faa614
kernel/arch/arm/mach-pxa/corgi.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Support for Sharp SL-C7xx PDAs
34 * Models: SL-C700 (Corgi), SL-C750 (Shepherd), SL-C760 (Husky)
....@@ -5,11 +6,6 @@
56 * Copyright (c) 2004-2005 Richard Purdie
67 *
78 * Based on Sharp's 2.4 kernel patches/lubbock.c
8
- *
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
- *
139 */
1410
1511 #include <linux/kernel.h>
....@@ -24,6 +20,7 @@
2420 #include <linux/mtd/physmap.h>
2521 #include <linux/pm.h>
2622 #include <linux/gpio.h>
23
+#include <linux/gpio/machine.h>
2724 #include <linux/backlight.h>
2825 #include <linux/i2c.h>
2926 #include <linux/platform_data/i2c-pxa.h>
....@@ -493,11 +490,23 @@
493490 static struct pxamci_platform_data corgi_mci_platform_data = {
494491 .detect_delay_ms = 250,
495492 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
496
- .gpio_card_detect = CORGI_GPIO_nSD_DETECT,
497
- .gpio_card_ro = CORGI_GPIO_nSD_WP,
498
- .gpio_power = CORGI_GPIO_SD_PWR,
499493 };
500494
495
+static struct gpiod_lookup_table corgi_mci_gpio_table = {
496
+ .dev_id = "pxa2xx-mci.0",
497
+ .table = {
498
+ /* Card detect on GPIO 9 */
499
+ GPIO_LOOKUP("gpio-pxa", CORGI_GPIO_nSD_DETECT,
500
+ "cd", GPIO_ACTIVE_LOW),
501
+ /* Write protect on GPIO 7 */
502
+ GPIO_LOOKUP("gpio-pxa", CORGI_GPIO_nSD_WP,
503
+ "wp", GPIO_ACTIVE_LOW),
504
+ /* Power on GPIO 33 */
505
+ GPIO_LOOKUP("gpio-pxa", CORGI_GPIO_SD_PWR,
506
+ "power", GPIO_ACTIVE_HIGH),
507
+ { },
508
+ },
509
+};
501510
502511 /*
503512 * Irda
....@@ -517,7 +526,7 @@
517526 };
518527
519528 #if IS_ENABLED(CONFIG_SPI_PXA2XX)
520
-static struct pxa2xx_spi_master corgi_spi_info = {
529
+static struct pxa2xx_spi_controller corgi_spi_info = {
521530 .num_chipselect = 3,
522531 };
523532
....@@ -554,13 +563,20 @@
554563 }
555564 }
556565
566
+static struct gpiod_lookup_table corgi_lcdcon_gpio_table = {
567
+ .dev_id = "spi1.1",
568
+ .table = {
569
+ GPIO_LOOKUP("gpio-pxa", CORGI_GPIO_BACKLIGHT_CONT,
570
+ "BL_CONT", GPIO_ACTIVE_HIGH),
571
+ { },
572
+ },
573
+};
574
+
557575 static struct corgi_lcd_platform_data corgi_lcdcon_info = {
558576 .init_mode = CORGI_LCD_MODE_VGA,
559577 .max_intensity = 0x2f,
560578 .default_intensity = 0x1f,
561579 .limit_mask = 0x0b,
562
- .gpio_backlight_cont = CORGI_GPIO_BACKLIGHT_CONT,
563
- .gpio_backlight_on = -1,
564580 .kick_battery = corgi_bl_kick_battery,
565581 };
566582
....@@ -600,6 +616,7 @@
600616 static void __init corgi_init_spi(void)
601617 {
602618 pxa2xx_set_spi_info(1, &corgi_spi_info);
619
+ gpiod_add_lookup_table(&corgi_lcdcon_gpio_table);
603620 spi_register_board_info(ARRAY_AND_SIZE(corgi_spi_devices));
604621 }
605622 #else
....@@ -731,6 +748,7 @@
731748 corgi_init_spi();
732749
733750 pxa_set_udc_info(&udc_info);
751
+ gpiod_add_lookup_table(&corgi_mci_gpio_table);
734752 pxa_set_mci_info(&corgi_mci_platform_data);
735753 pxa_set_ficp_info(&corgi_ficp_platform_data);
736754 pxa_set_i2c_info(NULL);