Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+40 -109
+2
arch/arm/mach-sa1100/Kconfig
··· 139 139 config SA1100_SHANNON 140 140 bool "Shannon" 141 141 select ARM_SA1100_CPUFREQ 142 + select REGULATOR 143 + select REGULATOR_FIXED_VOLTAGE 142 144 help 143 145 The Shannon (also known as a Tuxscreen, and also as a IS2630) was a 144 146 limited edition webphone produced by Philips. The Shannon is a SA1100
+38
arch/arm/mach-sa1100/shannon.c
··· 5 5 6 6 #include <linux/init.h> 7 7 #include <linux/device.h> 8 + #include <linux/gpio/machine.h> 8 9 #include <linux/kernel.h> 9 10 #include <linux/platform_data/sa11x0-serial.h> 10 11 #include <linux/tty.h> 11 12 #include <linux/mtd/mtd.h> 12 13 #include <linux/mtd/partitions.h> 14 + #include <linux/regulator/fixed.h> 15 + #include <linux/regulator/machine.h> 13 16 14 17 #include <video/sa1100fb.h> 15 18 ··· 75 72 .lccr3 = LCCR3_ACBsDiv(512), 76 73 }; 77 74 75 + static struct gpiod_lookup_table shannon_pcmcia0_gpio_table = { 76 + .dev_id = "sa11x0-pcmcia.0", 77 + .table = { 78 + GPIO_LOOKUP("gpio", 24, "detect", GPIO_ACTIVE_LOW), 79 + GPIO_LOOKUP("gpio", 26, "ready", GPIO_ACTIVE_HIGH), 80 + { }, 81 + }, 82 + }; 83 + 84 + static struct gpiod_lookup_table shannon_pcmcia1_gpio_table = { 85 + .dev_id = "sa11x0-pcmcia.1", 86 + .table = { 87 + GPIO_LOOKUP("gpio", 25, "detect", GPIO_ACTIVE_LOW), 88 + GPIO_LOOKUP("gpio", 27, "ready", GPIO_ACTIVE_HIGH), 89 + { }, 90 + }, 91 + }; 92 + 93 + static struct regulator_consumer_supply shannon_cf_vcc_consumers[] = { 94 + REGULATOR_SUPPLY("vcc", "sa11x0-pcmcia.0"), 95 + REGULATOR_SUPPLY("vcc", "sa11x0-pcmcia.1"), 96 + }; 97 + 98 + static struct fixed_voltage_config shannon_cf_vcc_pdata __initdata = { 99 + .supply_name = "cf-power", 100 + .microvolts = 3300000, 101 + .enabled_at_boot = 1, 102 + .gpio = -EINVAL, 103 + }; 104 + 78 105 static void __init shannon_init(void) 79 106 { 107 + sa11x0_register_fixed_regulator(0, &shannon_cf_vcc_pdata, 108 + shannon_cf_vcc_consumers, 109 + ARRAY_SIZE(shannon_cf_vcc_consumers)); 110 + sa11x0_register_pcmcia(0, &shannon_pcmcia0_gpio_table); 111 + sa11x0_register_pcmcia(1, &shannon_pcmcia1_gpio_table); 80 112 sa11x0_ppc_configure_mcp(); 81 113 sa11x0_register_lcd(&shannon_lcd_info); 82 114 sa11x0_register_mtd(&shannon_flash_data, &shannon_flash_resource, 1);
-1
drivers/pcmcia/Makefile
··· 49 49 sa1100_cs-$(CONFIG_SA1100_COLLIE) += pxa2xx_sharpsl.o 50 50 sa1100_cs-$(CONFIG_SA1100_H3100) += sa1100_h3600.o 51 51 sa1100_cs-$(CONFIG_SA1100_H3600) += sa1100_h3600.o 52 - sa1100_cs-$(CONFIG_SA1100_SHANNON) += sa1100_shannon.o 53 52 sa1100_cs-$(CONFIG_SA1100_SIMPAD) += sa1100_simpad.o 54 53 55 54 pxa2xx_cm_x2xx_cs-y += pxa2xx_cm_x2xx.o pxa2xx_cm_x255.o pxa2xx_cm_x270.o
-3
drivers/pcmcia/sa1100_generic.c
··· 101 101 #if defined(CONFIG_SA1100_H3100) || defined(CONFIG_SA1100_H3600) 102 102 pcmcia_h3600_init, 103 103 #endif 104 - #ifdef CONFIG_SA1100_SHANNON 105 - pcmcia_shannon_init, 106 - #endif 107 104 #ifdef CONFIG_SA1100_SIMPAD 108 105 pcmcia_simpad_init, 109 106 #endif
-1
drivers/pcmcia/sa1100_generic.h
··· 14 14 extern int pcmcia_h3600_init(struct device *); 15 15 extern int pcmcia_pangolin_init(struct device *); 16 16 extern int pcmcia_pfs168_init(struct device *); 17 - extern int pcmcia_shannon_init(struct device *); 18 17 extern int pcmcia_simpad_init(struct device *); 19 18 extern int pcmcia_stork_init(struct device *); 20 19 extern int pcmcia_system3_init(struct device *);
-104
drivers/pcmcia/sa1100_shannon.c
··· 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 - }