linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] arm: lpc32xx: add tsc-device
@ 2011-03-28 16:01 Wolfram Sang
  2011-03-28 16:01 ` [PATCH 2/4] arm: lpc32xx: add rtc-device Wolfram Sang
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Wolfram Sang @ 2011-03-28 16:01 UTC (permalink / raw)
  To: linux-arm-kernel

Fix the clock name, too.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
---
 arch/arm/mach-lpc32xx/clock.c  |    2 +-
 arch/arm/mach-lpc32xx/common.c |   21 +++++++++++++++++++++
 arch/arm/mach-lpc32xx/common.h |    1 +
 3 files changed, 23 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-lpc32xx/clock.c b/arch/arm/mach-lpc32xx/clock.c
index da0e649..1e02751 100644
--- a/arch/arm/mach-lpc32xx/clock.c
+++ b/arch/arm/mach-lpc32xx/clock.c
@@ -1077,7 +1077,7 @@ static struct clk_lookup lookups[] = {
 	_REGISTER_CLOCK("lpc32xx-nand.0", "nand_ck", clk_nand)
 	_REGISTER_CLOCK("tbd", "i2s0_ck", clk_i2s0)
 	_REGISTER_CLOCK("tbd", "i2s1_ck", clk_i2s1)
-	_REGISTER_CLOCK("lpc32xx-ts", NULL, clk_tsc)
+	_REGISTER_CLOCK("ts-lpc32xx", NULL, clk_tsc)
 	_REGISTER_CLOCK("dev:mmc0", "MCLK", clk_mmc)
 	_REGISTER_CLOCK("lpc-net.0", NULL, clk_net)
 	_REGISTER_CLOCK("dev:clcd", NULL, clk_lcd)
diff --git a/arch/arm/mach-lpc32xx/common.c b/arch/arm/mach-lpc32xx/common.c
index ee24dc2..5c186b0 100644
--- a/arch/arm/mach-lpc32xx/common.c
+++ b/arch/arm/mach-lpc32xx/common.c
@@ -95,6 +95,27 @@ struct platform_device lpc32xx_i2c2_device = {
 	},
 };
 
+/* TSC (Touch Screen Controller) */
+
+static struct resource lpc32xx_tsc_resources[] = {
+	{
+		.start = LPC32XX_ADC_BASE,
+		.end = LPC32XX_ADC_BASE + SZ_16K - 1,
+		.flags = IORESOURCE_MEM,
+	}, {
+		.start = IRQ_LPC32XX_TS_IRQ,
+		.end = IRQ_LPC32XX_TS_IRQ,
+		.flags = IORESOURCE_IRQ,
+	},
+};
+
+struct platform_device lpc32xx_tsc_device = {
+	.name =  "ts-lpc32xx",
+	.id = -1,
+	.num_resources = ARRAY_SIZE(lpc32xx_tsc_resources),
+	.resource = lpc32xx_tsc_resources,
+};
+
 /*
  * Returns the unique ID for the device
  */
diff --git a/arch/arm/mach-lpc32xx/common.h b/arch/arm/mach-lpc32xx/common.h
index f82211f..e81243c 100644
--- a/arch/arm/mach-lpc32xx/common.h
+++ b/arch/arm/mach-lpc32xx/common.h
@@ -28,6 +28,7 @@ extern struct platform_device lpc32xx_watchdog_device;
 extern struct platform_device lpc32xx_i2c0_device;
 extern struct platform_device lpc32xx_i2c1_device;
 extern struct platform_device lpc32xx_i2c2_device;
+extern struct platform_device lpc32xx_tsc_device;
 
 /*
  * Other arch specific structures and functions
-- 
1.7.2.5

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/4] arm: lpc32xx: add rtc-device
  2011-03-28 16:01 [PATCH 1/4] arm: lpc32xx: add tsc-device Wolfram Sang
@ 2011-03-28 16:01 ` Wolfram Sang
  2011-03-28 16:01 ` [PATCH 3/4] arm: lpc32xx: fix size of watchdog resource Wolfram Sang
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Wolfram Sang @ 2011-03-28 16:01 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
---
 arch/arm/mach-lpc32xx/common.c |   21 +++++++++++++++++++++
 arch/arm/mach-lpc32xx/common.h |    1 +
 2 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-lpc32xx/common.c b/arch/arm/mach-lpc32xx/common.c
index 5c186b0..83daba6 100644
--- a/arch/arm/mach-lpc32xx/common.c
+++ b/arch/arm/mach-lpc32xx/common.c
@@ -116,6 +116,27 @@ struct platform_device lpc32xx_tsc_device = {
 	.resource = lpc32xx_tsc_resources,
 };
 
+/* RTC */
+
+static struct resource lpc32xx_rtc_resources[] = {
+	{
+		.start = LPC32XX_RTC_BASE,
+		.end = LPC32XX_RTC_BASE + SZ_16K - 1,
+		.flags = IORESOURCE_MEM,
+	}, {
+		.start = IRQ_LPC32XX_RTC,
+		.end = IRQ_LPC32XX_RTC,
+		.flags = IORESOURCE_IRQ,
+	},
+};
+
+struct platform_device lpc32xx_rtc_device = {
+	.name =  "rtc-lpc32xx",
+	.id = -1,
+	.num_resources = ARRAY_SIZE(lpc32xx_rtc_resources),
+	.resource = lpc32xx_rtc_resources,
+};
+
 /*
  * Returns the unique ID for the device
  */
diff --git a/arch/arm/mach-lpc32xx/common.h b/arch/arm/mach-lpc32xx/common.h
index e81243c..5583f52 100644
--- a/arch/arm/mach-lpc32xx/common.h
+++ b/arch/arm/mach-lpc32xx/common.h
@@ -29,6 +29,7 @@ extern struct platform_device lpc32xx_i2c0_device;
 extern struct platform_device lpc32xx_i2c1_device;
 extern struct platform_device lpc32xx_i2c2_device;
 extern struct platform_device lpc32xx_tsc_device;
+extern struct platform_device lpc32xx_rtc_device;
 
 /*
  * Other arch specific structures and functions
-- 
1.7.2.5

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/4] arm: lpc32xx: fix size of watchdog resource
  2011-03-28 16:01 [PATCH 1/4] arm: lpc32xx: add tsc-device Wolfram Sang
  2011-03-28 16:01 ` [PATCH 2/4] arm: lpc32xx: add rtc-device Wolfram Sang
