All of lore.kernel.org
 help / color / mirror / Atom feed
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-i2c@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 v2 14/17] ARM: pxa: poodle: use new LoCoMo driver
Date: Tue, 28 Apr 2015 02:55:51 +0300	[thread overview]
Message-ID: <1430178954-11138-15-git-send-email-dbaryshkov@gmail.com> (raw)
In-Reply-To: <1430178954-11138-1-git-send-email-dbaryshkov@gmail.com>

Convert poodle to use new mfd-based LoCoMo driver.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
 arch/arm/mach-pxa/Kconfig               |  1 -
 arch/arm/mach-pxa/include/mach/poodle.h | 16 ++++++---
 arch/arm/mach-pxa/poodle.c              | 58 ++++++++++++++++++++++++++++++---
 3 files changed, 65 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
index 8896e71..a2756b0 100644
--- a/arch/arm/mach-pxa/Kconfig
+++ b/arch/arm/mach-pxa/Kconfig
@@ -481,7 +481,6 @@ config MACH_POODLE
 	bool "Enable Sharp SL-5600 (Poodle) Support"
 	depends on PXA_SHARPSL
 	select PXA25x
-	select SHARP_LOCOMO
 
 config MACH_CORGI
 	bool "Enable Sharp SL-C700 (Corgi) Support"
diff --git a/arch/arm/mach-pxa/include/mach/poodle.h b/arch/arm/mach-pxa/include/mach/poodle.h
index b56b193..dd4afae 100644
--- a/arch/arm/mach-pxa/include/mach/poodle.h
+++ b/arch/arm/mach-pxa/include/mach/poodle.h
@@ -81,11 +81,17 @@
 #define POODLE_GPIO_L_LCLK	(POODLE_SCOOP_GPIO_BASE + 10)
 #define POODLE_GPIO_HS_OUT	(POODLE_SCOOP_GPIO_BASE + 11)
 
-#define POODLE_LOCOMO_GPIO_AMP_ON      LOCOMO_GPIO(8)
-#define POODLE_LOCOMO_GPIO_MUTE_L      LOCOMO_GPIO(10)
-#define POODLE_LOCOMO_GPIO_MUTE_R      LOCOMO_GPIO(11)
-#define POODLE_LOCOMO_GPIO_232VCC_ON   LOCOMO_GPIO(12)
-#define POODLE_LOCOMO_GPIO_JK_B        LOCOMO_GPIO(13)
+#define POODLE_LOCOMO_GPIO_BASE	(PXA_NR_BUILTIN_GPIO + 12)
+#define POODLE_GPIO_LCD_VSHA_ON	(POODLE_LOCOMO_GPIO_BASE + 4)
+#define POODLE_GPIO_LCD_VSHD_ON	(POODLE_LOCOMO_GPIO_BASE + 5)
+#define POODLE_GPIO_LCD_VEE_ON	(POODLE_LOCOMO_GPIO_BASE + 6)
+#define POODLE_GPIO_LCD_MOD	(POODLE_LOCOMO_GPIO_BASE + 7)
+#define POODLE_GPIO_AMP_ON	(POODLE_LOCOMO_GPIO_BASE + 8)
+#define POODLE_GPIO_FL_VR	(POODLE_LOCOMO_GPIO_BASE + 9)
+#define POODLE_GPIO_MUTE_L	(POODLE_LOCOMO_GPIO_BASE + 10)
+#define POODLE_GPIO_MUTE_R	(POODLE_LOCOMO_GPIO_BASE + 11)
+#define POODLE_GPIO_232VCC_ON	(POODLE_LOCOMO_GPIO_BASE + 12)
+#define POODLE_GPIO_JK_B	(POODLE_LOCOMO_GPIO_BASE + 13)
 
 #define POODLE_NR_IRQS		(IRQ_BOARD_START + 4)	/* 4 for LoCoMo */
 
diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c
index 195b112..a61e4b8 100644
--- a/arch/arm/mach-pxa/poodle.c
+++ b/arch/arm/mach-pxa/poodle.c
@@ -23,6 +23,7 @@
 #include <linux/delay.h>
 #include <linux/mtd/physmap.h>
 #include <linux/gpio.h>
+#include <linux/gpio/machine.h>
 #include <linux/i2c.h>
 #include <linux/i2c/pxa-i2c.h>
 #include <linux/regulator/machine.h>
@@ -31,6 +32,8 @@
 #include <linux/spi/pxa2xx_spi.h>
 #include <linux/mtd/sharpsl.h>
 #include <linux/memblock.h>
+#include <linux/iio/machine.h>
+#include <linux/mfd/locomo.h>
 
 #include <mach/hardware.h>
 #include <asm/mach-types.h>
@@ -49,7 +52,6 @@
 #include <linux/platform_data/video-pxafb.h>
 
 #include <asm/hardware/scoop.h>
-#include <asm/hardware/locomo.h>
 #include <asm/mach/sharpsl_param.h>
 
 #include "generic.h"
@@ -179,7 +181,8 @@ static struct resource locomo_resources[] = {
 };
 
 static struct locomo_platform_data locomo_info = {
-	.irq_base	= IRQ_BOARD_START,
+	.gpio_base	  = POODLE_LOCOMO_GPIO_BASE,
+	.comadj	          = 118,
 };
 
 struct platform_device poodle_locomo_device = {
@@ -192,8 +195,6 @@ struct platform_device poodle_locomo_device = {
 	},
 };
 
-EXPORT_SYMBOL(poodle_locomo_device);
-
 #if defined(CONFIG_SPI_PXA2XX) || defined(CONFIG_SPI_PXA2XX_MODULE)
 static struct pxa2xx_spi_master poodle_spi_info = {
 	.num_chipselect	= 1,
@@ -424,6 +425,47 @@ static struct i2c_board_info __initdata poodle_i2c_devices[] = {
 	{ I2C_BOARD_INFO("wm8731", 0x1b) },
 };
 
+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 poodle_audio_gpios_table = {
+	.dev_id = "poodle-audio",
+	.table = {
+		GPIO_LOOKUP("locomo-gpio", 10, "mute-l", GPIO_ACTIVE_LOW),
+		GPIO_LOOKUP("locomo-gpio", 11, "mute-r", GPIO_ACTIVE_LOW),
+		GPIO_LOOKUP("locomo-gpio", 8, "amp-on", GPIO_ACTIVE_LOW),
+		{ },
+	},
+}, poodle_bl_gpios_table = {
+	.dev_id = "locomo-backlight.0",
+	.table = {
+		GPIO_LOOKUP("locomo-gpio", 9, "flvr", GPIO_ACTIVE_HIGH),
+		{ },
+	},
+}, poodle_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 poodle_poweroff(void)
 {
 	pxa_restart(REBOOT_HARD, NULL);
@@ -445,6 +487,13 @@ static void __init poodle_init(void)
 
 	platform_scoop_config = &poodle_pcmcia_config;
 
+	if (sharpsl_param.comadj != -1)
+		locomo_info.comadj = sharpsl_param.comadj;
+
+	gpiod_add_lookup_table(&poodle_audio_gpios_table);
+	gpiod_add_lookup_table(&poodle_bl_gpios_table);
+	gpiod_add_lookup_table(&poodle_lcd_gpios_table);
+
 	ret = platform_add_devices(devices, ARRAY_SIZE(devices));
 	if (ret)
 		pr_warn("poodle: Unable to register LoCoMo device\n");
@@ -455,6 +504,7 @@ static void __init poodle_init(void)
 	pxa_set_ficp_info(&poodle_ficp_platform_data);
 	pxa_set_i2c_info(NULL);
 	i2c_register_board_info(0, ARRAY_AND_SIZE(poodle_i2c_devices));
+	i2c_register_board_info(1, ARRAY_AND_SIZE(locomo_i2c_devs));
 	poodle_init_spi();
 	regulator_has_full_constraints();
 }
-- 
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-i2c@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 v2 14/17] ARM: pxa: poodle: use new LoCoMo driver
Date: Mon, 27 Apr 2015 23:55:51 +0000	[thread overview]
Message-ID: <1430178954-11138-15-git-send-email-dbaryshkov@gmail.com> (raw)
In-Reply-To: <1430178954-11138-1-git-send-email-dbaryshkov@gmail.com>

Convert poodle to use new mfd-based LoCoMo driver.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
 arch/arm/mach-pxa/Kconfig               |  1 -
 arch/arm/mach-pxa/include/mach/poodle.h | 16 ++++++---
 arch/arm/mach-pxa/poodle.c              | 58 ++++++++++++++++++++++++++++++---
 3 files changed, 65 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
index 8896e71..a2756b0 100644
--- a/arch/arm/mach-pxa/Kconfig
+++ b/arch/arm/mach-pxa/Kconfig
@@ -481,7 +481,6 @@ config MACH_POODLE
 	bool "Enable Sharp SL-5600 (Poodle) Support"
 	depends on PXA_SHARPSL
 	select PXA25x
-	select SHARP_LOCOMO
 
 config MACH_CORGI
 	bool "Enable Sharp SL-C700 (Corgi) Support"
diff --git a/arch/arm/mach-pxa/include/mach/poodle.h b/arch/arm/mach-pxa/include/mach/poodle.h
index b56b193..dd4afae 100644
--- a/arch/arm/mach-pxa/include/mach/poodle.h
+++ b/arch/arm/mach-pxa/include/mach/poodle.h
@@ -81,11 +81,17 @@
 #define POODLE_GPIO_L_LCLK	(POODLE_SCOOP_GPIO_BASE + 10)
 #define POODLE_GPIO_HS_OUT	(POODLE_SCOOP_GPIO_BASE + 11)
 
-#define POODLE_LOCOMO_GPIO_AMP_ON      LOCOMO_GPIO(8)
-#define POODLE_LOCOMO_GPIO_MUTE_L      LOCOMO_GPIO(10)
-#define POODLE_LOCOMO_GPIO_MUTE_R      LOCOMO_GPIO(11)
-#define POODLE_LOCOMO_GPIO_232VCC_ON   LOCOMO_GPIO(12)
-#define POODLE_LOCOMO_GPIO_JK_B        LOCOMO_GPIO(13)
+#define POODLE_LOCOMO_GPIO_BASE	(PXA_NR_BUILTIN_GPIO + 12)
+#define POODLE_GPIO_LCD_VSHA_ON	(POODLE_LOCOMO_GPIO_BASE + 4)
+#define POODLE_GPIO_LCD_VSHD_ON	(POODLE_LOCOMO_GPIO_BASE + 5)
+#define POODLE_GPIO_LCD_VEE_ON	(POODLE_LOCOMO_GPIO_BASE + 6)
+#define POODLE_GPIO_LCD_MOD	(POODLE_LOCOMO_GPIO_BASE + 7)
+#define POODLE_GPIO_AMP_ON	(POODLE_LOCOMO_GPIO_BASE + 8)
+#define POODLE_GPIO_FL_VR	(POODLE_LOCOMO_GPIO_BASE + 9)
+#define POODLE_GPIO_MUTE_L	(POODLE_LOCOMO_GPIO_BASE + 10)
+#define POODLE_GPIO_MUTE_R	(POODLE_LOCOMO_GPIO_BASE + 11)
+#define POODLE_GPIO_232VCC_ON	(POODLE_LOCOMO_GPIO_BASE + 12)
+#define POODLE_GPIO_JK_B	(POODLE_LOCOMO_GPIO_BASE + 13)
 
 #define POODLE_NR_IRQS		(IRQ_BOARD_START + 4)	/* 4 for LoCoMo */
 
diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c
index 195b112..a61e4b8 100644
--- a/arch/arm/mach-pxa/poodle.c
+++ b/arch/arm/mach-pxa/poodle.c
@@ -23,6 +23,7 @@
 #include <linux/delay.h>
 #include <linux/mtd/physmap.h>
 #include <linux/gpio.h>
+#include <linux/gpio/machine.h>
 #include <linux/i2c.h>
 #include <linux/i2c/pxa-i2c.h>
 #include <linux/regulator/machine.h>
@@ -31,6 +32,8 @@
 #include <linux/spi/pxa2xx_spi.h>
 #include <linux/mtd/sharpsl.h>
 #include <linux/memblock.h>
+#include <linux/iio/machine.h>
+#include <linux/mfd/locomo.h>
 
 #include <mach/hardware.h>
 #include <asm/mach-types.h>
@@ -49,7 +52,6 @@
 #include <linux/platform_data/video-pxafb.h>
 
 #include <asm/hardware/scoop.h>
-#include <asm/hardware/locomo.h>
 #include <asm/mach/sharpsl_param.h>
 
 #include "generic.h"
@@ -179,7 +181,8 @@ static struct resource locomo_resources[] = {
 };
 
 static struct locomo_platform_data locomo_info = {
-	.irq_base	= IRQ_BOARD_START,
+	.gpio_base	  = POODLE_LOCOMO_GPIO_BASE,
+	.comadj	          = 118,
 };
 
 struct platform_device poodle_locomo_device = {
@@ -192,8 +195,6 @@ struct platform_device poodle_locomo_device = {
 	},
 };
 
