From: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
To: Russell King <linux@arm.linux.org.uk>,
Daniel Mack <daniel@zonque.org>,
Robert Jarzmik <robert.jarzmik@free.fr>,
Linus Walleij <linus.walleij@linaro.org>,
Alexandre Courbot <gnurou@gmail.com>,
Wolfram Sang <wsa@the-dreams.de>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Bryan Wu <cooloney@gmail.com>, Richard Purdie <rpurdie@rpsys.net>,
Samuel Ortiz <sameo@linux.intel.com>,
Lee Jones <lee.jones@linaro.org>, Mark Brown <broonie@kernel.org>,
Jingoo Han <jg1.han@samsung.com>,
Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>,
Tomi Valkeinen <tomi.valkeinen@ti.com>,
Liam Girdwood <lgirdwood@gmail.com>,
Andrea Adami <andrea.adami@gmail.com>
Cc: linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org,
linux-input@vger.kernel.org, linux-leds@vger.kernel.org,
linux-spi@vger.kernel.org, linux-fbdev@vger.kernel.org,
alsa-devel@alsa-project.org
Subject: [PATCH v3 11/17] ARM: sa1100: make collie use new locomo drivers
Date: Sun, 17 May 2015 19:27:51 +0300 [thread overview]
Message-ID: <1431880077-26321-12-git-send-email-dbaryshkov@gmail.com> (raw)
In-Reply-To: <1431880077-26321-1-git-send-email-dbaryshkov@gmail.com>
Switch collie to new mfd-based locomo driver. Update platform data and
add necessary spi, i2c and regulator devices.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
arch/arm/mach-sa1100/Kconfig | 1 -
arch/arm/mach-sa1100/collie.c | 213 ++++++++++++++++++++++-------
arch/arm/mach-sa1100/include/mach/collie.h | 16 ++-
3 files changed, 178 insertions(+), 52 deletions(-)
diff --git a/arch/arm/mach-sa1100/Kconfig b/arch/arm/mach-sa1100/Kconfig
index c6f6ed1..37af126 100644
--- a/arch/arm/mach-sa1100/Kconfig
+++ b/arch/arm/mach-sa1100/Kconfig
@@ -48,7 +48,6 @@ endchoice
config SA1100_COLLIE
bool "Sharp Zaurus SL5500"
# FIXME: select ARM_SA11x0_CPUFREQ
- select SHARP_LOCOMO
select SHARP_PARAM
select SHARP_SCOOP
help
diff --git a/arch/arm/mach-sa1100/collie.c b/arch/arm/mach-sa1100/collie.c
index 3cc2b71..b6dda7a 100644
--- a/arch/arm/mach-sa1100/collie.c
+++ b/arch/arm/mach-sa1100/collie.c
@@ -24,13 +24,21 @@
#include <linux/platform_data/sa11x0-serial.h>
#include <linux/platform_device.h>
#include <linux/mfd/ucb1x00.h>
+#include <linux/mfd/locomo.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
#include <linux/timer.h>
#include <linux/gpio_keys.h>
#include <linux/input.h>
+#include <linux/i2c.h>
#include <linux/gpio.h>
#include <linux/power/gpio-charger.h>
+#include <linux/gpio/machine.h>
+#include <linux/iio/machine.h>
+#include <linux/mmc/host.h>
+#include <linux/regulator/fixed.h>
+#include <linux/regulator/machine.h>
+#include <linux/spi/mmc_spi.h>
#include <video/sa1100fb.h>
@@ -47,7 +55,6 @@
#include <asm/hardware/scoop.h>
#include <asm/mach/sharpsl_param.h>
-#include <asm/hardware/locomo.h>
#include <linux/platform_data/mfd-mcp-sa11x0.h>
#include <mach/irqs.h>
@@ -151,36 +158,54 @@ static struct platform_device collie_power_device = {
.dev.platform_data = &collie_power_data,
};
-#ifdef CONFIG_SHARP_LOCOMO
/*
* low-level UART features.
*/
-struct platform_device collie_locomo_device;
+static struct gpio collie_uart_gpio[] = {
+ { COLLIE_GPIO_CTS, GPIOF_IN, "CTS" },
+ { COLLIE_GPIO_RTS, GPIOF_OUT_INIT_LOW, "RTS" },
+ { COLLIE_GPIO_DTR, GPIOF_OUT_INIT_LOW, "DTR" },
+ { COLLIE_GPIO_DSR, GPIOF_IN, "DSR" },
+};
+
+static bool collie_uart_gpio_ok;
static void collie_uart_set_mctrl(struct uart_port *port, u_int mctrl)
{
- if (mctrl & TIOCM_RTS)
- locomo_gpio_write(&collie_locomo_device.dev, LOCOMO_GPIO_RTS, 0);
- else
- locomo_gpio_write(&collie_locomo_device.dev, LOCOMO_GPIO_RTS, 1);
-
- if (mctrl & TIOCM_DTR)
- locomo_gpio_write(&collie_locomo_device.dev, LOCOMO_GPIO_DTR, 0);
- else
- locomo_gpio_write(&collie_locomo_device.dev, LOCOMO_GPIO_DTR, 1);
+ if (!collie_uart_gpio_ok) {
+ int rc = gpio_request_array(collie_uart_gpio,
+ ARRAY_SIZE(collie_uart_gpio));
+ if (rc)
+ pr_err("collie_uart_set_mctrl: gpio request %d\n", rc);
+ else
+ collie_uart_gpio_ok = true;
+ }
+
+ if (collie_uart_gpio_ok) {
+ gpio_set_value(COLLIE_GPIO_RTS, !(mctrl & TIOCM_RTS));
+ gpio_set_value(COLLIE_GPIO_DTR, !(mctrl & TIOCM_DTR));
+ }
}
static u_int collie_uart_get_mctrl(struct uart_port *port)
{
int ret = TIOCM_CD;
- unsigned int r;
- r = locomo_gpio_read_output(&collie_locomo_device.dev, LOCOMO_GPIO_CTS & LOCOMO_GPIO_DSR);
- if (r == -ENODEV)
+ if (!collie_uart_gpio_ok) {
+ int rc = gpio_request_array(collie_uart_gpio,
+ ARRAY_SIZE(collie_uart_gpio));
+ if (rc)
+ pr_err("collie_uart_get_mctrl: gpio request %d\n", rc);
+ else
+ collie_uart_gpio_ok = true;
+ }
+
+ if (!collie_uart_gpio_ok)
return ret;
- if (r & LOCOMO_GPIO_CTS)
+
+ if (gpio_get_value(COLLIE_GPIO_CTS))
ret |= TIOCM_CTS;
- if (r & LOCOMO_GPIO_DSR)
+ if (gpio_get_value(COLLIE_GPIO_DSR))
ret |= TIOCM_DSR;
return ret;
@@ -191,33 +216,35 @@ static struct sa1100_port_fns collie_port_fns __initdata = {
.get_mctrl = collie_uart_get_mctrl,
};
-static int collie_uart_probe(struct locomo_dev *dev)
-{
- return 0;
-}
-
-static int collie_uart_remove(struct locomo_dev *dev)
-{
- return 0;
-}
+static struct regulator_consumer_supply collie_amp_on_consumer_supplies[] = {
+ REGULATOR_SUPPLY("VCC", "1-004e"),
+};
-static struct locomo_driver collie_uart_driver = {
- .drv = {
- .name = "collie_uart",
+static struct regulator_init_data collie_amp_on_init_data = {
+ .constraints = {
+ .name = "AMP_ON",
+ .valid_ops_mask = REGULATOR_CHANGE_STATUS,
},
- .devid = LOCOMO_DEVID_UART,
- .probe = collie_uart_probe,
- .remove = collie_uart_remove,
+ .consumer_supplies = collie_amp_on_consumer_supplies,
+ .num_consumer_supplies = ARRAY_SIZE(collie_amp_on_consumer_supplies),
};
-static int __init collie_uart_init(void)
-{
- return locomo_driver_register(&collie_uart_driver);
-}
-device_initcall(collie_uart_init);
-
-#endif
+static struct fixed_voltage_config collie_amp_on_data = {
+ .supply_name = "amp_on",
+ .microvolts = 3300000,
+ .gpio = COLLIE_GPIO_AMP2_ON,
+ .startup_delay = 5,
+ .enable_high = 1,
+ .init_data = &collie_amp_on_init_data,
+};
+static struct platform_device collie_amp_on_device = {
+ .name = "reg-fixed-voltage",
+ .id = -1,
+ .dev = {
+ .platform_data = &collie_amp_on_data,
+ },
+};
static struct resource locomo_resources[] = {
[0] = DEFINE_RES_MEM(0x40000000, SZ_8K),
@@ -225,14 +252,15 @@ static struct resource locomo_resources[] = {
};
static struct locomo_platform_data locomo_info = {
- .irq_base = IRQ_BOARD_START,
+ .gpio_base = COLLIE_LOCOMO_GPIO_BASE,
+ .comadj = 128,
};
-struct platform_device collie_locomo_device = {
+static struct platform_device collie_locomo_device = {
.name = "locomo",
.id = 0,
.dev = {
- .platform_data = &locomo_info,
+ .platform_data = &locomo_info,
},
.num_resources = ARRAY_SIZE(locomo_resources),
.resource = locomo_resources,
@@ -270,7 +298,55 @@ static struct platform_device collie_gpio_keys_device = {
},
};
+static int collie_mmc_init(struct device *dev,
+ irqreturn_t (*isr)(int, void*), void *mmc)
+{
+ int ret;
+
+ ret = gpio_request(COLLIE_GPIO_CARD_POWER, "MMC power");
+ if (!ret)
+ ret = gpio_direction_output(COLLIE_GPIO_CARD_POWER, 0);
+ if (ret)
+ gpio_free(COLLIE_GPIO_CARD_POWER);
+ return ret;
+}
+
+static void collie_mmc_exit(struct device *dev, void *mmc)
+{
+ gpio_free(COLLIE_GPIO_CARD_POWER);
+}
+
+static void collie_mmc_setpower(struct device *dev, unsigned int mask)
+{
+ gpio_set_value(COLLIE_GPIO_CARD_POWER, !!mask);
+}
+
+static struct mmc_spi_platform_data collie_mmc_data = {
+ .init = collie_mmc_init,
+ .exit = collie_mmc_exit,
+ .setpower = collie_mmc_setpower,
+ .detect_delay = 200,
+ .powerup_msecs = 200,
+ .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
+ .flags = MMC_SPI_USE_CD_GPIO | MMC_SPI_USE_RO_GPIO,
+ .cd_gpio = COLLIE_GPIO_CARD_DETECT,
+ .ro_gpio = COLLIE_GPIO_CARD_RO,
+ .caps2 = MMC_CAP2_RO_ACTIVE_HIGH,
+};
+
+static struct spi_board_info collie_spi_board_info[] __initdata = {
+ {
+ .modalias = "mmc_spi",
+ .platform_data = &collie_mmc_data,
+ .max_speed_hz = 25000000,
+ .bus_num = 0,
+ .chip_select = 0,
+ .mode = SPI_MODE_0,
+ },
+};
+
static struct platform_device *devices[] __initdata = {
+ &collie_amp_on_device,
&collie_locomo_device,
&colliescoop_device,
&collie_power_device,
@@ -347,10 +423,39 @@ static struct sa1100fb_mach_info collie_lcd_info = {
.lccr0 = LCCR0_Color | LCCR0_Sngl | LCCR0_Act,
.lccr3 = LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(2),
+};
-#ifdef CONFIG_BACKLIGHT_LOCOMO
- .lcd_power = locomolcd_power
-#endif
+static struct iio_map locomo_iio_map[] = {
+ {
+ .consumer_dev_name = "locomo-lcd.0",
+ .consumer_channel = "comadj",
+ .adc_channel_label = "CH0",
+ },
+ { }
+};
+
+static struct i2c_board_info locomo_i2c_devs[] __initdata = {
+ {
+ I2C_BOARD_INFO("m62332", 0x4e),
+ .platform_data = locomo_iio_map,
+ },
+};
+
+static struct gpiod_lookup_table collie_bl_gpios_table = {
+ .dev_id = "locomo-backlight.0",
+ .table = {
+ GPIO_LOOKUP("locomo-gpio", 9, "flvr", GPIO_ACTIVE_HIGH),
+ { },
+ },
+}, collie_lcd_gpios_table = {
+ .dev_id = "locomo-lcd.0",
+ .table = {
+ GPIO_LOOKUP("locomo-gpio", 4, "VSHA", GPIO_ACTIVE_HIGH),
+ GPIO_LOOKUP("locomo-gpio", 5, "VSHD", GPIO_ACTIVE_HIGH),
+ GPIO_LOOKUP("locomo-gpio", 6, "Vee", GPIO_ACTIVE_HIGH),
+ GPIO_LOOKUP("locomo-gpio", 7, "MOD", GPIO_ACTIVE_HIGH),
+ { },
+ },
};
static void __init collie_init(void)
@@ -381,11 +486,19 @@ static void __init collie_init(void)
GPSR |= _COLLIE_GPIO_UCB1x00_RESET;
+ sharpsl_save_param();
+
sa11x0_ppc_configure_mcp();
platform_scoop_config = &collie_pcmcia_config;
+ if (sharpsl_param.comadj != -1)
+ locomo_info.comadj = sharpsl_param.comadj;
+
+ gpiod_add_lookup_table(&collie_bl_gpios_table);
+ gpiod_add_lookup_table(&collie_lcd_gpios_table);
+
ret = platform_add_devices(devices, ARRAY_SIZE(devices));
if (ret) {
printk(KERN_WARNING "collie: Unable to register LoCoMo device\n");
@@ -397,7 +510,13 @@ static void __init collie_init(void)
sa11x0_register_mcp(&collie_mcp_data);
sa11x0_register_irda(&collie_ir_data);
- sharpsl_save_param();
+ i2c_register_board_info(1,
+ locomo_i2c_devs, ARRAY_SIZE(locomo_i2c_devs));
+
+ spi_register_board_info(collie_spi_board_info,
+ ARRAY_SIZE(collie_spi_board_info));
+
+ regulator_has_full_constraints();
}
static struct map_desc collie_io_desc[] __initdata = {
@@ -419,9 +538,7 @@ static void __init collie_map_io(void)
sa1100_map_io();
iotable_init(collie_io_desc, ARRAY_SIZE(collie_io_desc));
-#ifdef CONFIG_SHARP_LOCOMO
sa1100_register_uart_fns(&collie_port_fns);
-#endif
sa1100_register_uart(0, 3);
sa1100_register_uart(1, 1);
}
diff --git a/arch/arm/mach-sa1100/include/mach/collie.h b/arch/arm/mach-sa1100/include/mach/collie.h
index b478ca1..2e3bf80 100644
--- a/arch/arm/mach-sa1100/include/mach/collie.h
+++ b/arch/arm/mach-sa1100/include/mach/collie.h
@@ -24,12 +24,12 @@ extern void locomolcd_power(int on);
#define COLLIE_SCP_MUTE_L SCOOP_GPCR_PA14
#define COLLIE_SCP_MUTE_R SCOOP_GPCR_PA15
#define COLLIE_SCP_5VON SCOOP_GPCR_PA16
-#define COLLIE_SCP_AMP_ON SCOOP_GPCR_PA17
+#define COLLIE_GPIO_AMP2_ON (COLLIE_SCOOP_GPIO_BASE + 6)
#define COLLIE_GPIO_VPEN (COLLIE_SCOOP_GPIO_BASE + 7)
#define COLLIE_SCP_LB_VOL_CHG SCOOP_GPCR_PA19
#define COLLIE_SCOOP_IO_DIR (COLLIE_SCP_MUTE_L | COLLIE_SCP_MUTE_R | \
- COLLIE_SCP_5VON | COLLIE_SCP_AMP_ON | \
+ COLLIE_SCP_5VON | \
COLLIE_SCP_LB_VOL_CHG)
#define COLLIE_SCOOP_IO_OUT (COLLIE_SCP_MUTE_L | COLLIE_SCP_MUTE_R)
@@ -81,7 +81,7 @@ extern void locomolcd_power(int on);
#define COLLIE_TC35143_GPIO_TBL_CHK UCB_IO_1
#define COLLIE_TC35143_GPIO_VPEN_ON UCB_IO_2
#define COLLIE_GPIO_IR_ON (COLLIE_TC35143_GPIO_BASE + 3)
-#define COLLIE_TC35143_GPIO_AMP_ON UCB_IO_4
+#define COLLIE_GPIO_AMP1_ON (COLLIE_TC35143_GPIO_BASE + 4)
#define COLLIE_TC35143_GPIO_VERSION1 UCB_IO_5
#define COLLIE_TC35143_GPIO_FS8KLPF UCB_IO_5
#define COLLIE_TC35143_GPIO_BUZZER_BIAS UCB_IO_6
@@ -92,4 +92,14 @@ extern void locomolcd_power(int on);
#define COLLIE_TC35143_GPIO_OUT (UCB_IO_1 | UCB_IO_3 | UCB_IO_4 \
| UCB_IO_6)
+/* GPIOs on LoCoMo GA */
+#define COLLIE_LOCOMO_GPIO_BASE (GPIO_MAX + 13 + 10)
+#define COLLIE_GPIO_RTS (COLLIE_LOCOMO_GPIO_BASE + 0)
+#define COLLIE_GPIO_CTS (COLLIE_LOCOMO_GPIO_BASE + 1)
+#define COLLIE_GPIO_DSR (COLLIE_LOCOMO_GPIO_BASE + 2)
+#define COLLIE_GPIO_DTR (COLLIE_LOCOMO_GPIO_BASE + 3)
+#define COLLIE_GPIO_CARD_DETECT (COLLIE_LOCOMO_GPIO_BASE + 13)
+#define COLLIE_GPIO_CARD_RO (COLLIE_LOCOMO_GPIO_BASE + 14)
+#define COLLIE_GPIO_CARD_POWER (COLLIE_LOCOMO_GPIO_BASE + 15)
+
#endif
--
2.1.4
WARNING: multiple messages have this Message-ID (diff)
From: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
To: Russell King <linux@arm.linux.org.uk>,
Daniel Mack <daniel@zonque.org>,
Robert Jarzmik <robert.jarzmik@free.fr>,
Linus Walleij <linus.walleij@linaro.org>,
Alexandre Courbot <gnurou@gmail.com>,
Wolfram Sang <wsa@the-dreams.de>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Bryan Wu <cooloney@gmail.com>, Richard Purdie <rpurdie@rpsys.net>,
Samuel Ortiz <sameo@linux.intel.com>,
Lee Jones <lee.jones@linaro.org>, Mark Brown <broonie@kernel.org>,
Jingoo Han <jg1.han@samsung.com>,
Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>,
Tomi Valkeinen <tomi.valkeinen@ti.com>,
Liam Girdwood <lgirdwood@gmail.com>,
Andrea Adami <andrea.adami@gmail.com>
Cc: linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org,
linux-input@vger.kernel.org, linux-leds@vger.kernel.org,
linux-spi@vger.kernel.org, linux-fbdev@vger.kernel.org,
alsa-devel@alsa-project.org
Subject: [PATCH v3 11/17] ARM: sa1100: make collie use new locomo drivers
Date: Sun, 17 May 2015 16:27:51 +0000 [thread overview]
Message-ID: <1431880077-26321-12-git-send-email-dbaryshkov@gmail.com> (raw)
In-Reply-To: <1431880077-26321-1-git-send-email-dbaryshkov@gmail.com>
Switch collie to new mfd-based locomo driver. Update platform data and
add necessary spi, i2c and regulator devices.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
arch/arm/mach-sa1100/Kconfig | 1 -
arch/arm/mach-sa1100/collie.c | 213 ++++++++++++++++++++++-------
arch/arm/mach-sa1100/include/mach/collie.h | 16 ++-
3 files changed, 178 insertions(+), 52 deletions(-)
diff --git a/arch/arm/mach-sa1100/Kconfig b/arch/arm/mach-sa1100/Kconfig
index c6f6ed1..37af126 100644
--- a/arch/arm/mach-sa1100/Kconfig
+++ b/arch/arm/mach-sa1100/Kconfig
@@ -48,7 +48,6 @@ endchoice
config SA1100_COLLIE
bool "Sharp Zaurus SL5500"
# FIXME: select ARM_SA11x0_CPUFREQ
- select SHARP_LOCOMO
select SHARP_PARAM
select SHARP_SCOOP
help
diff --git a/arch/arm/mach-sa1100/collie.c b/arch/arm/mach-sa1100/collie.c
index 3cc2b71..b6dda7a 100644
--- a/arch/arm/mach-sa1100/collie.c
+++ b/arch/arm/mach-sa1100/collie.c
@@ -24,13 +24,21 @@
#include <linux/platform_data/sa11x0-serial.h>
#include <linux/platform_device.h>
#include <linux/mfd/ucb1x00.h>
+#include <linux/mfd/locomo.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
#include <linux/timer.h>
#include <linux/gpio_keys.h>
#include <linux/input.h>
+#include <linux/i2c.h>
#include <linux/gpio.h>
#include <linux/power/gpio-charger.h>
+#include <linux/gpio/machine.h>
+#include <linux/iio/machine.h>
+#include <linux/mmc/host.h>
+#include <linux/regulator/fixed.h>
+#include <linux/regulator/machine.h>
+#include <linux/spi/mmc_spi.h>
#include <video/sa1100fb.h>
@@ -47,7 +55,6 @@
#include <asm/hardware/scoop.h>
#include <asm/mach/sharpsl_param.h>
-#include <asm/hardware/locomo.h>
#include <linux/platform_data/mfd-mcp-sa11x0.h>
#include <mach/irqs.h>
@@ -151,36 +158,54 @@ static struct platform_device collie_power_device = {
.dev.platform_data = &collie_power_data,
};
-#ifdef CONFIG_SHARP_LOCOMO
/*
* low-level UART features.
*/
-struct platform_device collie_locomo_device;
+static struct gpio collie_uart_gpio[] = {
+ { COLLIE_GPIO_CTS, GPIOF_IN, "CTS" },
+ { COLLIE_GPIO_RTS, GPIOF_OUT_INIT_LOW, "RTS" },
+ { COLLIE_GPIO_DTR, GPIOF_OUT_INIT_LOW, "DTR" },
+ { COLLIE_GPIO_DSR, GPIOF_IN, "DSR" },
+};
+
+static bool collie_uart_gpio_ok;
static void collie_uart_set_mctrl(struct uart_port *port, u_int mctrl)
{
- if (mctrl & TIOCM_RTS)
- locomo_gpio_write(&collie_locomo_device.dev, LOCOMO_GPIO_RTS, 0);
- else
- locomo_gpio_write(&collie_locomo_device.dev, LOCOMO_GPIO_RTS, 1);
-
- if (mctrl & TIOCM_DTR)
- locomo_gpio_write(&collie_locomo_device.dev, LOCOMO_GPIO_DTR, 0);
- else
- locomo_gpio_write(&collie_locomo_device.dev, LOCOMO_GPIO_DTR, 1);
+ if (!collie_uart_gpio_ok) {
+ int rc = gpio_request_array(collie_uart_gpio,
+ ARRAY_SIZE(collie_uart_gpio));
+ if (rc)
+ pr_err("collie_uart_set_mctrl: gpio request %d\n", rc);
+ else
+ collie_uart_gpio_ok = true;
+ }
+
+ if (collie_uart_gpio_ok) {
+ gpio_set_value(COLLIE_GPIO_RTS, !(mctrl & TIOCM_RTS));
+ gpio_set_value(COLLIE_GPIO_DTR, !(mctrl & TIOCM_DTR));
+ }
}
static u_int collie_uart_get_mctrl(struct uart_port *port)
{
int ret = TIOCM_CD;
- unsigned int r;
- r = locomo_gpio_read_output(&collie_locomo_device.dev, LOCOMO_GPIO_CTS & LOCOMO_GPIO_DSR);
- if (r = -ENODEV)
+ if (!collie_uart_gpio_ok) {
+ int rc = gpio_request_array(collie_uart_gpio,
+ ARRAY_SIZE(collie_uart_gpio));
+ if (rc)
+ pr_err("collie_uart_get_mctrl: gpio request %d\n", rc);
+ else
+ collie_uart_gpio_ok = true;
+ }
+
+ if (!collie_uart_gpio_ok)
return ret;
- if (r & LOCOMO_GPIO_CTS)
+
+ if (gpio_get_value(COLLIE_GPIO_CTS))
ret |= TIOCM_CTS;
- if (r & LOCOMO_GPIO_DSR)
+ if (gpio_get_value(COLLIE_GPIO_DSR))
ret |= TIOCM_DSR;
return ret;
@@ -191,33 +216,35 @@ static struct sa1100_port_fns collie_port_fns __initdata = {
.get_mctrl = collie_uart_get_mctrl,
};
-static int collie_uart_probe(struct locomo_dev *dev)
-{
- return 0;
-}
-
-static int collie_uart_remove(struct locomo_dev *dev)
-{
- return 0;
-}
+static struct regulator_consumer_supply collie_amp_on_consumer_supplies[] = {
+ REGULATOR_SUPPLY("VCC", "1-004e"),
+};
-static struct locomo_driver collie_uart_driver = {
- .drv = {
- .name = "collie_uart",
+static struct regulator_init_data collie_amp_on_init_data = {
+ .constraints = {
+ .name = "AMP_ON",
+ .valid_ops_mask = REGULATOR_CHANGE_STATUS,
},
- .devid = LOCOMO_DEVID_UART,
- .probe = collie_uart_probe,
- .remove = collie_uart_remove,
+ .consumer_supplies = collie_amp_on_consumer_supplies,
+ .num_consumer_supplies = ARRAY_SIZE(collie_amp_on_consumer_supplies),
};
-static int __init collie_uart_init(void)
-{
- return locomo_driver_register(&collie_uart_driver);
-}
-device_initcall(collie_uart_init);
-
-#endif
+static struct fixed_voltage_config collie_amp_on_data = {
+ .supply_name = "amp_on",
+ .microvolts = 3300000,
+ .gpio = COLLIE_GPIO_AMP2_ON,
+ .startup_delay = 5,
+ .enable_high = 1,
+ .init_data = &collie_amp_on_init_data,
+};
+static struct platform_device collie_amp_on_device = {
+ .name = "reg-fixed-voltage",
+ .id = -1,
+ .dev = {
+ .platform_data = &collie_amp_on_data,
+ },
+};
static struct resource locomo_resources[] = {
[0] = DEFINE_RES_MEM(0x40000000, SZ_8K),
@@ -225,14 +252,15 @@ static struct resource locomo_resources[] = {
};
static struct locomo_platform_data locomo_info = {
- .irq_base = IRQ_BOARD_START,
+ .gpio_base = COLLIE_LOCOMO_GPIO_BASE,
+ .comadj = 128,
};
-struct platform_device collie_locomo_device = {
+static struct platform_device collie_locomo_device = {
.name = "locomo",
.id = 0,
.dev = {
- .platform_data = &locomo_info,
+ .platform_data = &locomo_info,
},
.num_resources = ARRAY_SIZE(locomo_resources),
.resource = locomo_resources,
@@ -270,7 +298,55 @@ static struct platform_device collie_gpio_keys_device = {
},
};
+static int collie_mmc_init(struct device *dev,
+ irqreturn_t (*isr)(int, void*), void *mmc)
+{
+ int ret;
+
+ ret = gpio_request(COLLIE_GPIO_CARD_POWER, "MMC power");
+ if (!ret)
+ ret = gpio_direction_output(COLLIE_GPIO_CARD_POWER, 0);
+ if (ret)
+ gpio_free(COLLIE_GPIO_CARD_POWER);
+ return ret;
+}
+
+static void collie_mmc_exit(struct device *dev, void *mmc)
+{
+ gpio_free(COLLIE_GPIO_CARD_POWER);
+}
+
+static void collie_mmc_setpower(struct device *dev, unsigned int mask)
+{
+ gpio_set_value(COLLIE_GPIO_CARD_POWER, !!mask);
+}
+
+static struct mmc_spi_platform_data collie_mmc_data = {
+ .init = collie_mmc_init,
+ .exit = collie_mmc_exit,
+ .setpower = collie_mmc_setpower,
+ .detect_delay = 200,
+ .powerup_msecs = 200,
+ .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
+ .flags = MMC_SPI_USE_CD_GPIO | MMC_SPI_USE_RO_GPIO,
+ .cd_gpio = COLLIE_GPIO_CARD_DETECT,
+ .ro_gpio = COLLIE_GPIO_CARD_RO,
+ .caps2 = MMC_CAP2_RO_ACTIVE_HIGH,
+};
+
+static struct spi_board_info collie_spi_board_info[] __initdata = {
+ {
+ .modalias = "mmc_spi",
+ .platform_data = &collie_mmc_data,
+ .max_speed_hz = 25000000,
+ .bus_num = 0,
+ .chip_select = 0,
+ .mode = SPI_MODE_0,
+ },
+};
+
static struct platform_device *devices[] __initdata = {
+ &collie_amp_on_device,
&collie_locomo_device,
&colliescoop_device,
&collie_power_device,
@@ -347,10 +423,39 @@ static struct sa1100fb_mach_info collie_lcd_info = {
.lccr0 = LCCR0_Color | LCCR0_Sngl | LCCR0_Act,
.lccr3 = LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(2),
+};
-#ifdef CONFIG_BACKLIGHT_LOCOMO
- .lcd_power = locomolcd_power
-#endif
+static struct iio_map locomo_iio_map[] = {
+ {
+ .consumer_dev_name = "locomo-lcd.0",
+ .consumer_channel = "comadj",
+ .adc_channel_label = "CH0",
+ },
+ { }
+};
+
+static struct i2c_board_info locomo_i2c_devs[] __initdata = {
+ {
+ I2C_BOARD_INFO("m62332", 0x4e),
+ .platform_data = locomo_iio_map,
+ },
+};
+
+static struct gpiod_lookup_table collie_bl_gpios_table = {
+ .dev_id = "locomo-backlight.0",
+ .table = {
+ GPIO_LOOKUP("locomo-gpio", 9, "flvr", GPIO_ACTIVE_HIGH),
+ { },
+ },
+}, collie_lcd_gpios_table = {
+ .dev_id = "locomo-lcd.0",
+ .table = {
+ GPIO_LOOKUP("locomo-gpio", 4, "VSHA", GPIO_ACTIVE_HIGH),
+ GPIO_LOOKUP("locomo-gpio", 5, "VSHD", GPIO_ACTIVE_HIGH),
+ GPIO_LOOKUP("locomo-gpio", 6, "Vee", GPIO_ACTIVE_HIGH),
+ GPIO_LOOKUP("locomo-gpio", 7, "MOD", GPIO_ACTIVE_HIGH),
+ { },
+ },
};
static void __init collie_init(void)
@@ -381,11 +486,19 @@ static void __init collie_init(void)
GPSR |= _COLLIE_GPIO_UCB1x00_RESET;
+ sharpsl_save_param();
+
sa11x0_ppc_configure_mcp();
platform_scoop_config = &collie_pcmcia_config;
+ if (sharpsl_param.comadj != -1)
+ locomo_info.comadj = sharpsl_param.comadj;
+
+ gpiod_add_lookup_table(&collie_bl_gpios_table);
+ gpiod_add_lookup_table(&collie_lcd_gpios_table);
+
ret = platform_add_devices(devices, ARRAY_SIZE(devices));
if (ret) {
printk(KERN_WARNING "collie: Unable to register LoCoMo device\n");
@@ -397,7 +510,13 @@ static void __init collie_init(void)
sa11x0_register_mcp(&collie_mcp_data);
sa11x0_register_irda(&collie_ir_data);
- sharpsl_save_param();
+ i2c_register_board_info(1,
+ locomo_i2c_devs, ARRAY_SIZE(locomo_i2c_devs));
+
+ spi_register_board_info(collie_spi_board_info,
+ ARRAY_SIZE(collie_spi_board_info));
+
+ regulator_has_full_constraints();
}
static struct map_desc collie_io_desc[] __initdata = {
@@ -419,9 +538,7 @@ static void __init collie_map_io(void)
sa1100_map_io();
iotable_init(collie_io_desc, ARRAY_SIZE(collie_io_desc));
-#ifdef CONFIG_SHARP_LOCOMO
sa1100_register_uart_fns(&collie_port_fns);
-#endif
sa1100_register_uart(0, 3);
sa1100_register_uart(1, 1);
}
diff --git a/arch/arm/mach-sa1100/include/mach/collie.h b/arch/arm/mach-sa1100/include/mach/collie.h
index b478ca1..2e3bf80 100644
--- a/arch/arm/mach-sa1100/include/mach/collie.h
+++ b/arch/arm/mach-sa1100/include/mach/collie.h
@@ -24,12 +24,12 @@ extern void locomolcd_power(int on);
#define COLLIE_SCP_MUTE_L SCOOP_GPCR_PA14
#define COLLIE_SCP_MUTE_R SCOOP_GPCR_PA15
#define COLLIE_SCP_5VON SCOOP_GPCR_PA16
-#define COLLIE_SCP_AMP_ON SCOOP_GPCR_PA17
+#define COLLIE_GPIO_AMP2_ON (COLLIE_SCOOP_GPIO_BASE + 6)
#define COLLIE_GPIO_VPEN (COLLIE_SCOOP_GPIO_BASE + 7)
#define COLLIE_SCP_LB_VOL_CHG SCOOP_GPCR_PA19
#define COLLIE_SCOOP_IO_DIR (COLLIE_SCP_MUTE_L | COLLIE_SCP_MUTE_R | \
- COLLIE_SCP_5VON | COLLIE_SCP_AMP_ON | \
+ COLLIE_SCP_5VON | \
COLLIE_SCP_LB_VOL_CHG)
#define COLLIE_SCOOP_IO_OUT (COLLIE_SCP_MUTE_L | COLLIE_SCP_MUTE_R)
@@ -81,7 +81,7 @@ extern void locomolcd_power(int on);
#define COLLIE_TC35143_GPIO_TBL_CHK UCB_IO_1
#define COLLIE_TC35143_GPIO_VPEN_ON UCB_IO_2
#define COLLIE_GPIO_IR_ON (COLLIE_TC35143_GPIO_BASE + 3)
-#define COLLIE_TC35143_GPIO_AMP_ON UCB_IO_4
+#define COLLIE_GPIO_AMP1_ON (COLLIE_TC35143_GPIO_BASE + 4)
#define COLLIE_TC35143_GPIO_VERSION1 UCB_IO_5
#define COLLIE_TC35143_GPIO_FS8KLPF UCB_IO_5
#define COLLIE_TC35143_GPIO_BUZZER_BIAS UCB_IO_6
@@ -92,4 +92,14 @@ extern void locomolcd_power(int on);
#define COLLIE_TC35143_GPIO_OUT (UCB_IO_1 | UCB_IO_3 | UCB_IO_4 \
| UCB_IO_6)
+/* GPIOs on LoCoMo GA */
+#define COLLIE_LOCOMO_GPIO_BASE (GPIO_MAX + 13 + 10)
+#define COLLIE_GPIO_RTS (COLLIE_LOCOMO_GPIO_BASE + 0)
+#define COLLIE_GPIO_CTS (COLLIE_LOCOMO_GPIO_BASE + 1)
+#define COLLIE_GPIO_DSR (COLLIE_LOCOMO_GPIO_BASE + 2)
+#define COLLIE_GPIO_DTR (COLLIE_LOCOMO_GPIO_BASE + 3)
+#define COLLIE_GPIO_CARD_DETECT (COLLIE_LOCOMO_GPIO_BASE + 13)
+#define COLLIE_GPIO_CARD_RO (COLLIE_LOCOMO_GPIO_BASE + 14)
+#define COLLIE_GPIO_CARD_POWER (COLLIE_LOCOMO_GPIO_BASE + 15)
+
#endif
--
2.1.4
WARNING: multiple messages have this Message-ID (diff)
From: dbaryshkov@gmail.com (Dmitry Eremin-Solenikov)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 11/17] ARM: sa1100: make collie use new locomo drivers
Date: Sun, 17 May 2015 19:27:51 +0300 [thread overview]
Message-ID: <1431880077-26321-12-git-send-email-dbaryshkov@gmail.com> (raw)
In-Reply-To: <1431880077-26321-1-git-send-email-dbaryshkov@gmail.com>
Switch collie to new mfd-based locomo driver. Update platform data and
add necessary spi, i2c and regulator devices.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
arch/arm/mach-sa1100/Kconfig | 1 -
arch/arm/mach-sa1100/collie.c | 213 ++++++++++++++++++++++-------
arch/arm/mach-sa1100/include/mach/collie.h | 16 ++-
3 files changed, 178 insertions(+), 52 deletions(-)
diff --git a/arch/arm/mach-sa1100/Kconfig b/arch/arm/mach-sa1100/Kconfig
index c6f6ed1..37af126 100644
--- a/arch/arm/mach-sa1100/Kconfig
+++ b/arch/arm/mach-sa1100/Kconfig
@@ -48,7 +48,6 @@ endchoice
config SA1100_COLLIE
bool "Sharp Zaurus SL5500"
# FIXME: select ARM_SA11x0_CPUFREQ
- select SHARP_LOCOMO
select SHARP_PARAM
select SHARP_SCOOP
help
diff --git a/arch/arm/mach-sa1100/collie.c b/arch/arm/mach-sa1100/collie.c
index 3cc2b71..b6dda7a 100644
--- a/arch/arm/mach-sa1100/collie.c
+++ b/arch/arm/mach-sa1100/collie.c
@@ -24,13 +24,21 @@
#include <linux/platform_data/sa11x0-serial.h>
#include <linux/platform_device.h>
#include <linux/mfd/ucb1x00.h>
+#include <linux/mfd/locomo.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
#include <linux/timer.h>
#include <linux/gpio_keys.h>
#include <linux/input.h>
+#include <linux/i2c.h>
#include <linux/gpio.h>
#include <linux/power/gpio-charger.h>
+#include <linux/gpio/machine.h>
+#include <linux/iio/machine.h>
+#include <linux/mmc/host.h>
+#include <linux/regulator/fixed.h>
+#include <linux/regulator/machine.h>
+#include <linux/spi/mmc_spi.h>
#include <video/sa1100fb.h>
@@ -47,7 +55,6 @@
#include <asm/hardware/scoop.h>
#include <asm/mach/sharpsl_param.h>
-#include <asm/hardware/locomo.h>
#include <linux/platform_data/mfd-mcp-sa11x0.h>
#include <mach/irqs.h>
@@ -151,36 +158,54 @@ static struct platform_device collie_power_device = {
.dev.platform_data = &collie_power_data,
};
-#ifdef CONFIG_SHARP_LOCOMO
/*
* low-level UART features.
*/
-struct platform_device collie_locomo_device;
+static struct gpio collie_uart_gpio[] = {
+ { COLLIE_GPIO_CTS, GPIOF_IN, "CTS" },
+ { COLLIE_GPIO_RTS, GPIOF_OUT_INIT_LOW, "RTS" },
+ { COLLIE_GPIO_DTR, GPIOF_OUT_INIT_LOW, "DTR" },
+ { COLLIE_GPIO_DSR, GPIOF_IN, "DSR" },
+};
+
+static bool collie_uart_gpio_ok;
static void collie_uart_set_mctrl(struct uart_port *port, u_int mctrl)
{
- if (mctrl & TIOCM_RTS)
- locomo_gpio_write(&collie_locomo_device.dev, LOCOMO_GPIO_RTS, 0);
- else
- locomo_gpio_write(&collie_locomo_device.dev, LOCOMO_GPIO_RTS, 1);
-
- if (mctrl & TIOCM_DTR)
- locomo_gpio_write(&collie_locomo_device.dev, LOCOMO_GPIO_DTR, 0);
- else
- locomo_gpio_write(&collie_locomo_device.dev, LOCOMO_GPIO_DTR, 1);
+ if (!collie_uart_gpio_ok) {
+ int rc = gpio_request_array(collie_uart_gpio,
+ ARRAY_SIZE(collie_uart_gpio));
+ if (rc)
+ pr_err("collie_uart_set_mctrl: gpio request %d\n", rc);
+ else
+ collie_uart_gpio_ok = true;
+ }
+
+ if (collie_uart_gpio_ok) {
+ gpio_set_value(COLLIE_GPIO_RTS, !(mctrl & TIOCM_RTS));
+ gpio_set_value(COLLIE_GPIO_DTR, !(mctrl & TIOCM_DTR));
+ }
}
static u_int collie_uart_get_mctrl(struct uart_port *port)
{
int ret = TIOCM_CD;
- unsigned int r;
- r = locomo_gpio_read_output(&collie_locomo_device.dev, LOCOMO_GPIO_CTS & LOCOMO_GPIO_DSR);
- if (r == -ENODEV)
+ if (!collie_uart_gpio_ok) {
+ int rc = gpio_request_array(collie_uart_gpio,
+ ARRAY_SIZE(collie_uart_gpio));
+ if (rc)
+ pr_err("collie_uart_get_mctrl: gpio request %d\n", rc);
+ else
+ collie_uart_gpio_ok = true;
+ }
+
+ if (!collie_uart_gpio_ok)
return ret;
- if (r & LOCOMO_GPIO_CTS)
+
+ if (gpio_get_value(COLLIE_GPIO_CTS))
ret |= TIOCM_CTS;
- if (r & LOCOMO_GPIO_DSR)
+ if (gpio_get_value(COLLIE_GPIO_DSR))
ret |= TIOCM_DSR;
return ret;
@@ -191,33 +216,35 @@ static struct sa1100_port_fns collie_port_fns __initdata = {
.get_mctrl = collie_uart_get_mctrl,
};
-static int collie_uart_probe(struct locomo_dev *dev)
-{
- return 0;
-}
-
-static int collie_uart_remove(struct locomo_dev *dev)
-{
- return 0;
-}
+static struct regulator_consumer_supply collie_amp_on_consumer_supplies[] = {
+ REGULATOR_SUPPLY("VCC", "1-004e"),
+};
-static struct locomo_driver collie_uart_driver = {
- .drv = {
- .name = "collie_uart",
+static struct regulator_init_data collie_amp_on_init_data = {
+ .constraints = {
+ .name = "AMP_ON",
+ .valid_ops_mask = REGULATOR_CHANGE_STATUS,
},
- .devid = LOCOMO_DEVID_UART,
- .probe = collie_uart_probe,
- .remove = collie_uart_remove,
+ .consumer_supplies = collie_amp_on_consumer_supplies,
+ .num_consumer_supplies = ARRAY_SIZE(collie_amp_on_consumer_supplies),
};
-static int __init collie_uart_init(void)
-{
- return locomo_driver_register(&collie_uart_driver);
-}
-device_initcall(collie_uart_init);
-
-#endif
+static struct fixed_voltage_config collie_amp_on_data = {
+ .supply_name = "amp_on",
+ .microvolts = 3300000,
+ .gpio = COLLIE_GPIO_AMP2_ON,
+ .startup_delay = 5,
+ .enable_high = 1,
+ .init_data = &collie_amp_on_init_data,
+};
+static struct platform_device collie_amp_on_device = {
+ .name = "reg-fixed-voltage",
+ .id = -1,
+ .dev = {
+ .platform_data = &collie_amp_on_data,
+ },
+};
static struct resource locomo_resources[] = {
[0] = DEFINE_RES_MEM(0x40000000, SZ_8K),
@@ -225,14 +252,15 @@ static struct resource locomo_resources[] = {
};
static struct locomo_platform_data locomo_info = {
- .irq_base = IRQ_BOARD_START,
+ .gpio_base = COLLIE_LOCOMO_GPIO_BASE,
+ .comadj = 128,
};
-struct platform_device collie_locomo_device = {
+static struct platform_device collie_locomo_device = {
.name = "locomo",
.id = 0,
.dev = {
- .platform_data = &locomo_info,
+ .platform_data = &locomo_info,
},
.num_resources = ARRAY_SIZE(locomo_resources),
.resource = locomo_resources,
@@ -270,7 +298,55 @@ static struct platform_device collie_gpio_keys_device = {
},
};
+static int collie_mmc_init(struct device *dev,
+ irqreturn_t (*isr)(int, void*), void *mmc)
+{
+ int ret;
+
+ ret = gpio_request(COLLIE_GPIO_CARD_POWER, "MMC power");
+ if (!ret)
+ ret = gpio_direction_output(COLLIE_GPIO_CARD_POWER, 0);
+ if (ret)
+ gpio_free(COLLIE_GPIO_CARD_POWER);
+ return ret;
+}
+
+static void collie_mmc_exit(struct device *dev, void *mmc)
+{
+ gpio_free(COLLIE_GPIO_CARD_POWER);
+}
+
+static void collie_mmc_setpower(struct device *dev, unsigned int mask)
+{
+ gpio_set_value(COLLIE_GPIO_CARD_POWER, !!mask);
+}
+
+static struct mmc_spi_platform_data collie_mmc_data = {
+ .init = collie_mmc_init,
+ .exit = collie_mmc_exit,
+ .setpower = collie_mmc_setpower,
+ .detect_delay = 200,
+ .powerup_msecs = 200,
+ .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
+ .flags = MMC_SPI_USE_CD_GPIO | MMC_SPI_USE_RO_GPIO,
+ .cd_gpio = COLLIE_GPIO_CARD_DETECT,
+ .ro_gpio = COLLIE_GPIO_CARD_RO,
+ .caps2 = MMC_CAP2_RO_ACTIVE_HIGH,
+};
+
+static struct spi_board_info collie_spi_board_info[] __initdata = {
+ {
+ .modalias = "mmc_spi",
+ .platform_data = &collie_mmc_data,
+ .max_speed_hz = 25000000,
+ .bus_num = 0,
+ .chip_select = 0,
+ .mode = SPI_MODE_0,
+ },
+};
+
static struct platform_device *devices[] __initdata = {
+ &collie_amp_on_device,
&collie_locomo_device,
&colliescoop_device,
&collie_power_device,
@@ -347,10 +423,39 @@ static struct sa1100fb_mach_info collie_lcd_info = {
.lccr0 = LCCR0_Color | LCCR0_Sngl | LCCR0_Act,
.lccr3 = LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(2),
+};
-#ifdef CONFIG_BACKLIGHT_LOCOMO
- .lcd_power = locomolcd_power
-#endif
+static struct iio_map locomo_iio_map[] = {
+ {
+ .consumer_dev_name = "locomo-lcd.0",
+ .consumer_channel = "comadj",
+ .adc_channel_label = "CH0",
+ },
+ { }
+};
+
+static struct i2c_board_info locomo_i2c_devs[] __initdata = {
+ {
+ I2C_BOARD_INFO("m62332", 0x4e),
+ .platform_data = locomo_iio_map,
+ },
+};
+
+static struct gpiod_lookup_table collie_bl_gpios_table = {
+ .dev_id = "locomo-backlight.0",
+ .table = {
+ GPIO_LOOKUP("locomo-gpio", 9, "flvr", GPIO_ACTIVE_HIGH),
+ { },
+ },
+}, collie_lcd_gpios_table = {
+ .dev_id = "locomo-lcd.0",
+ .table = {
+ GPIO_LOOKUP("locomo-gpio", 4, "VSHA", GPIO_ACTIVE_HIGH),
+ GPIO_LOOKUP("locomo-gpio", 5, "VSHD", GPIO_ACTIVE_HIGH),
+ GPIO_LOOKUP("locomo-gpio", 6, "Vee", GPIO_ACTIVE_HIGH),
+ GPIO_LOOKUP("locomo-gpio", 7, "MOD", GPIO_ACTIVE_HIGH),
+ { },
+ },
};
static void __init collie_init(void)
@@ -381,11 +486,19 @@ static void __init collie_init(void)
GPSR |= _COLLIE_GPIO_UCB1x00_RESET;
+ sharpsl_save_param();
+
sa11x0_ppc_configure_mcp();
platform_scoop_config = &collie_pcmcia_config;
+ if (sharpsl_param.comadj != -1)
+ locomo_info.comadj = sharpsl_param.comadj;
+
+ gpiod_add_lookup_table(&collie_bl_gpios_table);
+ gpiod_add_lookup_table(&collie_lcd_gpios_table);
+
ret = platform_add_devices(devices, ARRAY_SIZE(devices));
if (ret) {
printk(KERN_WARNING "collie: Unable to register LoCoMo device\n");
@@ -397,7 +510,13 @@ static void __init collie_init(void)
sa11x0_register_mcp(&collie_mcp_data);
sa11x0_register_irda(&collie_ir_data);
- sharpsl_save_param();
+ i2c_register_board_info(1,
+ locomo_i2c_devs, ARRAY_SIZE(locomo_i2c_devs));
+
+ spi_register_board_info(collie_spi_board_info,
+ ARRAY_SIZE(collie_spi_board_info));
+
+ regulator_has_full_constraints();
}
static struct map_desc collie_io_desc[] __initdata = {
@@ -419,9 +538,7 @@ static void __init collie_map_io(void)
sa1100_map_io();
iotable_init(collie_io_desc, ARRAY_SIZE(collie_io_desc));
-#ifdef CONFIG_SHARP_LOCOMO
sa1100_register_uart_fns(&collie_port_fns);
-#endif
sa1100_register_uart(0, 3);
sa1100_register_uart(1, 1);
}
diff --git a/arch/arm/mach-sa1100/include/mach/collie.h b/arch/arm/mach-sa1100/include/mach/collie.h
index b478ca1..2e3bf80 100644
--- a/arch/arm/mach-sa1100/include/mach/collie.h
+++ b/arch/arm/mach-sa1100/include/mach/collie.h
@@ -24,12 +24,12 @@ extern void locomolcd_power(int on);
#define COLLIE_SCP_MUTE_L SCOOP_GPCR_PA14
#define COLLIE_SCP_MUTE_R SCOOP_GPCR_PA15
#define COLLIE_SCP_5VON SCOOP_GPCR_PA16
-#define COLLIE_SCP_AMP_ON SCOOP_GPCR_PA17
+#define COLLIE_GPIO_AMP2_ON (COLLIE_SCOOP_GPIO_BASE + 6)
#define COLLIE_GPIO_VPEN (COLLIE_SCOOP_GPIO_BASE + 7)
#define COLLIE_SCP_LB_VOL_CHG SCOOP_GPCR_PA19
#define COLLIE_SCOOP_IO_DIR (COLLIE_SCP_MUTE_L | COLLIE_SCP_MUTE_R | \
- COLLIE_SCP_5VON | COLLIE_SCP_AMP_ON | \
+ COLLIE_SCP_5VON | \
COLLIE_SCP_LB_VOL_CHG)
#define COLLIE_SCOOP_IO_OUT (COLLIE_SCP_MUTE_L | COLLIE_SCP_MUTE_R)
@@ -81,7 +81,7 @@ extern void locomolcd_power(int on);
#define COLLIE_TC35143_GPIO_TBL_CHK UCB_IO_1
#define COLLIE_TC35143_GPIO_VPEN_ON UCB_IO_2
#define COLLIE_GPIO_IR_ON (COLLIE_TC35143_GPIO_BASE + 3)
-#define COLLIE_TC35143_GPIO_AMP_ON UCB_IO_4
+#define COLLIE_GPIO_AMP1_ON (COLLIE_TC35143_GPIO_BASE + 4)
#define COLLIE_TC35143_GPIO_VERSION1 UCB_IO_5
#define COLLIE_TC35143_GPIO_FS8KLPF UCB_IO_5
#define COLLIE_TC35143_GPIO_BUZZER_BIAS UCB_IO_6
@@ -92,4 +92,14 @@ extern void locomolcd_power(int on);
#define COLLIE_TC35143_GPIO_OUT (UCB_IO_1 | UCB_IO_3 | UCB_IO_4 \
| UCB_IO_6)
+/* GPIOs on LoCoMo GA */
+#define COLLIE_LOCOMO_GPIO_BASE (GPIO_MAX + 13 + 10)
+#define COLLIE_GPIO_RTS (COLLIE_LOCOMO_GPIO_BASE + 0)
+#define COLLIE_GPIO_CTS (COLLIE_LOCOMO_GPIO_BASE + 1)
+#define COLLIE_GPIO_DSR (COLLIE_LOCOMO_GPIO_BASE + 2)
+#define COLLIE_GPIO_DTR (COLLIE_LOCOMO_GPIO_BASE + 3)
+#define COLLIE_GPIO_CARD_DETECT (COLLIE_LOCOMO_GPIO_BASE + 13)
+#define COLLIE_GPIO_CARD_RO (COLLIE_LOCOMO_GPIO_BASE + 14)
+#define COLLIE_GPIO_CARD_POWER (COLLIE_LOCOMO_GPIO_BASE + 15)
+
#endif
--
2.1.4
next prev parent reply other threads:[~2015-05-17 16:27 UTC|newest]
Thread overview: 81+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-17 16:27 [PATCH v3 00/17] new LoCoMo driver set Dmitry Eremin-Solenikov
2015-05-17 16:27 ` Dmitry Eremin-Solenikov
2015-05-17 16:27 ` Dmitry Eremin-Solenikov
[not found] ` <1431880077-26321-1-git-send-email-dbaryshkov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-05-17 16:27 ` [PATCH v3 01/17] mfd: add new driver for Sharp LoCoMo Dmitry Eremin-Solenikov
2015-05-17 16:27 ` Dmitry Eremin-Solenikov
[not found] ` <1431880077-26321-2-git-send-email-dbaryshkov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-05-19 10:38 ` Lee Jones
2015-05-19 10:38 ` Lee Jones
2015-05-19 11:21 ` Russell King - ARM Linux
2015-05-19 11:21 ` Russell King - ARM Linux
2015-05-19 11:21 ` Russell King - ARM Linux
2015-05-19 12:33 ` Lee Jones
2015-05-19 12:33 ` Lee Jones
2015-05-19 12:33 ` Lee Jones
2015-05-17 16:27 ` [PATCH v3 04/17] input: make LoCoMo keyboard driver support both poodle and collie Dmitry Eremin-Solenikov
2015-05-17 16:27 ` Dmitry Eremin-Solenikov
2015-05-17 16:27 ` Dmitry Eremin-Solenikov
[not found] ` <1431880077-26321-5-git-send-email-dbaryshkov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-05-18 16:50 ` Dmitry Torokhov
2015-05-18 16:50 ` Dmitry Torokhov
2015-05-18 16:50 ` Dmitry Torokhov
2015-05-17 16:27 ` [PATCH v3 13/17] ASoC: pxa: poodle: make use of new locomo GPIO interface Dmitry Eremin-Solenikov
2015-05-17 16:27 ` Dmitry Eremin-Solenikov
2015-05-17 16:27 ` Dmitry Eremin-Solenikov
2015-05-17 16:27 ` [PATCH v3 14/17] ARM: pxa: poodle: use new LoCoMo driver Dmitry Eremin-Solenikov
2015-05-17 16:27 ` Dmitry Eremin-Solenikov
2015-05-17 16:27 ` Dmitry Eremin-Solenikov
2015-05-17 16:27 ` [PATCH v3 17/17] ARM: drop old " Dmitry Eremin-Solenikov
2015-05-17 16:27 ` Dmitry Eremin-Solenikov
2015-05-17 16:27 ` [PATCH v3 02/17] leds: port locomo leds driver to new locomo core Dmitry Eremin-Solenikov
2015-05-17 16:27 ` Dmitry Eremin-Solenikov
2015-05-17 16:27 ` Dmitry Eremin-Solenikov
2015-05-18 8:37 ` Jacek Anaszewski
2015-05-18 8:37 ` Jacek Anaszewski
2015-05-18 8:37 ` Jacek Anaszewski
2015-05-17 16:27 ` [PATCH v3 03/17] input: convert LoCoMo keyboard driver to use " Dmitry Eremin-Solenikov
2015-05-17 16:27 ` Dmitry Eremin-Solenikov
2015-05-17 16:27 ` Dmitry Eremin-Solenikov
2015-05-18 16:50 ` Dmitry Torokhov
2015-05-18 16:50 ` Dmitry Torokhov
2015-05-18 16:50 ` Dmitry Torokhov
2015-05-17 16:27 ` [PATCH v3 05/17] video: backlight: add new locomo backlight driver Dmitry Eremin-Solenikov
2015-05-17 16:27 ` Dmitry Eremin-Solenikov
2015-05-17 16:27 ` Dmitry Eremin-Solenikov
2015-05-17 16:27 ` [PATCH v3 06/17] video: lcd: add LoCoMo LCD driver Dmitry Eremin-Solenikov
2015-05-17 16:27 ` Dmitry Eremin-Solenikov
2015-05-17 16:27 ` Dmitry Eremin-Solenikov
2015-05-19 9:36 ` Lee Jones
2015-05-19 9:36 ` Lee Jones
2015-05-19 9:36 ` Lee Jones
2015-05-19 9:45 ` Dmitry Eremin-Solenikov
2015-05-19 9:45 ` Dmitry Eremin-Solenikov
2015-05-19 9:45 ` Dmitry Eremin-Solenikov
2015-05-19 12:34 ` Lee Jones
2015-05-19 12:34 ` Lee Jones
2015-05-19 12:34 ` Lee Jones
2015-05-17 16:27 ` [PATCH v3 07/17] gpio: port LoCoMo gpio support from old driver Dmitry Eremin-Solenikov
2015-05-17 16:27 ` Dmitry Eremin-Solenikov
2015-05-17 16:27 ` Dmitry Eremin-Solenikov
2015-05-17 16:27 ` [PATCH v3 08/17] gpio: locomo: implement per-pin irq handling Dmitry Eremin-Solenikov
2015-05-17 16:27 ` Dmitry Eremin-Solenikov
2015-05-17 16:27 ` Dmitry Eremin-Solenikov
2015-05-17 16:27 ` [PATCH v3 09/17] spi: add locomo SPI driver Dmitry Eremin-Solenikov
2015-05-17 16:27 ` Dmitry Eremin-Solenikov
2015-05-17 16:27 ` Dmitry Eremin-Solenikov
2015-05-17 16:27 ` [PATCH v3 10/17] i2c: add locomo i2c driver Dmitry Eremin-Solenikov
2015-05-17 16:27 ` Dmitry Eremin-Solenikov
2015-05-17 16:27 ` Dmitry Eremin-Solenikov
2015-05-17 16:27 ` Dmitry Eremin-Solenikov [this message]
2015-05-17 16:27 ` [PATCH v3 11/17] ARM: sa1100: make collie use new locomo drivers Dmitry Eremin-Solenikov
2015-05-17 16:27 ` Dmitry Eremin-Solenikov
2015-05-17 16:27 ` [PATCH v3 12/17] ARM: sa1100: don't preallocate IRQ space for locomo Dmitry Eremin-Solenikov
2015-05-17 16:27 ` Dmitry Eremin-Solenikov
2015-05-17 16:27 ` Dmitry Eremin-Solenikov
2015-05-17 16:27 ` [PATCH v3 15/17] ARM: pxa: poodle: " Dmitry Eremin-Solenikov
2015-05-17 16:27 ` Dmitry Eremin-Solenikov
2015-05-17 16:27 ` Dmitry Eremin-Solenikov
2015-05-17 16:27 ` [PATCH v3 16/17] video: backlight: drop old locomo bl/lcd driver Dmitry Eremin-Solenikov
2015-05-17 16:27 ` Dmitry Eremin-Solenikov
2015-05-17 16:27 ` Dmitry Eremin-Solenikov
-- strict thread matches above, loose matches on Subject: below --
2015-05-20 12:26 [PATCH v3 06/17] video: lcd: add LoCoMo LCD driver Jingoo Han
2015-05-20 12:26 ` Jingoo Han
2015-05-20 12:26 ` Jingoo Han
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1431880077-26321-12-git-send-email-dbaryshkov@gmail.com \
--to=dbaryshkov@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=andrea.adami@gmail.com \
--cc=broonie@kernel.org \
--cc=cooloney@gmail.com \
--cc=daniel@zonque.org \
--cc=dmitry.torokhov@gmail.com \
--cc=gnurou@gmail.com \
--cc=jg1.han@samsung.com \
--cc=lee.jones@linaro.org \
--cc=lgirdwood@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=plagnioj@jcrosoft.com \
--cc=robert.jarzmik@free.fr \
--cc=rpurdie@rpsys.net \
--cc=sameo@linux.intel.com \
--cc=tomi.valkeinen@ti.com \
--cc=wsa@the-dreams.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.