forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-10-12 a5969cabbb4660eab42b6ef0412cbbd1200cf14d
kernel/arch/arm/mach-pxa/lubbock.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * linux/arch/arm/mach-pxa/lubbock.c
34 *
....@@ -6,10 +7,6 @@
67 * Author: Nicolas Pitre
78 * Created: Jun 15, 2001
89 * Copyright: MontaVista Software Inc.
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 #include <linux/clkdev.h>
1512 #include <linux/gpio.h>
....@@ -39,7 +36,7 @@
3936 #include <asm/mach-types.h>
4037 #include <mach/hardware.h>
4138 #include <asm/irq.h>
42
-#include <asm/sizes.h>
39
+#include <linux/sizes.h>
4340
4441 #include <asm/mach/arch.h>
4542 #include <asm/mach/map.h>
....@@ -119,12 +116,11 @@
119116
120117 static struct gpio_chip *lubbock_misc_wr_gc;
121118
122
-void lubbock_set_misc_wr(unsigned int mask, unsigned int set)
119
+static void lubbock_set_misc_wr(unsigned int mask, unsigned int set)
123120 {
124121 unsigned long m = mask, v = set;
125122 lubbock_misc_wr_gc->set_multiple(lubbock_misc_wr_gc, &m, &v);
126123 }
127
-EXPORT_SYMBOL(lubbock_set_misc_wr);
128124
129125 static int lubbock_udc_is_connected(void)
130126 {
....@@ -136,9 +132,25 @@
136132 // no D+ pullup; lubbock can't connect/disconnect in software
137133 };
138134
135
+/* GPIOs for SA1111 PCMCIA */
136
+static struct gpiod_lookup_table sa1111_pcmcia_gpio_table = {
137
+ .dev_id = "1800",
138
+ .table = {
139
+ { "sa1111", 0, "a0vpp", GPIO_ACTIVE_HIGH },
140
+ { "sa1111", 1, "a1vpp", GPIO_ACTIVE_HIGH },
141
+ { "sa1111", 2, "a0vcc", GPIO_ACTIVE_HIGH },
142
+ { "sa1111", 3, "a1vcc", GPIO_ACTIVE_HIGH },
143
+ { "lubbock", 14, "b0vcc", GPIO_ACTIVE_HIGH },
144
+ { "lubbock", 15, "b1vcc", GPIO_ACTIVE_HIGH },
145
+ { },
146
+ },
147
+};
148
+
139149 static void lubbock_init_pcmcia(void)
140150 {
141151 struct clk *clk;
152
+
153
+ gpiod_add_lookup_table(&sa1111_pcmcia_gpio_table);
142154
143155 /* Add an alias for the SA1111 PCMCIA clock */
144156 clk = clk_get_sys("pxa2xx-pcmcia", NULL);
....@@ -181,7 +193,7 @@
181193 * (to J5) and poking board registers (as done below). Else it's only useful
182194 * for the temperature sensors.
183195 */
184
-static struct pxa2xx_spi_master pxa_ssp_master_info = {
196
+static struct pxa2xx_spi_controller pxa_ssp_master_info = {
185197 .num_chipselect = 1,
186198 };
187199
....@@ -440,9 +452,6 @@
440452 .init = lubbock_mci_init,
441453 .get_ro = lubbock_mci_get_ro,
442454 .exit = lubbock_mci_exit,
443
- .gpio_card_detect = -1,
444
- .gpio_card_ro = -1,
445
- .gpio_power = -1,
446455 };
447456
448457 static void lubbock_irda_transceiver_mode(struct device *dev, int mode)