-EXPORT_SYMBOL(poodle_locomo_device);
-
 #if defined(CONFIG_SPI_PXA2XX) || defined(CONFIG_SPI_PXA2XX_MODULE)
 static struct pxa2xx_spi_master poodle_spi_info = {
 	.num_chipselect	= 1,
@@ -424,6 +425,47 @@ static struct i2c_board_info __initdata poodle_i2c_devices[] = {
 	{ I2C_BOARD_INFO("wm8731", 0x1b) },
 };
 
+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 poodle_audio_gpios_table = {
+	.dev_id = "poodle-audio",
+	.table = {
+		GPIO_LOOKUP("locomo-gpio", 10, "mute-l", GPIO_ACTIVE_LOW),
+		GPIO_LOOKUP("locomo-gpio", 11, "mute-r", GPIO_ACTIVE_LOW),
+		GPIO_LOOKUP("locomo-gpio", 8, "amp-on", GPIO_ACTIVE_LOW),
+		{ },
+	},
+}, poodle_bl_gpios_table = {
+	.dev_id = "locomo-backlight.0",
+	.table = {
+		GPIO_LOOKUP("locomo-gpio", 9, "flvr", GPIO_ACTIVE_HIGH),
+		{ },
+	},
+}, poodle_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 poodle_poweroff(void)
 {
 	pxa_restart(REBOOT_HARD, NULL);
@@ -445,6 +487,13 @@ static void __init poodle_init(void)
 
 	platform_scoop_config = &poodle_pcmcia_config;
 
+	if (sharpsl_param.comadj != -1)
+		locomo_info.comadj = sharpsl_param.comadj;
+
+	gpiod_add_lookup_table(&poodle_audio_gpios_table);
+	gpiod_add_lookup_table(&poodle_bl_gpios_table);
+	gpiod_add_lookup_table(&poodle_lcd_gpios_table);
+
 	ret = platform_add_devices(devices, ARRAY_SIZE(devices));
 	if (ret)
 		pr_warn("poodle: Unable to register LoCoMo device\n");
@@ -455,6 +504,7 @@ static void __init poodle_init(void)
 	pxa_set_ficp_info(&poodle_ficp_platform_data);
 	pxa_set_i2c_info(NULL);
 	i2c_register_board_info(0, ARRAY_AND_SIZE(poodle_i2c_devices));
+	i2c_register_board_info(1, ARRAY_AND_SIZE(locomo_i2c_devs));
 	poodle_init_spi();
 	regulator_has_full_constraints();
 }
-- 
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 v2 14/17] ARM: pxa: poodle: use new LoCoMo driver
Date: Tue, 28 Apr 2015 02:55:51 +0300	[thread overview]
Message-ID: <1430178954-11138-15-git-send-email-dbaryshkov@gmail.com> (raw)
In-Reply-To: <1430178954-11138-1-git-send-email-dbaryshkov@gmail.com>

Convert poodle to use new mfd-based LoCoMo driver.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
 arch/arm/mach-pxa/Kconfig               |  1 -
 arch/arm/mach-pxa/include/mach/poodle.h | 16 ++++++---
 arch/arm/mach-pxa/poodle.c              | 58 ++++++++++++++++++++++++++++++---
 3 files changed, 65 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
index 8896e71..a2756b0 100644
--- a/arch/arm/mach-pxa/Kconfig
+++ b/arch/arm/mach-pxa/Kconfig
@@ -481,7 +481,6 @@ config MACH_POODLE
 	bool "Enable Sharp SL-5600 (Poodle) Support"
 	depends on PXA_SHARPSL
 	select PXA25x
-	select SHARP_LOCOMO
 
 config MACH_CORGI
 	bool "Enable Sharp SL-C700 (Corgi) Support"
diff --git a/arch/arm/mach-pxa/include/mach/poodle.h b/arch/arm/mach-pxa/include/mach/poodle.h
index b56b193..dd4afae 100644
--- a/arch/arm/mach-pxa/include/mach/poodle.h
+++ b/arch/arm/mach-pxa/include/mach/poodle.h
@@ -81,11 +81,17 @@
 #define POODLE_GPIO_L_LCLK	(POODLE_SCOOP_GPIO_BASE + 10)
 #define POODLE_GPIO_HS_OUT	(POODLE_SCOOP_GPIO_BASE + 11)
 
-#define POODLE_LOCOMO_GPIO_AMP_ON      LOCOMO_GPIO(8)
-#define POODLE_LOCOMO_GPIO_MUTE_L      LOCOMO_GPIO(10)
-#define POODLE_LOCOMO_GPIO_MUTE_R      LOCOMO_GPIO(11)
-#define POODLE_LOCOMO_GPIO_232VCC_ON   LOCOMO_GPIO(12)
-#define POODLE_LOCOMO_GPIO_JK_B        LOCOMO_GPIO(13)
+#define POODLE_LOCOMO_GPIO_BASE	(PXA_NR_BUILTIN_GPIO + 12)
+#define POODLE_GPIO_LCD_VSHA_ON	(POODLE_LOCOMO_GPIO_BASE + 4)
+#define POODLE_GPIO_LCD_VSHD_ON	(POODLE_LOCOMO_GPIO_BASE + 5)
+#define POODLE_GPIO_LCD_VEE_ON	(POODLE_LOCOMO_GPIO_BASE + 6)
+#define POODLE_GPIO_LCD_MOD	(POODLE_LOCOMO_GPIO_BASE + 7)
+#define POODLE_GPIO_AMP_ON	(POODLE_LOCOMO_GPIO_BASE + 8)
+#define POODLE_GPIO_FL_VR	(POODLE_LOCOMO_GPIO_BASE + 9)
+#define POODLE_GPIO_MUTE_L	(POODLE_LOCOMO_GPIO_BASE + 10)
+#define POODLE_GPIO_MUTE_R	(POODLE_LOCOMO_GPIO_BASE + 11)
+#define POODLE_GPIO_232VCC_ON	(POODLE_LOCOMO_GPIO_BASE + 12)
+#define POODLE_GPIO_JK_B	(POODLE_LOCOMO_GPIO_BASE + 13)
 
 #define POODLE_NR_IRQS		(IRQ_BOARD_START + 4)	/* 4 for LoCoMo */
 
diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c
index 195b112..a61e4b8 100644
--- a/arch/arm/mach-pxa/poodle.c
+++ b/arch/arm/mach-pxa/poodle.c
@@ -23,6 +23,7 @@
 #include <linux/delay.h>
 #include <linux/mtd/physmap.h>
 #include <linux/gpio.h>
+#include <linux/gpio/machine.h>
 #include <linux/i2c.h>
 #include <linux/i2c/pxa-i2c.h>
 #include <linux/regulator/machine.h>
@@ -31,6 +32,8 @@
 #include <linux/spi/pxa2xx_spi.h>
 #include <linux/mtd/sharpsl.h>
 #include <linux/memblock.h>
+#include <linux/iio/machine.h>
+#include <linux/mfd/locomo.h>
 
 #include <mach/hardware.h>
 #include <asm/mach-types.h>
@@ -49,7 +52,6 @@
 #include <linux/platform_data/video-pxafb.h>
 
 #include <asm/hardware/scoop.h>
-#include <asm/hardware/locomo.h>
 #include <asm/mach/sharpsl_param.h>
 
 #include "generic.h"
@@ -179,7 +181,8 @@ static struct resource locomo_resources[] = {
 };
 
 static struct locomo_platform_data locomo_info = {
-	.irq_base	= IRQ_BOARD_START,
+	.gpio_base	  = POODLE_LOCOMO_GPIO_BASE,
+	.comadj	          = 118,
 };
 
 struct platform_device poodle_locomo_device = {
@@ -192,8 +195,6 @@ struct platform_device poodle_locomo_device = {
 	},
 };
 
-EXPORT_SYMBOL(poodle_locomo_device);
-
 #if defined(CONFIG_SPI_PXA2XX) || defined(CONFIG_SPI_PXA2XX_MODULE)
 static struct pxa2xx_spi_master poodle_spi_info = {
 	.num_chipselect	= 1,
@@ -424,6 +425,47 @@ static struct i2c_board_info __initdata poodle_i2c_devices[] = {
 	{ I2C_BOARD_INFO("wm8731", 0x1b) },
 };
 
+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 poodle_audio_gpios_table = {
+	.dev_id = "poodle-audio",
+	.table = {
+		GPIO_LOOKUP("locomo-gpio", 10, "mute-l", GPIO_ACTIVE_LOW),
+		GPIO_LOOKUP("locomo-gpio", 11, "mute-r", GPIO_ACTIVE_LOW),
+		GPIO_LOOKUP("locomo-gpio", 8, "amp-on", GPIO_ACTIVE_LOW),
+		{ },
+	},
+}, poodle_bl_gpios_table = {
+	.dev_id = "locomo-backlight.0",
+	.table = {
+		GPIO_LOOKUP("locomo-gpio", 9, "flvr", GPIO_ACTIVE_HIGH),
+		{ },
+	},
+}, poodle_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 poodle_poweroff(void)
 {
 	pxa_restart(REBOOT_HARD, NULL);
@@ -445,6 +487,13 @@ static void __init poodle_init(void)
 
 	platform_scoop_config = &poodle_pcmcia_config;
 
+	if (sharpsl_param.comadj != -1)
+		locomo_info.comadj = sharpsl_param.comadj;
+
+	gpiod_add_lookup_table(&poodle_audio_gpios_table);
+	gpiod_add_lookup_table(&poodle_bl_gpios_table);
+	gpiod_add_lookup_table(&poodle_lcd_gpios_table);
+
 	ret = platform_add_devices(devices, ARRAY_SIZE(devices));
 	if (ret)
 		pr_warn("poodle: Unable to register LoCoMo device\n");
@@ -455,6 +504,7 @@ static void __init poodle_init(void)
 	pxa_set_ficp_info(&poodle_ficp_platform_data);
 	pxa_set_i2c_info(NULL);
 	i2c_register_board_info(0, ARRAY_AND_SIZE(poodle_i2c_devices));
+	i2c_register_board_info(1, ARRAY_AND_SIZE(locomo_i2c_devs));
 	poodle_init_spi();
 	regulator_has_full_constraints();
 }
-- 
2.1.4

  parent reply	other threads:[~2015-04-27 23:55 UTC|newest]

Thread overview: 148+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-27 23:55 [PATCH v2 00/17] new locomo driver set Dmitry Eremin-Solenikov
2015-04-27 23:55 ` Dmitry Eremin-Solenikov
2015-04-27 23:55 ` Dmitry Eremin-Solenikov
2015-04-27 23:55 ` [PATCH v2 01/17] mfd: add new driver for Sharp LoCoMo Dmitry Eremin-Solenikov
2015-04-27 23:55   ` Dmitry Eremin-Solenikov
     [not found]   ` <1430178954-11138-2-git-send-email-dbaryshkov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-04-28 18:45     ` Lee Jones
2015-04-28 18:45       ` Lee Jones
2015-05-12 20:39       ` Dmitry Eremin-Solenikov
2015-05-12 20:39         ` Dmitry Eremin-Solenikov
2015-05-12 20:39         ` Dmitry Eremin-Solenikov
2015-05-12 20:39         ` Dmitry Eremin-Solenikov
2015-05-13  9:41         ` Lee Jones
2015-05-13  9:41           ` Lee Jones
2015-05-13  9:41           ` Lee Jones
2015-05-13  9:41           ` Lee Jones
2015-04-27 23:55 ` [PATCH v2 02/17] leds: port locomo leds driver to new locomo core Dmitry Eremin-Solenikov
2015-04-27 23:55   ` Dmitry Eremin-Solenikov
2015-04-27 23:55   ` Dmitry Eremin-Solenikov
2015-05-06 15:05   ` Jacek Anaszewski
2015-05-06 15:05     ` Jacek Anaszewski
2015-05-06 15:05     ` Jacek Anaszewski
2015-05-12 15:35     ` Dmitry Eremin-Solenikov
2015-05-12 15:35       ` Dmitry Eremin-Solenikov
2015-05-12 15:35       ` Dmitry Eremin-Solenikov
2015-05-12 15:35       ` Dmitry Eremin-Solenikov
     [not found]       ` <CALT56yNJWapNw1XLrzfbUDUz1LF_BB9DfF94H6GhbnBUEP80_w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-05-13 10:31         ` Jacek Anaszewski
2015-05-13 10:31           ` Jacek Anaszewski
2015-05-13 10:31           ` Jacek Anaszewski
2015-05-13 10:31           ` Jacek Anaszewski
     [not found]           ` <555327EA.5060402-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2015-05-13 14:14             ` Dmitry Eremin-Solenikov
2015-05-13 14:14               ` Dmitry Eremin-Solenikov
2015-05-13 14:14               ` Dmitry Eremin-Solenikov
2015-05-13 14:14               ` Dmitry Eremin-Solenikov
2015-05-13 14:53               ` Jacek Anaszewski
2015-05-13 14:53                 ` Jacek Anaszewski
2015-05-13 14:53                 ` Jacek Anaszewski
2015-05-13 14:53                 ` Jacek Anaszewski
     [not found]                 ` <5553654F.4010608-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2015-05-13 16:42                   ` Dmitry Torokhov
2015-05-13 16:42                     ` Dmitry Torokhov
2015-05-13 16:42                     ` Dmitry Torokhov
2015-05-13 16:42                     ` Dmitry Torokhov
2015-05-14  6:35                     ` Jacek Anaszewski
2015-05-14  6:35                       ` Jacek Anaszewski
2015-05-14  6:35                       ` Jacek Anaszewski
2015-05-14  6:35                       ` Jacek Anaszewski
2015-04-27 23:55 ` [PATCH v2 05/17] video: backlight: add new locomo backlight driver Dmitry Eremin-Solenikov
2015-04-27 23:55   ` Dmitry Eremin-Solenikov
2015-04-27 23:55   ` Dmitry Eremin-Solenikov
     [not found] ` <1430178954-11138-1-git-send-email-dbaryshkov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-04-27 23:55   ` [PATCH v2 03/17] input: convert LoCoMo keyboard driver to use new locomo core Dmitry Eremin-Solenikov
2015-04-27 23:55     ` Dmitry Eremin-Solenikov
2015-04-27 23:55     ` Dmitry Eremin-Solenikov
2015-05-12 20:21     ` Dmitry Torokhov
2015-05-12 20:21       ` Dmitry Torokhov
2015-05-12 20:21       ` Dmitry Torokhov
2015-05-12 21:01       ` Dmitry Eremin-Solenikov
2015-05-12 21:01         ` Dmitry Eremin-Solenikov
2015-05-12 21:01         ` Dmitry Eremin-Solenikov
2015-05-12 21:01         ` Dmitry Eremin-Solenikov
2015-05-12 21:13         ` Dmitry Torokhov
2015-05-12 21:13           ` Dmitry Torokhov
2015-05-12 21:13           ` Dmitry Torokhov
2015-05-12 21:13           ` Dmitry Torokhov
2015-04-27 23:55   ` [PATCH v2 04/17] input: locomokbd: provide an Alt-SysRQ combination Dmitry Eremin-Solenikov
2015-04-27 23:55     ` Dmitry Eremin-Solenikov
2015-04-27 23:55     ` Dmitry Eremin-Solenikov
2015-05-12 20:12     ` Dmitry Torokhov
2015-05-12 20:12       ` Dmitry Torokhov
2015-05-12 20:12       ` Dmitry Torokhov
2015-05-12 20:40       ` Dmitry Eremin-Solenikov
2015-05-12 20:40         ` Dmitry Eremin-Solenikov
2015-05-12 20:40         ` Dmitry Eremin-Solenikov
2015-05-12 20:40         ` Dmitry Eremin-Solenikov
2015-04-27 23:55   ` [PATCH v2 06/17] video: lcd: add LoCoMo LCD driver Dmitry Eremin-Solenikov
2015-04-27 23:55     ` Dmitry Eremin-Solenikov
2015-04-27 23:55     ` Dmitry Eremin-Solenikov
2015-04-27 23:55   ` [PATCH v2 10/17] i2c: add locomo i2c driver Dmitry Eremin-Solenikov
2015-04-27 23:55     ` Dmitry Eremin-Solenikov
2015-04-27 23:55     ` Dmitry Eremin-Solenikov
2015-05-12 19:24     ` Wolfram Sang
2015-05-12 19:24       ` Wolfram Sang
2015-05-12 19:24       ` Wolfram Sang
2015-05-12 19:27       ` Dmitry Eremin-Solenikov
2015-05-12 19:27         ` Dmitry Eremin-Solenikov
2015-05-12 19:27         ` Dmitry Eremin-Solenikov
2015-05-12 19:27         ` Dmitry Eremin-Solenikov
2015-05-12 19:28         ` Wolfram Sang
2015-05-12 19:28           ` Wolfram Sang
2015-05-12 19:28           ` Wolfram Sang
2015-05-12 19:28           ` Wolfram Sang
2015-04-27 23:55 ` [PATCH v2 07/17] gpio: port LoCoMo gpio support from old driver Dmitry Eremin-Solenikov
2015-04-27 23:55   ` Dmitry Eremin-Solenikov
2015-04-27 23:55   ` Dmitry Eremin-Solenikov
2015-05-06 14:12   ` Linus Walleij
2015-05-06 14:12     ` Linus Walleij
2015-05-06 14:12     ` Linus Walleij
2015-04-27 23:55 ` [PATCH v2 08/17] gpio: locomo: implement per-pin irq handling Dmitry Eremin-Solenikov
2015-04-27 23:55   ` Dmitry Eremin-Solenikov
2015-04-27 23:55   ` Dmitry Eremin-Solenikov
2015-05-06 14:15   ` Linus Walleij
2015-05-06 14:15     ` Linus Walleij
2015-05-06 14:15     ` Linus Walleij
2015-05-06 16:42     ` Dmitry Eremin-Solenikov
2015-05-06 16:42       ` Dmitry Eremin-Solenikov
2015-05-06 16:42       ` Dmitry Eremin-Solenikov
2015-05-12 11:15       ` Linus Walleij
2015-05-12 11:15         ` Linus Walleij
2015-05-12 11:15         ` Linus Walleij
2015-04-27 23:55 ` [PATCH v2 09/17] spi: add locomo SPI driver Dmitry Eremin-Solenikov
2015-04-27 23:55   ` Dmitry Eremin-Solenikov
2015-04-27 23:55   ` Dmitry Eremin-Solenikov
2015-04-29 11:27   ` Mark Brown
2015-04-29 11:27     ` Mark Brown
2015-04-29 11:27     ` Mark Brown
2015-04-27 23:55 ` [PATCH v2 11/17] ARM: sa1100: make collie use new locomo drivers Dmitry Eremin-Solenikov
2015-04-27 23:55   ` Dmitry Eremin-Solenikov
2015-04-27 23:55   ` Dmitry Eremin-Solenikov
2015-04-27 23:55 ` [PATCH v2 12/17] ARM: sa1100: don't preallocate IRQ space for locomo Dmitry Eremin-Solenikov
2015-04-27 23:55   ` Dmitry Eremin-Solenikov
2015-04-27 23:55   ` Dmitry Eremin-Solenikov
2015-04-27 23:55 ` [PATCH v2 13/17] ASoC: pxa: poodle: make use of new locomo GPIO interface Dmitry Eremin-Solenikov
2015-04-27 23:55   ` Dmitry Eremin-Solenikov
2015-04-27 23:55   ` Dmitry Eremin-Solenikov
2015-05-06 14:19   ` Linus Walleij
2015-05-06 14:19     ` Linus Walleij
2015-05-06 14:19     ` Linus Walleij
2015-04-27 23:55 ` Dmitry Eremin-Solenikov [this message]
2015-04-27 23:55   ` [PATCH v2 14/17] ARM: pxa: poodle: use new LoCoMo driver Dmitry Eremin-Solenikov
2015-04-27 23:55   ` Dmitry Eremin-Solenikov
     [not found]   ` <1430178954-11138-15-git-send-email-dbaryshkov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-04-28 19:35     ` Robert Jarzmik
2015-04-28 19:35       ` Robert Jarzmik
2015-04-28 19:35       ` Robert Jarzmik
2015-05-06 14:20     ` Linus Walleij
2015-05-06 14:20       ` Linus Walleij
2015-05-06 14:20       ` Linus Walleij
2015-04-27 23:55 ` [PATCH v2 15/17] ARM: pxa: poodle: don't preallocate IRQ space for locomo Dmitry Eremin-Solenikov
2015-04-27 23:55   ` Dmitry Eremin-Solenikov
2015-04-27 23:55   ` Dmitry Eremin-Solenikov
2015-04-28 19:36   ` Robert Jarzmik
2015-04-28 19:36     ` Robert Jarzmik
2015-04-28 19:36     ` Robert Jarzmik
2015-04-27 23:55 ` [PATCH v2 16/17] video: backlight: drop old locomo bl/lcd driver Dmitry Eremin-Solenikov
2015-04-27 23:55   ` Dmitry Eremin-Solenikov
2015-04-27 23:55   ` Dmitry Eremin-Solenikov
2015-04-27 23:55 ` [PATCH v2 17/17] ARM: drop old LoCoMo driver Dmitry Eremin-Solenikov
2015-04-27 23:55   ` Dmitry Eremin-Solenikov
     [not found]   ` <1430178954-11138-18-git-send-email-dbaryshkov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-05-06 14:22     ` Linus Walleij
2015-05-06 14:22       ` Linus Walleij
2015-05-06 14:22       ` Linus Walleij

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=1430178954-11138-15-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-i2c@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.