diff options
author | Russell King <rmk+kernel@armlinux.org.uk> | 2016-08-31 03:49:48 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@armlinux.org.uk> | 2018-04-06 10:53:22 -0400 |
commit | b51af86559d4b5c831abbec545c76f721a8d8237 (patch) | |
tree | c7bf1169b7c472851ac532a8d6a5fc12917ce28f | |
parent | 80c799dbf88d0b404e1304b469eb157e4e9e0fbf (diff) |
ARM: sa1100/shannon: convert to generic CF sockets
Convert shannon to use the generic CF socket support.
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
-rw-r--r-- | arch/arm/mach-sa1100/Kconfig | 2 | ||||
-rw-r--r-- | arch/arm/mach-sa1100/shannon.c | 38 | ||||
-rw-r--r-- | drivers/pcmcia/Makefile | 1 | ||||
-rw-r--r-- | drivers/pcmcia/sa1100_generic.c | 3 | ||||
-rw-r--r-- | drivers/pcmcia/sa1100_generic.h | 1 | ||||
-rw-r--r-- | drivers/pcmcia/sa1100_shannon.c | 104 |
6 files changed, 40 insertions, 109 deletions
diff --git a/arch/arm/mach-sa1100/Kconfig b/arch/arm/mach-sa1100/Kconfig index 5ca5847d89cc..fde7ef1ab192 100644 --- a/arch/arm/mach-sa1100/Kconfig +++ b/arch/arm/mach-sa1100/Kconfig | |||
@@ -139,6 +139,8 @@ config SA1100_PLEB | |||
139 | config SA1100_SHANNON | 139 | config SA1100_SHANNON |
140 | bool "Shannon" | 140 | bool "Shannon" |
141 | select ARM_SA1100_CPUFREQ | 141 | select ARM_SA1100_CPUFREQ |
142 | select REGULATOR | ||
143 | select REGULATOR_FIXED_VOLTAGE | ||
142 | help | 144 | help |
143 | The Shannon (also known as a Tuxscreen, and also as a IS2630) was a | 145 | The Shannon (also known as a Tuxscreen, and also as a IS2630) was a |
144 | limited edition webphone produced by Philips. The Shannon is a SA1100 | 146 | limited edition webphone produced by Philips. The Shannon is a SA1100 |
diff --git a/arch/arm/mach-sa1100/shannon.c b/arch/arm/mach-sa1100/shannon.c index 856664c783d9..22f7fe0b809f 100644 --- a/arch/arm/mach-sa1100/shannon.c +++ b/arch/arm/mach-sa1100/shannon.c | |||
@@ -5,11 +5,14 @@ | |||
5 | 5 | ||
6 | #include <linux/init.h> | 6 | #include <linux/init.h> |
7 | #include <linux/device.h> | 7 | #include <linux/device.h> |
8 | #include <linux/gpio/machine.h> | ||
8 | #include <linux/kernel.h> | 9 | #include <linux/kernel.h> |
9 | #include <linux/platform_data/sa11x0-serial.h> | 10 | #include <linux/platform_data/sa11x0-serial.h> |
10 | #include <linux/tty.h> | 11 | #include <linux/tty.h> |
11 | #include <linux/mtd/mtd.h> | 12 | #include <linux/mtd/mtd.h> |
12 | #include <linux/mtd/partitions.h> | 13 | #include <linux/mtd/partitions.h> |
14 | #include <linux/regulator/fixed.h> | ||
15 | #include <linux/regulator/machine.h> | ||
13 | 16 | ||
14 | #include <video/sa1100fb.h> | 17 | #include <video/sa1100fb.h> |
15 | 18 | ||
@@ -72,8 +75,43 @@ static struct sa1100fb_mach_info shannon_lcd_info = { | |||
72 | .lccr3 = LCCR3_ACBsDiv(512), | 75 | .lccr3 = LCCR3_ACBsDiv(512), |
73 | }; | 76 | }; |
74 | 77 | ||
78 | static struct gpiod_lookup_table shannon_pcmcia0_gpio_table = { | ||
79 | .dev_id = "sa11x0-pcmcia.0", | ||
80 | .table = { | ||
81 | GPIO_LOOKUP("gpio", 24, "detect", GPIO_ACTIVE_LOW), | ||
82 | GPIO_LOOKUP("gpio", 26, "ready", GPIO_ACTIVE_HIGH), | ||
83 | { }, | ||
84 | }, | ||
85 | }; | ||
86 | |||
87 | static struct gpiod_lookup_table shannon_pcmcia1_gpio_table = { | ||
88 | .dev_id = "sa11x0-pcmcia.1", | ||
89 | .table = { | ||
90 | GPIO_LOOKUP("gpio", 25, "detect", GPIO_ACTIVE_LOW), | ||
91 | GPIO_LOOKUP("gpio", 27, "ready", GPIO_ACTIVE_HIGH), | ||
92 | { }, | ||
93 | }, | ||
94 | }; | ||
95 | |||
96 | static struct regulator_consumer_supply shannon_cf_vcc_consumers[] = { | ||
97 | REGULATOR_SUPPLY("vcc", "sa11x0-pcmcia.0"), | ||
98 | REGULATOR_SUPPLY("vcc", "sa11x0-pcmcia.1"), | ||
99 | }; | ||
100 | |||
101 | static struct fixed_voltage_config shannon_cf_vcc_pdata __initdata = { | ||
102 | .supply_name = "cf-power", | ||
103 | .microvolts = 3300000, | ||
104 | .enabled_at_boot = 1, | ||
105 | .gpio = -EINVAL, | ||
106 | }; | ||
107 | |||
75 | static void __init shannon_init(void) | 108 | static void __init shannon_init(void) |
76 | { | 109 | { |
110 | sa11x0_register_fixed_regulator(0, &shannon_cf_vcc_pdata, | ||
111 | shannon_cf_vcc_consumers, | ||
112 | ARRAY_SIZE(shannon_cf_vcc_consumers)); | ||
113 | sa11x0_register_pcmcia(0, &shannon_pcmcia0_gpio_table); | ||
114 | sa11x0_register_pcmcia(1, &shannon_pcmcia1_gpio_table); | ||
77 | sa11x0_ppc_configure_mcp(); | 115 | sa11x0_ppc_configure_mcp(); |
78 | sa11x0_register_lcd(&shannon_lcd_info); | 116 | sa11x0_register_lcd(&shannon_lcd_info); |
79 | sa11x0_register_mtd(&shannon_flash_data, &shannon_flash_resource, 1); | 117 | sa11x0_register_mtd(&shannon_flash_data, &shannon_flash_resource, 1); |
diff --git a/drivers/pcmcia/Makefile b/drivers/pcmcia/Makefile index 722871ac51b4..7f501d38a7a2 100644 --- a/drivers/pcmcia/Makefile +++ b/drivers/pcmcia/Makefile | |||
@@ -49,7 +49,6 @@ sa1100_cs-y += sa1100_generic.o | |||
49 | sa1100_cs-$(CONFIG_SA1100_COLLIE) += pxa2xx_sharpsl.o | 49 | sa1100_cs-$(CONFIG_SA1100_COLLIE) += pxa2xx_sharpsl.o |
50 | sa1100_cs-$(CONFIG_SA1100_H3100) += sa1100_h3600.o | 50 | sa1100_cs-$(CONFIG_SA1100_H3100) += sa1100_h3600.o |
51 | sa1100_cs-$(CONFIG_SA1100_H3600) += sa1100_h3600.o | 51 | sa1100_cs-$(CONFIG_SA1100_H3600) += sa1100_h3600.o |
52 | sa1100_cs-$(CONFIG_SA1100_SHANNON) += sa1100_shannon.o | ||
53 | sa1100_cs-$(CONFIG_SA1100_SIMPAD) += sa1100_simpad.o | 52 | sa1100_cs-$(CONFIG_SA1100_SIMPAD) += sa1100_simpad.o |
54 | 53 | ||
55 | pxa2xx_cm_x2xx_cs-y += pxa2xx_cm_x2xx.o pxa2xx_cm_x255.o pxa2xx_cm_x270.o | 54 | pxa2xx_cm_x2xx_cs-y += pxa2xx_cm_x2xx.o pxa2xx_cm_x255.o pxa2xx_cm_x270.o |
diff --git a/drivers/pcmcia/sa1100_generic.c b/drivers/pcmcia/sa1100_generic.c index 59a670f330b7..47b060c57418 100644 --- a/drivers/pcmcia/sa1100_generic.c +++ b/drivers/pcmcia/sa1100_generic.c | |||
@@ -101,9 +101,6 @@ static int (*sa11x0_pcmcia_legacy_hw_init[])(struct device *dev) = { | |||
101 | #if defined(CONFIG_SA1100_H3100) || defined(CONFIG_SA1100_H3600) | 101 | #if defined(CONFIG_SA1100_H3100) || defined(CONFIG_SA1100_H3600) |
102 | pcmcia_h3600_init, | 102 | pcmcia_h3600_init, |
103 | #endif | 103 | #endif |
104 | #ifdef CONFIG_SA1100_SHANNON | ||
105 | pcmcia_shannon_init, | ||
106 | #endif | ||
107 | #ifdef CONFIG_SA1100_SIMPAD | 104 | #ifdef CONFIG_SA1100_SIMPAD |
108 | pcmcia_simpad_init, | 105 | pcmcia_simpad_init, |
109 | #endif | 106 | #endif |
diff --git a/drivers/pcmcia/sa1100_generic.h b/drivers/pcmcia/sa1100_generic.h index 1e255c173cd8..7b7cdcd20187 100644 --- a/drivers/pcmcia/sa1100_generic.h +++ b/drivers/pcmcia/sa1100_generic.h | |||
@@ -14,7 +14,6 @@ extern int pcmcia_graphicsmaster_init(struct device *); | |||
14 | extern int pcmcia_h3600_init(struct device *); | 14 | extern int pcmcia_h3600_init(struct device *); |
15 | extern int pcmcia_pangolin_init(struct device *); | 15 | extern int pcmcia_pangolin_init(struct device *); |
16 | extern int pcmcia_pfs168_init(struct device *); | 16 | extern int pcmcia_pfs168_init(struct device *); |
17 | extern int pcmcia_shannon_init(struct device *); | ||
18 | extern int pcmcia_simpad_init(struct device *); | 17 | extern int pcmcia_simpad_init(struct device *); |
19 | extern int pcmcia_stork_init(struct device *); | 18 | extern int pcmcia_stork_init(struct device *); |
20 | extern int pcmcia_system3_init(struct device *); | 19 | extern int pcmcia_system3_init(struct device *); |
diff --git a/drivers/pcmcia/sa1100_shannon.c b/drivers/pcmcia/sa1100_shannon.c deleted file mode 100644 index 0e52a575986e..000000000000 --- a/drivers/pcmcia/sa1100_shannon.c +++ /dev/null | |||
@@ -1,104 +0,0 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
2 | /* | ||
3 | * drivers/pcmcia/sa1100_shannon.c | ||
4 | * | ||
5 | * PCMCIA implementation routines for Shannon | ||
6 | * | ||
7 | */ | ||
8 | #include <linux/module.h> | ||
9 | #include <linux/kernel.h> | ||
10 | #include <linux/device.h> | ||
11 | #include <linux/init.h> | ||
12 | #include <linux/io.h> | ||
13 | |||
14 | #include <mach/hardware.h> | ||
15 | #include <asm/mach-types.h> | ||
16 | #include <mach/shannon.h> | ||
17 | #include <asm/irq.h> | ||
18 | #include "sa1100_generic.h" | ||
19 | |||
20 | static int shannon_pcmcia_hw_init(struct soc_pcmcia_socket *skt) | ||
21 | { | ||
22 | /* All those are inputs */ | ||
23 | GAFR &= ~(GPIO_GPIO(SHANNON_GPIO_EJECT_0) | | ||
24 | GPIO_GPIO(SHANNON_GPIO_EJECT_1) | | ||
25 | GPIO_GPIO(SHANNON_GPIO_RDY_0) | | ||
26 | GPIO_GPIO(SHANNON_GPIO_RDY_1)); | ||
27 | |||
28 | if (skt->nr == 0) { | ||
29 | skt->stat[SOC_STAT_CD].gpio = SHANNON_GPIO_EJECT_0; | ||
30 | skt->stat[SOC_STAT_CD].name = "PCMCIA_CD_0"; | ||
31 | skt->stat[SOC_STAT_RDY].gpio = SHANNON_GPIO_RDY_0; | ||
32 | skt->stat[SOC_STAT_RDY].name = "PCMCIA_RDY_0"; | ||
33 | } else { | ||
34 | skt->stat[SOC_STAT_CD].gpio = SHANNON_GPIO_EJECT_1; | ||
35 | skt->stat[SOC_STAT_CD].name = "PCMCIA_CD_1"; | ||
36 | skt->stat[SOC_STAT_RDY].gpio = SHANNON_GPIO_RDY_1; | ||
37 | skt->stat[SOC_STAT_RDY].name = "PCMCIA_RDY_1"; | ||
38 | } | ||
39 | |||
40 | return 0; | ||
41 | } | ||
42 | |||
43 | static void | ||
44 | shannon_pcmcia_socket_state(struct soc_pcmcia_socket *skt, | ||
45 | struct pcmcia_state *state) | ||
46 | { | ||
47 | switch (skt->nr) { | ||
48 | case 0: | ||
49 | state->bvd1 = 1; | ||
50 | state->bvd2 = 1; | ||
51 | state->vs_3v = 1; /* FIXME Can only apply 3.3V on Shannon. */ | ||
52 | state->vs_Xv = 0; | ||
53 | break; | ||
54 | |||
55 | case 1: | ||
56 | state->bvd1 = 1; | ||
57 | state->bvd2 = 1; | ||
58 | state->vs_3v = 1; /* FIXME Can only apply 3.3V on Shannon. */ | ||
59 | state->vs_Xv = 0; | ||
60 | break; | ||
61 | } | ||
62 | } | ||
63 | |||
64 | static int | ||
65 | shannon_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, | ||
66 | const socket_state_t *state) | ||
67 | { | ||
68 | switch (state->Vcc) { | ||
69 | case 0: /* power off */ | ||
70 | printk(KERN_WARNING "%s(): CS asked for 0V, still applying 3.3V..\n", __func__); | ||
71 | break; | ||
72 | case 50: | ||
73 | printk(KERN_WARNING "%s(): CS asked for 5V, applying 3.3V..\n", __func__); | ||
74 | case 33: | ||
75 | break; | ||
76 | default: | ||
77 | printk(KERN_ERR "%s(): unrecognized Vcc %u\n", | ||
78 | __func__, state->Vcc); | ||
79 | return -1; | ||
80 | } | ||
81 | |||
82 | printk(KERN_WARNING "%s(): Warning, Can't perform reset\n", __func__); | ||
83 | |||
84 | /* Silently ignore Vpp, output enable, speaker enable. */ | ||
85 | |||
86 | return 0; | ||
87 | } | ||
88 | |||
89 | static struct pcmcia_low_level shannon_pcmcia_ops = { | ||
90 | .owner = THIS_MODULE, | ||
91 | .hw_init = shannon_pcmcia_hw_init, | ||
92 | .socket_state = shannon_pcmcia_socket_state, | ||
93 | .configure_socket = shannon_pcmcia_configure_socket, | ||
94 | }; | ||
95 | |||
96 | int pcmcia_shannon_init(struct device *dev) | ||
97 | { | ||
98 | int ret = -ENODEV; | ||
99 | |||
100 | if (machine_is_shannon()) | ||
101 | ret = sa11xx_drv_pcmcia_probe(dev, &shannon_pcmcia_ops, 0, 2); | ||
102 | |||
103 | return ret; | ||
104 | } | ||