* [PATCH v2] OpenRD: Enable SD/UART selection for serial port 1
[not found] <no>
@ 2010-08-10 8:29 ` Tanmay Upadhyay
2010-08-10 8:56 ` Alexander Clouter
2010-08-10 8:40 ` [PATCH] ARM: Fix broken Kconfig in arch/arm Tanmay Upadhyay
` (11 subsequent siblings)
12 siblings, 1 reply; 42+ messages in thread
From: Tanmay Upadhyay @ 2010-08-10 8:29 UTC (permalink / raw)
To: linux-arm-kernel
This patch enables user to use serial port 1 of the OpenRD device for SDIO
or UART(RS232/RS485). The selection can be done through kernel parameter.
By default the port would be used for SDIO. To select RS232 or RS485 mode,
pass string "uart=232" or "uart=485" respectively in the kernel parameters.
"uart=485" is ignored on OpenRD-Base as it doesn't have RS485 port.
Signed-off-by: Tanmay Upadhyay <tanmay.upadhyay@einfochips.com>
---
arch/arm/mach-kirkwood/openrd-setup.c | 92 ++++++++++++++++++++++++++++++++-
1 files changed, 91 insertions(+), 1 deletions(-)
diff --git a/arch/arm/mach-kirkwood/openrd-setup.c b/arch/arm/mach-kirkwood/openrd-setup.c
index fd06be6..cd061ab 100644
--- a/arch/arm/mach-kirkwood/openrd-setup.c
+++ b/arch/arm/mach-kirkwood/openrd-setup.c
@@ -19,6 +19,7 @@
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <mach/kirkwood.h>
+#include <mach/gpio.h>
#include <plat/mvsdio.h>
#include "common.h"
#include "mpp.h"
@@ -57,7 +58,15 @@ static struct mvsdio_platform_data openrd_mvsdio_data = {
};
static unsigned int openrd_mpp_config[] __initdata = {
+ MPP12_SD_CLK,
+ MPP13_SD_CMD,
+ MPP14_SD_D0,
+ MPP15_SD_D1,
+ MPP16_SD_D2,
+ MPP17_SD_D3,
+ MPP28_GPIO,
MPP29_GPIO,
+ MPP34_GPIO,
0
};
@@ -67,6 +76,71 @@ static struct i2c_board_info i2c_board_info[] __initdata = {
},
};
+static int __initdata uart1;
+
+static int __init sd_uart_selection(char *str)
+{
+ /* Default is SD. Change if required, for UART */
+ if (!str)
+ return 0;
+
+ if (!strncmp(str, "232", 3)) {
+ uart1 = 232;
+ } else if (!strncmp(str, "485", 3)) {
+ /* OpenRD-Base doesn't have RS485. Treat is as an
+ * unknown argument & just have default setting -
+ * which is SD */
+ if (machine_is_openrd_base())
+ return 1;
+
+ uart1 = 485;
+ }
+ return 1;
+}
+/* Parse boot_command_line string uart=232/485 */
+__setup("uart=", sd_uart_selection);
+
+static int __init uart1_mpp_config(void)
+{
+ /* Configure MPP for UART1 */
+ unsigned int uart1_mpp_config[] = {
+ MPP13_UART1_TXD,
+ MPP14_UART1_RXD,
+ 0
+ };
+
+ kirkwood_mpp_conf(uart1_mpp_config);
+
+ if (gpio_request(34, "SD_UART1_SEL")) {
+ printk(KERN_ERR "GPIO request failed for SD/UART1 selection"
+ ", gpio: 34\n");
+ return -EIO;
+ }
+
+ if (gpio_request(28, "RS232_RS485_SEL")) {
+ printk(KERN_ERR "GPIO request failed for RS232/RS485 selection"
+ ", gpio# 28\n");
+ gpio_free(34);
+ return -EIO;
+ }
+
+ /* Select UART1
+ * Pin # 34: 0 => UART1, 1 => SD */
+ gpio_direction_output(34, 0);
+
+ /* Select RS232 OR RS485
+ * Pin # 28: 0 => RS232, 1 => RS485 */
+ if (uart1 == 232)
+ gpio_direction_output(28, 0);
+ else
+ gpio_direction_output(28, 1);
+
+ gpio_free(34);
+ gpio_free(28);
+
+ return 0;
+}
+
static void __init openrd_init(void)
{
/*
@@ -90,7 +164,6 @@ static void __init openrd_init(void)
kirkwood_ge01_init(&openrd_ge01_data);
kirkwood_sata_init(&openrd_sata_data);
- kirkwood_sdio_init(&openrd_mvsdio_data);
kirkwood_i2c_init();
@@ -99,6 +172,23 @@ static void __init openrd_init(void)
ARRAY_SIZE(i2c_board_info));
kirkwood_audio_init();
}
+
+ if (!uart1) {
+ /* Select SD
+ * Pin # 34: 0 => UART1, 1 => SD */
+ if (gpio_request(34, "SD_UART1_SEL")) {
+ printk(KERN_ERR "GPIO request failed for SD/UART1 "
+ "selection, gpio: 34\n");
+ } else {
+
+ gpio_direction_output(34, 1);
+ gpio_free(34);
+ kirkwood_sdio_init(&openrd_mvsdio_data);
+ }
+ } else {
+ if (!uart1_mpp_config())
+ kirkwood_uart1_init();
+ }
}
static int __init openrd_pci_init(void)
--
1.6.6.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH] ARM: Fix broken Kconfig in arch/arm
[not found] <no>
2010-08-10 8:29 ` [PATCH v2] OpenRD: Enable SD/UART selection for serial port 1 Tanmay Upadhyay
@ 2010-08-10 8:40 ` Tanmay Upadhyay
2011-04-18 15:06 ` [v2 0/7] OMAP: GPIO: Use PM runtime framework Varadarajan, Charulatha
` (10 subsequent siblings)
12 siblings, 0 replies; 42+ messages in thread
From: Tanmay Upadhyay @ 2010-08-10 8:40 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Tanmay Upadhyay <tanmay.upadhyay@einfochips.com>
---
arch/arm/Kconfig | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 232f0c7..684c1a1 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1184,8 +1184,8 @@ config LOCAL_TIMERS
REALVIEW_EB_A9MP || MACH_REALVIEW_PBX || ARCH_OMAP4 || \
ARCH_U8500 || ARCH_VEXPRESS_CA9X4 || ARCH_TEGRA)
default y
- select HAVE_ARM_TWD if (ARCH_REALVIEW || ARCH_VEXPRESS || ARCH_OMAP4 || \\
- ARCH_U8500 || ARCH_TEGRA
+ select HAVE_ARM_TWD if (ARCH_REALVIEW || ARCH_VEXPRESS || ARCH_OMAP4 || \
+ ARCH_U8500 || ARCH_TEGRA)
help
Enable support for local timers on SMP platforms, rather then the
legacy IPI broadcast method. Local timers allows the system
--
1.6.6.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH v2] OpenRD: Enable SD/UART selection for serial port 1
2010-08-10 8:29 ` [PATCH v2] OpenRD: Enable SD/UART selection for serial port 1 Tanmay Upadhyay
@ 2010-08-10 8:56 ` Alexander Clouter
2010-08-10 8:58 ` Alexander Clouter
0 siblings, 1 reply; 42+ messages in thread
From: Alexander Clouter @ 2010-08-10 8:56 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
Comments inline.
* Tanmay Upadhyay <tanmay.upadhyay@einfochips.com> [2010-08-10 13:59:33+0530]:
>
> This patch enables user to use serial port 1 of the OpenRD device for SDIO
> or UART(RS232/RS485). The selection can be done through kernel parameter.
>
> By default the port would be used for SDIO. To select RS232 or RS485 mode,
> pass string "uart=232" or "uart=485" respectively in the kernel parameters.
> "uart=485" is ignored on OpenRD-Base as it doesn't have RS485 port.
>
> Signed-off-by: Tanmay Upadhyay <tanmay.upadhyay@einfochips.com>
> ---
> arch/arm/mach-kirkwood/openrd-setup.c | 92 ++++++++++++++++++++++++++++++++-
> 1 files changed, 91 insertions(+), 1 deletions(-)
>
> diff --git a/arch/arm/mach-kirkwood/openrd-setup.c b/arch/arm/mach-kirkwood/openrd-setup.c
> index fd06be6..cd061ab 100644
> --- a/arch/arm/mach-kirkwood/openrd-setup.c
> +++ b/arch/arm/mach-kirkwood/openrd-setup.c
> @@ -19,6 +19,7 @@
> #include <asm/mach-types.h>
> #include <asm/mach/arch.h>
> #include <mach/kirkwood.h>
> +#include <mach/gpio.h>
> #include <plat/mvsdio.h>
> #include "common.h"
> #include "mpp.h"
> @@ -57,7 +58,15 @@ static struct mvsdio_platform_data openrd_mvsdio_data = {
> };
>
> static unsigned int openrd_mpp_config[] __initdata = {
> + MPP12_SD_CLK,
> + MPP13_SD_CMD,
> + MPP14_SD_D0,
> + MPP15_SD_D1,
> + MPP16_SD_D2,
> + MPP17_SD_D3,
> + MPP28_GPIO,
> MPP29_GPIO,
> + MPP34_GPIO,
> 0
> };
>
> @@ -67,6 +76,71 @@ static struct i2c_board_info i2c_board_info[] __initdata = {
> },
> };
>
> +static int __initdata uart1;
> +
> +static int __init sd_uart_selection(char *str)
> +{
> + /* Default is SD. Change if required, for UART */
> + if (!str)
> + return 0;
> +
> + if (!strncmp(str, "232", 3)) {
> + uart1 = 232;
> + } else if (!strncmp(str, "485", 3)) {
> + /* OpenRD-Base doesn't have RS485. Treat is as an
> + * unknown argument & just have default setting -
> + * which is SD */
> + if (machine_is_openrd_base())
> + return 1;
> +
>
uart1 = -ENODEV;
return 1;
> + uart1 = 485;
> + }
> + return 1;
>
uart1 = -EINVAL;
return 1;
> +}
> +/* Parse boot_command_line string uart=232/485 */
> +__setup("uart=", sd_uart_selection);
> +
>
'kirkwood_init_uart1' instead maybe, only going to annoy someone
otherwise I'm guessing.
> +static int __init uart1_mpp_config(void)
> +{
> + /* Configure MPP for UART1 */
> + unsigned int uart1_mpp_config[] = {
> + MPP13_UART1_TXD,
> + MPP14_UART1_RXD,
> + 0
> + };
> +
> + kirkwood_mpp_conf(uart1_mpp_config);
> +
> + if (gpio_request(34, "SD_UART1_SEL")) {
> + printk(KERN_ERR "GPIO request failed for SD/UART1 selection"
> + ", gpio: 34\n");
> + return -EIO;
> + }
> +
> + if (gpio_request(28, "RS232_RS485_SEL")) {
> + printk(KERN_ERR "GPIO request failed for RS232/RS485 selection"
> + ", gpio# 28\n");
> + gpio_free(34);
> + return -EIO;
> + }
> +
> + /* Select UART1
> + * Pin # 34: 0 => UART1, 1 => SD */
> + gpio_direction_output(34, 0);
> +
> + /* Select RS232 OR RS485
> + * Pin # 28: 0 => RS232, 1 => RS485 */
> + if (uart1 == 232)
> + gpio_direction_output(28, 0);
> + else
> + gpio_direction_output(28, 1);
> +
> + gpio_free(34);
> + gpio_free(28);
> +
> + return 0;
> +}
> +
> static void __init openrd_init(void)
> {
> /*
> @@ -90,7 +164,6 @@ static void __init openrd_init(void)
> kirkwood_ge01_init(&openrd_ge01_data);
>
> kirkwood_sata_init(&openrd_sata_data);
> - kirkwood_sdio_init(&openrd_mvsdio_data);
>
> kirkwood_i2c_init();
>
> @@ -99,6 +172,23 @@ static void __init openrd_init(void)
> ARRAY_SIZE(i2c_board_info));
> kirkwood_audio_init();
> }
> +
> + if (!uart1) {
> + /* Select SD
> + * Pin # 34: 0 => UART1, 1 => SD */
> + if (gpio_request(34, "SD_UART1_SEL")) {
> + printk(KERN_ERR "GPIO request failed for SD/UART1 "
> + "selection, gpio: 34\n");
> + } else {
> +
> + gpio_direction_output(34, 1);
> + gpio_free(34);
> + kirkwood_sdio_init(&openrd_mvsdio_data);
> + }
> + } else {
>
} else if (uart1 < 0) {
prink(KERN_WARNING, "<grumble>, uart1 init issue, "
"defaulting to SD: %d\n", uart1);
} else {
> + if (!uart1_mpp_config())
> + kirkwood_uart1_init();
> + }
> }
>
> static int __init openrd_pci_init(void)
> --
> 1.6.6.1
Afterwards, remember to run it through ./scripts/checkpatch.pl.
Cheers
--
Alexander Clouter
.sigmonster says: Old MacDonald had an agricultural real estate tax abatement.
^ permalink raw reply [flat|nested] 42+ messages in thread
* [PATCH v2] OpenRD: Enable SD/UART selection for serial port 1
2010-08-10 8:56 ` Alexander Clouter
@ 2010-08-10 8:58 ` Alexander Clouter
2010-08-10 10:27 ` Tanmay Upadhyay
0 siblings, 1 reply; 42+ messages in thread
From: Alexander Clouter @ 2010-08-10 8:58 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
Just a quick amendment;
* Alexander Clouter <alex@digriz.org.uk> [2010-08-10 09:56:43+0100]:
>
> * Tanmay Upadhyay <tanmay.upadhyay@einfochips.com> [2010-08-10 13:59:33+0530]:
> >
> > This patch enables user to use serial port 1 of the OpenRD device for SDIO
> > or UART(RS232/RS485). The selection can be done through kernel parameter.
> >
> > By default the port would be used for SDIO. To select RS232 or RS485 mode,
> > pass string "uart=232" or "uart=485" respectively in the kernel parameters.
> > "uart=485" is ignored on OpenRD-Base as it doesn't have RS485 port.
> >
> > Signed-off-by: Tanmay Upadhyay <tanmay.upadhyay@einfochips.com>
> > ---
> > arch/arm/mach-kirkwood/openrd-setup.c | 92 ++++++++++++++++++++++++++++++++-
> > 1 files changed, 91 insertions(+), 1 deletions(-)
> >
> > diff --git a/arch/arm/mach-kirkwood/openrd-setup.c b/arch/arm/mach-kirkwood/openrd-setup.c
> > index fd06be6..cd061ab 100644
> > --- a/arch/arm/mach-kirkwood/openrd-setup.c
> > +++ b/arch/arm/mach-kirkwood/openrd-setup.c
> > @@ -19,6 +19,7 @@
> > #include <asm/mach-types.h>
> > #include <asm/mach/arch.h>
> > #include <mach/kirkwood.h>
> > +#include <mach/gpio.h>
> > #include <plat/mvsdio.h>
> > #include "common.h"
> > #include "mpp.h"
> > @@ -57,7 +58,15 @@ static struct mvsdio_platform_data openrd_mvsdio_data = {
> > };
> >
> > static unsigned int openrd_mpp_config[] __initdata = {
> > + MPP12_SD_CLK,
> > + MPP13_SD_CMD,
> > + MPP14_SD_D0,
> > + MPP15_SD_D1,
> > + MPP16_SD_D2,
> > + MPP17_SD_D3,
> > + MPP28_GPIO,
> > MPP29_GPIO,
> > + MPP34_GPIO,
> > 0
> > };
> >
> > @@ -67,6 +76,71 @@ static struct i2c_board_info i2c_board_info[] __initdata = {
> > },
> > };
> >
> > +static int __initdata uart1;
>
static int __initdata uart1 = -EINVAL;
> > +
> > +static int __init sd_uart_selection(char *str)
> > +{
> > + /* Default is SD. Change if required, for UART */
> > + if (!str)
> > + return 0;
> > +
> > + if (!strncmp(str, "232", 3)) {
> > + uart1 = 232;
> > + } else if (!strncmp(str, "485", 3)) {
> > + /* OpenRD-Base doesn't have RS485. Treat is as an
> > + * unknown argument & just have default setting -
> > + * which is SD */
> > + if (machine_is_openrd_base())
> > + return 1;
> > +
> >
> uart1 = -ENODEV;
> return 1;
>
> > + uart1 = 485;
> > + }
> > + return 1;
> >
> uart1 = -EINVAL;
> return 1;
>
Drop this suggested amendment.
Cheers
--
Alexander Clouter
.sigmonster says: What I need is a MATURE RELATIONSHIP with a FLOPPY DISK ...
^ permalink raw reply [flat|nested] 42+ messages in thread
* [PATCH v2] OpenRD: Enable SD/UART selection for serial port 1
2010-08-10 8:58 ` Alexander Clouter
@ 2010-08-10 10:27 ` Tanmay Upadhyay
2010-08-10 10:28 ` Alexander Clouter
0 siblings, 1 reply; 42+ messages in thread
From: Tanmay Upadhyay @ 2010-08-10 10:27 UTC (permalink / raw)
To: linux-arm-kernel
On 08/10/2010 02:28 PM, Alexander Clouter wrote:
> Hi,
>
> Just a quick amendment;
>
> * Alexander Clouter<alex@digriz.org.uk> [2010-08-10 09:56:43+0100]:
>
>> * Tanmay Upadhyay<tanmay.upadhyay@einfochips.com> [2010-08-10 13:59:33+0530]:
>>
>>> This patch enables user to use serial port 1 of the OpenRD device for SDIO
>>> or UART(RS232/RS485). The selection can be done through kernel parameter.
>>>
>>> By default the port would be used for SDIO. To select RS232 or RS485 mode,
>>> pass string "uart=232" or "uart=485" respectively in the kernel parameters.
>>> "uart=485" is ignored on OpenRD-Base as it doesn't have RS485 port.
>>>
>>> Signed-off-by: Tanmay Upadhyay<tanmay.upadhyay@einfochips.com>
>>> ---
>>> arch/arm/mach-kirkwood/openrd-setup.c | 92 ++++++++++++++++++++++++++++++++-
>>> 1 files changed, 91 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/arch/arm/mach-kirkwood/openrd-setup.c b/arch/arm/mach-kirkwood/openrd-setup.c
>>> index fd06be6..cd061ab 100644
>>> --- a/arch/arm/mach-kirkwood/openrd-setup.c
>>> +++ b/arch/arm/mach-kirkwood/openrd-setup.c
>>> @@ -19,6 +19,7 @@
>>> #include<asm/mach-types.h>
>>> #include<asm/mach/arch.h>
>>> #include<mach/kirkwood.h>
>>> +#include<mach/gpio.h>
>>> #include<plat/mvsdio.h>
>>> #include "common.h"
>>> #include "mpp.h"
>>> @@ -57,7 +58,15 @@ static struct mvsdio_platform_data openrd_mvsdio_data = {
>>> };
>>>
>>> static unsigned int openrd_mpp_config[] __initdata = {
>>> + MPP12_SD_CLK,
>>> + MPP13_SD_CMD,
>>> + MPP14_SD_D0,
>>> + MPP15_SD_D1,
>>> + MPP16_SD_D2,
>>> + MPP17_SD_D3,
>>> + MPP28_GPIO,
>>> MPP29_GPIO,
>>> + MPP34_GPIO,
>>> 0
>>> };
>>>
>>> @@ -67,6 +76,71 @@ static struct i2c_board_info i2c_board_info[] __initdata = {
>>> },
>>> };
>>>
>>> +static int __initdata uart1;
>>>
>>
> static int __initdata uart1 = -EINVAL;
>
>
>>> +
>>> +static int __init sd_uart_selection(char *str)
>>> +{
>>> + /* Default is SD. Change if required, for UART */
>>> + if (!str)
>>> + return 0;
>>> +
>>> + if (!strncmp(str, "232", 3)) {
>>> + uart1 = 232;
>>> + } else if (!strncmp(str, "485", 3)) {
>>> + /* OpenRD-Base doesn't have RS485. Treat is as an
>>> + * unknown argument& just have default setting -
>>> + * which is SD */
>>> + if (machine_is_openrd_base())
>>> + return 1;
>>> +
>>>
>>>
>> uart1 = -ENODEV;
>> return 1;
>>
>>
>>> + uart1 = 485;
>>> + }
>>> + return 1;
>>>
>>>
>> uart1 = -EINVAL;
>> return 1;
>>
>>
> Drop this suggested amendment.
>
> Cheers
>
>
Intention here is to provide SD support by default. It will be switched
to UART mode only if someone asks to do so via kernel parameter. If
someone doesn't give OR gives improper kernel parameter, he/she won't
get UART1. It will simply fall-back to the default setting - which is SD
support.
Does this make sense? Please suggest.
Thanks,
Tanmay
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20100810/d3ec9071/attachment-0001.html>
^ permalink raw reply [flat|nested] 42+ messages in thread
* [PATCH v2] OpenRD: Enable SD/UART selection for serial port 1
2010-08-10 10:27 ` Tanmay Upadhyay
@ 2010-08-10 10:28 ` Alexander Clouter
2010-08-10 10:49 ` Tanmay Upadhyay
0 siblings, 1 reply; 42+ messages in thread
From: Alexander Clouter @ 2010-08-10 10:28 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
* Tanmay Upadhyay <tanmay.upadhyay@einfochips.com> [2010-08-10 15:52:14+0530]:
>
> Intention here is to provide SD support by default. It will be switched
> to UART mode only if someone asks to do so via kernel parameter. If
> someone doesn't give OR gives improper kernel parameter, he/she won't get
> UART1. It will simply fall-back to the default setting - which is SD
> support.
>
My mis-type, I forgot to put a
'kirkwood_sdio_init(&openrd_mvsdio_data);' after my added printk().
Cheers
--
Alexander Clouter
.sigmonster says: BOFH excuse #367:
Webmasters kidnapped by evil cult.
^ permalink raw reply [flat|nested] 42+ messages in thread
* [PATCH v2] OpenRD: Enable SD/UART selection for serial port 1
2010-08-10 10:28 ` Alexander Clouter
@ 2010-08-10 10:49 ` Tanmay Upadhyay
2010-08-10 11:53 ` Alexander Clouter
0 siblings, 1 reply; 42+ messages in thread
From: Tanmay Upadhyay @ 2010-08-10 10:49 UTC (permalink / raw)
To: linux-arm-kernel
On 08/10/2010 03:58 PM, Alexander Clouter wrote:
> Hi,
>
> * Tanmay Upadhyay<tanmay.upadhyay@einfochips.com> [2010-08-10 15:52:14+0530]:
>
>> Intention here is to provide SD support by default. It will be switched
>> to UART mode only if someone asks to do so via kernel parameter. If
>> someone doesn't give OR gives improper kernel parameter, he/she won't get
>> UART1. It will simply fall-back to the default setting - which is SD
>> support.
>>
>>
> My mis-type, I forgot to put a
> 'kirkwood_sdio_init(&openrd_mvsdio_data);' after my added printk().
>
> Cheers
>
>
If I understood correctly, intention behind this is to inform user that
he/she made a mistake while passing the kernel parameters. Is this correct?
Thanks,
Tanmay
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20100810/5e2bfe4c/attachment-0001.html>
^ permalink raw reply [flat|nested] 42+ messages in thread
* [PATCH v2] OpenRD: Enable SD/UART selection for serial port 1
2010-08-10 10:49 ` Tanmay Upadhyay
@ 2010-08-10 11:53 ` Alexander Clouter
2010-08-11 5:21 ` Tanmay Upadhyay
0 siblings, 1 reply; 42+ messages in thread
From: Alexander Clouter @ 2010-08-10 11:53 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
* Tanmay Upadhyay <tanmay.upadhyay@einfochips.com> [2010-08-10 16:20:20+0530]:
>
> On 08/10/2010 03:58 PM, Alexander Clouter wrote:
>>
>> * Tanmay Upadhyay<tanmay.upadhyay@einfochips.com> [2010-08-10 15:52:14+0530]:
>>
>>> Intention here is to provide SD support by default. It will be switched
>>> to UART mode only if someone asks to do so via kernel parameter. If
>>> someone doesn't give OR gives improper kernel parameter, he/she won't get
>>> UART1. It will simply fall-back to the default setting - which is SD
>>> support.
>>
>> My mis-type, I forgot to put a
>> 'kirkwood_sdio_init(&openrd_mvsdio_data);' after my added printk().
>>
> If I understood correctly, intention behind this is to inform user that
> he/she made a mistake while passing the kernel parameters. Is this
> correct?
>
Exactly, and there is no harm turning on the SD slot rather than UART1
at the same time.
Cheers
--
Alexander Clouter
.sigmonster says: tax office, n.:
Den of inequity.
^ permalink raw reply [flat|nested] 42+ messages in thread
* [PATCH v2] OpenRD: Enable SD/UART selection for serial port 1
2010-08-10 11:53 ` Alexander Clouter
@ 2010-08-11 5:21 ` Tanmay Upadhyay
0 siblings, 0 replies; 42+ messages in thread
From: Tanmay Upadhyay @ 2010-08-11 5:21 UTC (permalink / raw)
To: linux-arm-kernel
On 08/10/2010 05:23 PM, Alexander Clouter wrote:
> Hi,
>
> * Tanmay Upadhyay<tanmay.upadhyay@einfochips.com> [2010-08-10 16:20:20+0530]:
>
>> On 08/10/2010 03:58 PM, Alexander Clouter wrote:
>>
>>> * Tanmay Upadhyay<tanmay.upadhyay@einfochips.com> [2010-08-10 15:52:14+0530]:
>>>
>>>
>>>> Intention here is to provide SD support by default. It will be switched
>>>> to UART mode only if someone asks to do so via kernel parameter. If
>>>> someone doesn't give OR gives improper kernel parameter, he/she won't get
>>>> UART1. It will simply fall-back to the default setting - which is SD
>>>> support.
>>>>
>>> My mis-type, I forgot to put a
>>> 'kirkwood_sdio_init(&openrd_mvsdio_data);' after my added printk().
>>>
>>>
>> If I understood correctly, intention behind this is to inform user that
>> he/she made a mistake while passing the kernel parameters. Is this
>> correct?
>>
>>
> Exactly, and there is no harm turning on the SD slot rather than UART1
> at the same time.
>
> Cheers
>
>
Sent version 3 to the list.
-- Tanmay
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20100811/844218f3/attachment-0001.html>
^ permalink raw reply [flat|nested] 42+ messages in thread
* [v2 0/7] OMAP: GPIO: Use PM runtime framework
[not found] <no>
2010-08-10 8:29 ` [PATCH v2] OpenRD: Enable SD/UART selection for serial port 1 Tanmay Upadhyay
2010-08-10 8:40 ` [PATCH] ARM: Fix broken Kconfig in arch/arm Tanmay Upadhyay
@ 2011-04-18 15:06 ` Varadarajan, Charulatha
2011-04-19 6:26 ` Tony Lindgren
2011-04-18 15:06 ` [PATCH 1/7] OMAP: GPIO: Make gpio_context part of gpio_bank structure Varadarajan, Charulatha
` (9 subsequent siblings)
12 siblings, 1 reply; 42+ messages in thread
From: Varadarajan, Charulatha @ 2011-04-18 15:06 UTC (permalink / raw)
To: linux-arm-kernel
From: Charulatha V <charu@ti.com>
Use PM runtime framework in OMAP GPIO driver.
Patch series is based on mainline rc3 following commit
commit a1b49cb7e2a7961ec3aa8b64860bf480d4ec9077
Merge branch 'i2c-for-linus' of
git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging
Changes in v2:
* Use a per-bank flag 'looses_context' (using pwrdm_can_ever_lose_context())
instead of using the powerdomain name
* Make use of omap_device_get_context_loss_count() to decide on if restore
context needs to be done.
* Do not remove #ifdef CONFIG_ARCH_OMAP2PLUS
* Do not use pm_runtime_suspended() before calling pm_runtime_get_sync/put_sync
* use IS_ERR_VALUE() instead of '< 0' in "if" conditions
(Thanks to Kevin and Paul for the above suggestions)
Previous version of this patch series is available at:
http://ns.spinics.net/lists/linux-omap/msg48167.html
http://ns.spinics.net/lists/linux-omap/msg47989.html
http://ns.spinics.net/lists/linux-omap/msg47827.html
http://ns.spinics.net/lists/linux-omap/msg47830.html
Compile tested for:
- omap1_defconfig
- omap2plus_defconfig
Boot test (success on the following boards):
- OMAP1710-H3
- OMAP2420-H4
- OMAP3430-SDP
- OMAP3430-Zoom2
- OMAP3630-Zoom3
- OMAP4430-SDP
GPIO module functionality testing (success on the following boards):
- OMAP2420-H4
- OMAP3430-SDP
- OMAP3430-Zoom2
- OMAP3630-Zoom3
- OMAP4430-SDP
PM Testing (success as given below):
OMAP3430-SDP: retention, off_mode, system_wide suspend, gpio wakeup
OMAP3630-Zoom3: retention, system_wide suspend
using the following:
echo 5 > /sys/devices/platform/omap/omap_uart.0/sleep_timeout
echo 5 > /sys/devices/platform/omap/omap_uart.1/sleep_timeout
echo 5 > /sys/devices/platform/omap/omap_uart.2/sleep_timeout
echo 5 > /sys/devices/platform/omap/omap_uart.3/sleep_timeout
echo '5' > /debug/pm_debug/wakeup_timer_seconds
echo 1 > /debug/pm_debug/sleep_while_idle
echo 1 > /debug/pm_debug/enable_off_mode
echo mem > /sys/power/state
Charulatha V (7):
OMAP: GPIO: Make gpio_context part of gpio_bank structure
OMAP: GPIO: Use flag to identify wkup dmn GPIO
OMAP4: GPIO: Save/restore context
OMAP: GPIO: handle save/restore ctx in GPIO driver
OMAP2+: GPIO: make workaround_enabled bank specific
OMAP: GPIO: Cleanup prepare_for_idle/resume
OMAP: GPIO: use PM runtime framework
arch/arm/mach-omap2/gpio.c | 6 +
arch/arm/mach-omap2/pm34xx.c | 22 +-
arch/arm/plat-omap/gpio.c | 766 ++++++++++++++++++--------------
arch/arm/plat-omap/include/plat/gpio.h | 3 +-
4 files changed, 439 insertions(+), 358 deletions(-)
^ permalink raw reply [flat|nested] 42+ messages in thread
* [PATCH 1/7] OMAP: GPIO: Make gpio_context part of gpio_bank structure
[not found] <no>
` (2 preceding siblings ...)
2011-04-18 15:06 ` [v2 0/7] OMAP: GPIO: Use PM runtime framework Varadarajan, Charulatha
@ 2011-04-18 15:06 ` Varadarajan, Charulatha
2011-04-18 15:06 ` [PATCH 2/7] OMAP: GPIO: Use flag to identify wkup dmn GPIO Varadarajan, Charulatha
` (8 subsequent siblings)
12 siblings, 0 replies; 42+ messages in thread
From: Varadarajan, Charulatha @ 2011-04-18 15:06 UTC (permalink / raw)
To: linux-arm-kernel
From: Charulatha V <charu@ti.com>
gpio_context array, which is used to save gpio bank's context,
is used only for OMAP3 architecture.
Move gpio_context as part of gpio_bank structure so that
it can be specific to each gpio bank and can be used for
any OMAP architecture
TODO: extend the gpio save/restore context function for OMAP4
architecture. This is done in one of the next patches in this
series
Signed-off-by: Charulatha V <charu@ti.com>
---
arch/arm/plat-omap/gpio.c | 72 +++++++++++++++++++++-----------------------
1 files changed, 34 insertions(+), 38 deletions(-)
diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index d2adcdd..c8736b0 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -133,6 +133,19 @@
#define OMAP4_GPIO_CLEARDATAOUT 0x0190
#define OMAP4_GPIO_SETDATAOUT 0x0194
+struct gpio_regs {
+ u32 irqenable1;
+ u32 irqenable2;
+ u32 wake_en;
+ u32 ctrl;
+ u32 oe;
+ u32 leveldetect0;
+ u32 leveldetect1;
+ u32 risingdetect;
+ u32 fallingdetect;
+ u32 dataout;
+};
+
struct gpio_bank {
unsigned long pbase;
void __iomem *base;
@@ -145,7 +158,7 @@ struct gpio_bank {
#endif
u32 non_wakeup_gpios;
u32 enabled_non_wakeup_gpios;
-
+ struct gpio_regs context;
u32 saved_datain;
u32 saved_fallingdetect;
u32 saved_risingdetect;
@@ -161,23 +174,6 @@ struct gpio_bank {
int stride;
};
-#ifdef CONFIG_ARCH_OMAP3
-struct omap3_gpio_regs {
- u32 irqenable1;
- u32 irqenable2;
- u32 wake_en;
- u32 ctrl;
- u32 oe;
- u32 leveldetect0;
- u32 leveldetect1;
- u32 risingdetect;
- u32 fallingdetect;
- u32 dataout;
-};
-
-static struct omap3_gpio_regs gpio_context[OMAP34XX_NR_GPIOS];
-#endif
-
/*
* TODO: Cleanup gpio_bank usage as it is having information
* related to all instances of the device
@@ -2034,25 +2030,25 @@ void omap_gpio_save_context(void)
/* saving banks from 2-6 only since GPIO1 is in WKUP */
for (i = 1; i < gpio_bank_count; i++) {
struct gpio_bank *bank = &gpio_bank[i];
- gpio_context[i].irqenable1 =
+ bank->context.irqenable1 =
__raw_readl(bank->base + OMAP24XX_GPIO_IRQENABLE1);
- gpio_context[i].irqenable2 =
+ bank->context.irqenable2 =
__raw_readl(bank->base + OMAP24XX_GPIO_IRQENABLE2);
- gpio_context[i].wake_en =
+ bank->context.wake_en =
__raw_readl(bank->base + OMAP24XX_GPIO_WAKE_EN);
- gpio_context[i].ctrl =
+ bank->context.ctrl =
__raw_readl(bank->base + OMAP24XX_GPIO_CTRL);
- gpio_context[i].oe =
+ bank->context.oe =
__raw_readl(bank->base + OMAP24XX_GPIO_OE);
- gpio_context[i].leveldetect0 =
+ bank->context.leveldetect0 =
__raw_readl(bank->base + OMAP24XX_GPIO_LEVELDETECT0);
- gpio_context[i].leveldetect1 =
+ bank->context.leveldetect1 =
__raw_readl(bank->base + OMAP24XX_GPIO_LEVELDETECT1);
- gpio_context[i].risingdetect =
+ bank->context.risingdetect =
__raw_readl(bank->base + OMAP24XX_GPIO_RISINGDETECT);
- gpio_context[i].fallingdetect =
+ bank->context.fallingdetect =
__raw_readl(bank->base + OMAP24XX_GPIO_FALLINGDETECT);
- gpio_context[i].dataout =
+ bank->context.dataout =
__raw_readl(bank->base + OMAP24XX_GPIO_DATAOUT);
}
}
@@ -2064,25 +2060,25 @@ void omap_gpio_restore_context(void)
for (i = 1; i < gpio_bank_count; i++) {
struct gpio_bank *bank = &gpio_bank[i];
- __raw_writel(gpio_context[i].irqenable1,
+ __raw_writel(bank->context.irqenable1,
bank->base + OMAP24XX_GPIO_IRQENABLE1);
- __raw_writel(gpio_context[i].irqenable2,
+ __raw_writel(bank->context.irqenable2,
bank->base + OMAP24XX_GPIO_IRQENABLE2);
- __raw_writel(gpio_context[i].wake_en,
+ __raw_writel(bank->context.wake_en,
bank->base + OMAP24XX_GPIO_WAKE_EN);
- __raw_writel(gpio_context[i].ctrl,
+ __raw_writel(bank->context.ctrl,
bank->base + OMAP24XX_GPIO_CTRL);
- __raw_writel(gpio_context[i].oe,
+ __raw_writel(bank->context.oe,
bank->base + OMAP24XX_GPIO_OE);
- __raw_writel(gpio_context[i].leveldetect0,
+ __raw_writel(bank->context.leveldetect0,
bank->base + OMAP24XX_GPIO_LEVELDETECT0);
- __raw_writel(gpio_context[i].leveldetect1,
+ __raw_writel(bank->context.leveldetect1,
bank->base + OMAP24XX_GPIO_LEVELDETECT1);
- __raw_writel(gpio_context[i].risingdetect,
+ __raw_writel(bank->context.risingdetect,
bank->base + OMAP24XX_GPIO_RISINGDETECT);
- __raw_writel(gpio_context[i].fallingdetect,
+ __raw_writel(bank->context.fallingdetect,
bank->base + OMAP24XX_GPIO_FALLINGDETECT);
- __raw_writel(gpio_context[i].dataout,
+ __raw_writel(bank->context.dataout,
bank->base + OMAP24XX_GPIO_DATAOUT);
}
}
--
1.7.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH 2/7] OMAP: GPIO: Use flag to identify wkup dmn GPIO
[not found] <no>
` (3 preceding siblings ...)
2011-04-18 15:06 ` [PATCH 1/7] OMAP: GPIO: Make gpio_context part of gpio_bank structure Varadarajan, Charulatha
@ 2011-04-18 15:06 ` Varadarajan, Charulatha
2011-04-18 15:06 ` [PATCH 3/7] OMAP4: GPIO: Save/restore context Varadarajan, Charulatha
` (7 subsequent siblings)
12 siblings, 0 replies; 42+ messages in thread
From: Varadarajan, Charulatha @ 2011-04-18 15:06 UTC (permalink / raw)
To: linux-arm-kernel
From: Charulatha V <charu@ti.com>
In omap3, save/restore context is implemented for GPIO
banks 2-6 as GPIO bank1 is in wakeup domain. Instead
of identifying bank's power domain by bank id, make use
of a flag "losses_context" which is filled by
pwrdm_can_ever_lose_context() during dev_init.
For getting the powerdomain pointer, omap_hwmod_get_pwrdm()
is used. omap_device_get_pwrdm() could not be used as the
pwrdm information needs to be filled in pdata, whereas
omap_device_get_pwrdm() could be used only after
omap_device_build() call.
Signed-off-by: Charulatha V <charu@ti.com>
---
arch/arm/mach-omap2/gpio.c | 6 ++++++
arch/arm/plat-omap/gpio.c | 31 ++++++++++++++++++++-----------
arch/arm/plat-omap/include/plat/gpio.h | 1 +
3 files changed, 27 insertions(+), 11 deletions(-)
diff --git a/arch/arm/mach-omap2/gpio.c b/arch/arm/mach-omap2/gpio.c
index 9529842..1f1c604 100644
--- a/arch/arm/mach-omap2/gpio.c
+++ b/arch/arm/mach-omap2/gpio.c
@@ -24,6 +24,8 @@
#include <plat/omap_hwmod.h>
#include <plat/omap_device.h>
+#include "powerdomain.h"
+
static struct omap_device_pm_latency omap_gpio_latency[] = {
[0] = {
.deactivate_func = omap_device_idle_hwmods,
@@ -39,6 +41,7 @@ static int omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused)
struct omap_gpio_dev_attr *dev_attr;
char *name = "omap_gpio";
int id;
+ struct powerdomain *pwrdm;
/*
* extract the device id from name field available in the
@@ -75,6 +78,9 @@ static int omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused)
return -EINVAL;
}
+ pwrdm = omap_hwmod_get_pwrdm(oh);
+ pdata->looses_context = pwrdm_can_ever_lose_context(pwrdm);
+
od = omap_device_build(name, id - 1, oh, pdata,
sizeof(*pdata), omap_gpio_latency,
ARRAY_SIZE(omap_gpio_latency),
diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index c8736b0..74085b5 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -172,6 +172,7 @@ struct gpio_bank {
struct device *dev;
bool dbck_flag;
int stride;
+ bool looses_context;
};
/*
@@ -1711,6 +1712,7 @@ static int __devinit omap_gpio_probe(struct platform_device *pdev)
bank->dbck_flag = pdata->dbck_flag;
bank->stride = pdata->bank_stride;
bank_width = pdata->bank_width;
+ bank->looses_context = pdata->looses_context;
spin_lock_init(&bank->lock);
@@ -1856,16 +1858,15 @@ static int workaround_enabled;
void omap2_gpio_prepare_for_idle(int off_mode)
{
int i, c = 0;
- int min = 0;
- if (cpu_is_omap34xx())
- min = 1;
-
- for (i = min; i < gpio_bank_count; i++) {
+ for (i = 0; i < gpio_bank_count; i++) {
struct gpio_bank *bank = &gpio_bank[i];
u32 l1 = 0, l2 = 0;
int j;
+ if (!bank->looses_context)
+ continue;
+
for (j = 0; j < hweight_long(bank->dbck_enable_mask); j++)
clk_disable(bank->dbck);
@@ -1925,15 +1926,15 @@ void omap2_gpio_prepare_for_idle(int off_mode)
void omap2_gpio_resume_after_idle(void)
{
int i;
- int min = 0;
- if (cpu_is_omap34xx())
- min = 1;
- for (i = min; i < gpio_bank_count; i++) {
+ for (i = 0; i < gpio_bank_count; i++) {
struct gpio_bank *bank = &gpio_bank[i];
u32 l = 0, gen, gen0, gen1;
int j;
+ if (!bank->looses_context)
+ continue;
+
for (j = 0; j < hweight_long(bank->dbck_enable_mask); j++)
clk_enable(bank->dbck);
@@ -2028,8 +2029,12 @@ void omap_gpio_save_context(void)
int i;
/* saving banks from 2-6 only since GPIO1 is in WKUP */
- for (i = 1; i < gpio_bank_count; i++) {
+ for (i = 0; i < gpio_bank_count; i++) {
struct gpio_bank *bank = &gpio_bank[i];
+
+ if (!bank->looses_context)
+ continue;
+
bank->context.irqenable1 =
__raw_readl(bank->base + OMAP24XX_GPIO_IRQENABLE1);
bank->context.irqenable2 =
@@ -2058,8 +2063,12 @@ void omap_gpio_restore_context(void)
{
int i;
- for (i = 1; i < gpio_bank_count; i++) {
+ for (i = 0; i < gpio_bank_count; i++) {
struct gpio_bank *bank = &gpio_bank[i];
+
+ if (!bank->looses_context)
+ continue;
+
__raw_writel(bank->context.irqenable1,
bank->base + OMAP24XX_GPIO_IRQENABLE1);
__raw_writel(bank->context.irqenable2,
diff --git a/arch/arm/plat-omap/include/plat/gpio.h b/arch/arm/plat-omap/include/plat/gpio.h
index cac2e8a..15aeb71 100644
--- a/arch/arm/plat-omap/include/plat/gpio.h
+++ b/arch/arm/plat-omap/include/plat/gpio.h
@@ -77,6 +77,7 @@ struct omap_gpio_platform_data {
int bank_width; /* GPIO bank width */
int bank_stride; /* Only needed for omap1 MPUIO */
bool dbck_flag; /* dbck required or not - True for OMAP3&4 */
+ bool looses_context; /* whether the bank would ever loose context */
};
/* TODO: Analyze removing gpio_bank_count usage from driver code */
--
1.7.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH 3/7] OMAP4: GPIO: Save/restore context
[not found] <no>
` (4 preceding siblings ...)
2011-04-18 15:06 ` [PATCH 2/7] OMAP: GPIO: Use flag to identify wkup dmn GPIO Varadarajan, Charulatha
@ 2011-04-18 15:06 ` Varadarajan, Charulatha
2011-04-21 0:26 ` Kevin Hilman
2011-04-18 15:06 ` [PATCH 4/7] OMAP: GPIO: handle save/restore ctx in GPIO driver Varadarajan, Charulatha
` (6 subsequent siblings)
12 siblings, 1 reply; 42+ messages in thread
From: Varadarajan, Charulatha @ 2011-04-18 15:06 UTC (permalink / raw)
To: linux-arm-kernel
From: Charulatha V <charu@ti.com>
Modify the omap_gpio_save/restore_context to support OMAP4
architecture so that the OMAP GPIO driver need not be modified
when OMAP4 off mode support is available.
Signed-off-by: Charulatha V <charu@ti.com>
---
arch/arm/plat-omap/gpio.c | 131 +++++++++++++++++++++++++++++---------------
1 files changed, 86 insertions(+), 45 deletions(-)
diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index 74085b5..e68da08 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -2022,43 +2022,62 @@ void omap2_gpio_resume_after_idle(void)
#endif
-#ifdef CONFIG_ARCH_OMAP3
-/* save the registers of bank 2-6 */
void omap_gpio_save_context(void)
{
int i;
- /* saving banks from 2-6 only since GPIO1 is in WKUP */
for (i = 0; i < gpio_bank_count; i++) {
struct gpio_bank *bank = &gpio_bank[i];
if (!bank->looses_context)
continue;
- bank->context.irqenable1 =
- __raw_readl(bank->base + OMAP24XX_GPIO_IRQENABLE1);
- bank->context.irqenable2 =
- __raw_readl(bank->base + OMAP24XX_GPIO_IRQENABLE2);
- bank->context.wake_en =
- __raw_readl(bank->base + OMAP24XX_GPIO_WAKE_EN);
- bank->context.ctrl =
- __raw_readl(bank->base + OMAP24XX_GPIO_CTRL);
- bank->context.oe =
- __raw_readl(bank->base + OMAP24XX_GPIO_OE);
- bank->context.leveldetect0 =
- __raw_readl(bank->base + OMAP24XX_GPIO_LEVELDETECT0);
- bank->context.leveldetect1 =
- __raw_readl(bank->base + OMAP24XX_GPIO_LEVELDETECT1);
- bank->context.risingdetect =
- __raw_readl(bank->base + OMAP24XX_GPIO_RISINGDETECT);
- bank->context.fallingdetect =
- __raw_readl(bank->base + OMAP24XX_GPIO_FALLINGDETECT);
- bank->context.dataout =
- __raw_readl(bank->base + OMAP24XX_GPIO_DATAOUT);
+ if (bank->method == METHOD_GPIO_24XX) {
+ bank->context.irqenable1 = __raw_readl(
+ bank->base + OMAP24XX_GPIO_IRQENABLE1);
+ bank->context.irqenable2 = __raw_readl(
+ bank->base + OMAP24XX_GPIO_IRQENABLE2);
+ bank->context.wake_en = __raw_readl(
+ bank->base + OMAP24XX_GPIO_WAKE_EN);
+ bank->context.ctrl = __raw_readl(
+ bank->base + OMAP24XX_GPIO_CTRL);
+ bank->context.oe = __raw_readl(
+ bank->base + OMAP24XX_GPIO_OE);
+ bank->context.leveldetect0 = __raw_readl(bank->base +
+ OMAP24XX_GPIO_LEVELDETECT0);
+ bank->context.leveldetect1 = __raw_readl(bank->base +
+ OMAP24XX_GPIO_LEVELDETECT1);
+ bank->context.risingdetect = __raw_readl(bank->base +
+ OMAP24XX_GPIO_RISINGDETECT);
+ bank->context.fallingdetect = __raw_readl(bank->base +
+ OMAP24XX_GPIO_FALLINGDETECT);
+ bank->context.dataout = __raw_readl(
+ bank->base + OMAP24XX_GPIO_DATAOUT);
+ } else if (bank->method == METHOD_GPIO_44XX) {
+ bank->context.irqenable1 = __raw_readl(
+ bank->base + OMAP4_GPIO_IRQSTATUSSET0);
+ bank->context.irqenable2 = __raw_readl(
+ bank->base + OMAP4_GPIO_IRQSTATUSSET1);
+ bank->context.wake_en = __raw_readl(
+ bank->base + OMAP4_GPIO_IRQWAKEN0);
+ bank->context.ctrl = __raw_readl(
+ bank->base + OMAP4_GPIO_CTRL);
+ bank->context.oe = __raw_readl(
+ bank->base + OMAP24XX_GPIO_OE);
+ bank->context.leveldetect0 = __raw_readl(bank->base +
+ OMAP4_GPIO_LEVELDETECT0);
+ bank->context.leveldetect1 = __raw_readl(bank->base +
+ OMAP4_GPIO_LEVELDETECT1);
+ bank->context.risingdetect = __raw_readl(bank->base +
+ OMAP4_GPIO_RISINGDETECT);
+ bank->context.fallingdetect = __raw_readl(bank->base +
+ OMAP4_GPIO_FALLINGDETECT);
+ bank->context.dataout = __raw_readl(
+ bank->base + OMAP4_GPIO_DATAOUT);
+ }
}
}
-/* restore the required registers of bank 2-6 */
void omap_gpio_restore_context(void)
{
int i;
@@ -2069,29 +2088,51 @@ void omap_gpio_restore_context(void)
if (!bank->looses_context)
continue;
- __raw_writel(bank->context.irqenable1,
- bank->base + OMAP24XX_GPIO_IRQENABLE1);
- __raw_writel(bank->context.irqenable2,
- bank->base + OMAP24XX_GPIO_IRQENABLE2);
- __raw_writel(bank->context.wake_en,
- bank->base + OMAP24XX_GPIO_WAKE_EN);
- __raw_writel(bank->context.ctrl,
- bank->base + OMAP24XX_GPIO_CTRL);
- __raw_writel(bank->context.oe,
- bank->base + OMAP24XX_GPIO_OE);
- __raw_writel(bank->context.leveldetect0,
- bank->base + OMAP24XX_GPIO_LEVELDETECT0);
- __raw_writel(bank->context.leveldetect1,
- bank->base + OMAP24XX_GPIO_LEVELDETECT1);
- __raw_writel(bank->context.risingdetect,
- bank->base + OMAP24XX_GPIO_RISINGDETECT);
- __raw_writel(bank->context.fallingdetect,
- bank->base + OMAP24XX_GPIO_FALLINGDETECT);
- __raw_writel(bank->context.dataout,
- bank->base + OMAP24XX_GPIO_DATAOUT);
+ if (bank->method == METHOD_GPIO_24XX) {
+ __raw_writel(bank->context.irqenable1, bank->base +
+ OMAP24XX_GPIO_IRQENABLE1);
+ __raw_writel(bank->context.irqenable2, bank->base +
+ OMAP24XX_GPIO_IRQENABLE2);
+ __raw_writel(bank->context.wake_en, bank->base +
+ OMAP24XX_GPIO_WAKE_EN);
+ __raw_writel(bank->context.ctrl, bank->base +
+ OMAP24XX_GPIO_CTRL);
+ __raw_writel(bank->context.oe, bank->base +
+ OMAP24XX_GPIO_OE);
+ __raw_writel(bank->context.leveldetect0, bank->base +
+ OMAP24XX_GPIO_LEVELDETECT0);
+ __raw_writel(bank->context.leveldetect1, bank->base +
+ OMAP24XX_GPIO_LEVELDETECT1);
+ __raw_writel(bank->context.risingdetect, bank->base +
+ OMAP24XX_GPIO_RISINGDETECT);
+ __raw_writel(bank->context.fallingdetect, bank->base +
+ OMAP24XX_GPIO_FALLINGDETECT);
+ __raw_writel(bank->context.dataout, bank->base +
+ OMAP24XX_GPIO_DATAOUT);
+ } else if (bank->method == METHOD_GPIO_44XX) {
+ __raw_writel(bank->context.irqenable1, bank->base +
+ OMAP4_GPIO_IRQSTATUSSET0);
+ __raw_writel(bank->context.irqenable2, bank->base +
+ OMAP4_GPIO_IRQSTATUSSET1);
+ __raw_writel(bank->context.wake_en, bank->base +
+ OMAP4_GPIO_IRQWAKEN0);
+ __raw_writel(bank->context.ctrl, bank->base +
+ OMAP4_GPIO_CTRL);
+ __raw_writel(bank->context.oe, bank->base +
+ OMAP24XX_GPIO_OE);
+ __raw_writel(bank->context.leveldetect0, bank->base +
+ OMAP4_GPIO_LEVELDETECT0);
+ __raw_writel(bank->context.leveldetect1, bank->base +
+ OMAP4_GPIO_LEVELDETECT1);
+ __raw_writel(bank->context.risingdetect, bank->base +
+ OMAP4_GPIO_RISINGDETECT);
+ __raw_writel(bank->context.fallingdetect, bank->base +
+ OMAP4_GPIO_FALLINGDETECT);
+ __raw_writel(bank->context.dataout, bank->base +
+ OMAP4_GPIO_DATAOUT);
+ }
}
}
-#endif
static struct platform_driver omap_gpio_driver = {
.probe = omap_gpio_probe,
--
1.7.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH 4/7] OMAP: GPIO: handle save/restore ctx in GPIO driver
[not found] <no>
` (5 preceding siblings ...)
2011-04-18 15:06 ` [PATCH 3/7] OMAP4: GPIO: Save/restore context Varadarajan, Charulatha
@ 2011-04-18 15:06 ` Varadarajan, Charulatha
2011-04-18 15:06 ` [PATCH 5/7] OMAP2+: GPIO: make workaround_enabled bank specific Varadarajan, Charulatha
` (5 subsequent siblings)
12 siblings, 0 replies; 42+ messages in thread
From: Varadarajan, Charulatha @ 2011-04-18 15:06 UTC (permalink / raw)
To: linux-arm-kernel
From: Charulatha V <charu@ti.com>
Modify omap_gpio_prepare_for_idle() & omap_gpio_resume_after_idle()
functions to handle save context & restore context respectively in the
OMAP GPIO driver itself instead of calling these functions from pm specific
files. For this, in gpio_prepare_for_idle(), use
omap_device_get_context_loss_count() and in gpio_resume_after_idle()
call it again. If the count is different, do restore context.
context lost count is modified in omap_sram_idle() path when
pwrdm_post_transition() is called. But pwrdm_post_transition() is called
only after omap_gpio_resume_after_idle() is called. Hence correct this
so that context lost count is modified before calling
omap_gpio_resume_after_idle().
omap_gpio_prepare_for_idle() & omap_gpio_resume_after_idle()
do nothing if none of the GPIOs in a bank is being used.
Also remove usage of cpu_is_* checks from the above mentioned
functions and fix the multi-line comment style
Signed-off-by: Charulatha V <charu@ti.com>
---
Note that the usage of bank->method checks would be re-addressed
during OMAP GPIO cleanup series which would follow this patch series
arch/arm/mach-omap2/pm34xx.c | 22 +---
arch/arm/plat-omap/gpio.c | 226 ++++++++++++++++---------------
arch/arm/plat-omap/include/plat/gpio.h | 2 -
3 files changed, 122 insertions(+), 128 deletions(-)
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index 0c5e3a4..682d147 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -91,16 +91,6 @@ static struct powerdomain *mpu_pwrdm, *neon_pwrdm;
static struct powerdomain *core_pwrdm, *per_pwrdm;
static struct powerdomain *cam_pwrdm;
-static inline void omap3_per_save_context(void)
-{
- omap_gpio_save_context();
-}
-
-static inline void omap3_per_restore_context(void)
-{
- omap_gpio_restore_context();
-}
-
static void omap3_enable_io_chain(void)
{
int timeout = 0;
@@ -395,8 +385,10 @@ void omap_sram_idle(void)
if (!is_suspending())
if (per_next_state < PWRDM_POWER_ON ||
core_next_state < PWRDM_POWER_ON)
- if (!console_trylock())
+ if (!console_trylock()) {
+ pwrdm_post_transition();
goto console_still_active;
+ }
/* PER */
if (per_next_state < PWRDM_POWER_ON) {
@@ -404,8 +396,6 @@ void omap_sram_idle(void)
omap_uart_prepare_idle(2);
omap_uart_prepare_idle(3);
omap2_gpio_prepare_for_idle(per_going_off);
- if (per_next_state == PWRDM_POWER_OFF)
- omap3_per_save_context();
}
/* CORE */
@@ -467,12 +457,12 @@ void omap_sram_idle(void)
}
omap3_intc_resume_idle();
+ pwrdm_post_transition();
+
/* PER */
if (per_next_state < PWRDM_POWER_ON) {
per_prev_state = pwrdm_read_prev_pwrst(per_pwrdm);
omap2_gpio_resume_after_idle();
- if (per_prev_state == PWRDM_POWER_OFF)
- omap3_per_restore_context();
omap_uart_resume_idle(2);
omap_uart_resume_idle(3);
}
@@ -490,8 +480,6 @@ console_still_active:
omap3_disable_io_chain();
}
- pwrdm_post_transition();
-
clkdm_allow_idle(mpu_pwrdm->pwrdm_clkdms[0]);
}
diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index e68da08..5d4ed6c 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -24,6 +24,8 @@
#include <linux/slab.h>
#include <linux/pm_runtime.h>
+#include <plat/omap_device.h>
+
#include <mach/hardware.h>
#include <asm/irq.h>
#include <mach/irqs.h>
@@ -173,6 +175,7 @@ struct gpio_bank {
bool dbck_flag;
int stride;
bool looses_context;
+ u32 ctx_lost_cnt_before;
};
/*
@@ -1852,6 +1855,8 @@ static struct sys_device omap_gpio_device = {
#endif
#ifdef CONFIG_ARCH_OMAP2PLUS
+static void omap_gpio_save_context(struct gpio_bank *bank);
+static void omap_gpio_restore_context(struct gpio_bank *bank);
static int workaround_enabled;
@@ -1861,9 +1866,14 @@ void omap2_gpio_prepare_for_idle(int off_mode)
for (i = 0; i < gpio_bank_count; i++) {
struct gpio_bank *bank = &gpio_bank[i];
+ struct platform_device *pdev;
u32 l1 = 0, l2 = 0;
int j;
+ /* If the gpio bank is not used, do nothing */
+ if (!bank->mod_usage)
+ continue;
+
if (!bank->looses_context)
continue;
@@ -1873,22 +1883,22 @@ void omap2_gpio_prepare_for_idle(int off_mode)
if (!off_mode)
continue;
- /* If going to OFF, remove triggering for all
+ /*
+ * If going to OFF, remove triggering for all
* non-wakeup GPIOs. Otherwise spurious IRQs will be
- * generated. See OMAP2420 Errata item 1.101. */
+ * generated. See OMAP2420 Errata item 1.101.
+ */
if (!(bank->enabled_non_wakeup_gpios))
- continue;
+ goto save_gpio_ctx;
- if (cpu_is_omap24xx() || cpu_is_omap34xx()) {
+ if (bank->method == METHOD_GPIO_24XX) {
bank->saved_datain = __raw_readl(bank->base +
OMAP24XX_GPIO_DATAIN);
l1 = __raw_readl(bank->base +
OMAP24XX_GPIO_FALLINGDETECT);
l2 = __raw_readl(bank->base +
OMAP24XX_GPIO_RISINGDETECT);
- }
-
- if (cpu_is_omap44xx()) {
+ } else if (bank->method == METHOD_GPIO_44XX) {
bank->saved_datain = __raw_readl(bank->base +
OMAP4_GPIO_DATAIN);
l1 = __raw_readl(bank->base +
@@ -1902,19 +1912,23 @@ void omap2_gpio_prepare_for_idle(int off_mode)
l1 &= ~bank->enabled_non_wakeup_gpios;
l2 &= ~bank->enabled_non_wakeup_gpios;
- if (cpu_is_omap24xx() || cpu_is_omap34xx()) {
+ if (bank->method == METHOD_GPIO_24XX) {
__raw_writel(l1, bank->base +
OMAP24XX_GPIO_FALLINGDETECT);
__raw_writel(l2, bank->base +
OMAP24XX_GPIO_RISINGDETECT);
- }
-
- if (cpu_is_omap44xx()) {
+ } else if (bank->method == METHOD_GPIO_44XX) {
__raw_writel(l1, bank->base + OMAP4_GPIO_FALLINGDETECT);
__raw_writel(l2, bank->base + OMAP4_GPIO_RISINGDETECT);
}
c++;
+
+save_gpio_ctx:
+ pdev = to_platform_device(bank->dev);
+ bank->ctx_lost_cnt_before =
+ omap_device_get_context_loss_count(pdev);
+ omap_gpio_save_context(bank);
}
if (!c) {
workaround_enabled = 0;
@@ -1926,33 +1940,43 @@ void omap2_gpio_prepare_for_idle(int off_mode)
void omap2_gpio_resume_after_idle(void)
{
int i;
+ u32 ctx_lost_cnt_after;
for (i = 0; i < gpio_bank_count; i++) {
struct gpio_bank *bank = &gpio_bank[i];
+ struct platform_device *pdev;
u32 l = 0, gen, gen0, gen1;
int j;
+ /* If the gpio bank is not used, do nothing */
+ if (!bank->mod_usage)
+ continue;
+
if (!bank->looses_context)
continue;
for (j = 0; j < hweight_long(bank->dbck_enable_mask); j++)
clk_enable(bank->dbck);
- if (!workaround_enabled)
+ pdev = to_platform_device(bank->dev);
+ ctx_lost_cnt_after = omap_device_get_context_loss_count(pdev);
+
+ if (ctx_lost_cnt_after == bank->ctx_lost_cnt_before)
continue;
+ if (!workaround_enabled)
+ goto restore_gpio_ctx;
+
if (!(bank->enabled_non_wakeup_gpios))
- continue;
+ goto restore_gpio_ctx;
- if (cpu_is_omap24xx() || cpu_is_omap34xx()) {
+ if (bank->method == METHOD_GPIO_24XX) {
__raw_writel(bank->saved_fallingdetect,
bank->base + OMAP24XX_GPIO_FALLINGDETECT);
__raw_writel(bank->saved_risingdetect,
bank->base + OMAP24XX_GPIO_RISINGDETECT);
l = __raw_readl(bank->base + OMAP24XX_GPIO_DATAIN);
- }
-
- if (cpu_is_omap44xx()) {
+ } else if (bank->method == METHOD_GPIO_44XX) {
__raw_writel(bank->saved_fallingdetect,
bank->base + OMAP4_GPIO_FALLINGDETECT);
__raw_writel(bank->saved_risingdetect,
@@ -1960,10 +1984,12 @@ void omap2_gpio_resume_after_idle(void)
l = __raw_readl(bank->base + OMAP4_GPIO_DATAIN);
}
- /* Check if any of the non-wakeup interrupt GPIOs have changed
+ /*
+ * Check if any of the non-wakeup interrupt GPIOs have changed
* state. If so, generate an IRQ by software. This is
* horribly racy, but it's the best we can do to work around
- * this silicon bug. */
+ * this silicon bug.
+ */
l ^= bank->saved_datain;
l &= bank->enabled_non_wakeup_gpios;
@@ -1986,7 +2012,7 @@ void omap2_gpio_resume_after_idle(void)
if (gen) {
u32 old0, old1;
- if (cpu_is_omap24xx() || cpu_is_omap34xx()) {
+ if (bank->method == METHOD_GPIO_24XX) {
old0 = __raw_readl(bank->base +
OMAP24XX_GPIO_LEVELDETECT0);
old1 = __raw_readl(bank->base +
@@ -1999,9 +2025,7 @@ void omap2_gpio_resume_after_idle(void)
OMAP24XX_GPIO_LEVELDETECT0);
__raw_writel(old1, bank->base +
OMAP24XX_GPIO_LEVELDETECT1);
- }
-
- if (cpu_is_omap44xx()) {
+ } else if (bank->method == METHOD_GPIO_44XX) {
old0 = __raw_readl(bank->base +
OMAP4_GPIO_LEVELDETECT0);
old1 = __raw_readl(bank->base +
@@ -2016,123 +2040,107 @@ void omap2_gpio_resume_after_idle(void)
OMAP4_GPIO_LEVELDETECT1);
}
}
+
+restore_gpio_ctx:
+ omap_gpio_restore_context(bank);
}
}
-#endif
-
-void omap_gpio_save_context(void)
+void omap_gpio_save_context(struct gpio_bank *bank)
{
- int i;
-
- for (i = 0; i < gpio_bank_count; i++) {
- struct gpio_bank *bank = &gpio_bank[i];
-
- if (!bank->looses_context)
- continue;
-
- if (bank->method == METHOD_GPIO_24XX) {
- bank->context.irqenable1 = __raw_readl(
+ if (bank->method == METHOD_GPIO_24XX) {
+ bank->context.irqenable1 = __raw_readl(
bank->base + OMAP24XX_GPIO_IRQENABLE1);
- bank->context.irqenable2 = __raw_readl(
+ bank->context.irqenable2 = __raw_readl(
bank->base + OMAP24XX_GPIO_IRQENABLE2);
- bank->context.wake_en = __raw_readl(
+ bank->context.wake_en = __raw_readl(
bank->base + OMAP24XX_GPIO_WAKE_EN);
- bank->context.ctrl = __raw_readl(
+ bank->context.ctrl = __raw_readl(
bank->base + OMAP24XX_GPIO_CTRL);
- bank->context.oe = __raw_readl(
+ bank->context.oe = __raw_readl(
bank->base + OMAP24XX_GPIO_OE);
- bank->context.leveldetect0 = __raw_readl(bank->base +
+ bank->context.leveldetect0 = __raw_readl(bank->base +
OMAP24XX_GPIO_LEVELDETECT0);
- bank->context.leveldetect1 = __raw_readl(bank->base +
+ bank->context.leveldetect1 = __raw_readl(bank->base +
OMAP24XX_GPIO_LEVELDETECT1);
- bank->context.risingdetect = __raw_readl(bank->base +
+ bank->context.risingdetect = __raw_readl(bank->base +
OMAP24XX_GPIO_RISINGDETECT);
- bank->context.fallingdetect = __raw_readl(bank->base +
+ bank->context.fallingdetect = __raw_readl(bank->base +
OMAP24XX_GPIO_FALLINGDETECT);
- bank->context.dataout = __raw_readl(
+ bank->context.dataout = __raw_readl(
bank->base + OMAP24XX_GPIO_DATAOUT);
- } else if (bank->method == METHOD_GPIO_44XX) {
- bank->context.irqenable1 = __raw_readl(
+ } else if (bank->method == METHOD_GPIO_44XX) {
+ bank->context.irqenable1 = __raw_readl(
bank->base + OMAP4_GPIO_IRQSTATUSSET0);
- bank->context.irqenable2 = __raw_readl(
+ bank->context.irqenable2 = __raw_readl(
bank->base + OMAP4_GPIO_IRQSTATUSSET1);
- bank->context.wake_en = __raw_readl(
+ bank->context.wake_en = __raw_readl(
bank->base + OMAP4_GPIO_IRQWAKEN0);
- bank->context.ctrl = __raw_readl(
+ bank->context.ctrl = __raw_readl(
bank->base + OMAP4_GPIO_CTRL);
- bank->context.oe = __raw_readl(
+ bank->context.oe = __raw_readl(
bank->base + OMAP24XX_GPIO_OE);
- bank->context.leveldetect0 = __raw_readl(bank->base +
+ bank->context.leveldetect0 = __raw_readl(bank->base +
OMAP4_GPIO_LEVELDETECT0);
- bank->context.leveldetect1 = __raw_readl(bank->base +
+ bank->context.leveldetect1 = __raw_readl(bank->base +
OMAP4_GPIO_LEVELDETECT1);
- bank->context.risingdetect = __raw_readl(bank->base +
+ bank->context.risingdetect = __raw_readl(bank->base +
OMAP4_GPIO_RISINGDETECT);
- bank->context.fallingdetect = __raw_readl(bank->base +
+ bank->context.fallingdetect = __raw_readl(bank->base +
OMAP4_GPIO_FALLINGDETECT);
- bank->context.dataout = __raw_readl(
+ bank->context.dataout = __raw_readl(
bank->base + OMAP4_GPIO_DATAOUT);
- }
}
}
-void omap_gpio_restore_context(void)
+void omap_gpio_restore_context(struct gpio_bank *bank)
{
- int i;
-
- for (i = 0; i < gpio_bank_count; i++) {
- struct gpio_bank *bank = &gpio_bank[i];
-
- if (!bank->looses_context)
- continue;
-
- if (bank->method == METHOD_GPIO_24XX) {
- __raw_writel(bank->context.irqenable1, bank->base +
- OMAP24XX_GPIO_IRQENABLE1);
- __raw_writel(bank->context.irqenable2, bank->base +
- OMAP24XX_GPIO_IRQENABLE2);
- __raw_writel(bank->context.wake_en, bank->base +
- OMAP24XX_GPIO_WAKE_EN);
- __raw_writel(bank->context.ctrl, bank->base +
- OMAP24XX_GPIO_CTRL);
- __raw_writel(bank->context.oe, bank->base +
- OMAP24XX_GPIO_OE);
- __raw_writel(bank->context.leveldetect0, bank->base +
- OMAP24XX_GPIO_LEVELDETECT0);
- __raw_writel(bank->context.leveldetect1, bank->base +
- OMAP24XX_GPIO_LEVELDETECT1);
- __raw_writel(bank->context.risingdetect, bank->base +
- OMAP24XX_GPIO_RISINGDETECT);
- __raw_writel(bank->context.fallingdetect, bank->base +
- OMAP24XX_GPIO_FALLINGDETECT);
- __raw_writel(bank->context.dataout, bank->base +
- OMAP24XX_GPIO_DATAOUT);
- } else if (bank->method == METHOD_GPIO_44XX) {
- __raw_writel(bank->context.irqenable1, bank->base +
- OMAP4_GPIO_IRQSTATUSSET0);
- __raw_writel(bank->context.irqenable2, bank->base +
- OMAP4_GPIO_IRQSTATUSSET1);
- __raw_writel(bank->context.wake_en, bank->base +
- OMAP4_GPIO_IRQWAKEN0);
- __raw_writel(bank->context.ctrl, bank->base +
- OMAP4_GPIO_CTRL);
- __raw_writel(bank->context.oe, bank->base +
- OMAP24XX_GPIO_OE);
- __raw_writel(bank->context.leveldetect0, bank->base +
- OMAP4_GPIO_LEVELDETECT0);
- __raw_writel(bank->context.leveldetect1, bank->base +
- OMAP4_GPIO_LEVELDETECT1);
- __raw_writel(bank->context.risingdetect, bank->base +
- OMAP4_GPIO_RISINGDETECT);
- __raw_writel(bank->context.fallingdetect, bank->base +
- OMAP4_GPIO_FALLINGDETECT);
- __raw_writel(bank->context.dataout, bank->base +
- OMAP4_GPIO_DATAOUT);
- }
+ if (bank->method == METHOD_GPIO_24XX) {
+ __raw_writel(bank->context.irqenable1, bank->base +
+ OMAP24XX_GPIO_IRQENABLE1);
+ __raw_writel(bank->context.irqenable2, bank->base +
+ OMAP24XX_GPIO_IRQENABLE2);
+ __raw_writel(bank->context.wake_en, bank->base +
+ OMAP24XX_GPIO_WAKE_EN);
+ __raw_writel(bank->context.ctrl, bank->base +
+ OMAP24XX_GPIO_CTRL);
+ __raw_writel(bank->context.oe, bank->base +
+ OMAP24XX_GPIO_OE);
+ __raw_writel(bank->context.leveldetect0, bank->base +
+ OMAP24XX_GPIO_LEVELDETECT0);
+ __raw_writel(bank->context.leveldetect1, bank->base +
+ OMAP24XX_GPIO_LEVELDETECT1);
+ __raw_writel(bank->context.risingdetect, bank->base +
+ OMAP24XX_GPIO_RISINGDETECT);
+ __raw_writel(bank->context.fallingdetect, bank->base +
+ OMAP24XX_GPIO_FALLINGDETECT);
+ __raw_writel(bank->context.dataout, bank->base +
+ OMAP24XX_GPIO_DATAOUT);
+ } else if (bank->method == METHOD_GPIO_44XX) {
+ __raw_writel(bank->context.irqenable1, bank->base +
+ OMAP4_GPIO_IRQSTATUSSET0);
+ __raw_writel(bank->context.irqenable2, bank->base +
+ OMAP4_GPIO_IRQSTATUSSET1);
+ __raw_writel(bank->context.wake_en, bank->base +
+ OMAP4_GPIO_IRQWAKEN0);
+ __raw_writel(bank->context.ctrl, bank->base +
+ OMAP4_GPIO_CTRL);
+ __raw_writel(bank->context.oe, bank->base +
+ OMAP24XX_GPIO_OE);
+ __raw_writel(bank->context.leveldetect0, bank->base +
+ OMAP4_GPIO_LEVELDETECT0);
+ __raw_writel(bank->context.leveldetect1, bank->base +
+ OMAP4_GPIO_LEVELDETECT1);
+ __raw_writel(bank->context.risingdetect, bank->base +
+ OMAP4_GPIO_RISINGDETECT);
+ __raw_writel(bank->context.fallingdetect, bank->base +
+ OMAP4_GPIO_FALLINGDETECT);
+ __raw_writel(bank->context.dataout, bank->base +
+ OMAP4_GPIO_DATAOUT);
}
}
+#endif
static struct platform_driver omap_gpio_driver = {
.probe = omap_gpio_probe,
diff --git a/arch/arm/plat-omap/include/plat/gpio.h b/arch/arm/plat-omap/include/plat/gpio.h
index 15aeb71..84b9106 100644
--- a/arch/arm/plat-omap/include/plat/gpio.h
+++ b/arch/arm/plat-omap/include/plat/gpio.h
@@ -87,8 +87,6 @@ extern void omap2_gpio_prepare_for_idle(int off_mode);
extern void omap2_gpio_resume_after_idle(void);
extern void omap_set_gpio_debounce(int gpio, int enable);
extern void omap_set_gpio_debounce_time(int gpio, int enable);
-extern void omap_gpio_save_context(void);
-extern void omap_gpio_restore_context(void);
/*-------------------------------------------------------------------------*/
/* Wrappers for "new style" GPIO calls, using the new infrastructure
--
1.7.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH 5/7] OMAP2+: GPIO: make workaround_enabled bank specific
[not found] <no>
` (6 preceding siblings ...)
2011-04-18 15:06 ` [PATCH 4/7] OMAP: GPIO: handle save/restore ctx in GPIO driver Varadarajan, Charulatha
@ 2011-04-18 15:06 ` Varadarajan, Charulatha
2011-04-18 15:06 ` [PATCH 6/7] OMAP: GPIO: Cleanup prepare_for_idle/resume Varadarajan, Charulatha
` (4 subsequent siblings)
12 siblings, 0 replies; 42+ messages in thread
From: Varadarajan, Charulatha @ 2011-04-18 15:06 UTC (permalink / raw)
To: linux-arm-kernel
From: Charulatha V <charu@ti.com>
Make workaround_enabled flag bank-specific instead of using a single
flag for all the banks together. This would be helpful while making
use of runtime framework in OMAP GPIO driver which would make the
driver handle each GPIO bank independently.
Also rename workaround_enabled flag to off_mode_wkup_wa_enabled
Signed-off-by: Charulatha V <charu@ti.com>
---
arch/arm/plat-omap/gpio.c | 16 ++++++----------
1 files changed, 6 insertions(+), 10 deletions(-)
diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index 5d4ed6c..5933c98 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -176,6 +176,7 @@ struct gpio_bank {
int stride;
bool looses_context;
u32 ctx_lost_cnt_before;
+ bool off_mode_wkup_wa_enabled;
};
/*
@@ -1636,6 +1637,7 @@ static void __init omap_gpio_chip_init(struct gpio_bank *bank)
static int gpio;
bank->mod_usage = 0;
+ bank->off_mode_wkup_wa_enabled = false;
/*
* REVISIT eventually switch from OMAP-specific gpio structs
* over to the generic ones
@@ -1858,11 +1860,9 @@ static struct sys_device omap_gpio_device = {
static void omap_gpio_save_context(struct gpio_bank *bank);
static void omap_gpio_restore_context(struct gpio_bank *bank);
-static int workaround_enabled;
-
void omap2_gpio_prepare_for_idle(int off_mode)
{
- int i, c = 0;
+ int i;
for (i = 0; i < gpio_bank_count; i++) {
struct gpio_bank *bank = &gpio_bank[i];
@@ -1922,7 +1922,7 @@ void omap2_gpio_prepare_for_idle(int off_mode)
__raw_writel(l2, bank->base + OMAP4_GPIO_RISINGDETECT);
}
- c++;
+ bank->off_mode_wkup_wa_enabled = true;
save_gpio_ctx:
pdev = to_platform_device(bank->dev);
@@ -1930,11 +1930,6 @@ save_gpio_ctx:
omap_device_get_context_loss_count(pdev);
omap_gpio_save_context(bank);
}
- if (!c) {
- workaround_enabled = 0;
- return;
- }
- workaround_enabled = 1;
}
void omap2_gpio_resume_after_idle(void)
@@ -1964,7 +1959,7 @@ void omap2_gpio_resume_after_idle(void)
if (ctx_lost_cnt_after == bank->ctx_lost_cnt_before)
continue;
- if (!workaround_enabled)
+ if (!bank->off_mode_wkup_wa_enabled)
goto restore_gpio_ctx;
if (!(bank->enabled_non_wakeup_gpios))
@@ -2042,6 +2037,7 @@ void omap2_gpio_resume_after_idle(void)
}
restore_gpio_ctx:
+ bank->off_mode_wkup_wa_enabled = false;
omap_gpio_restore_context(bank);
}
--
1.7.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH 6/7] OMAP: GPIO: Cleanup prepare_for_idle/resume
[not found] <no>
` (7 preceding siblings ...)
2011-04-18 15:06 ` [PATCH 5/7] OMAP2+: GPIO: make workaround_enabled bank specific Varadarajan, Charulatha
@ 2011-04-18 15:06 ` Varadarajan, Charulatha
2011-04-18 15:06 ` [PATCH 7/7] OMAP: GPIO: use PM runtime framework Varadarajan, Charulatha
` (3 subsequent siblings)
12 siblings, 0 replies; 42+ messages in thread
From: Varadarajan, Charulatha @ 2011-04-18 15:06 UTC (permalink / raw)
To: linux-arm-kernel
From: Charulatha V <charu@ti.com>
Use a function named gpio_bank_handle_idle() in
omap_gpio_prepare_for_idle() to do the following:
* debounce clock disable
* if the next powerdomain state for the bank is off-mode:
- remove triggering for all non-wakeup GPIOs (this is handled by
a new function named omap_gpio_idle_handle_errata_i468())
- save context
Also handle omap_gpio_resume_after_idle() in a
similar way, using a function gpio_bank_handle_resume().
This would be helpful while modifying OMAP GPIO driver to use
PM runtime framework.
Signed-off-by: Charulatha V <charu@ti.com>
---
arch/arm/plat-omap/gpio.c | 350 ++++++++++++++++++++++++---------------------
1 files changed, 187 insertions(+), 163 deletions(-)
diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index 5933c98..7660c06 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -1747,6 +1747,187 @@ static int __devinit omap_gpio_probe(struct platform_device *pdev)
return 0;
}
+#ifdef CONFIG_ARCH_OMAP2PLUS
+static int is_pwrdm_nxt_state_off;
+
+static inline void omap_gpio_idle_handle_errata_i468(struct gpio_bank *bank)
+{
+ u32 l1 = 0, l2 = 0;
+
+ /*
+ * If going to OFF, remove triggering for all
+ * non-wakeup GPIOs. Otherwise spurious IRQs will be
+ * generated. See OMAP2420 Errata item 1.101.
+ */
+ if (!(bank->enabled_non_wakeup_gpios))
+ return;
+
+ if (bank->method == METHOD_GPIO_24XX) {
+ bank->saved_datain = __raw_readl(bank->base +
+ OMAP24XX_GPIO_DATAIN);
+
+ l1 = __raw_readl(bank->base + OMAP24XX_GPIO_FALLINGDETECT);
+ l2 = __raw_readl(bank->base + OMAP24XX_GPIO_RISINGDETECT);
+ } else if (bank->method == METHOD_GPIO_44XX) {
+ bank->saved_datain = __raw_readl(bank->base +
+ OMAP4_GPIO_DATAIN);
+
+ l1 = __raw_readl(bank->base + OMAP4_GPIO_FALLINGDETECT);
+ l2 = __raw_readl(bank->base + OMAP4_GPIO_RISINGDETECT);
+ }
+
+ bank->saved_fallingdetect = l1;
+ bank->saved_risingdetect = l2;
+ l1 &= ~bank->enabled_non_wakeup_gpios;
+ l2 &= ~bank->enabled_non_wakeup_gpios;
+
+ if (bank->method == METHOD_GPIO_24XX) {
+ __raw_writel(l1, bank->base + OMAP24XX_GPIO_FALLINGDETECT);
+ __raw_writel(l2, bank->base + OMAP24XX_GPIO_RISINGDETECT);
+ } else if (bank->method == METHOD_GPIO_44XX) {
+ __raw_writel(l1, bank->base + OMAP4_GPIO_FALLINGDETECT);
+ __raw_writel(l2, bank->base + OMAP4_GPIO_RISINGDETECT);
+ }
+
+ bank->off_mode_wkup_wa_enabled = true;
+}
+
+static inline void omap_gpio_resume_handle_errata_i468(struct gpio_bank *bank)
+{
+ u32 l = 0, gen, gen0, gen1;
+
+ if (!bank->off_mode_wkup_wa_enabled)
+ return;
+
+ bank->off_mode_wkup_wa_enabled = false;
+
+ if (!(bank->enabled_non_wakeup_gpios))
+ return;
+
+ if (bank->method == METHOD_GPIO_24XX) {
+ __raw_writel(bank->saved_fallingdetect,
+ bank->base + OMAP24XX_GPIO_FALLINGDETECT);
+ __raw_writel(bank->saved_risingdetect,
+ bank->base + OMAP24XX_GPIO_RISINGDETECT);
+
+ l = __raw_readl(bank->base + OMAP24XX_GPIO_DATAIN);
+ } else if (bank->method == METHOD_GPIO_44XX) {
+ __raw_writel(bank->saved_fallingdetect,
+ bank->base + OMAP4_GPIO_FALLINGDETECT);
+ __raw_writel(bank->saved_risingdetect,
+ bank->base + OMAP4_GPIO_RISINGDETECT);
+
+ l = __raw_readl(bank->base + OMAP4_GPIO_DATAIN);
+ }
+
+ /*
+ * Check if any of the non-wakeup interrupt GPIOs have changed
+ * state. If so, generate an IRQ by software. This is
+ * horribly racy, but it's the best we can do to work around
+ * this silicon bug.
+ */
+ l ^= bank->saved_datain;
+ l &= bank->enabled_non_wakeup_gpios;
+
+ /*
+ * No need to generate IRQs for the rising edge for gpio IRQs
+ * configured with falling edge only; and vice versa.
+ */
+ gen0 = l & bank->saved_fallingdetect;
+ gen0 &= bank->saved_datain;
+ gen1 = l & bank->saved_risingdetect;
+ gen1 &= ~(bank->saved_datain);
+
+ /* FIXME: Consider GPIO IRQs with level detections properly! */
+ gen = l & (~(bank->saved_fallingdetect) & ~(bank->saved_risingdetect));
+
+ /* Consider all GPIO IRQs needed to be updated */
+ gen |= gen0 | gen1;
+
+ if (gen) {
+ u32 old0, old1;
+
+ if (bank->method == METHOD_GPIO_24XX) {
+ old0 = __raw_readl(bank->base +
+ OMAP24XX_GPIO_LEVELDETECT0);
+ old1 = __raw_readl(bank->base +
+ OMAP24XX_GPIO_LEVELDETECT1);
+ __raw_writel(old0 | gen, bank->base +
+ OMAP24XX_GPIO_LEVELDETECT0);
+ __raw_writel(old1 | gen, bank->base +
+ OMAP24XX_GPIO_LEVELDETECT1);
+ __raw_writel(old0, bank->base +
+ OMAP24XX_GPIO_LEVELDETECT0);
+ __raw_writel(old1, bank->base +
+ OMAP24XX_GPIO_LEVELDETECT1);
+ } else if (bank->method == METHOD_GPIO_44XX) {
+ old0 = __raw_readl(bank->base +
+ OMAP4_GPIO_LEVELDETECT0);
+ old1 = __raw_readl(bank->base +
+ OMAP4_GPIO_LEVELDETECT1);
+ __raw_writel(old0 | l, bank->base +
+ OMAP4_GPIO_LEVELDETECT0);
+ __raw_writel(old1 | l, bank->base +
+ OMAP4_GPIO_LEVELDETECT1);
+ __raw_writel(old0, bank->base +
+ OMAP4_GPIO_LEVELDETECT0);
+ __raw_writel(old1, bank->base +
+ OMAP4_GPIO_LEVELDETECT1);
+ }
+ }
+}
+
+static int gpio_bank_handle_idle(struct device *dev)
+{
+ struct platform_device *pdev = to_platform_device(dev);
+ struct gpio_bank *bank = &gpio_bank[pdev->id];
+ int j;
+
+ /* If the gpio bank is not used, do nothing */
+ if (!bank->mod_usage || !bank->looses_context)
+ return 0;
+
+ for (j = 0; j < hweight_long(bank->dbck_enable_mask); j++)
+ clk_disable(bank->dbck);
+
+ /* Save the context lost count */
+ bank->ctx_lost_cnt_before =
+ omap_device_get_context_loss_count(pdev);
+
+ if (is_pwrdm_nxt_state_off) {
+ omap_gpio_idle_handle_errata_i468(bank);
+ omap_gpio_save_context(bank);
+ }
+
+ return 0;
+}
+
+static int gpio_bank_handle_resume(struct device *dev)
+{
+ struct platform_device *pdev = to_platform_device(dev);
+ struct gpio_bank *bank = &gpio_bank[pdev->id];
+ u32 ctx_lost_cnt_after;
+ int j;
+
+ /* If the gpio bank is not used, do nothing */
+ if (!bank->mod_usage || !bank->looses_context)
+ return 0;
+
+ for (j = 0; j < hweight_long(bank->dbck_enable_mask); j++)
+ clk_enable(bank->dbck);
+
+ pdev = to_platform_device(bank->dev);
+ ctx_lost_cnt_after = omap_device_get_context_loss_count(pdev);
+
+ if (ctx_lost_cnt_after != bank->ctx_lost_cnt_before) {
+ omap_gpio_resume_handle_errata_i468(bank);
+ omap_gpio_restore_context(bank);
+ }
+
+ return 0;
+}
+#endif
+
#if defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP2PLUS)
static int omap_gpio_suspend(struct sys_device *dev, pm_message_t mesg)
{
@@ -1864,183 +2045,26 @@ void omap2_gpio_prepare_for_idle(int off_mode)
{
int i;
+ is_pwrdm_nxt_state_off = off_mode;
+
for (i = 0; i < gpio_bank_count; i++) {
struct gpio_bank *bank = &gpio_bank[i];
- struct platform_device *pdev;
- u32 l1 = 0, l2 = 0;
- int j;
-
- /* If the gpio bank is not used, do nothing */
- if (!bank->mod_usage)
- continue;
-
- if (!bank->looses_context)
- continue;
-
- for (j = 0; j < hweight_long(bank->dbck_enable_mask); j++)
- clk_disable(bank->dbck);
-
- if (!off_mode)
- continue;
-
- /*
- * If going to OFF, remove triggering for all
- * non-wakeup GPIOs. Otherwise spurious IRQs will be
- * generated. See OMAP2420 Errata item 1.101.
- */
- if (!(bank->enabled_non_wakeup_gpios))
- goto save_gpio_ctx;
-
- if (bank->method == METHOD_GPIO_24XX) {
- bank->saved_datain = __raw_readl(bank->base +
- OMAP24XX_GPIO_DATAIN);
- l1 = __raw_readl(bank->base +
- OMAP24XX_GPIO_FALLINGDETECT);
- l2 = __raw_readl(bank->base +
- OMAP24XX_GPIO_RISINGDETECT);
- } else if (bank->method == METHOD_GPIO_44XX) {
- bank->saved_datain = __raw_readl(bank->base +
- OMAP4_GPIO_DATAIN);
- l1 = __raw_readl(bank->base +
- OMAP4_GPIO_FALLINGDETECT);
- l2 = __raw_readl(bank->base +
- OMAP4_GPIO_RISINGDETECT);
- }
-
- bank->saved_fallingdetect = l1;
- bank->saved_risingdetect = l2;
- l1 &= ~bank->enabled_non_wakeup_gpios;
- l2 &= ~bank->enabled_non_wakeup_gpios;
-
- if (bank->method == METHOD_GPIO_24XX) {
- __raw_writel(l1, bank->base +
- OMAP24XX_GPIO_FALLINGDETECT);
- __raw_writel(l2, bank->base +
- OMAP24XX_GPIO_RISINGDETECT);
- } else if (bank->method == METHOD_GPIO_44XX) {
- __raw_writel(l1, bank->base + OMAP4_GPIO_FALLINGDETECT);
- __raw_writel(l2, bank->base + OMAP4_GPIO_RISINGDETECT);
- }
-
- bank->off_mode_wkup_wa_enabled = true;
-save_gpio_ctx:
- pdev = to_platform_device(bank->dev);
- bank->ctx_lost_cnt_before =
- omap_device_get_context_loss_count(pdev);
- omap_gpio_save_context(bank);
+ gpio_bank_handle_idle(bank->dev);
}
}
void omap2_gpio_resume_after_idle(void)
{
int i;
- u32 ctx_lost_cnt_after;
+
+ is_pwrdm_nxt_state_off = 0;
for (i = 0; i < gpio_bank_count; i++) {
struct gpio_bank *bank = &gpio_bank[i];
- struct platform_device *pdev;
- u32 l = 0, gen, gen0, gen1;
- int j;
-
- /* If the gpio bank is not used, do nothing */
- if (!bank->mod_usage)
- continue;
-
- if (!bank->looses_context)
- continue;
-
- for (j = 0; j < hweight_long(bank->dbck_enable_mask); j++)
- clk_enable(bank->dbck);
-
- pdev = to_platform_device(bank->dev);
- ctx_lost_cnt_after = omap_device_get_context_loss_count(pdev);
-
- if (ctx_lost_cnt_after == bank->ctx_lost_cnt_before)
- continue;
-
- if (!bank->off_mode_wkup_wa_enabled)
- goto restore_gpio_ctx;
-
- if (!(bank->enabled_non_wakeup_gpios))
- goto restore_gpio_ctx;
-
- if (bank->method == METHOD_GPIO_24XX) {
- __raw_writel(bank->saved_fallingdetect,
- bank->base + OMAP24XX_GPIO_FALLINGDETECT);
- __raw_writel(bank->saved_risingdetect,
- bank->base + OMAP24XX_GPIO_RISINGDETECT);
- l = __raw_readl(bank->base + OMAP24XX_GPIO_DATAIN);
- } else if (bank->method == METHOD_GPIO_44XX) {
- __raw_writel(bank->saved_fallingdetect,
- bank->base + OMAP4_GPIO_FALLINGDETECT);
- __raw_writel(bank->saved_risingdetect,
- bank->base + OMAP4_GPIO_RISINGDETECT);
- l = __raw_readl(bank->base + OMAP4_GPIO_DATAIN);
- }
-
- /*
- * Check if any of the non-wakeup interrupt GPIOs have changed
- * state. If so, generate an IRQ by software. This is
- * horribly racy, but it's the best we can do to work around
- * this silicon bug.
- */
- l ^= bank->saved_datain;
- l &= bank->enabled_non_wakeup_gpios;
- /*
- * No need to generate IRQs for the rising edge for gpio IRQs
- * configured with falling edge only; and vice versa.
- */
- gen0 = l & bank->saved_fallingdetect;
- gen0 &= bank->saved_datain;
-
- gen1 = l & bank->saved_risingdetect;
- gen1 &= ~(bank->saved_datain);
-
- /* FIXME: Consider GPIO IRQs with level detections properly! */
- gen = l & (~(bank->saved_fallingdetect) &
- ~(bank->saved_risingdetect));
- /* Consider all GPIO IRQs needed to be updated */
- gen |= gen0 | gen1;
-
- if (gen) {
- u32 old0, old1;
-
- if (bank->method == METHOD_GPIO_24XX) {
- old0 = __raw_readl(bank->base +
- OMAP24XX_GPIO_LEVELDETECT0);
- old1 = __raw_readl(bank->base +
- OMAP24XX_GPIO_LEVELDETECT1);
- __raw_writel(old0 | gen, bank->base +
- OMAP24XX_GPIO_LEVELDETECT0);
- __raw_writel(old1 | gen, bank->base +
- OMAP24XX_GPIO_LEVELDETECT1);
- __raw_writel(old0, bank->base +
- OMAP24XX_GPIO_LEVELDETECT0);
- __raw_writel(old1, bank->base +
- OMAP24XX_GPIO_LEVELDETECT1);
- } else if (bank->method == METHOD_GPIO_44XX) {
- old0 = __raw_readl(bank->base +
- OMAP4_GPIO_LEVELDETECT0);
- old1 = __raw_readl(bank->base +
- OMAP4_GPIO_LEVELDETECT1);
- __raw_writel(old0 | l, bank->base +
- OMAP4_GPIO_LEVELDETECT0);
- __raw_writel(old1 | l, bank->base +
- OMAP4_GPIO_LEVELDETECT1);
- __raw_writel(old0, bank->base +
- OMAP4_GPIO_LEVELDETECT0);
- __raw_writel(old1, bank->base +
- OMAP4_GPIO_LEVELDETECT1);
- }
- }
-
-restore_gpio_ctx:
- bank->off_mode_wkup_wa_enabled = false;
- omap_gpio_restore_context(bank);
+ gpio_bank_handle_resume(bank->dev);
}
-
}
void omap_gpio_save_context(struct gpio_bank *bank)
--
1.7.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH 7/7] OMAP: GPIO: use PM runtime framework
[not found] <no>
` (8 preceding siblings ...)
2011-04-18 15:06 ` [PATCH 6/7] OMAP: GPIO: Cleanup prepare_for_idle/resume Varadarajan, Charulatha
@ 2011-04-18 15:06 ` Varadarajan, Charulatha
2011-07-14 9:37 ` [PATCH 1/2] ARM: pxa168: gplugD: Get rid of mfp-gplugd.h Tanmay Upadhyay
` (2 subsequent siblings)
12 siblings, 0 replies; 42+ messages in thread
From: Varadarajan, Charulatha @ 2011-04-18 15:06 UTC (permalink / raw)
To: linux-arm-kernel
From: Charulatha V <charu@ti.com>
Call runtime pm APIs pm_runtime_get_sync() and pm_runtime_put_sync()
for enabling/disabling the clocks, sysconfig settings and remove usage
of clock FW APIs.
Note: OMAP16xx & OMAP2 has interface and functional clocks whereas
OMAP3 & 4 has interface and debounce clocks.
GPIO driver is modified to use dev_pm_ops instead of sysdev_class.
With this approach, omap_gpio_suspend() & omap_gpio_resume()
are not part of sys_dev_class.
Usage of PM runtime get/put APIs in GPIO driver is as given below:
pm_runtime_get_sync():
* in the probe before accessing the GPIO registers
* at the beginning of omap_gpio_request()
-only when one of the gpios is requested on a bank, in which,
no other gpio is being used (when mod_usage becomes non-zero).
This is because omap_gpio_request() is called for all the GPIOs in
a bank.
* at the beginning of omap_gpio_resume_after_idle()
* at the beginning of gpio_irq_handler()
pm_runtime_put_sync():
* in the probe after completing GPIO register access
* at the end of omap_gpio_free()
- only when the last used gpio in the gpio bank is
freed (when mod_usage becomes 0).
* at the end of omap_gpio_prepare_for_idle()
* at the end of gpio_irq_handler()
In omap_gpio_suspend/resume() it is not required to call PM runtime APIs
because omap_gpio_prepare_for_idle()/omap_gpio_resume_after_idle() would
be handling them.
OMAP GPIO Request/ Free:
*During a gpio_request when mod_usage becomes non-zero, the bank
registers are configured with init time configurations inorder to
make sure that the GPIO init time configurations are not lost if
the context was earlier lost when the GPIO bank was not in use.
*omap_gpio_request()/free() functions are called for each GPIO pin in a
given bank whereas PM runtime get_sync/put_sync needs to be called only
once per bank whenever it is required to enable/disable clocks. Hence it
is required to use bank->mod_usage flag in omap_gpio_request()/free()
functions.
TODO:
*Cleanup GPIO driver to avoid usage of gpio_bank_count &
cpu_is_* checks. This would be sent very soon on top of
this patch series.
Signed-off-by: Charulatha V <charu@ti.com>
---
arch/arm/plat-omap/gpio.c | 298 +++++++++++++++++++++++---------------------
1 files changed, 156 insertions(+), 142 deletions(-)
diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index 7660c06..88ef9d7 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -179,6 +179,8 @@ struct gpio_bank {
bool off_mode_wkup_wa_enabled;
};
+static void omap_gpio_mod_init(struct gpio_bank *bank, int id);
+
/*
* TODO: Cleanup gpio_bank usage as it is having information
* related to all instances of the device
@@ -1037,8 +1039,28 @@ static int omap_gpio_request(struct gpio_chip *chip, unsigned offset)
struct gpio_bank *bank = container_of(chip, struct gpio_bank, chip);
unsigned long flags;
+ /*
+ * If this is the first gpio_request for the bank,
+ * enable the bank module
+ */
+ if (!bank->mod_usage) {
+ struct platform_device *pdev = to_platform_device(bank->dev);
+
+ if (IS_ERR_VALUE(pm_runtime_get_sync(bank->dev))) {
+ dev_err(bank->dev, "%s: GPIO bank %d "
+ "pm_runtime_get_sync failed\n",
+ __func__, pdev->id);
+ return -EINVAL;
+ }
+
+ /* Initialize the gpio bank registers to init time value */
+ omap_gpio_mod_init(bank, pdev->id);
+ }
+
spin_lock_irqsave(&bank->lock, flags);
+ bank->mod_usage |= 1 << offset;
+
/* Set trigger to none. You need to enable the desired trigger with
* request_irq() or set_irq_type().
*/
@@ -1053,22 +1075,7 @@ static int omap_gpio_request(struct gpio_chip *chip, unsigned offset)
__raw_writel(__raw_readl(reg) | (1 << offset), reg);
}
#endif
- if (!cpu_class_is_omap1()) {
- if (!bank->mod_usage) {
- void __iomem *reg = bank->base;
- u32 ctrl;
-
- if (cpu_is_omap24xx() || cpu_is_omap34xx())
- reg += OMAP24XX_GPIO_CTRL;
- else if (cpu_is_omap44xx())
- reg += OMAP4_GPIO_CTRL;
- ctrl = __raw_readl(reg);
- /* Module is enabled, clocks are not gated */
- ctrl &= 0xFFFFFFFE;
- __raw_writel(ctrl, reg);
- }
- bank->mod_usage |= 1 << offset;
- }
+
spin_unlock_irqrestore(&bank->lock, flags);
return 0;
@@ -1101,24 +1108,40 @@ static void omap_gpio_free(struct gpio_chip *chip, unsigned offset)
__raw_writel(1 << offset, reg);
}
#endif
- if (!cpu_class_is_omap1()) {
- bank->mod_usage &= ~(1 << offset);
- if (!bank->mod_usage) {
- void __iomem *reg = bank->base;
- u32 ctrl;
-
- if (cpu_is_omap24xx() || cpu_is_omap34xx())
- reg += OMAP24XX_GPIO_CTRL;
- else if (cpu_is_omap44xx())
- reg += OMAP4_GPIO_CTRL;
- ctrl = __raw_readl(reg);
- /* Module is disabled, clocks are gated */
- ctrl |= 1;
- __raw_writel(ctrl, reg);
- }
+ bank->mod_usage &= ~(1 << offset);
+ if (!bank->mod_usage) {
+ void __iomem *reg = bank->base;
+ u32 ctrl;
+
+ if (bank->method == METHOD_GPIO_24XX)
+ reg += OMAP24XX_GPIO_CTRL;
+ else if (bank->method == METHOD_GPIO_44XX)
+ reg += OMAP4_GPIO_CTRL;
+ else
+ goto reset_gpio;
+
+ ctrl = __raw_readl(reg);
+ /* Module is disabled, clocks are gated */
+ ctrl |= 1;
+ __raw_writel(ctrl, reg);
}
+reset_gpio:
_reset_gpio(bank, bank->chip.base + offset);
spin_unlock_irqrestore(&bank->lock, flags);
+
+ /*
+ * If this is the last gpio to be freed in the bank,
+ * disable the bank module
+ */
+ if (!bank->mod_usage) {
+ if (IS_ERR_VALUE(pm_runtime_put_sync(bank->dev) < 0)) {
+ struct platform_device *pdev =
+ to_platform_device(bank->dev);
+ dev_err(bank->dev, "%s: GPIO bank %d "
+ "pm_runtime_put_sync failed\n",
+ __func__, pdev->id);
+ }
+ }
}
/*
@@ -1142,6 +1165,9 @@ static void gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
desc->irq_data.chip->irq_ack(&desc->irq_data);
bank = irq_get_handler_data(irq);
+
+ pm_runtime_get_sync(bank->dev);
+
#ifdef CONFIG_ARCH_OMAP1
if (bank->method == METHOD_MPUIO)
isr_reg = bank->base +
@@ -1233,6 +1259,8 @@ static void gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
exit:
if (!unmasked)
desc->irq_data.chip->irq_unmask(&desc->irq_data);
+
+ pm_runtime_put_sync(bank->dev);
}
static void gpio_irq_shutdown(struct irq_data *d)
@@ -1735,12 +1763,25 @@ static int __devinit omap_gpio_probe(struct platform_device *pdev)
}
pm_runtime_enable(bank->dev);
- pm_runtime_get_sync(bank->dev);
+ pm_runtime_irq_safe(bank->dev);
+
+ if (IS_ERR_VALUE(pm_runtime_get_sync(bank->dev) < 0)) {
+ dev_err(bank->dev, "%s: GPIO bank %d pm_runtime_get_sync "
+ "failed\n", __func__, id);
+ iounmap(bank->base);
+ return -EINVAL;
+ }
- omap_gpio_mod_init(bank, id);
omap_gpio_chip_init(bank);
omap_gpio_show_rev(bank);
+ if (IS_ERR_VALUE(pm_runtime_put_sync(bank->dev) < 0)) {
+ dev_err(bank->dev, "%s: GPIO bank %d pm_runtime_put_sync "
+ "failed\n", __func__, id);
+ iounmap(bank->base);
+ return -EINVAL;
+ }
+
if (!gpio_init_done)
gpio_init_done = 1;
@@ -1748,6 +1789,9 @@ static int __devinit omap_gpio_probe(struct platform_device *pdev)
}
#ifdef CONFIG_ARCH_OMAP2PLUS
+static void omap_gpio_save_context(struct gpio_bank *bank);
+static void omap_gpio_restore_context(struct gpio_bank *bank);
+
static int is_pwrdm_nxt_state_off;
static inline void omap_gpio_idle_handle_errata_i468(struct gpio_bank *bank)
@@ -1876,9 +1920,11 @@ static inline void omap_gpio_resume_handle_errata_i468(struct gpio_bank *bank)
}
}
}
+#endif
-static int gpio_bank_handle_idle(struct device *dev)
+static int omap_gpio_pm_runtime_suspend(struct device *dev)
{
+#ifdef CONFIG_ARCH_OMAP2PLUS
struct platform_device *pdev = to_platform_device(dev);
struct gpio_bank *bank = &gpio_bank[pdev->id];
int j;
@@ -1898,12 +1944,14 @@ static int gpio_bank_handle_idle(struct device *dev)
omap_gpio_idle_handle_errata_i468(bank);
omap_gpio_save_context(bank);
}
+#endif
return 0;
}
-static int gpio_bank_handle_resume(struct device *dev)
+static int omap_gpio_pm_runtime_resume(struct device *dev)
{
+#ifdef CONFIG_ARCH_OMAP2PLUS
struct platform_device *pdev = to_platform_device(dev);
struct gpio_bank *bank = &gpio_bank[pdev->id];
u32 ctx_lost_cnt_after;
@@ -1923,124 +1971,89 @@ static int gpio_bank_handle_resume(struct device *dev)
omap_gpio_resume_handle_errata_i468(bank);
omap_gpio_restore_context(bank);
}
+#endif
return 0;
}
-#endif
-#if defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP2PLUS)
-static int omap_gpio_suspend(struct sys_device *dev, pm_message_t mesg)
+static int omap_gpio_suspend(struct device *dev)
{
- int i;
+ struct platform_device *pdev = to_platform_device(dev);
+ struct gpio_bank *bank = &gpio_bank[pdev->id];
+ void __iomem *wake_status;
+ void __iomem *wake_clear;
+ void __iomem *wake_set;
- if (!cpu_class_is_omap2() && !cpu_is_omap16xx())
+ if (!bank->mod_usage)
return 0;
- for (i = 0; i < gpio_bank_count; i++) {
- struct gpio_bank *bank = &gpio_bank[i];
- void __iomem *wake_status;
- void __iomem *wake_clear;
- void __iomem *wake_set;
- unsigned long flags;
+ switch (bank->method) {
+ case METHOD_GPIO_1610:
+ wake_status = bank->base + OMAP1610_GPIO_WAKEUPENABLE;
+ wake_clear = bank->base + OMAP1610_GPIO_CLEAR_WAKEUPENA;
+ wake_set = bank->base + OMAP1610_GPIO_SET_WAKEUPENA;
+ break;
- switch (bank->method) {
-#ifdef CONFIG_ARCH_OMAP16XX
- case METHOD_GPIO_1610:
- wake_status = bank->base + OMAP1610_GPIO_WAKEUPENABLE;
- wake_clear = bank->base + OMAP1610_GPIO_CLEAR_WAKEUPENA;
- wake_set = bank->base + OMAP1610_GPIO_SET_WAKEUPENA;
- break;
-#endif
-#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
- case METHOD_GPIO_24XX:
- wake_status = bank->base + OMAP24XX_GPIO_WAKE_EN;
- wake_clear = bank->base + OMAP24XX_GPIO_CLEARWKUENA;
- wake_set = bank->base + OMAP24XX_GPIO_SETWKUENA;
- break;
-#endif
-#ifdef CONFIG_ARCH_OMAP4
- case METHOD_GPIO_44XX:
- wake_status = bank->base + OMAP4_GPIO_IRQWAKEN0;
- wake_clear = bank->base + OMAP4_GPIO_IRQWAKEN0;
- wake_set = bank->base + OMAP4_GPIO_IRQWAKEN0;
- break;
-#endif
- default:
- continue;
- }
+ case METHOD_GPIO_24XX:
+ wake_status = bank->base + OMAP24XX_GPIO_WAKE_EN;
+ wake_clear = bank->base + OMAP24XX_GPIO_CLEARWKUENA;
+ wake_set = bank->base + OMAP24XX_GPIO_SETWKUENA;
+ break;
- spin_lock_irqsave(&bank->lock, flags);
- bank->saved_wakeup = __raw_readl(wake_status);
- __raw_writel(0xffffffff, wake_clear);
- __raw_writel(bank->suspend_wakeup, wake_set);
- spin_unlock_irqrestore(&bank->lock, flags);
+ case METHOD_GPIO_44XX:
+ wake_status = bank->base + OMAP4_GPIO_IRQWAKEN0;
+ wake_clear = bank->base + OMAP4_GPIO_IRQWAKEN0;
+ wake_set = bank->base + OMAP4_GPIO_IRQWAKEN0;
+ break;
+
+ default:
+ return 0;
}
+ bank->saved_wakeup = __raw_readl(wake_status);
+ __raw_writel(0xffffffff, wake_clear);
+ __raw_writel(bank->suspend_wakeup, wake_set);
+
return 0;
}
-static int omap_gpio_resume(struct sys_device *dev)
+static int omap_gpio_resume(struct device *dev)
{
- int i;
+ struct platform_device *pdev = to_platform_device(dev);
+ struct gpio_bank *bank = &gpio_bank[pdev->id];
+ void __iomem *wake_clear;
+ void __iomem *wake_set;
- if (!cpu_class_is_omap2() && !cpu_is_omap16xx())
+ if (!bank->mod_usage)
return 0;
- for (i = 0; i < gpio_bank_count; i++) {
- struct gpio_bank *bank = &gpio_bank[i];
- void __iomem *wake_clear;
- void __iomem *wake_set;
- unsigned long flags;
+ switch (bank->method) {
+ case METHOD_GPIO_1610:
+ wake_clear = bank->base + OMAP1610_GPIO_CLEAR_WAKEUPENA;
+ wake_set = bank->base + OMAP1610_GPIO_SET_WAKEUPENA;
+ break;
- switch (bank->method) {
-#ifdef CONFIG_ARCH_OMAP16XX
- case METHOD_GPIO_1610:
- wake_clear = bank->base + OMAP1610_GPIO_CLEAR_WAKEUPENA;
- wake_set = bank->base + OMAP1610_GPIO_SET_WAKEUPENA;
- break;
-#endif
-#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
- case METHOD_GPIO_24XX:
- wake_clear = bank->base + OMAP24XX_GPIO_CLEARWKUENA;
- wake_set = bank->base + OMAP24XX_GPIO_SETWKUENA;
- break;
-#endif
-#ifdef CONFIG_ARCH_OMAP4
- case METHOD_GPIO_44XX:
- wake_clear = bank->base + OMAP4_GPIO_IRQWAKEN0;
- wake_set = bank->base + OMAP4_GPIO_IRQWAKEN0;
- break;
-#endif
- default:
- continue;
- }
+ case METHOD_GPIO_24XX:
+ wake_clear = bank->base + OMAP24XX_GPIO_CLEARWKUENA;
+ wake_set = bank->base + OMAP24XX_GPIO_SETWKUENA;
+ break;
- spin_lock_irqsave(&bank->lock, flags);
- __raw_writel(0xffffffff, wake_clear);
- __raw_writel(bank->saved_wakeup, wake_set);
- spin_unlock_irqrestore(&bank->lock, flags);
+ case METHOD_GPIO_44XX:
+ wake_clear = bank->base + OMAP4_GPIO_IRQWAKEN0;
+ wake_set = bank->base + OMAP4_GPIO_IRQWAKEN0;
+ break;
+
+ default:
+ return 0;
}
+ __raw_writel(0xffffffff, wake_clear);
+ __raw_writel(bank->saved_wakeup, wake_set);
+
return 0;
}
-static struct sysdev_class omap_gpio_sysclass = {
- .name = "gpio",
- .suspend = omap_gpio_suspend,
- .resume = omap_gpio_resume,
-};
-
-static struct sys_device omap_gpio_device = {
- .id = 0,
- .cls = &omap_gpio_sysclass,
-};
-
-#endif
-
#ifdef CONFIG_ARCH_OMAP2PLUS
-static void omap_gpio_save_context(struct gpio_bank *bank);
-static void omap_gpio_restore_context(struct gpio_bank *bank);
-
void omap2_gpio_prepare_for_idle(int off_mode)
{
int i;
@@ -2050,7 +2063,10 @@ void omap2_gpio_prepare_for_idle(int off_mode)
for (i = 0; i < gpio_bank_count; i++) {
struct gpio_bank *bank = &gpio_bank[i];
- gpio_bank_handle_idle(bank->dev);
+ if (IS_ERR_VALUE(pm_runtime_put_sync(bank->dev) < 0))
+ dev_err(bank->dev, "%s: GPIO bank %d "
+ "pm_runtime_put_sync failed\n",
+ __func__, i);
}
}
@@ -2063,7 +2079,10 @@ void omap2_gpio_resume_after_idle(void)
for (i = 0; i < gpio_bank_count; i++) {
struct gpio_bank *bank = &gpio_bank[i];
- gpio_bank_handle_resume(bank->dev);
+ if (IS_ERR_VALUE(pm_runtime_get_sync(bank->dev) < 0))
+ dev_err(bank->dev, "%s: GPIO bank %d "
+ "pm_runtime_get_sync failed\n",
+ __func__, i);
}
}
@@ -2162,10 +2181,18 @@ void omap_gpio_restore_context(struct gpio_bank *bank)
}
#endif
+static const struct dev_pm_ops gpio_pm_ops = {
+ .runtime_suspend = omap_gpio_pm_runtime_suspend,
+ .runtime_resume = omap_gpio_pm_runtime_resume,
+ .suspend = omap_gpio_suspend,
+ .resume = omap_gpio_resume,
+};
+
static struct platform_driver omap_gpio_driver = {
.probe = omap_gpio_probe,
.driver = {
.name = "omap_gpio",
+ .pm = &gpio_pm_ops,
},
};
@@ -2182,21 +2209,8 @@ postcore_initcall(omap_gpio_drv_reg);
static int __init omap_gpio_sysinit(void)
{
- int ret = 0;
-
mpuio_init();
-
-#if defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP2PLUS)
- if (cpu_is_omap16xx() || cpu_class_is_omap2()) {
- if (ret == 0) {
- ret = sysdev_class_register(&omap_gpio_sysclass);
- if (ret == 0)
- ret = sysdev_register(&omap_gpio_device);
- }
- }
-#endif
-
- return ret;
+ return 0;
}
arch_initcall(omap_gpio_sysinit);
--
1.7.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [v2 0/7] OMAP: GPIO: Use PM runtime framework
2011-04-18 15:06 ` [v2 0/7] OMAP: GPIO: Use PM runtime framework Varadarajan, Charulatha
@ 2011-04-19 6:26 ` Tony Lindgren
2011-04-20 23:59 ` Kevin Hilman
0 siblings, 1 reply; 42+ messages in thread
From: Tony Lindgren @ 2011-04-19 6:26 UTC (permalink / raw)
To: linux-arm-kernel
* Varadarajan, Charulatha <charu@ti.com> [110418 18:00]:
> From: Charulatha V <charu@ti.com>
>
> Use PM runtime framework in OMAP GPIO driver.
...
> arch/arm/mach-omap2/gpio.c | 6 +
> arch/arm/mach-omap2/pm34xx.c | 22 +-
> arch/arm/plat-omap/gpio.c | 766 ++++++++++++++++++--------------
> arch/arm/plat-omap/include/plat/gpio.h | 3 +-
> 4 files changed, 439 insertions(+), 358 deletions(-)
Before this series gets merged we first need to do the following:
- Pass some registers in platform_data so we can have common
functions in gpio.c instead of having to test for the bank->method
in each function. This allows getting rid of the ifdefs as
discussed in the ARM Linux consolidation thread.
- Move it to drivers/gpio
- Further consolidate with whatever common GPIO code might
be coming up.
Regards,
Tony
^ permalink raw reply [flat|nested] 42+ messages in thread
* [v2 0/7] OMAP: GPIO: Use PM runtime framework
2011-04-19 6:26 ` Tony Lindgren
@ 2011-04-20 23:59 ` Kevin Hilman
2011-04-21 5:42 ` Tony Lindgren
0 siblings, 1 reply; 42+ messages in thread
From: Kevin Hilman @ 2011-04-20 23:59 UTC (permalink / raw)
To: linux-arm-kernel
Hi Tony,
Tony Lindgren <tony@atomide.com> writes:
> * Varadarajan, Charulatha <charu@ti.com> [110418 18:00]:
>> From: Charulatha V <charu@ti.com>
>>
>> Use PM runtime framework in OMAP GPIO driver.
> ...
>
>> arch/arm/mach-omap2/gpio.c | 6 +
>> arch/arm/mach-omap2/pm34xx.c | 22 +-
>> arch/arm/plat-omap/gpio.c | 766 ++++++++++++++++++--------------
>> arch/arm/plat-omap/include/plat/gpio.h | 3 +-
>> 4 files changed, 439 insertions(+), 358 deletions(-)
>
> Before this series gets merged we first need to do the following:
> - Pass some registers in platform_data so we can have common
> functions in gpio.c instead of having to test for the bank->method
> in each function. This allows getting rid of the ifdefs as
> discussed in the ARM Linux consolidation thread.
I have a series that starts this process, will post it shortly.
> - Move it to drivers/gpio
>
> - Further consolidate with whatever common GPIO code might
> be coming up.
Is the above order required?
IMO, before we move it to drivers/gpio, this code needs to be runtime PM
converted (using this series from Charu.) The runtime PM conversion
removes a bunch of platform-specific hacks that should be moved into
drivers/*.
Personally, I think we should go in this order
- runtime PM conversion
- #ifdef cleanup
- move to drivers/gpio
- look at consolidation with other drivers
I'm willing to queue the GPIO work in my tree while it's under way if
you like as well.
Kevin
^ permalink raw reply [flat|nested] 42+ messages in thread
* [PATCH 3/7] OMAP4: GPIO: Save/restore context
2011-04-18 15:06 ` [PATCH 3/7] OMAP4: GPIO: Save/restore context Varadarajan, Charulatha
@ 2011-04-21 0:26 ` Kevin Hilman
0 siblings, 0 replies; 42+ messages in thread
From: Kevin Hilman @ 2011-04-21 0:26 UTC (permalink / raw)
To: linux-arm-kernel
"Varadarajan, Charulatha" <charu@ti.com> writes:
> From: Charulatha V <charu@ti.com>
>
> Modify the omap_gpio_save/restore_context to support OMAP4
> architecture so that the OMAP GPIO driver need not be modified
> when OMAP4 off mode support is available.
>
> Signed-off-by: Charulatha V <charu@ti.com>
> ---
> arch/arm/plat-omap/gpio.c | 131 +++++++++++++++++++++++++++++---------------
> 1 files changed, 86 insertions(+), 45 deletions(-)
>
> diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
> index 74085b5..e68da08 100644
> --- a/arch/arm/plat-omap/gpio.c
> +++ b/arch/arm/plat-omap/gpio.c
> @@ -2022,43 +2022,62 @@ void omap2_gpio_resume_after_idle(void)
>
> #endif
>
> -#ifdef CONFIG_ARCH_OMAP3
> -/* save the registers of bank 2-6 */
> void omap_gpio_save_context(void)
> {
> int i;
>
> - /* saving banks from 2-6 only since GPIO1 is in WKUP */
Minor: these comment removals belong in the previous patch.
Kevin
^ permalink raw reply [flat|nested] 42+ messages in thread
* [v2 0/7] OMAP: GPIO: Use PM runtime framework
2011-04-20 23:59 ` Kevin Hilman
@ 2011-04-21 5:42 ` Tony Lindgren
2011-04-21 15:15 ` Kevin Hilman
2011-04-23 8:35 ` Linus Walleij
0 siblings, 2 replies; 42+ messages in thread
From: Tony Lindgren @ 2011-04-21 5:42 UTC (permalink / raw)
To: linux-arm-kernel
* Kevin Hilman <khilman@ti.com> [110421 02:56]:
> Hi Tony,
>
> Tony Lindgren <tony@atomide.com> writes:
>
> > * Varadarajan, Charulatha <charu@ti.com> [110418 18:00]:
> >> From: Charulatha V <charu@ti.com>
> >>
> >> Use PM runtime framework in OMAP GPIO driver.
> > ...
> >
> >> arch/arm/mach-omap2/gpio.c | 6 +
> >> arch/arm/mach-omap2/pm34xx.c | 22 +-
> >> arch/arm/plat-omap/gpio.c | 766 ++++++++++++++++++--------------
> >> arch/arm/plat-omap/include/plat/gpio.h | 3 +-
> >> 4 files changed, 439 insertions(+), 358 deletions(-)
> >
> > Before this series gets merged we first need to do the following:
> > - Pass some registers in platform_data so we can have common
> > functions in gpio.c instead of having to test for the bank->method
> > in each function. This allows getting rid of the ifdefs as
> > discussed in the ARM Linux consolidation thread.
>
> I have a series that starts this process, will post it shortly.
Saw that, looks good :) Need to post it also to lakml BTW.
> > - Move it to drivers/gpio
> >
> > - Further consolidate with whatever common GPIO code might
> > be coming up.
>
> Is the above order required?
Yes please. Otherwise we'll have more of the "crazy churn" in
arch/arm/*omap*/ and the runtime PM patches should apply easily
in drivers/gpio too.
> IMO, before we move it to drivers/gpio, this code needs to be runtime PM
> converted (using this series from Charu.) The runtime PM conversion
> removes a bunch of platform-specific hacks that should be moved into
> drivers/*.
>
> Personally, I think we should go in this order
>
> - runtime PM conversion
Let's do this after the consolidation and move to drivers/gpio.
This way any additions can be reviewed by the drivers/gpio maintainers.
> - #ifdef cleanup
Looks like you got this already done :)
> - move to drivers/gpio
With this part there may be more comments from the drivers/gpio
maintainers so we need to get to this point ASAP.
> - look at consolidation with other drivers
>
> I'm willing to queue the GPIO work in my tree while it's under way if
> you like as well.
If so, please put all the consolidation patches into a separate
branch with absolutely zero additional new code. And let's merge
those branches into linux-omap devel-cleanup branch on regular
basis for testing.
Regards,
Tony
^ permalink raw reply [flat|nested] 42+ messages in thread
* [v2 0/7] OMAP: GPIO: Use PM runtime framework
2011-04-21 5:42 ` Tony Lindgren
@ 2011-04-21 15:15 ` Kevin Hilman
2011-04-22 6:11 ` Tony Lindgren
2011-04-23 8:35 ` Linus Walleij
1 sibling, 1 reply; 42+ messages in thread
From: Kevin Hilman @ 2011-04-21 15:15 UTC (permalink / raw)
To: linux-arm-kernel
Tony Lindgren <tony@atomide.com> writes:
> * Kevin Hilman <khilman@ti.com> [110421 02:56]:
>> Hi Tony,
>>
>> Tony Lindgren <tony@atomide.com> writes:
>>
>> > * Varadarajan, Charulatha <charu@ti.com> [110418 18:00]:
>> >> From: Charulatha V <charu@ti.com>
>> >>
>> >> Use PM runtime framework in OMAP GPIO driver.
>> > ...
>> >
>> >> arch/arm/mach-omap2/gpio.c | 6 +
>> >> arch/arm/mach-omap2/pm34xx.c | 22 +-
>> >> arch/arm/plat-omap/gpio.c | 766 ++++++++++++++++++--------------
>> >> arch/arm/plat-omap/include/plat/gpio.h | 3 +-
>> >> 4 files changed, 439 insertions(+), 358 deletions(-)
>> >
>> > Before this series gets merged we first need to do the following:
>> > - Pass some registers in platform_data so we can have common
>> > functions in gpio.c instead of having to test for the bank->method
>> > in each function. This allows getting rid of the ifdefs as
>> > discussed in the ARM Linux consolidation thread.
>>
>> I have a series that starts this process, will post it shortly.
>
> Saw that, looks good :) Need to post it also to lakml BTW.
Yeah, I only posted to l-o so far because it's not done. I only removed
a few of the #ifdef sections, there are still several more to do.
>> > - Move it to drivers/gpio
>> >
>> > - Further consolidate with whatever common GPIO code might
>> > be coming up.
>>
>> Is the above order required?
>
> Yes please. Otherwise we'll have more of the "crazy churn" in
> arch/arm/*omap*/ and the runtime PM patches should apply easily
> in drivers/gpio too.
>
>> IMO, before we move it to drivers/gpio, this code needs to be runtime PM
>> converted (using this series from Charu.) The runtime PM conversion
>> removes a bunch of platform-specific hacks that should be moved into
>> drivers/*.
>>
>> Personally, I think we should go in this order
>>
>> - runtime PM conversion
>
> Let's do this after the consolidation and move to drivers/gpio.
> This way any additions can be reviewed by the drivers/gpio maintainers.
OK
>> - #ifdef cleanup
>
> Looks like you got this already done :)
Well, it's only partially done. I only converted the direction and data
in/out functions. There are several others to do still.
>> - move to drivers/gpio
>
> With this part there may be more comments from the drivers/gpio
> maintainers so we need to get to this point ASAP.
OK
>> - look at consolidation with other drivers
>>
>> I'm willing to queue the GPIO work in my tree while it's under way if
>> you like as well.
>
> If so, please put all the consolidation patches into a separate
> branch with absolutely zero additional new code. And let's merge
> those branches into linux-omap devel-cleanup branch on regular
> basis for testing.
>
OK
Kevin
^ permalink raw reply [flat|nested] 42+ messages in thread
* [v2 0/7] OMAP: GPIO: Use PM runtime framework
2011-04-21 15:15 ` Kevin Hilman
@ 2011-04-22 6:11 ` Tony Lindgren
0 siblings, 0 replies; 42+ messages in thread
From: Tony Lindgren @ 2011-04-22 6:11 UTC (permalink / raw)
To: linux-arm-kernel
* Kevin Hilman <khilman@ti.com> [110421 18:12]:
> Tony Lindgren <tony@atomide.com> writes:
> >
> > Saw that, looks good :) Need to post it also to lakml BTW.
>
> Yeah, I only posted to l-o so far because it's not done. I only removed
> a few of the #ifdef sections, there are still several more to do.
Oh I see. Anyways looks good to me. I can give it a try next week
too on few boards.
Regards,
Tony
^ permalink raw reply [flat|nested] 42+ messages in thread
* [v2 0/7] OMAP: GPIO: Use PM runtime framework
2011-04-21 5:42 ` Tony Lindgren
2011-04-21 15:15 ` Kevin Hilman
@ 2011-04-23 8:35 ` Linus Walleij
2011-04-26 7:29 ` Tony Lindgren
1 sibling, 1 reply; 42+ messages in thread
From: Linus Walleij @ 2011-04-23 8:35 UTC (permalink / raw)
To: linux-arm-kernel
2011/4/21 Tony Lindgren <tony@atomide.com>:
> * Kevin Hilman <khilman@ti.com> [110421 02:56]:
>> > - Move it to drivers/gpio
>> >
>> > - Further consolidate with whatever common GPIO code might
>> > ? be coming up.
>>
>> Is the above order required?
>
> Yes please. Otherwise we'll have more of the "crazy churn" in
> arch/arm/*omap*/ and the runtime PM patches should apply easily
> in drivers/gpio too.
Since you'll probably be dependent on stuff happening in my patches
to move stuff into drivers/gpio I'll be happy to carry the patches in my
gpio-consolidation branch with Tony's ACKs if need be.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 42+ messages in thread
* [v2 0/7] OMAP: GPIO: Use PM runtime framework
2011-04-23 8:35 ` Linus Walleij
@ 2011-04-26 7:29 ` Tony Lindgren
2011-04-27 13:18 ` Linus Walleij
0 siblings, 1 reply; 42+ messages in thread
From: Tony Lindgren @ 2011-04-26 7:29 UTC (permalink / raw)
To: linux-arm-kernel
* Linus Walleij <linus.walleij@linaro.org> [110423 01:32]:
> 2011/4/21 Tony Lindgren <tony@atomide.com>:
> > * Kevin Hilman <khilman@ti.com> [110421 02:56]:
>
> >> > - Move it to drivers/gpio
> >> >
> >> > - Further consolidate with whatever common GPIO code might
> >> > ? be coming up.
> >>
> >> Is the above order required?
> >
> > Yes please. Otherwise we'll have more of the "crazy churn" in
> > arch/arm/*omap*/ and the runtime PM patches should apply easily
> > in drivers/gpio too.
>
> Since you'll probably be dependent on stuff happening in my patches
> to move stuff into drivers/gpio I'll be happy to carry the patches in my
> gpio-consolidation branch with Tony's ACKs if need be.
Sounds good to me.
Tony
^ permalink raw reply [flat|nested] 42+ messages in thread
* [v2 0/7] OMAP: GPIO: Use PM runtime framework
2011-04-26 7:29 ` Tony Lindgren
@ 2011-04-27 13:18 ` Linus Walleij
2011-05-03 16:22 ` Kevin Hilman
0 siblings, 1 reply; 42+ messages in thread
From: Linus Walleij @ 2011-04-27 13:18 UTC (permalink / raw)
To: linux-arm-kernel
2011/4/26 Tony Lindgren <tony@atomide.com>:
> * Linus Walleij <linus.walleij@linaro.org> [110423 01:32]:
>> Since you'll probably be dependent on stuff happening in my patches
>> to move stuff into drivers/gpio I'll be happy to carry the patches in my
>> gpio-consolidation branch with Tony's ACKs if need be.
>
> Sounds good to me.
I've just posted a patch series that moves "our" two GPIO drivers to
drivers/gpio, they should serve as good inspiration... Tell me if I can
help out, stack patches on top of this series and I'll carry them.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 42+ messages in thread
* [v2 0/7] OMAP: GPIO: Use PM runtime framework
2011-04-27 13:18 ` Linus Walleij
@ 2011-05-03 16:22 ` Kevin Hilman
2011-05-03 21:41 ` Linus Walleij
0 siblings, 1 reply; 42+ messages in thread
From: Kevin Hilman @ 2011-05-03 16:22 UTC (permalink / raw)
To: linux-arm-kernel
Linus Walleij <linus.walleij@linaro.org> writes:
> 2011/4/26 Tony Lindgren <tony@atomide.com>:
>> * Linus Walleij <linus.walleij@linaro.org> [110423 01:32]:
>>> Since you'll probably be dependent on stuff happening in my patches
>>> to move stuff into drivers/gpio I'll be happy to carry the patches in my
>>> gpio-consolidation branch with Tony's ACKs if need be.
>>
>> Sounds good to me.
>
> I've just posted a patch series that moves "our" two GPIO drivers to
> drivers/gpio, they should serve as good inspiration... Tell me if I can
> help out, stack patches on top of this series and I'll carry them.
Great, thanks.
Are you OK with a move of the current OMAP GPIO drivers (rather ugly)
into drivers/gpio first, followed by the cleanup/restructure patches?
Kevin
^ permalink raw reply [flat|nested] 42+ messages in thread
* [v2 0/7] OMAP: GPIO: Use PM runtime framework
2011-05-03 16:22 ` Kevin Hilman
@ 2011-05-03 21:41 ` Linus Walleij
2011-05-04 6:19 ` Tony Lindgren
0 siblings, 1 reply; 42+ messages in thread
From: Linus Walleij @ 2011-05-03 21:41 UTC (permalink / raw)
To: linux-arm-kernel
2011/5/3 Kevin Hilman <khilman@ti.com>:
> Are you OK with a move of the current OMAP GPIO drivers (rather ugly)
> into drivers/gpio first, followed by the cleanup/restructure patches?
In my case I actually did some cleanup after moving the driver for
U300, but I think this is a question to the GPIO maintainer who
I want to ACK this stuff in the end.
Grant?
You can always squash it later ...
Linus Walleij
^ permalink raw reply [flat|nested] 42+ messages in thread
* [v2 0/7] OMAP: GPIO: Use PM runtime framework
2011-05-03 21:41 ` Linus Walleij
@ 2011-05-04 6:19 ` Tony Lindgren
2011-05-12 0:57 ` Linus Walleij
0 siblings, 1 reply; 42+ messages in thread
From: Tony Lindgren @ 2011-05-04 6:19 UTC (permalink / raw)
To: linux-arm-kernel
* Linus Walleij <linus.walleij@linaro.org> [110504 00:37]:
> 2011/5/3 Kevin Hilman <khilman@ti.com>:
>
> > Are you OK with a move of the current OMAP GPIO drivers (rather ugly)
> > into drivers/gpio first, followed by the cleanup/restructure patches?
>
> In my case I actually did some cleanup after moving the driver for
> U300, but I think this is a question to the GPIO maintainer who
> I want to ACK this stuff in the end.
>
> Grant?
>
> You can always squash it later ...
Personally I would prefer absolutely minimal clean-up of current
code before moving to drivers/gpio to cut down the "crazy churn" in
arch/arm/. Also then further changes are easier for the GPIO
maintainers to review.
Of course I understand that this might cause extra load for the
GPIO maintainers, so it's up to the GPIO maintainers to set the
required standards before accepting the code into drivers/gpio.
Regards,
Tony
^ permalink raw reply [flat|nested] 42+ messages in thread
* [v2 0/7] OMAP: GPIO: Use PM runtime framework
2011-05-04 6:19 ` Tony Lindgren
@ 2011-05-12 0:57 ` Linus Walleij
2011-05-12 9:42 ` Kevin Hilman
2011-05-19 19:05 ` Grant Likely
0 siblings, 2 replies; 42+ messages in thread
From: Linus Walleij @ 2011-05-12 0:57 UTC (permalink / raw)
To: linux-arm-kernel
2011/5/4 Tony Lindgren <tony@atomide.com>:
> * Linus Walleij <linus.walleij@linaro.org> [110504 00:37]:
>> 2011/5/3 Kevin Hilman <khilman@ti.com>:
>>
>> > Are you OK with a move of the current OMAP GPIO drivers (rather ugly)
>> > into drivers/gpio first, followed by the cleanup/restructure patches?
>>
>> In my case I actually did some cleanup after moving the driver for
>> U300, but I think this is a question to the GPIO maintainer who
>> I want to ACK this stuff in the end.
>>
>> Grant?
>>
>> You can always squash it later ...
>
> Personally I would prefer absolutely minimal clean-up of current
> code before moving to drivers/gpio to cut down the "crazy churn" in
> arch/arm/. Also then further changes are easier for the GPIO
> maintainers to review.
>
> Of course I understand that this might cause extra load for the
> GPIO maintainers, so it's up to the GPIO maintainers to set the
> required standards before accepting the code into drivers/gpio.
After discussion with Grant (in person) here at UDS I am informed
that he will not be able to review my GPIO consolidation patches in
time to make adjustments needed for this merge window, so we're
aiming at early 2.6.41 for these.
He has indicated that he has problems with the chosen config
mechanism and that we may need to back a few technical
assumptions out, and we need some more time for that.
For example we may need to refer to configurations by a string
or indeed export the struct gpio_chip accessor function
gpio_to_chip() and use custom functions for special stuff,
as was the first idea.
I will do the refactoring once I have a clear indication from the
maintainer where he wants this to end up, so my GPIO
consolidation patches will need to rest for a while.
For TI I guess this currently means you simply cannot work
on GPIO stuff until you know where to go with it unless you
allow the OMAP GPIO authors to keep churning in arch/arm/*...
That's unless Grant is OK with us moving stuff into
drivers/gpio that does *not* use gpiolib and utilize singletons to
get at the gpio_chip addresses (i.e. current form) and keep it
churning like that until it can be refactored.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 42+ messages in thread
* [v2 0/7] OMAP: GPIO: Use PM runtime framework
2011-05-12 0:57 ` Linus Walleij
@ 2011-05-12 9:42 ` Kevin Hilman
2011-05-19 19:08 ` Grant Likely
2011-05-19 19:05 ` Grant Likely
1 sibling, 1 reply; 42+ messages in thread
From: Kevin Hilman @ 2011-05-12 9:42 UTC (permalink / raw)
To: linux-arm-kernel
Linus Walleij <linus.walleij@linaro.org> writes:
[...]
> For TI I guess this currently means you simply cannot work
> on GPIO stuff until you know where to go with it unless you
> allow the OMAP GPIO authors to keep churning in arch/arm/*...
>
> That's unless Grant is OK with us moving stuff into
> drivers/gpio that does *not* use gpiolib and utilize singletons to
> get at the gpio_chip addresses (i.e. current form) and keep it
> churning like that until it can be refactored.
The churn will happen one way or another. the only question is whether
it happens in drivers/gpio or arch/arm/*.
Grant, what's your feeling here. How much ugliness are you willing to
tolerate in a bulk move to drivers/gpio. At least for OMAP, I am
personally be working on the cleanup/move so I can work either way,
although I know Tony has an obvious preference for moving it to
drivers/gpio. :)
The OMAP driver is already using gpiolib. The main ugliness in the OMAP
driver is the awful ifdeffery used to handle the differences across the
various SoCs in the OMAP family. I've already got most of that cleaned
up[1].
Kevin
[1] http://marc.info/?l=linux-omap&m=130351321022770&w=2
^ permalink raw reply [flat|nested] 42+ messages in thread
* [v2 0/7] OMAP: GPIO: Use PM runtime framework
2011-05-12 0:57 ` Linus Walleij
2011-05-12 9:42 ` Kevin Hilman
@ 2011-05-19 19:05 ` Grant Likely
1 sibling, 0 replies; 42+ messages in thread
From: Grant Likely @ 2011-05-19 19:05 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, May 12, 2011 at 02:57:04AM +0200, Linus Walleij wrote:
> 2011/5/4 Tony Lindgren <tony@atomide.com>:
> > * Linus Walleij <linus.walleij@linaro.org> [110504 00:37]:
> >> 2011/5/3 Kevin Hilman <khilman@ti.com>:
> >>
> >> > Are you OK with a move of the current OMAP GPIO drivers (rather ugly)
> >> > into drivers/gpio first, followed by the cleanup/restructure patches?
> >>
> >> In my case I actually did some cleanup after moving the driver for
> >> U300, but I think this is a question to the GPIO maintainer who
> >> I want to ACK this stuff in the end.
> >>
> >> Grant?
> >>
> >> You can always squash it later ...
> >
> > Personally I would prefer absolutely minimal clean-up of current
> > code before moving to drivers/gpio to cut down the "crazy churn" in
> > arch/arm/. Also then further changes are easier for the GPIO
> > maintainers to review.
> >
> > Of course I understand that this might cause extra load for the
> > GPIO maintainers, so it's up to the GPIO maintainers to set the
> > required standards before accepting the code into drivers/gpio.
>
> After discussion with Grant (in person) here at UDS I am informed
> that he will not be able to review my GPIO consolidation patches in
> time to make adjustments needed for this merge window, so we're
> aiming at early 2.6.41 for these.
>
> He has indicated that he has problems with the chosen config
> mechanism and that we may need to back a few technical
> assumptions out, and we need some more time for that.
>
> For example we may need to refer to configurations by a string
> or indeed export the struct gpio_chip accessor function
> gpio_to_chip() and use custom functions for special stuff,
> as was the first idea.
>
> I will do the refactoring once I have a clear indication from the
> maintainer where he wants this to end up, so my GPIO
> consolidation patches will need to rest for a while.
>
> For TI I guess this currently means you simply cannot work
> on GPIO stuff until you know where to go with it unless you
> allow the OMAP GPIO authors to keep churning in arch/arm/*...
>
> That's unless Grant is OK with us moving stuff into
> drivers/gpio that does *not* use gpiolib and utilize singletons to
> get at the gpio_chip addresses (i.e. current form) and keep it
> churning like that until it can be refactored.
I'm okay with non-gpiolib drivers being moved in before they are
cleaned up.
g.
^ permalink raw reply [flat|nested] 42+ messages in thread
* [v2 0/7] OMAP: GPIO: Use PM runtime framework
2011-05-12 9:42 ` Kevin Hilman
@ 2011-05-19 19:08 ` Grant Likely
2011-05-20 3:34 ` Shawn Guo
0 siblings, 1 reply; 42+ messages in thread
From: Grant Likely @ 2011-05-19 19:08 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, May 12, 2011 at 11:42:39AM +0200, Kevin Hilman wrote:
> Linus Walleij <linus.walleij@linaro.org> writes:
>
> [...]
>
> > For TI I guess this currently means you simply cannot work
> > on GPIO stuff until you know where to go with it unless you
> > allow the OMAP GPIO authors to keep churning in arch/arm/*...
> >
> > That's unless Grant is OK with us moving stuff into
> > drivers/gpio that does *not* use gpiolib and utilize singletons to
> > get at the gpio_chip addresses (i.e. current form) and keep it
> > churning like that until it can be refactored.
>
> The churn will happen one way or another. the only question is whether
> it happens in drivers/gpio or arch/arm/*.
>
> Grant, what's your feeling here. How much ugliness are you willing to
> tolerate in a bulk move to drivers/gpio. At least for OMAP, I am
> personally be working on the cleanup/move so I can work either way,
> although I know Tony has an obvious preference for moving it to
> drivers/gpio. :)
>
> The OMAP driver is already using gpiolib. The main ugliness in the OMAP
> driver is the awful ifdeffery used to handle the differences across the
> various SoCs in the OMAP family. I've already got most of that cleaned
> up[1].
Go ahead and move stuff. I may as well have the junk in my tree.
I request however to have at least some semblance of organization.
I'd like each driver filename to be named something like gpio_*.c, and
put things into the Makefile/Kconfig in alphabetical order as much as
possible.
Also, for an awful lot of these SoC gpio controllers there is almost
zero value in having a user visible Kconfig entry for it because they
are so tiny. I'd rather see on-chip gpio controllers configured in
automatically without any user selectable options.
g.
^ permalink raw reply [flat|nested] 42+ messages in thread
* [v2 0/7] OMAP: GPIO: Use PM runtime framework
2011-05-19 19:08 ` Grant Likely
@ 2011-05-20 3:34 ` Shawn Guo
0 siblings, 0 replies; 42+ messages in thread
From: Shawn Guo @ 2011-05-20 3:34 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, May 19, 2011 at 01:08:41PM -0600, Grant Likely wrote:
> On Thu, May 12, 2011 at 11:42:39AM +0200, Kevin Hilman wrote:
> > Linus Walleij <linus.walleij@linaro.org> writes:
> >
> > [...]
> >
> > > For TI I guess this currently means you simply cannot work
> > > on GPIO stuff until you know where to go with it unless you
> > > allow the OMAP GPIO authors to keep churning in arch/arm/*...
> > >
> > > That's unless Grant is OK with us moving stuff into
> > > drivers/gpio that does *not* use gpiolib and utilize singletons to
> > > get at the gpio_chip addresses (i.e. current form) and keep it
> > > churning like that until it can be refactored.
> >
> > The churn will happen one way or another. the only question is whether
> > it happens in drivers/gpio or arch/arm/*.
> >
> > Grant, what's your feeling here. How much ugliness are you willing to
> > tolerate in a bulk move to drivers/gpio. At least for OMAP, I am
> > personally be working on the cleanup/move so I can work either way,
> > although I know Tony has an obvious preference for moving it to
> > drivers/gpio. :)
> >
> > The OMAP driver is already using gpiolib. The main ugliness in the OMAP
> > driver is the awful ifdeffery used to handle the differences across the
> > various SoCs in the OMAP family. I've already got most of that cleaned
> > up[1].
>
> Go ahead and move stuff. I may as well have the junk in my tree.
>
> I request however to have at least some semblance of organization.
> I'd like each driver filename to be named something like gpio_*.c, and
Just confirm that you really mean gpio_*.c than *_gpio.c, because I
see there have been several *_gpio.c but none gpio_*.c under
drivers/gpio.
> put things into the Makefile/Kconfig in alphabetical order as much as
> possible.
>
--
Regards,
Shawn
^ permalink raw reply [flat|nested] 42+ messages in thread
* [PATCH 1/2] ARM: pxa168: gplugD: Get rid of mfp-gplugd.h
[not found] <no>
` (9 preceding siblings ...)
2011-04-18 15:06 ` [PATCH 7/7] OMAP: GPIO: use PM runtime framework Varadarajan, Charulatha
@ 2011-07-14 9:37 ` Tanmay Upadhyay
2011-07-18 6:00 ` Eric Miao
2011-07-14 9:37 ` [PATCH 2/2] ARM: pxa168: gplugD: bug-fix: Free correct GPIO Tanmay Upadhyay
2011-12-06 11:07 ` [PATCH] USB: pxa168: Fix compilation error Tanmay Upadhyay
12 siblings, 1 reply; 42+ messages in thread
From: Tanmay Upadhyay @ 2011-07-14 9:37 UTC (permalink / raw)
To: linux-arm-kernel
Move definitions from mfp-gplugd.h to mfp-pxa168.h as they aren't
gplugD specific.
Signed-off-by: Tanmay Upadhyay <tanmay.upadhyay@einfochips.com>
---
arch/arm/mach-mmp/gplugd.c | 18 +++++++---
arch/arm/mach-mmp/include/mach/mfp-gplugd.h | 52 ---------------------------
arch/arm/mach-mmp/include/mach/mfp-pxa168.h | 37 ++++++++++++++++---
3 files changed, 45 insertions(+), 62 deletions(-)
delete mode 100644 arch/arm/mach-mmp/include/mach/mfp-gplugd.h
diff --git a/arch/arm/mach-mmp/gplugd.c b/arch/arm/mach-mmp/gplugd.c
index c070c24..0770e51 100644
--- a/arch/arm/mach-mmp/gplugd.c
+++ b/arch/arm/mach-mmp/gplugd.c
@@ -16,16 +16,18 @@
#include <mach/gpio.h>
#include <mach/pxa168.h>
#include <mach/mfp-pxa168.h>
-#include <mach/mfp-gplugd.h>
#include "common.h"
static unsigned long gplugd_pin_config[] __initdata = {
/* UART3 */
- GPIO8_UART3_SOUT,
- GPIO9_UART3_SIN,
- GPI1O_UART3_CTS,
- GPI11_UART3_RTS,
+ GPIO8_UART3_TXD,
+ GPIO9_UART3_RXD,
+ GPIO1O_UART3_CTS,
+ GPIO11_UART3_RTS,
+
+ /* USB OTG PEN */
+ GPIO18_GPIO,
/* MMC2 */
GPIO28_MMC2_CMD,
@@ -109,6 +111,12 @@ static unsigned long gplugd_pin_config[] __initdata = {
GPIO105_CI2C_SDA,
GPIO106_CI2C_SCL,
+ /* SPI NOR Flash on SSP2 */
+ GPIO107_SSP2_RXD,
+ GPIO108_SSP2_TXD,
+ GPIO110_GPIO, /* SPI_CSn */
+ GPIO111_SSP2_CLK,
+
/* Select JTAG */
GPIO109_GPIO,
diff --git a/arch/arm/mach-mmp/include/mach/mfp-gplugd.h b/arch/arm/mach-mmp/include/mach/mfp-gplugd.h
deleted file mode 100644
index b8cf38d..0000000
--- a/arch/arm/mach-mmp/include/mach/mfp-gplugd.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * linux/arch/arm/mach-mmp/include/mach/mfp-gplugd.h
- *
- * MFP definitions used in gplugD
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#ifndef __MACH_MFP_GPLUGD_H
-#define __MACH_MFP_GPLUGD_H
-
-#include <plat/mfp.h>
-#include <mach/mfp.h>
-
-/* UART3 */
-#define GPIO8_UART3_SOUT MFP_CFG(GPIO8, AF2)
-#define GPIO9_UART3_SIN MFP_CFG(GPIO9, AF2)
-#define GPI1O_UART3_CTS MFP_CFG(GPIO10, AF2)
-#define GPI11_UART3_RTS MFP_CFG(GPIO11, AF2)
-
-/* MMC2 */
-#define GPIO28_MMC2_CMD MFP_CFG_DRV(GPIO28, AF6, FAST)
-#define GPIO29_MMC2_CLK MFP_CFG_DRV(GPIO29, AF6, FAST)
-#define GPIO30_MMC2_DAT0 MFP_CFG_DRV(GPIO30, AF6, FAST)
-#define GPIO31_MMC2_DAT1 MFP_CFG_DRV(GPIO31, AF6, FAST)
-#define GPIO32_MMC2_DAT2 MFP_CFG_DRV(GPIO32, AF6, FAST)
-#define GPIO33_MMC2_DAT3 MFP_CFG_DRV(GPIO33, AF6, FAST)
-
-/* I2S */
-#undef GPIO114_I2S_FRM
-#undef GPIO115_I2S_BCLK
-
-#define GPIO114_I2S_FRM MFP_CFG_DRV(GPIO114, AF1, FAST)
-#define GPIO115_I2S_BCLK MFP_CFG_DRV(GPIO115, AF1, FAST)
-#define GPIO116_I2S_TXD MFP_CFG_DRV(GPIO116, AF1, FAST)
-
-/* MMC4 */
-#define GPIO125_MMC4_DAT3 MFP_CFG_DRV(GPIO125, AF7, FAST)
-#define GPIO126_MMC4_DAT2 MFP_CFG_DRV(GPIO126, AF7, FAST)
-#define GPIO127_MMC4_DAT1 MFP_CFG_DRV(GPIO127, AF7, FAST)
-#define GPIO0_2_MMC4_DAT0 MFP_CFG_DRV(GPIO0_2, AF7, FAST)
-#define GPIO1_2_MMC4_CMD MFP_CFG_DRV(GPIO1_2, AF7, FAST)
-#define GPIO2_2_MMC4_CLK MFP_CFG_DRV(GPIO2_2, AF7, FAST)
-
-/* OTG GPIO */
-#define GPIO_USB_OTG_PEN 18
-#define GPIO_USB_OIDIR 20
-
-/* Other GPIOs are 35, 84, 85 */
-#endif /* __MACH_MFP_GPLUGD_H */
diff --git a/arch/arm/mach-mmp/include/mach/mfp-pxa168.h b/arch/arm/mach-mmp/include/mach/mfp-pxa168.h
index 8c78232..92aaa3c 100644
--- a/arch/arm/mach-mmp/include/mach/mfp-pxa168.h
+++ b/arch/arm/mach-mmp/include/mach/mfp-pxa168.h
@@ -203,6 +203,10 @@
#define GPIO33_CF_nCD2 MFP_CFG(GPIO33, AF3)
/* UART */
+#define GPIO8_UART3_TXD MFP_CFG(GPIO8, AF2)
+#define GPIO9_UART3_RXD MFP_CFG(GPIO9, AF2)
+#define GPIO1O_UART3_CTS MFP_CFG(GPIO10, AF2)
+#define GPIO11_UART3_RTS MFP_CFG(GPIO11, AF2)
#define GPIO88_UART2_TXD MFP_CFG(GPIO88, AF2)
#define GPIO89_UART2_RXD MFP_CFG(GPIO89, AF2)
#define GPIO107_UART1_TXD MFP_CFG_DRV(GPIO107, AF1, FAST)
@@ -232,6 +236,22 @@
#define GPIO53_MMC1_CD MFP_CFG(GPIO53, AF1)
#define GPIO46_MMC1_WP MFP_CFG(GPIO46, AF1)
+/* MMC2 */
+#define GPIO28_MMC2_CMD MFP_CFG_DRV(GPIO28, AF6, FAST)
+#define GPIO29_MMC2_CLK MFP_CFG_DRV(GPIO29, AF6, FAST)
+#define GPIO30_MMC2_DAT0 MFP_CFG_DRV(GPIO30, AF6, FAST)
+#define GPIO31_MMC2_DAT1 MFP_CFG_DRV(GPIO31, AF6, FAST)
+#define GPIO32_MMC2_DAT2 MFP_CFG_DRV(GPIO32, AF6, FAST)
+#define GPIO33_MMC2_DAT3 MFP_CFG_DRV(GPIO33, AF6, FAST)
+
+/* MMC4 */
+#define GPIO125_MMC4_DAT3 MFP_CFG_DRV(GPIO125, AF7, FAST)
+#define GPIO126_MMC4_DAT2 MFP_CFG_DRV(GPIO126, AF7, FAST)
+#define GPIO127_MMC4_DAT1 MFP_CFG_DRV(GPIO127, AF7, FAST)
+#define GPIO0_2_MMC4_DAT0 MFP_CFG_DRV(GPIO0_2, AF7, FAST)
+#define GPIO1_2_MMC4_CMD MFP_CFG_DRV(GPIO1_2, AF7, FAST)
+#define GPIO2_2_MMC4_CLK MFP_CFG_DRV(GPIO2_2, AF7, FAST)
+
/* LCD */
#define GPIO84_LCD_CS MFP_CFG(GPIO84, AF1)
#define GPIO60_LCD_DD0 MFP_CFG(GPIO60, AF1)
@@ -269,11 +289,12 @@
#define GPIO106_CI2C_SCL MFP_CFG(GPIO106, AF1)
/* I2S */
-#define GPIO113_I2S_MCLK MFP_CFG(GPIO113,AF6)
-#define GPIO114_I2S_FRM MFP_CFG(GPIO114,AF1)
-#define GPIO115_I2S_BCLK MFP_CFG(GPIO115,AF1)
-#define GPIO116_I2S_RXD MFP_CFG(GPIO116,AF2)
-#define GPIO117_I2S_TXD MFP_CFG(GPIO117,AF2)
+#define GPIO113_I2S_MCLK MFP_CFG(GPIO113, AF6)
+#define GPIO114_I2S_FRM MFP_CFG(GPIO114, AF1)
+#define GPIO115_I2S_BCLK MFP_CFG(GPIO115, AF1)
+#define GPIO116_I2S_RXD MFP_CFG(GPIO116, AF2)
+#define GPIO116_I2S_TXD MFP_CFG(GPIO116, AF1)
+#define GPIO117_I2S_TXD MFP_CFG(GPIO117, AF2)
/* PWM */
#define GPIO96_PWM3_OUT MFP_CFG(GPIO96, AF1)
@@ -324,4 +345,10 @@
#define GPIO101_MII_MDIO MFP_CFG(GPIO101, AF5)
#define GPIO103_RX_DV MFP_CFG(GPIO103, AF5)
+/* SSP2 */
+#define GPIO107_SSP2_RXD MFP_CFG(GPIO107, AF4)
+#define GPIO108_SSP2_TXD MFP_CFG(GPIO108, AF4)
+#define GPIO111_SSP2_CLK MFP_CFG(GPIO111, AF4)
+#define GPIO112_SSP2_FRM MFP_CFG(GPIO112, AF4)
+
#endif /* __ASM_MACH_MFP_PXA168_H */
--
1.7.0.4
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH 2/2] ARM: pxa168: gplugD: bug-fix: Free correct GPIO
[not found] <no>
` (10 preceding siblings ...)
2011-07-14 9:37 ` [PATCH 1/2] ARM: pxa168: gplugD: Get rid of mfp-gplugd.h Tanmay Upadhyay
@ 2011-07-14 9:37 ` Tanmay Upadhyay
2011-07-18 5:59 ` Eric Miao
2011-12-06 11:07 ` [PATCH] USB: pxa168: Fix compilation error Tanmay Upadhyay
12 siblings, 1 reply; 42+ messages in thread
From: Tanmay Upadhyay @ 2011-07-14 9:37 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Tanmay Upadhyay <tanmay.upadhyay@einfochips.com>
---
arch/arm/mach-mmp/gplugd.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-mmp/gplugd.c b/arch/arm/mach-mmp/gplugd.c
index 0770e51..98e25d9 100644
--- a/arch/arm/mach-mmp/gplugd.c
+++ b/arch/arm/mach-mmp/gplugd.c
@@ -162,7 +162,7 @@ static void __init select_disp_freq(void)
"frequency\n");
} else {
gpio_direction_output(35, 1);
- gpio_free(104);
+ gpio_free(35);
}
if (unlikely(gpio_request(85, "DISP_FREQ_SEL_2"))) {
@@ -170,7 +170,7 @@ static void __init select_disp_freq(void)
"frequency\n");
} else {
gpio_direction_output(85, 0);
- gpio_free(104);
+ gpio_free(85);
}
}
--
1.7.0.4
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH 2/2] ARM: pxa168: gplugD: bug-fix: Free correct GPIO
2011-07-14 9:37 ` [PATCH 2/2] ARM: pxa168: gplugD: bug-fix: Free correct GPIO Tanmay Upadhyay
@ 2011-07-18 5:59 ` Eric Miao
0 siblings, 0 replies; 42+ messages in thread
From: Eric Miao @ 2011-07-18 5:59 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Jul 14, 2011 at 5:37 PM, Tanmay Upadhyay
<tanmay.upadhyay@einfochips.com> wrote:
> Signed-off-by: Tanmay Upadhyay <tanmay.upadhyay@einfochips.com>
Applied to 'devel'.
> ---
> ?arch/arm/mach-mmp/gplugd.c | ? ?4 ++--
> ?1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-mmp/gplugd.c b/arch/arm/mach-mmp/gplugd.c
> index 0770e51..98e25d9 100644
> --- a/arch/arm/mach-mmp/gplugd.c
> +++ b/arch/arm/mach-mmp/gplugd.c
> @@ -162,7 +162,7 @@ static void __init select_disp_freq(void)
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?"frequency\n");
> ? ? ? ?} else {
> ? ? ? ? ? ? ? ?gpio_direction_output(35, 1);
> - ? ? ? ? ? ? ? gpio_free(104);
> + ? ? ? ? ? ? ? gpio_free(35);
> ? ? ? ?}
>
> ? ? ? ?if (unlikely(gpio_request(85, "DISP_FREQ_SEL_2"))) {
> @@ -170,7 +170,7 @@ static void __init select_disp_freq(void)
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?"frequency\n");
> ? ? ? ?} else {
> ? ? ? ? ? ? ? ?gpio_direction_output(85, 0);
> - ? ? ? ? ? ? ? gpio_free(104);
> + ? ? ? ? ? ? ? gpio_free(85);
> ? ? ? ?}
> ?}
>
> --
> 1.7.0.4
>
>
^ permalink raw reply [flat|nested] 42+ messages in thread
* [PATCH 1/2] ARM: pxa168: gplugD: Get rid of mfp-gplugd.h
2011-07-14 9:37 ` [PATCH 1/2] ARM: pxa168: gplugD: Get rid of mfp-gplugd.h Tanmay Upadhyay
@ 2011-07-18 6:00 ` Eric Miao
0 siblings, 0 replies; 42+ messages in thread
From: Eric Miao @ 2011-07-18 6:00 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Jul 14, 2011 at 5:37 PM, Tanmay Upadhyay
<tanmay.upadhyay@einfochips.com> wrote:
> Move definitions from mfp-gplugd.h to mfp-pxa168.h as they aren't
> gplugD specific.
>
> Signed-off-by: Tanmay Upadhyay <tanmay.upadhyay@einfochips.com>
Applied to 'devel'.
> ---
> ?arch/arm/mach-mmp/gplugd.c ? ? ? ? ? ? ? ? ?| ? 18 +++++++---
> ?arch/arm/mach-mmp/include/mach/mfp-gplugd.h | ? 52 ---------------------------
> ?arch/arm/mach-mmp/include/mach/mfp-pxa168.h | ? 37 ++++++++++++++++---
> ?3 files changed, 45 insertions(+), 62 deletions(-)
> ?delete mode 100644 arch/arm/mach-mmp/include/mach/mfp-gplugd.h
>
> diff --git a/arch/arm/mach-mmp/gplugd.c b/arch/arm/mach-mmp/gplugd.c
> index c070c24..0770e51 100644
> --- a/arch/arm/mach-mmp/gplugd.c
> +++ b/arch/arm/mach-mmp/gplugd.c
> @@ -16,16 +16,18 @@
> ?#include <mach/gpio.h>
> ?#include <mach/pxa168.h>
> ?#include <mach/mfp-pxa168.h>
> -#include <mach/mfp-gplugd.h>
>
> ?#include "common.h"
>
> ?static unsigned long gplugd_pin_config[] __initdata = {
> ? ? ? ?/* UART3 */
> - ? ? ? GPIO8_UART3_SOUT,
> - ? ? ? GPIO9_UART3_SIN,
> - ? ? ? GPI1O_UART3_CTS,
> - ? ? ? GPI11_UART3_RTS,
> + ? ? ? GPIO8_UART3_TXD,
> + ? ? ? GPIO9_UART3_RXD,
> + ? ? ? GPIO1O_UART3_CTS,
> + ? ? ? GPIO11_UART3_RTS,
> +
> + ? ? ? /* USB OTG PEN */
> + ? ? ? GPIO18_GPIO,
>
> ? ? ? ?/* MMC2 */
> ? ? ? ?GPIO28_MMC2_CMD,
> @@ -109,6 +111,12 @@ static unsigned long gplugd_pin_config[] __initdata = {
> ? ? ? ?GPIO105_CI2C_SDA,
> ? ? ? ?GPIO106_CI2C_SCL,
>
> + ? ? ? /* SPI NOR Flash on SSP2 */
> + ? ? ? GPIO107_SSP2_RXD,
> + ? ? ? GPIO108_SSP2_TXD,
> + ? ? ? GPIO110_GPIO, ? ? /* SPI_CSn */
> + ? ? ? GPIO111_SSP2_CLK,
> +
> ? ? ? ?/* Select JTAG */
> ? ? ? ?GPIO109_GPIO,
>
> diff --git a/arch/arm/mach-mmp/include/mach/mfp-gplugd.h b/arch/arm/mach-mmp/include/mach/mfp-gplugd.h
> deleted file mode 100644
> index b8cf38d..0000000
> --- a/arch/arm/mach-mmp/include/mach/mfp-gplugd.h
> +++ /dev/null
> @@ -1,52 +0,0 @@
> -/*
> - * linux/arch/arm/mach-mmp/include/mach/mfp-gplugd.h
> - *
> - * ? MFP definitions used in gplugD
> - *
> - * This program is free software; you can redistribute it and/or modify
> - * it under the terms of the GNU General Public License version 2 as
> - * published by the Free Software Foundation.
> - */
> -
> -#ifndef __MACH_MFP_GPLUGD_H
> -#define __MACH_MFP_GPLUGD_H
> -
> -#include <plat/mfp.h>
> -#include <mach/mfp.h>
> -
> -/* UART3 */
> -#define GPIO8_UART3_SOUT ? ? ? MFP_CFG(GPIO8, AF2)
> -#define GPIO9_UART3_SIN ? ? ? ?MFP_CFG(GPIO9, AF2)
> -#define GPI1O_UART3_CTS ? ? ? ?MFP_CFG(GPIO10, AF2)
> -#define GPI11_UART3_RTS ? ? ? ?MFP_CFG(GPIO11, AF2)
> -
> -/* MMC2 */
> -#define ? ? ? ?GPIO28_MMC2_CMD ? ? ? ? MFP_CFG_DRV(GPIO28, AF6, FAST)
> -#define ? ? ? ?GPIO29_MMC2_CLK ? ? ? ? MFP_CFG_DRV(GPIO29, AF6, FAST)
> -#define ? ? ? ?GPIO30_MMC2_DAT0 ? ? ? ?MFP_CFG_DRV(GPIO30, AF6, FAST)
> -#define ? ? ? ?GPIO31_MMC2_DAT1 ? ? ? ?MFP_CFG_DRV(GPIO31, AF6, FAST)
> -#define ? ? ? ?GPIO32_MMC2_DAT2 ? ? ? ?MFP_CFG_DRV(GPIO32, AF6, FAST)
> -#define ? ? ? ?GPIO33_MMC2_DAT3 ? ? ? ?MFP_CFG_DRV(GPIO33, AF6, FAST)
> -
> -/* I2S */
> -#undef GPIO114_I2S_FRM
> -#undef GPIO115_I2S_BCLK
> -
> -#define GPIO114_I2S_FRM ? ? ? ? ? ? ? ?MFP_CFG_DRV(GPIO114, AF1, FAST)
> -#define GPIO115_I2S_BCLK ? ? ? ?MFP_CFG_DRV(GPIO115, AF1, FAST)
> -#define GPIO116_I2S_TXD ? ? ? ? MFP_CFG_DRV(GPIO116, AF1, FAST)
> -
> -/* MMC4 */
> -#define GPIO125_MMC4_DAT3 ? ? ? MFP_CFG_DRV(GPIO125, AF7, FAST)
> -#define GPIO126_MMC4_DAT2 ? ? ? MFP_CFG_DRV(GPIO126, AF7, FAST)
> -#define GPIO127_MMC4_DAT1 ? ? ? MFP_CFG_DRV(GPIO127, AF7, FAST)
> -#define GPIO0_2_MMC4_DAT0 ? ? ? MFP_CFG_DRV(GPIO0_2, AF7, FAST)
> -#define GPIO1_2_MMC4_CMD ? ? ? ?MFP_CFG_DRV(GPIO1_2, AF7, FAST)
> -#define GPIO2_2_MMC4_CLK ? ? ? ?MFP_CFG_DRV(GPIO2_2, AF7, FAST)
> -
> -/* OTG GPIO */
> -#define GPIO_USB_OTG_PEN ? ? ? ?18
> -#define GPIO_USB_OIDIR ? ? ? ? ?20
> -
> -/* Other GPIOs are 35, 84, 85 */
> -#endif /* __MACH_MFP_GPLUGD_H */
> diff --git a/arch/arm/mach-mmp/include/mach/mfp-pxa168.h b/arch/arm/mach-mmp/include/mach/mfp-pxa168.h
> index 8c78232..92aaa3c 100644
> --- a/arch/arm/mach-mmp/include/mach/mfp-pxa168.h
> +++ b/arch/arm/mach-mmp/include/mach/mfp-pxa168.h
> @@ -203,6 +203,10 @@
> ?#define GPIO33_CF_nCD2 ? ? ? ? MFP_CFG(GPIO33, AF3)
>
> ?/* UART */
> +#define GPIO8_UART3_TXD ? ? ? ? ? ? ? ?MFP_CFG(GPIO8, AF2)
> +#define GPIO9_UART3_RXD ? ? ? ? ? ? ? ?MFP_CFG(GPIO9, AF2)
> +#define GPIO1O_UART3_CTS ? ? ? MFP_CFG(GPIO10, AF2)
> +#define GPIO11_UART3_RTS ? ? ? MFP_CFG(GPIO11, AF2)
> ?#define GPIO88_UART2_TXD ? ? ? MFP_CFG(GPIO88, AF2)
> ?#define GPIO89_UART2_RXD ? ? ? MFP_CFG(GPIO89, AF2)
> ?#define GPIO107_UART1_TXD ? ? ?MFP_CFG_DRV(GPIO107, AF1, FAST)
> @@ -232,6 +236,22 @@
> ?#define GPIO53_MMC1_CD ? ? ? ? MFP_CFG(GPIO53, AF1)
> ?#define GPIO46_MMC1_WP ? ? ? ? MFP_CFG(GPIO46, AF1)
>
> +/* MMC2 */
> +#define ? ? ? ?GPIO28_MMC2_CMD ? ? ? ? MFP_CFG_DRV(GPIO28, AF6, FAST)
> +#define ? ? ? ?GPIO29_MMC2_CLK ? ? ? ? MFP_CFG_DRV(GPIO29, AF6, FAST)
> +#define ? ? ? ?GPIO30_MMC2_DAT0 ? ? ? ?MFP_CFG_DRV(GPIO30, AF6, FAST)
> +#define ? ? ? ?GPIO31_MMC2_DAT1 ? ? ? ?MFP_CFG_DRV(GPIO31, AF6, FAST)
> +#define ? ? ? ?GPIO32_MMC2_DAT2 ? ? ? ?MFP_CFG_DRV(GPIO32, AF6, FAST)
> +#define ? ? ? ?GPIO33_MMC2_DAT3 ? ? ? ?MFP_CFG_DRV(GPIO33, AF6, FAST)
> +
> +/* MMC4 */
> +#define GPIO125_MMC4_DAT3 ? ? ? MFP_CFG_DRV(GPIO125, AF7, FAST)
> +#define GPIO126_MMC4_DAT2 ? ? ? MFP_CFG_DRV(GPIO126, AF7, FAST)
> +#define GPIO127_MMC4_DAT1 ? ? ? MFP_CFG_DRV(GPIO127, AF7, FAST)
> +#define GPIO0_2_MMC4_DAT0 ? ? ? MFP_CFG_DRV(GPIO0_2, AF7, FAST)
> +#define GPIO1_2_MMC4_CMD ? ? ? ?MFP_CFG_DRV(GPIO1_2, AF7, FAST)
> +#define GPIO2_2_MMC4_CLK ? ? ? ?MFP_CFG_DRV(GPIO2_2, AF7, FAST)
> +
> ?/* LCD */
> ?#define GPIO84_LCD_CS ? ? ? ? ?MFP_CFG(GPIO84, AF1)
> ?#define GPIO60_LCD_DD0 ? ? ? ? MFP_CFG(GPIO60, AF1)
> @@ -269,11 +289,12 @@
> ?#define GPIO106_CI2C_SCL ? ? ? MFP_CFG(GPIO106, AF1)
>
> ?/* I2S */
> -#define GPIO113_I2S_MCLK ? ? ? MFP_CFG(GPIO113,AF6)
> -#define GPIO114_I2S_FRM ? ? ? ? ? ? ? ?MFP_CFG(GPIO114,AF1)
> -#define GPIO115_I2S_BCLK ? ? ? MFP_CFG(GPIO115,AF1)
> -#define GPIO116_I2S_RXD ? ? ? ? ? ? ? ?MFP_CFG(GPIO116,AF2)
> -#define GPIO117_I2S_TXD ? ? ? ? ? ? ? ?MFP_CFG(GPIO117,AF2)
> +#define GPIO113_I2S_MCLK ? ? ? MFP_CFG(GPIO113, AF6)
> +#define GPIO114_I2S_FRM ? ? ? ? ? ? ? ?MFP_CFG(GPIO114, AF1)
> +#define GPIO115_I2S_BCLK ? ? ? MFP_CFG(GPIO115, AF1)
> +#define GPIO116_I2S_RXD ? ? ? ? ? ? ? ?MFP_CFG(GPIO116, AF2)
> +#define GPIO116_I2S_TXD ? ? ? ? MFP_CFG(GPIO116, AF1)
> +#define GPIO117_I2S_TXD ? ? ? ? ? ? ? ?MFP_CFG(GPIO117, AF2)
>
> ?/* PWM */
> ?#define GPIO96_PWM3_OUT ? ? ? ? ? ? ? ?MFP_CFG(GPIO96, AF1)
> @@ -324,4 +345,10 @@
> ?#define GPIO101_MII_MDIO ? ? ? MFP_CFG(GPIO101, AF5)
> ?#define GPIO103_RX_DV ? ? ? ? ?MFP_CFG(GPIO103, AF5)
>
> +/* SSP2 */
> +#define GPIO107_SSP2_RXD ? ? ? MFP_CFG(GPIO107, AF4)
> +#define GPIO108_SSP2_TXD ? ? ? MFP_CFG(GPIO108, AF4)
> +#define GPIO111_SSP2_CLK ? ? ? MFP_CFG(GPIO111, AF4)
> +#define GPIO112_SSP2_FRM ? ? ? MFP_CFG(GPIO112, AF4)
> +
> ?#endif /* __ASM_MACH_MFP_PXA168_H */
> --
> 1.7.0.4
>
>
^ permalink raw reply [flat|nested] 42+ messages in thread
* [PATCH] USB: pxa168: Fix compilation error
[not found] <no>
` (11 preceding siblings ...)
2011-07-14 9:37 ` [PATCH 2/2] ARM: pxa168: gplugD: bug-fix: Free correct GPIO Tanmay Upadhyay
@ 2011-12-06 11:07 ` Tanmay Upadhyay
2011-12-06 11:25 ` Sergei Shtylyov
2011-12-07 19:57 ` [PATCH] " Alan Stern
12 siblings, 2 replies; 42+ messages in thread
From: Tanmay Upadhyay @ 2011-12-06 11:07 UTC (permalink / raw)
To: linux-arm-kernel
After commit c430131a02d677aa708f56342c1565edfdacb3c0,
HC_LENGTH takes two arguments. This patch fixes following
compilation error:
In file included from drivers/usb/host/ehci-hcd.c:1323:
drivers/usb/host/ehci-pxa168.c:302:54: error: macro "HC_LENGTH" requires 2 arguments, but only 1 given
In file included from drivers/usb/host/ehci-hcd.c:1323:
drivers/usb/host/ehci-pxa168.c: In function 'ehci_pxa168_drv_probe':
drivers/usb/host/ehci-pxa168.c:302: error: 'HC_LENGTH' undeclared (first use in this function)
drivers/usb/host/ehci-pxa168.c:302: error: (Each undeclared identifier is reported only once
drivers/usb/host/ehci-pxa168.c:302: error: for each function it appears in.)
Signed-off-by: Tanmay Upadhyay <tanmay.upadhyay@einfochips.com>
---
drivers/usb/host/ehci-pxa168.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/usb/host/ehci-pxa168.c b/drivers/usb/host/ehci-pxa168.c
index ac0c16e..8d0e7a2 100644
--- a/drivers/usb/host/ehci-pxa168.c
+++ b/drivers/usb/host/ehci-pxa168.c
@@ -299,7 +299,7 @@ static int __devinit ehci_pxa168_drv_probe(struct platform_device *pdev)
ehci = hcd_to_ehci(hcd);
ehci->caps = hcd->regs + 0x100;
ehci->regs = hcd->regs + 0x100 +
- HC_LENGTH(ehci_readl(ehci, &ehci->caps->hc_capbase));
+ HC_LENGTH(ehci, ehci_readl(ehci, &ehci->caps->hc_capbase));
ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params);
hcd->has_tt = 1;
ehci->sbrn = 0x20;
--
1.7.0.4
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH] USB: pxa168: Fix compilation error
2011-12-06 11:07 ` [PATCH] USB: pxa168: Fix compilation error Tanmay Upadhyay
@ 2011-12-06 11:25 ` Sergei Shtylyov
2011-12-08 4:33 ` [PATCH v2] " Tanmay Upadhyay
2011-12-07 19:57 ` [PATCH] " Alan Stern
1 sibling, 1 reply; 42+ messages in thread
From: Sergei Shtylyov @ 2011-12-06 11:25 UTC (permalink / raw)
To: linux-arm-kernel
Hello.
On 06-12-2011 15:07, Tanmay Upadhyay wrote:
> After commit c430131a02d677aa708f56342c1565edfdacb3c0,
Please also specify that commit's summary in parens.
> HC_LENGTH takes two arguments. This patch fixes following
> compilation error:
> In file included from drivers/usb/host/ehci-hcd.c:1323:
> drivers/usb/host/ehci-pxa168.c:302:54: error: macro "HC_LENGTH" requires 2 arguments, but only 1 given
> In file included from drivers/usb/host/ehci-hcd.c:1323:
> drivers/usb/host/ehci-pxa168.c: In function 'ehci_pxa168_drv_probe':
> drivers/usb/host/ehci-pxa168.c:302: error: 'HC_LENGTH' undeclared (first use in this function)
> drivers/usb/host/ehci-pxa168.c:302: error: (Each undeclared identifier is reported only once
> drivers/usb/host/ehci-pxa168.c:302: error: for each function it appears in.)
> Signed-off-by: Tanmay Upadhyay<tanmay.upadhyay@einfochips.com>
WBR, Sergei
^ permalink raw reply [flat|nested] 42+ messages in thread
* [PATCH] USB: pxa168: Fix compilation error
2011-12-06 11:07 ` [PATCH] USB: pxa168: Fix compilation error Tanmay Upadhyay
2011-12-06 11:25 ` Sergei Shtylyov
@ 2011-12-07 19:57 ` Alan Stern
1 sibling, 0 replies; 42+ messages in thread
From: Alan Stern @ 2011-12-07 19:57 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, 6 Dec 2011, Tanmay Upadhyay wrote:
> After commit c430131a02d677aa708f56342c1565edfdacb3c0,
> HC_LENGTH takes two arguments. This patch fixes following
> compilation error:
>
> In file included from drivers/usb/host/ehci-hcd.c:1323:
> drivers/usb/host/ehci-pxa168.c:302:54: error: macro "HC_LENGTH" requires 2 arguments, but only 1 given
> In file included from drivers/usb/host/ehci-hcd.c:1323:
> drivers/usb/host/ehci-pxa168.c: In function 'ehci_pxa168_drv_probe':
> drivers/usb/host/ehci-pxa168.c:302: error: 'HC_LENGTH' undeclared (first use in this function)
> drivers/usb/host/ehci-pxa168.c:302: error: (Each undeclared identifier is reported only once
> drivers/usb/host/ehci-pxa168.c:302: error: for each function it appears in.)
>
> Signed-off-by: Tanmay Upadhyay <tanmay.upadhyay@einfochips.com>
> ---
> drivers/usb/host/ehci-pxa168.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/usb/host/ehci-pxa168.c b/drivers/usb/host/ehci-pxa168.c
> index ac0c16e..8d0e7a2 100644
> --- a/drivers/usb/host/ehci-pxa168.c
> +++ b/drivers/usb/host/ehci-pxa168.c
> @@ -299,7 +299,7 @@ static int __devinit ehci_pxa168_drv_probe(struct platform_device *pdev)
> ehci = hcd_to_ehci(hcd);
> ehci->caps = hcd->regs + 0x100;
> ehci->regs = hcd->regs + 0x100 +
> - HC_LENGTH(ehci_readl(ehci, &ehci->caps->hc_capbase));
> + HC_LENGTH(ehci, ehci_readl(ehci, &ehci->caps->hc_capbase));
> ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params);
> hcd->has_tt = 1;
> ehci->sbrn = 0x20;
Acked-by: Alan Stern <stern@rowland.harvard.edu>
^ permalink raw reply [flat|nested] 42+ messages in thread
* [PATCH v2] USB: pxa168: Fix compilation error
2011-12-06 11:25 ` Sergei Shtylyov
@ 2011-12-08 4:33 ` Tanmay Upadhyay
0 siblings, 0 replies; 42+ messages in thread
From: Tanmay Upadhyay @ 2011-12-08 4:33 UTC (permalink / raw)
To: linux-arm-kernel
After commit c430131a02d677aa708f56342c1565edfdacb3c0 (Support
controllers with big endian capability regs), HC_LENGTH takes
two arguments. This patch fixes following compilation error:
In file included from drivers/usb/host/ehci-hcd.c:1323:
drivers/usb/host/ehci-pxa168.c:302:54: error: macro "HC_LENGTH" requires 2 arguments, but only 1 given
In file included from drivers/usb/host/ehci-hcd.c:1323:
drivers/usb/host/ehci-pxa168.c: In function 'ehci_pxa168_drv_probe':
drivers/usb/host/ehci-pxa168.c:302: error: 'HC_LENGTH' undeclared (first use in this function)
drivers/usb/host/ehci-pxa168.c:302: error: (Each undeclared identifier is reported only once
drivers/usb/host/ehci-pxa168.c:302: error: for each function it appears in.)
v2 - Added summary of the commit that caused this change
Signed-off-by: Tanmay Upadhyay <tanmay.upadhyay@einfochips.com>
---
drivers/usb/host/ehci-pxa168.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/usb/host/ehci-pxa168.c b/drivers/usb/host/ehci-pxa168.c
index ac0c16e..8d0e7a2 100644
--- a/drivers/usb/host/ehci-pxa168.c
+++ b/drivers/usb/host/ehci-pxa168.c
@@ -299,7 +299,7 @@ static int __devinit ehci_pxa168_drv_probe(struct platform_device *pdev)
ehci = hcd_to_ehci(hcd);
ehci->caps = hcd->regs + 0x100;
ehci->regs = hcd->regs + 0x100 +
- HC_LENGTH(ehci_readl(ehci, &ehci->caps->hc_capbase));
+ HC_LENGTH(ehci, ehci_readl(ehci, &ehci->caps->hc_capbase));
ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params);
hcd->has_tt = 1;
ehci->sbrn = 0x20;
--
1.7.0.4
^ permalink raw reply related [flat|nested] 42+ messages in thread
end of thread, other threads:[~2011-12-08 4:33 UTC | newest]
Thread overview: 42+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <no>
2010-08-10 8:29 ` [PATCH v2] OpenRD: Enable SD/UART selection for serial port 1 Tanmay Upadhyay
2010-08-10 8:56 ` Alexander Clouter
2010-08-10 8:58 ` Alexander Clouter
2010-08-10 10:27 ` Tanmay Upadhyay
2010-08-10 10:28 ` Alexander Clouter
2010-08-10 10:49 ` Tanmay Upadhyay
2010-08-10 11:53 ` Alexander Clouter
2010-08-11 5:21 ` Tanmay Upadhyay
2010-08-10 8:40 ` [PATCH] ARM: Fix broken Kconfig in arch/arm Tanmay Upadhyay
2011-04-18 15:06 ` [v2 0/7] OMAP: GPIO: Use PM runtime framework Varadarajan, Charulatha
2011-04-19 6:26 ` Tony Lindgren
2011-04-20 23:59 ` Kevin Hilman
2011-04-21 5:42 ` Tony Lindgren
2011-04-21 15:15 ` Kevin Hilman
2011-04-22 6:11 ` Tony Lindgren
2011-04-23 8:35 ` Linus Walleij
2011-04-26 7:29 ` Tony Lindgren
2011-04-27 13:18 ` Linus Walleij
2011-05-03 16:22 ` Kevin Hilman
2011-05-03 21:41 ` Linus Walleij
2011-05-04 6:19 ` Tony Lindgren
2011-05-12 0:57 ` Linus Walleij
2011-05-12 9:42 ` Kevin Hilman
2011-05-19 19:08 ` Grant Likely
2011-05-20 3:34 ` Shawn Guo
2011-05-19 19:05 ` Grant Likely
2011-04-18 15:06 ` [PATCH 1/7] OMAP: GPIO: Make gpio_context part of gpio_bank structure Varadarajan, Charulatha
2011-04-18 15:06 ` [PATCH 2/7] OMAP: GPIO: Use flag to identify wkup dmn GPIO Varadarajan, Charulatha
2011-04-18 15:06 ` [PATCH 3/7] OMAP4: GPIO: Save/restore context Varadarajan, Charulatha
2011-04-21 0:26 ` Kevin Hilman
2011-04-18 15:06 ` [PATCH 4/7] OMAP: GPIO: handle save/restore ctx in GPIO driver Varadarajan, Charulatha
2011-04-18 15:06 ` [PATCH 5/7] OMAP2+: GPIO: make workaround_enabled bank specific Varadarajan, Charulatha
2011-04-18 15:06 ` [PATCH 6/7] OMAP: GPIO: Cleanup prepare_for_idle/resume Varadarajan, Charulatha
2011-04-18 15:06 ` [PATCH 7/7] OMAP: GPIO: use PM runtime framework Varadarajan, Charulatha
2011-07-14 9:37 ` [PATCH 1/2] ARM: pxa168: gplugD: Get rid of mfp-gplugd.h Tanmay Upadhyay
2011-07-18 6:00 ` Eric Miao
2011-07-14 9:37 ` [PATCH 2/2] ARM: pxa168: gplugD: bug-fix: Free correct GPIO Tanmay Upadhyay
2011-07-18 5:59 ` Eric Miao
2011-12-06 11:07 ` [PATCH] USB: pxa168: Fix compilation error Tanmay Upadhyay
2011-12-06 11:25 ` Sergei Shtylyov
2011-12-08 4:33 ` [PATCH v2] " Tanmay Upadhyay
2011-12-07 19:57 ` [PATCH] " Alan Stern
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).