@ 2011-03-28 16:01 ` Wolfram Sang
  2011-03-28 16:01 ` [PATCH 4/4] arm: lpc32xx: clock: use bool logic instead of binary Wolfram Sang
  2011-03-29 16:43 ` [PATCH 1/4] arm: lpc32xx: add tsc-device Kevin Wells
  3 siblings, 0 replies; 7+ messages in thread
From: Wolfram Sang @ 2011-03-28 16:01 UTC (permalink / raw)
  To: linux-arm-kernel

And remove an unneeded index in the array-initialization.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
---
 arch/arm/mach-lpc32xx/common.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-lpc32xx/common.c b/arch/arm/mach-lpc32xx/common.c
index 83daba6..9edcd19 100644
--- a/arch/arm/mach-lpc32xx/common.c
+++ b/arch/arm/mach-lpc32xx/common.c
@@ -36,9 +36,9 @@
  * Watchdog timer
  */
 static struct resource watchdog_resources[] = {
-	[0] = {
+	{
 		.start = LPC32XX_WDTIM_BASE,
-		.end = LPC32XX_WDTIM_BASE + SZ_4K - 1,
+		.end = LPC32XX_WDTIM_BASE + SZ_16K - 1,
 		.flags = IORESOURCE_MEM,
 	},
 };
-- 
1.7.2.5

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 4/4] arm: lpc32xx: clock: use bool logic instead of binary
  2011-03-28 16:01 [PATCH 1/4] arm: lpc32xx: add tsc-device Wolfram Sang
  2011-03-28 16:01 ` [PATCH 2/4] arm: lpc32xx: add rtc-device Wolfram Sang
  2011-03-28 16:01 ` [PATCH 3/4] arm: lpc32xx: fix size of watchdog resource Wolfram Sang
@ 2011-03-28 16:01 ` Wolfram Sang
  2011-03-29 16:43 ` [PATCH 1/4] arm: lpc32xx: add tsc-device Kevin Wells
  3 siblings, 0 replies; 7+ messages in thread
From: Wolfram Sang @ 2011-03-28 16:01 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
---
 arch/arm/mach-lpc32xx/clock.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-lpc32xx/clock.c b/arch/arm/mach-lpc32xx/clock.c
index 1e02751..7218237 100644
--- a/arch/arm/mach-lpc32xx/clock.c
+++ b/arch/arm/mach-lpc32xx/clock.c
@@ -396,7 +396,7 @@ static int local_usbpll_enable(struct clk *clk, int enable)
 		__raw_writel(reg, LPC32XX_CLKPWR_USB_CTRL);
 
 		/* Wait for PLL lock */
-		while ((timeout > jiffies) & (ret == -ENODEV)) {
+		while ((timeout > jiffies) && (ret == -ENODEV)) {
 			reg = __raw_readl(LPC32XX_CLKPWR_USB_CTRL);
 			if (reg & LPC32XX_CLKPWR_USBCTRL_PLL_STS)
 				ret = 0;
-- 
1.7.2.5

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 1/4] arm: lpc32xx: add tsc-device
  2011-03-28 16:01 [PATCH 1/4] arm: lpc32xx: add tsc-device Wolfram Sang
                   ` (2 preceding siblings ...)
  2011-03-28 16:01 ` [PATCH 4/4] arm: lpc32xx: clock: use bool logic instead of binary Wolfram Sang
@ 2011-03-29 16:43 ` Kevin Wells
  2011-03-29 17:02   ` Wolfram Sang
  3 siblings, 1 reply; 7+ messages in thread
From: Kevin Wells @ 2011-03-29 16:43 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Wolfram,

Thanks for submitting these. These all look good!

> +/* TSC (Touch Screen Controller) */
> +
> +static struct resource lpc32xx_tsc_resources[] = {
> +	{
> +		.start = LPC32XX_ADC_BASE,
> +		.end = LPC32XX_ADC_BASE + SZ_16K - 1,

The LPC32xx user's guide spaces peripheral register sets 16K apart,
but internally the register blocks are 4K or smaller. I'm not sure
why these need to be setup as 16K instead of 4K. Hmm, maybe I'm
missing something here?

Kevin

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/4] arm: lpc32xx: add tsc-device
  2011-03-29 16:43 ` [PATCH 1/4] arm: lpc32xx: add tsc-device Kevin Wells
