From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934445AbcI0Tip (ORCPT ); Tue, 27 Sep 2016 15:38:45 -0400 Received: from mail-pa0-f53.google.com ([209.85.220.53]:32779 "EHLO mail-pa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752609AbcI0Tig (ORCPT ); Tue, 27 Sep 2016 15:38:36 -0400 Date: Tue, 27 Sep 2016 20:40:45 +0100 From: Lee Jones To: Mugunthan V N Cc: linux-iio@vger.kernel.org, Tony Lindgren , Rob Herring , Mark Rutland , Russell King , Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Vignesh R , "Andrew F . Davis" , linux-omap@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Sekhar Nori , Peter Ujfalusi Subject: Re: [PATCH 1/4] mfd: ti_am335x_tscadc: store physical address Message-ID: <20160927194045.GK21388@dell> References: <20160921161134.6951-1-mugunthanvnm@ti.com> <20160921161134.6951-2-mugunthanvnm@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20160921161134.6951-2-mugunthanvnm@ti.com> User-Agent: Mutt/1.6.2 (2016-07-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 21 Sep 2016, Mugunthan V N wrote: > store the physical address of the device in its priv to use it > for DMA addressing in the client drivers. > > Signed-off-by: Mugunthan V N > --- > drivers/mfd/ti_am335x_tscadc.c | 1 + > include/linux/mfd/ti_am335x_tscadc.h | 1 + > 2 files changed, 2 insertions(+) > > diff --git a/drivers/mfd/ti_am335x_tscadc.c b/drivers/mfd/ti_am335x_tscadc.c > index c8f027b..0f3fab4 100644 > --- a/drivers/mfd/ti_am335x_tscadc.c > +++ b/drivers/mfd/ti_am335x_tscadc.c > @@ -183,6 +183,7 @@ static int ti_tscadc_probe(struct platform_device *pdev) > tscadc->irq = err; > > res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > + tscadc->tscadc_phys_base = res->start; This is unusual. Can't you use a virt_to_phys() variant instead? > tscadc->tscadc_base = devm_ioremap_resource(&pdev->dev, res); > if (IS_ERR(tscadc->tscadc_base)) > return PTR_ERR(tscadc->tscadc_base); > diff --git a/include/linux/mfd/ti_am335x_tscadc.h b/include/linux/mfd/ti_am335x_tscadc.h > index 7f55b8b..e45a208 100644 > --- a/include/linux/mfd/ti_am335x_tscadc.h > +++ b/include/linux/mfd/ti_am335x_tscadc.h > @@ -155,6 +155,7 @@ struct ti_tscadc_dev { > struct device *dev; > struct regmap *regmap; > void __iomem *tscadc_base; > + phys_addr_t tscadc_phys_base; > int irq; > int used_cells; /* 1-2 */ > int tsc_wires; -- Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lee Jones Subject: Re: [PATCH 1/4] mfd: ti_am335x_tscadc: store physical address Date: Tue, 27 Sep 2016 20:40:45 +0100 Message-ID: <20160927194045.GK21388@dell> References: <20160921161134.6951-1-mugunthanvnm@ti.com> <20160921161134.6951-2-mugunthanvnm@ti.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Content-Disposition: inline In-Reply-To: <20160921161134.6951-2-mugunthanvnm-l0cyMroinI0@public.gmane.org> Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Mugunthan V N Cc: linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Tony Lindgren , Rob Herring , Mark Rutland , Russell King , Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Vignesh R , "Andrew F . Davis" , linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Sekhar Nori , Peter Ujfalusi List-Id: devicetree@vger.kernel.org On Wed, 21 Sep 2016, Mugunthan V N wrote: > store the physical address of the device in its priv to use it > for DMA addressing in the client drivers. > > Signed-off-by: Mugunthan V N > --- > drivers/mfd/ti_am335x_tscadc.c | 1 + > include/linux/mfd/ti_am335x_tscadc.h | 1 + > 2 files changed, 2 insertions(+) > > diff --git a/drivers/mfd/ti_am335x_tscadc.c b/drivers/mfd/ti_am335x_tscadc.c > index c8f027b..0f3fab4 100644 > --- a/drivers/mfd/ti_am335x_tscadc.c > +++ b/drivers/mfd/ti_am335x_tscadc.c > @@ -183,6 +183,7 @@ static int ti_tscadc_probe(struct platform_device *pdev) > tscadc->irq = err; > > res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > + tscadc->tscadc_phys_base = res->start; This is unusual. Can't you use a virt_to_phys() variant instead? > tscadc->tscadc_base = devm_ioremap_resource(&pdev->dev, res); > if (IS_ERR(tscadc->tscadc_base)) > return PTR_ERR(tscadc->tscadc_base); > diff --git a/include/linux/mfd/ti_am335x_tscadc.h b/include/linux/mfd/ti_am335x_tscadc.h > index 7f55b8b..e45a208 100644 > --- a/include/linux/mfd/ti_am335x_tscadc.h > +++ b/include/linux/mfd/ti_am335x_tscadc.h > @@ -155,6 +155,7 @@ struct ti_tscadc_dev { > struct device *dev; > struct regmap *regmap; > void __iomem *tscadc_base; > + phys_addr_t tscadc_phys_base; > int irq; > int used_cells; /* 1-2 */ > int tsc_wires; -- Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 From: lee.jones@linaro.org (Lee Jones) Date: Tue, 27 Sep 2016 20:40:45 +0100 Subject: [PATCH 1/4] mfd: ti_am335x_tscadc: store physical address In-Reply-To: <20160921161134.6951-2-mugunthanvnm@ti.com> References: <20160921161134.6951-1-mugunthanvnm@ti.com> <20160921161134.6951-2-mugunthanvnm@ti.com> Message-ID: <20160927194045.GK21388@dell> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Wed, 21 Sep 2016, Mugunthan V N wrote: > store the physical address of the device in its priv to use it > for DMA addressing in the client drivers. > > Signed-off-by: Mugunthan V N > --- > drivers/mfd/ti_am335x_tscadc.c | 1 + > include/linux/mfd/ti_am335x_tscadc.h | 1 + > 2 files changed, 2 insertions(+) > > diff --git a/drivers/mfd/ti_am335x_tscadc.c b/drivers/mfd/ti_am335x_tscadc.c > index c8f027b..0f3fab4 100644 > --- a/drivers/mfd/ti_am335x_tscadc.c > +++ b/drivers/mfd/ti_am335x_tscadc.c > @@ -183,6 +183,7 @@ static int ti_tscadc_probe(struct platform_device *pdev) > tscadc->irq = err; > > res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > + tscadc->tscadc_phys_base = res->start; This is unusual. Can't you use a virt_to_phys() variant instead? > tscadc->tscadc_base = devm_ioremap_resource(&pdev->dev, res); > if (IS_ERR(tscadc->tscadc_base)) > return PTR_ERR(tscadc->tscadc_base); > diff --git a/include/linux/mfd/ti_am335x_tscadc.h b/include/linux/mfd/ti_am335x_tscadc.h > index 7f55b8b..e45a208 100644 > --- a/include/linux/mfd/ti_am335x_tscadc.h > +++ b/include/linux/mfd/ti_am335x_tscadc.h > @@ -155,6 +155,7 @@ struct ti_tscadc_dev { > struct device *dev; > struct regmap *regmap; > void __iomem *tscadc_base; > + phys_addr_t tscadc_phys_base; > int irq; > int used_cells; /* 1-2 */ > int tsc_wires; -- Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org ? Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog