* [PATCH 00/10] ARM: OMAP1: ams-delta: replace custom I/O with GPIO
@ 2011-12-11 20:11 Janusz Krzysztofik
2011-12-11 20:12 ` [PATCH 08/10] omapfb: lcd_ams_delta: Drive control lines over GPIO Janusz Krzysztofik
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Janusz Krzysztofik @ 2011-12-11 20:11 UTC (permalink / raw)
To: Tony Lindgren, Grant Likely, Dmitry Torokhov, Richard Purdie,
David Woodhouse, Tomi Valkeinen, Jarkko Nikula
Cc: linux-omap, linux-arm-kernel, linux-kernel, Janusz Krzysztofik,
linux-input, linux-mtd, linux-fbdev, alsa-devel, Liam Girdwood,
Mark Brown
The Amstrad Delta board has two extra output ports used for driving
input lines of different on-board devices. Those ports are now
controlled with custom functions, provided by the board arch code and
used by several device drivers.
The idea behind the series is to replace those custom I/O functions
with gpiolib API. This way, existing drivers can be made less platform
dependent, and some of them perhaps even superseded with generic GPIO
based drivers after the board platform device descriptions are
converted. Moreover, should a new driver for the on-board Smart Card
controller ever be created, it could be designed as a generic GPIO
based driver, not a custom one.
Janusz Krzysztofik (10):
GPIO: gpio-generic: Move initialization up to postcore
ARM: OMAP1: ams-delta: convert latches to basic_mmio_gpio
ARM: OMAP1: ams-delta: supersede custom led device by leds-gpio
LED: drop leds-ams-delta driver
MTD: NAND: ams-delta: use GPIO instead of custom I/O
ARM: OMAP1: ams-delta: Use GPIO API in modem setup
ASoC: OMAP: ams-delta: Drive modem/codec pins over GPIO API
omapfb: lcd_ams_delta: Drive control lines over GPIO
input: serio: ams-delta: toggle keyboard power over GPIO
ARM: OMAP1: ams-delta: drop custom I/O functions
arch/arm/mach-omap1/Kconfig | 2 +
arch/arm/mach-omap1/board-ams-delta.c | 220 +++++++++++++++++----
arch/arm/plat-omap/include/plat/board-ams-delta.h | 50 ++---
drivers/gpio/gpio-generic.c | 2 +-
drivers/input/serio/ams_delta_serio.c | 45 +++--
drivers/leds/Kconfig | 7 -
drivers/leds/Makefile | 1 -
drivers/leds/leds-ams-delta.c | 137 -------------
drivers/mtd/nand/ams-delta.c | 74 +++++--
drivers/video/omap/lcd_ams_delta.c | 27 ++-
sound/soc/omap/ams-delta.c | 21 ++-
11 files changed, 309 insertions(+), 277 deletions(-)
delete mode 100644 drivers/leds/leds-ams-delta.c
--
1.7.3.4
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 08/10] omapfb: lcd_ams_delta: Drive control lines over GPIO
2011-12-11 20:11 [PATCH 00/10] ARM: OMAP1: ams-delta: replace custom I/O with GPIO Janusz Krzysztofik
@ 2011-12-11 20:12 ` Janusz Krzysztofik
2011-12-12 11:24 ` [PATCH 08/10] omapfb: lcd_ams_delta: Drive control lines over Tomi Valkeinen
2011-12-12 5:00 ` [PATCH 00/10] ARM: OMAP1: ams-delta: replace custom I/O with Jonathan McDowell
` (2 subsequent siblings)
3 siblings, 1 reply; 6+ messages in thread
From: Janusz Krzysztofik @ 2011-12-11 20:12 UTC (permalink / raw)
To: linux-arm-kernel
Don't use Amstrad Delta custom I/O functions any longer, use GPIO API
instead.
Depends on patch 5/10 "MTD: NAND: ams-delta: Use GPIO instead of custom
I/O".
Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
---
arch/arm/mach-omap1/board-ams-delta.c | 10 -------
arch/arm/plat-omap/include/plat/board-ams-delta.h | 2 -
drivers/video/omap/lcd_ams_delta.c | 27 +++++++++++++++-----
3 files changed, 20 insertions(+), 19 deletions(-)
diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c
index 5705481..b7422e3 100644
--- a/arch/arm/mach-omap1/board-ams-delta.c
+++ b/arch/arm/mach-omap1/board-ams-delta.c
@@ -232,16 +232,6 @@ static struct gpio _latch_gpios[] __initconst = {
.label = "dockit2",
},
{
- .gpio = AMS_DELTA_GPIO_PIN_LCD_VBLEN,
- .flags = GPIOF_OUT_INIT_LOW,
- .label = "lcd_vblen",
- },
- {
- .gpio = AMS_DELTA_GPIO_PIN_LCD_NDISP,
- .flags = GPIOF_OUT_INIT_LOW,
- .label = "lcd_ndisp",
- },
- {
.gpio = AMS_DELTA_GPIO_PIN_KEYBRD_PWR,
.flags = GPIOF_OUT_INIT_LOW,
.label = "keybrd_pwr",
diff --git a/arch/arm/plat-omap/include/plat/board-ams-delta.h b/arch/arm/plat-omap/include/plat/board-ams-delta.h
index 73fdab9..1d0706e 100644
--- a/arch/arm/plat-omap/include/plat/board-ams-delta.h
+++ b/arch/arm/plat-omap/include/plat/board-ams-delta.h
@@ -28,8 +28,6 @@
#if defined (CONFIG_MACH_AMS_DELTA)
-#define AMS_DELTA_LATCH2_LCD_VBLEN 0x0001
-#define AMS_DELTA_LATCH2_LCD_NDISP 0x0002
#define AMD_DELTA_LATCH2_KEYBRD_PWR 0x0100
#define AMD_DELTA_LATCH2_KEYBRD_DATA 0x0200
#define AMD_DELTA_LATCH2_SCARD_RSTIN 0x0400
diff --git a/drivers/video/omap/lcd_ams_delta.c b/drivers/video/omap/lcd_ams_delta.c
index 6978ae4..73b211b 100644
--- a/drivers/video/omap/lcd_ams_delta.c
+++ b/drivers/video/omap/lcd_ams_delta.c
@@ -25,6 +25,7 @@
#include <linux/io.h>
#include <linux/delay.h>
#include <linux/lcd.h>
+#include <linux/gpio.h>
#include <plat/board-ams-delta.h>
#include <mach/hardware.h>
@@ -98,29 +99,41 @@ static struct lcd_ops ams_delta_lcd_ops = {
/* omapfb panel section */
+static struct gpio _gpios[] __initconst_or_module = {
+ {
+ .gpio = AMS_DELTA_GPIO_PIN_LCD_VBLEN,
+ .flags = GPIOF_OUT_INIT_LOW,
+ .label = "lcd_vblen",
+ },
+ {
+ .gpio = AMS_DELTA_GPIO_PIN_LCD_NDISP,
+ .flags = GPIOF_OUT_INIT_LOW,
+ .label = "lcd_ndisp",
+ },
+};
+
static int ams_delta_panel_init(struct lcd_panel *panel,
struct omapfb_device *fbdev)
{
- return 0;
+ return gpio_request_array(_gpios, ARRAY_SIZE(_gpios));
}
static void ams_delta_panel_cleanup(struct lcd_panel *panel)
{
+ gpio_free_array(_gpios, ARRAY_SIZE(_gpios));
}
static int ams_delta_panel_enable(struct lcd_panel *panel)
{
- ams_delta_latch2_write(AMS_DELTA_LATCH2_LCD_NDISP,
- AMS_DELTA_LATCH2_LCD_NDISP);
- ams_delta_latch2_write(AMS_DELTA_LATCH2_LCD_VBLEN,
- AMS_DELTA_LATCH2_LCD_VBLEN);
+ gpio_set_value(AMS_DELTA_GPIO_PIN_LCD_NDISP, 1);
+ gpio_set_value(AMS_DELTA_GPIO_PIN_LCD_VBLEN, 1);
return 0;
}
static void ams_delta_panel_disable(struct lcd_panel *panel)
{
- ams_delta_latch2_write(AMS_DELTA_LATCH2_LCD_VBLEN, 0);
- ams_delta_latch2_write(AMS_DELTA_LATCH2_LCD_NDISP, 0);
+ gpio_set_value(AMS_DELTA_GPIO_PIN_LCD_VBLEN, 0);
+ gpio_set_value(AMS_DELTA_GPIO_PIN_LCD_NDISP, 0);
}
static unsigned long ams_delta_panel_get_caps(struct lcd_panel *panel)
--
1.7.3.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 00/10] ARM: OMAP1: ams-delta: replace custom I/O with
2011-12-11 20:11 [PATCH 00/10] ARM: OMAP1: ams-delta: replace custom I/O with GPIO Janusz Krzysztofik
2011-12-11 20:12 ` [PATCH 08/10] omapfb: lcd_ams_delta: Drive control lines over GPIO Janusz Krzysztofik
@ 2011-12-12 5:00 ` Jonathan McDowell
2011-12-19 23:08 ` [PATCH v2 0/7] ARM: OMAP1: ams-delta: replace custom I/O with GPIO Janusz Krzysztofik
2011-12-19 23:08 ` [PATCH v2 6/7] omapfb: lcd_ams_delta: drive control lines over GPIO Janusz Krzysztofik
3 siblings, 0 replies; 6+ messages in thread
From: Jonathan McDowell @ 2011-12-12 5:00 UTC (permalink / raw)
To: Janusz Krzysztofik
Cc: Tony Lindgren, Grant Likely, Dmitry Torokhov, Richard Purdie,
David Woodhouse, Tomi Valkeinen, Jarkko Nikula, linux-fbdev,
alsa-devel, Mark Brown, linux-kernel, linux-mtd, linux-input,
linux-omap, Liam Girdwood, linux-arm-kernel
On Sun, Dec 11, 2011 at 09:11:58PM +0100, Janusz Krzysztofik wrote:
> The Amstrad Delta board has two extra output ports used for driving
> input lines of different on-board devices. Those ports are now
> controlled with custom functions, provided by the board arch code and
> used by several device drivers.
>
> The idea behind the series is to replace those custom I/O functions
> with gpiolib API. This way, existing drivers can be made less platform
> dependent, and some of them perhaps even superseded with generic GPIO
> based drivers after the board platform device descriptions are
> converted. Moreover, should a new driver for the on-board Smart Card
> controller ever be created, it could be designed as a generic GPIO
> based driver, not a custom one.
Nice work; moving ams-delta over to gpiolib has been on my todo list for
a while (albeit quite low down).
J.
--
I just Fedexed my soul to hell. I'm *real* clever.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 08/10] omapfb: lcd_ams_delta: Drive control lines over
2011-12-11 20:12 ` [PATCH 08/10] omapfb: lcd_ams_delta: Drive control lines over GPIO Janusz Krzysztofik
@ 2011-12-12 11:24 ` Tomi Valkeinen
0 siblings, 0 replies; 6+ messages in thread
From: Tomi Valkeinen @ 2011-12-12 11:24 UTC (permalink / raw)
To: linux-arm-kernel
[-- Attachment #1: Type: text/plain, Size: 639 bytes --]
On Sun, 2011-12-11 at 21:12 +0100, Janusz Krzysztofik wrote:
> Don't use Amstrad Delta custom I/O functions any longer, use GPIO API
> instead.
>
> Depends on patch 5/10 "MTD: NAND: ams-delta: Use GPIO instead of custom
> I/O".
>
> Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
> ---
> arch/arm/mach-omap1/board-ams-delta.c | 10 -------
> arch/arm/plat-omap/include/plat/board-ams-delta.h | 2 -
> drivers/video/omap/lcd_ams_delta.c | 27 +++++++++++++++-----
> 3 files changed, 20 insertions(+), 19 deletions(-)
Acked-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Tomi
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 0/7] ARM: OMAP1: ams-delta: replace custom I/O with GPIO
2011-12-11 20:11 [PATCH 00/10] ARM: OMAP1: ams-delta: replace custom I/O with GPIO Janusz Krzysztofik
2011-12-11 20:12 ` [PATCH 08/10] omapfb: lcd_ams_delta: Drive control lines over GPIO Janusz Krzysztofik
2011-12-12 5:00 ` [PATCH 00/10] ARM: OMAP1: ams-delta: replace custom I/O with Jonathan McDowell
@ 2011-12-19 23:08 ` Janusz Krzysztofik
2011-12-19 23:08 ` [PATCH v2 6/7] omapfb: lcd_ams_delta: drive control lines over GPIO Janusz Krzysztofik
3 siblings, 0 replies; 6+ messages in thread
From: Janusz Krzysztofik @ 2011-12-19 23:08 UTC (permalink / raw)
To: Tony Lindgren
Cc: linux-omap, linux-arm-kernel, linux-kernel, Janusz Krzysztofik,
Grant Likely, Dmitry Torokhov, Richard Purdie, David Woodhouse,
Tomi Valkeinen, Jarkko Nikula, Liam Girdwood, Mark Brown,
linux-input, linux-mtd, linux-fbdev, alsa-devel
The Amstrad Delta board has two extra output ports used for driving
input lines of different on-board devices. Those ports are now
controlled with custom functions, provided by the board arch code and
used by several device drivers.
The idea behind the series is to replace those custom I/O functions
with gpiolib API. This way, existing drivers can be made less platform
dependent, and some of them perhaps even superseded with generic GPIO
based drivers after the board platform device descriptions are
converted. Moreover, should a new driver for the on-board Smart Card
controller ever be created, it could be designed as a generic GPIO
based driver, not a custom one.
Changes against initial version:
* the initial patch, which tried to move the gpio-generic driver
initialization up to the postcore_initcall level, replaced with an
alternative solution, moving the on-board devices initialization down
to late_initcall; thanks to Tony Lindgren who suggested this solution,
* dropped patches introducing changes to the modem and ASoC device
handling; those will be addressed in a separate patch series,
* final cleanups also dropped until those remaining devices are updated,
* the serio driver now takes care of one more GPIO pin which, even if
not used, belongs to the device interface and affects its functioning,
* misc code and changelog cosmetic cleanups,
* rebased on top of 3.2-rc6.
Thanks to those who reviewed the initial submission and responded with
their comments or Acks.
Janusz
Janusz Krzysztofik (7):
ARM: OMAP1: ams-delta: register latch dependent devices later
ARM: OMAP1: ams-delta: convert latches to basic_mmio_gpio
ARM: OMAP1: ams-delta: supersede custom led device by leds-gpio
LED: drop leds-ams-delta driver
MTD: NAND: ams-delta: use GPIO instead of custom I/O
omapfb: lcd_ams_delta: drive control lines over GPIO
input: serio: ams-delta: toggle keyboard power over GPIO
arch/arm/mach-omap1/Kconfig | 2 +
arch/arm/mach-omap1/board-ams-delta.c | 226 +++++++++++++++++----
arch/arm/plat-omap/include/plat/board-ams-delta.h | 48 ++---
drivers/input/serio/ams_delta_serio.c | 51 +++--
drivers/leds/Kconfig | 7 -
drivers/leds/Makefile | 1 -
drivers/leds/leds-ams-delta.c | 137 -------------
drivers/mtd/nand/ams-delta.c | 74 +++++--
drivers/video/omap/lcd_ams_delta.c | 27 ++-
sound/soc/omap/ams-delta.c | 4 +
10 files changed, 318 insertions(+), 259 deletions(-)
delete mode 100644 drivers/leds/leds-ams-delta.c
--
1.7.3.4
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 6/7] omapfb: lcd_ams_delta: drive control lines over GPIO
2011-12-11 20:11 [PATCH 00/10] ARM: OMAP1: ams-delta: replace custom I/O with GPIO Janusz Krzysztofik
` (2 preceding siblings ...)
2011-12-19 23:08 ` [PATCH v2 0/7] ARM: OMAP1: ams-delta: replace custom I/O with GPIO Janusz Krzysztofik
@ 2011-12-19 23:08 ` Janusz Krzysztofik
3 siblings, 0 replies; 6+ messages in thread
From: Janusz Krzysztofik @ 2011-12-19 23:08 UTC (permalink / raw)
To: linux-arm-kernel
Don't use Amstrad Delta custom I/O functions any longer, use GPIO API
instead.
Depends on patch 2/7 "ARM: OMAP1: ams-delta: convert latches to
basic_mmio_gpio".
Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Acked-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
---
Changes against initial version:
* was 8/10,
* no functional changes,
* rebased on top of v2 of patch 2/7, just in case.
arch/arm/mach-omap1/board-ams-delta.c | 10 -------
arch/arm/plat-omap/include/plat/board-ams-delta.h | 2 -
drivers/video/omap/lcd_ams_delta.c | 27 +++++++++++++++-----
3 files changed, 20 insertions(+), 19 deletions(-)
diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c
index cc6f962..3aba8f9 100644
--- a/arch/arm/mach-omap1/board-ams-delta.c
+++ b/arch/arm/mach-omap1/board-ams-delta.c
@@ -227,16 +227,6 @@ static struct gpio latch_gpios[] __initconst = {
.label = "dockit2",
},
{
- .gpio = AMS_DELTA_GPIO_PIN_LCD_VBLEN,
- .flags = GPIOF_OUT_INIT_LOW,
- .label = "lcd_vblen",
- },
- {
- .gpio = AMS_DELTA_GPIO_PIN_LCD_NDISP,
- .flags = GPIOF_OUT_INIT_LOW,
- .label = "lcd_ndisp",
- },
- {
.gpio = AMS_DELTA_GPIO_PIN_KEYBRD_PWR,
.flags = GPIOF_OUT_INIT_LOW,
.label = "keybrd_pwr",
diff --git a/arch/arm/plat-omap/include/plat/board-ams-delta.h b/arch/arm/plat-omap/include/plat/board-ams-delta.h
index 3e57833..e9ad673 100644
--- a/arch/arm/plat-omap/include/plat/board-ams-delta.h
+++ b/arch/arm/plat-omap/include/plat/board-ams-delta.h
@@ -28,8 +28,6 @@
#if defined (CONFIG_MACH_AMS_DELTA)
-#define AMS_DELTA_LATCH2_LCD_VBLEN 0x0001
-#define AMS_DELTA_LATCH2_LCD_NDISP 0x0002
#define AMD_DELTA_LATCH2_KEYBRD_PWR 0x0100
#define AMD_DELTA_LATCH2_KEYBRD_DATA 0x0200
#define AMD_DELTA_LATCH2_SCARD_RSTIN 0x0400
diff --git a/drivers/video/omap/lcd_ams_delta.c b/drivers/video/omap/lcd_ams_delta.c
index 6978ae4..73b211b 100644
--- a/drivers/video/omap/lcd_ams_delta.c
+++ b/drivers/video/omap/lcd_ams_delta.c
@@ -25,6 +25,7 @@
#include <linux/io.h>
#include <linux/delay.h>
#include <linux/lcd.h>
+#include <linux/gpio.h>
#include <plat/board-ams-delta.h>
#include <mach/hardware.h>
@@ -98,29 +99,41 @@ static struct lcd_ops ams_delta_lcd_ops = {
/* omapfb panel section */
+static struct gpio _gpios[] __initconst_or_module = {
+ {
+ .gpio = AMS_DELTA_GPIO_PIN_LCD_VBLEN,
+ .flags = GPIOF_OUT_INIT_LOW,
+ .label = "lcd_vblen",
+ },
+ {
+ .gpio = AMS_DELTA_GPIO_PIN_LCD_NDISP,
+ .flags = GPIOF_OUT_INIT_LOW,
+ .label = "lcd_ndisp",
+ },
+};
+
static int ams_delta_panel_init(struct lcd_panel *panel,
struct omapfb_device *fbdev)
{
- return 0;
+ return gpio_request_array(_gpios, ARRAY_SIZE(_gpios));
}
static void ams_delta_panel_cleanup(struct lcd_panel *panel)
{
+ gpio_free_array(_gpios, ARRAY_SIZE(_gpios));
}
static int ams_delta_panel_enable(struct lcd_panel *panel)
{
- ams_delta_latch2_write(AMS_DELTA_LATCH2_LCD_NDISP,
- AMS_DELTA_LATCH2_LCD_NDISP);
- ams_delta_latch2_write(AMS_DELTA_LATCH2_LCD_VBLEN,
- AMS_DELTA_LATCH2_LCD_VBLEN);
+ gpio_set_value(AMS_DELTA_GPIO_PIN_LCD_NDISP, 1);
+ gpio_set_value(AMS_DELTA_GPIO_PIN_LCD_VBLEN, 1);
return 0;
}
static void ams_delta_panel_disable(struct lcd_panel *panel)
{
- ams_delta_latch2_write(AMS_DELTA_LATCH2_LCD_VBLEN, 0);
- ams_delta_latch2_write(AMS_DELTA_LATCH2_LCD_NDISP, 0);
+ gpio_set_value(AMS_DELTA_GPIO_PIN_LCD_VBLEN, 0);
+ gpio_set_value(AMS_DELTA_GPIO_PIN_LCD_NDISP, 0);
}
static unsigned long ams_delta_panel_get_caps(struct lcd_panel *panel)
--
1.7.3.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-12-19 23:08 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-11 20:11 [PATCH 00/10] ARM: OMAP1: ams-delta: replace custom I/O with GPIO Janusz Krzysztofik
2011-12-11 20:12 ` [PATCH 08/10] omapfb: lcd_ams_delta: Drive control lines over GPIO Janusz Krzysztofik
2011-12-12 11:24 ` [PATCH 08/10] omapfb: lcd_ams_delta: Drive control lines over Tomi Valkeinen
2011-12-12 5:00 ` [PATCH 00/10] ARM: OMAP1: ams-delta: replace custom I/O with Jonathan McDowell
2011-12-19 23:08 ` [PATCH v2 0/7] ARM: OMAP1: ams-delta: replace custom I/O with GPIO Janusz Krzysztofik
2011-12-19 23:08 ` [PATCH v2 6/7] omapfb: lcd_ams_delta: drive control lines over GPIO Janusz Krzysztofik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).