diff mbox

[v7,03/14] spi/spi-atmel: add physical base address

Message ID 1363679016-3761-1-git-send-email-wenyou.yang@atmel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Wenyou Yang March 19, 2013, 7:43 a.m. UTC
From: Nicolas Ferre <nicolas.ferre@atmel.com>

Needed for future use with dmaengine enabled driver.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: spi-devel-general@lists.sourceforge.net
Cc: linux-kernel@vger.kernel.org
[wenyou.yang@atmel.com: submit the patch]
Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
---
 drivers/spi/spi-atmel.c |    2 ++
 1 file changed, 2 insertions(+)

Comments

Mark Brown April 1, 2013, 1:41 p.m. UTC | #1
On Tue, Mar 19, 2013 at 03:43:36PM +0800, Wenyou Yang wrote:

> +++ b/drivers/spi/spi-atmel.c
> @@ -196,6 +196,7 @@ struct atmel_spi_caps {
>  struct atmel_spi {
>  	spinlock_t		lock;
>  
> +	resource_size_t		phybase;
>  	void __iomem		*regs;
>  	int			irq;
>  	struct clk		*clk;

This looks like the wrong type?
Wenyou Yang April 2, 2013, 5:49 a.m. UTC | #2
Hi, Mark,

> -----Original Message-----

> From: Mark Brown [mailto:broonie@opensource.wolfsonmicro.com]

> Sent: 2013?4?1? 21:42

> To: Yang, Wenyou

> Cc: linux-arm-kernel@lists.infradead.org; grant.likely@secretlab.ca;

> richard.genoud@gmail.com; plagnioj@jcrosoft.com; Ferre, Nicolas; Lin, JM;

> spi-devel-general@lists.sourceforge.net; linux-kernel@vger.kernel.org

> Subject: Re: [PATCH v7 03/14] spi/spi-atmel: add physical base address

> 

> On Tue, Mar 19, 2013 at 03:43:36PM +0800, Wenyou Yang wrote:

> 

> > +++ b/drivers/spi/spi-atmel.c

> > @@ -196,6 +196,7 @@ struct atmel_spi_caps {  struct atmel_spi {

> >  	spinlock_t		lock;

> >

> > +	resource_size_t		phybase;

> >  	void __iomem		*regs;

> >  	int			irq;

> >  	struct clk		*clk;

> 

> This looks like the wrong type?


I double checked.

The type ' resource_size_t ' is defined in include/linux/ types.h as below,

typedef phys_addr_t resource_size_t;

I think it is OK.

Best Regards,
Wenyou Yang
Wenyou Yang April 2, 2013, 6:17 a.m. UTC | #3
Hi, Mark,

> -----Original Message-----

> From: Yang, Wenyou

> Sent: 2013?4?2? 13:50

> To: 'Mark Brown'

> Cc: linux-arm-kernel@lists.infradead.org; grant.likely@secretlab.ca;

> richard.genoud@gmail.com; plagnioj@jcrosoft.com; Ferre, Nicolas; Lin, JM;

> spi-devel-general@lists.sourceforge.net; linux-kernel@vger.kernel.org

> Subject: RE: [PATCH v7 03/14] spi/spi-atmel: add physical base address

> 

> Hi, Mark,

> 

> > -----Original Message-----

> > From: Mark Brown [mailto:broonie@opensource.wolfsonmicro.com]

> > Sent: 2013?4?1? 21:42

> > To: Yang, Wenyou

> > Cc: linux-arm-kernel@lists.infradead.org; grant.likely@secretlab.ca;

> > richard.genoud@gmail.com; plagnioj@jcrosoft.com; Ferre, Nicolas; Lin, JM;

> > spi-devel-general@lists.sourceforge.net; linux-kernel@vger.kernel.org

> > Subject: Re: [PATCH v7 03/14] spi/spi-atmel: add physical base address

> >

> > On Tue, Mar 19, 2013 at 03:43:36PM +0800, Wenyou Yang wrote:

> >

> > > +++ b/drivers/spi/spi-atmel.c

> > > @@ -196,6 +196,7 @@ struct atmel_spi_caps {  struct atmel_spi {

> > >  	spinlock_t		lock;

> > >

> > > +	resource_size_t		phybase;

> > >  	void __iomem		*regs;

> > >  	int			irq;

> > >  	struct clk		*clk;

> >

> > This looks like the wrong type?

> 

I got it, you are right, you mean It should be used " phys_addr_t " type.

	phys_addr_t	phybase;

Thanks.

Best Regards,
Wenyou Yang.

> I double checked.

> 

> The type ' resource_size_t ' is defined in include/linux/ types.h as below,

> 

> typedef phys_addr_t resource_size_t;

> 

> I think it is OK.

> 

> Best Regards,

> Wenyou Yang
diff mbox

Patch

diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c
index 64e2795..f3e1cd8 100644
--- a/drivers/spi/spi-atmel.c
+++ b/drivers/spi/spi-atmel.c
@@ -196,6 +196,7 @@  struct atmel_spi_caps {
 struct atmel_spi {
 	spinlock_t		lock;
 
+	resource_size_t		phybase;
 	void __iomem		*regs;
 	int			irq;
 	struct clk		*clk;
@@ -993,6 +994,7 @@  static int atmel_spi_probe(struct platform_device *pdev)
 	as->regs = ioremap(regs->start, resource_size(regs));
 	if (!as->regs)
 		goto out_free_buffer;
+	as->phybase = regs->start;
 	as->irq = irq;
 	as->clk = clk;