@ 2011-03-29 17:02   ` Wolfram Sang
  2011-03-29 17:56     ` Kevin Wells
  0 siblings, 1 reply; 7+ messages in thread
From: Wolfram Sang @ 2011-03-29 17:02 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Mar 29, 2011 at 06:43:45PM +0200, Kevin Wells wrote:
> Hi Wolfram,
> 
> Thanks for submitting these. These all look good!
> 
> > +/* TSC (Touch Screen Controller) */
> > +
> > +static struct resource lpc32xx_tsc_resources[] = {
> > +	{
> > +		.start = LPC32XX_ADC_BASE,
> > +		.end = LPC32XX_ADC_BASE + SZ_16K - 1,
> 
> The LPC32xx user's guide spaces peripheral register sets 16K apart,
> but internally the register blocks are 4K or smaller. I'm not sure
> why these need to be setup as 16K instead of 4K. Hmm, maybe I'm
> missing something here?

Probably not. I just took the user's guide as a reference. If you know this is
wrong, I can respin the series. ADC is also 4K?

Thanks,

   Wolfram

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20110329/2ff4b7a1/attachment.sig>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/4] arm: lpc32xx: add tsc-device
  2011-03-29 17:02   ` Wolfram Sang
@ 2011-03-29 17:56     ` Kevin Wells
  0 siblings, 0 replies; 7+ messages in thread
From: Kevin Wells @ 2011-03-29 17:56 UTC (permalink / raw)
  To: linux-arm-kernel


> Subject: Re: [PATCH 1/4] arm: lpc32xx: add tsc-device
> 
> On Tue, Mar 29, 2011 at 06:43:45PM +0200, Kevin Wells wrote:
> > Hi Wolfram,
> >
> > Thanks for submitting these. These all look good!
> >
> > > +/* TSC (Touch Screen Controller) */
> > > +
> > > +static struct resource lpc32xx_tsc_resources[] = {
> > > +	{
> > > +		.start = LPC32XX_ADC_BASE,
> > > +		.end = LPC32XX_ADC_BASE + SZ_16K - 1,
> >
> > The LPC32xx user's guide spaces peripheral register sets 16K apart,
> > but internally the register blocks are 4K or smaller. I'm not sure
> > why these need to be setup as 16K instead of 4K. Hmm, maybe I'm
> > missing something here?
> 
> Probably not. I just took the user's guide as a reference. If you know
> this is
> wrong, I can respin the series. ADC is also 4K?

Yes, WDT/ADC/RTC are all 4K register blocks.

> 
> Thanks,
> 
>    Wolfram
> 
> --
> Pengutronix e.K.                           | Wolfram Sang                |
> Industrial Linux Solutions                 | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-03-29 17:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-28 16:01 [PATCH 1/4] arm: lpc32xx: add tsc-device Wolfram Sang
2011-03-28 16:01 ` [PATCH 2/4] arm: lpc32xx: add rtc-device Wolfram Sang
2011-03-28 16:01 ` [PATCH 3/4] arm: lpc32xx: fix size of watchdog resource Wolfram Sang
2011-03-28 16:01 ` [PATCH 4/4] arm: lpc32xx: clock: use bool logic instead of binary Wolfram Sang
2011-03-29 16:43 ` [PATCH 1/4] arm: lpc32xx: add tsc-device Kevin Wells
2011-03-29 17:02   ` Wolfram Sang
2011-03-29 17:56     ` Kevin Wells

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).