All of lore.kernel.org
 help / color / mirror / Atom feed
From: Samuel Ortiz <sameo-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
To: "Patil, Rachna" <rachna-l0cyMroinI0@public.gmane.org>
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Dmitry Torokhov
	<dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Dmitry Torokhov <dtor-JGs/UdohzUI@public.gmane.org>,
	Jonathan Cameron <jic23-KWPb1pKIrIJaa/9Udqfwiw@public.gmane.org>
Subject: Re: [PATCH v4 2/5] MFD: ti_tscadc: Add support for TI's TSC/ADC MFDevice
Date: Mon, 1 Oct 2012 01:15:36 +0200	[thread overview]
Message-ID: <20120930231536.GE12231@sortiz-mobl> (raw)
In-Reply-To: <1348636814-14129-3-git-send-email-rachna-l0cyMroinI0@public.gmane.org>

Hi Rachna,

On Wed, Sep 26, 2012 at 10:50:11AM +0530, Patil, Rachna wrote:
> Add the mfd core driver which supports touchscreen
> and ADC.
> With this patch we are only adding infrastructure to
> support the MFD clients.
> 
> Signed-off-by: Patil, Rachna <rachna-l0cyMroinI0@public.gmane.org>
> ---
> Changes in v2:
> 	Merged "[PATCH 5/5] MFD: ti_tscadc: Add check on number of i/p channels",
> 	patch submitted in previous version into this file.
> 
> Changes in v3:
> 	No changes
> 
> Changes in v4:
> 	No changes
> 
>  drivers/mfd/Kconfig                  |    9 ++
>  drivers/mfd/Makefile                 |    1 +
>  drivers/mfd/ti_am335x_tscadc.c       |  193 ++++++++++++++++++++++++++++++++++
>  include/linux/mfd/ti_am335x_tscadc.h |  133 +++++++++++++++++++++++
>  4 files changed, 336 insertions(+), 0 deletions(-)
>  create mode 100644 drivers/mfd/ti_am335x_tscadc.c
>  create mode 100644 include/linux/mfd/ti_am335x_tscadc.h
Looks good to me, I only have a few comments:

> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
> index b1a1462..e472184 100644
> --- a/drivers/mfd/Kconfig
> +++ b/drivers/mfd/Kconfig
> @@ -94,6 +94,15 @@ config MFD_TI_SSP
>  	  To compile this driver as a module, choose M here: the
>  	  module will be called ti-ssp.
>  
> +config MFD_TI_AM335X_TSCADC
> +	tristate "TI ADC / Touch Screen chip support"
> +	depends on ARCH_OMAP2PLUS
- Why do you need to depend on that architecture ?
- You must select MFD_CORE.

> +static unsigned int tscadc_readl(struct ti_tscadc_dev *tsadc, unsigned int reg)
> +{
> +	return readl(tsadc->tscadc_base + reg);
> +}
> +
> +static void tscadc_writel(struct ti_tscadc_dev *tsadc, unsigned int reg,
> +					unsigned int val)
> +{
> +	writel(val, tsadc->tscadc_base + reg);
> +}
> +
Have you considered using the regmap MMIO API ? The benefits are not very
obvious in that case, but it's always better to use a common framework.


> +static	int __devinit ti_tscadc_probe(struct platform_device *pdev)
> +{
> +	struct ti_tscadc_dev	*tscadc;
> +	struct resource		*res;
> +	struct clk		*clk;
> +	struct mfd_tscadc_board	*pdata = pdev->dev.platform_data;
> +	int			irq;
> +	int			err, ctrl;
> +	int			clk_value, clock_rate;
> +
> +	if (!pdata) {
> +		dev_err(&pdev->dev, "Could not find platform data\n");
> +		return -EINVAL;
> +	}
> +
> +	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> +	if (!res) {
> +		dev_err(&pdev->dev, "no memory resource defined.\n");
> +		return -EINVAL;
> +	}
> +
> +	irq = platform_get_irq(pdev, 0);
> +	if (irq < 0) {
> +		dev_err(&pdev->dev, "no irq ID is specified.\n");
> +		return -EINVAL;
> +	}
> +
> +	/* Allocate memory for device */
> +	tscadc = kzalloc(sizeof(struct ti_tscadc_dev), GFP_KERNEL);
devm_kzalloc ?

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

WARNING: multiple messages have this Message-ID (diff)
From: Samuel Ortiz <sameo@linux.intel.com>
To: "Patil, Rachna" <rachna@ti.com>
Cc: linux-kernel@vger.kernel.org, linux-input@vger.kernel.org,
	linux-iio@vger.kernel.org,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Dmitry Torokhov <dtor@mail.ru>,
	Jonathan Cameron <jic23@cam.ac.uk>
Subject: Re: [PATCH v4 2/5] MFD: ti_tscadc: Add support for TI's TSC/ADC MFDevice
Date: Mon, 1 Oct 2012 01:15:36 +0200	[thread overview]
Message-ID: <20120930231536.GE12231@sortiz-mobl> (raw)
In-Reply-To: <1348636814-14129-3-git-send-email-rachna@ti.com>

Hi Rachna,

On Wed, Sep 26, 2012 at 10:50:11AM +0530, Patil, Rachna wrote:
> Add the mfd core driver which supports touchscreen
> and ADC.
> With this patch we are only adding infrastructure to
> support the MFD clients.
> 
> Signed-off-by: Patil, Rachna <rachna@ti.com>
> ---
> Changes in v2:
> 	Merged "[PATCH 5/5] MFD: ti_tscadc: Add check on number of i/p channels",
> 	patch submitted in previous version into this file.
> 
> Changes in v3:
> 	No changes
> 
> Changes in v4:
> 	No changes
> 
>  drivers/mfd/Kconfig                  |    9 ++
>  drivers/mfd/Makefile                 |    1 +
>  drivers/mfd/ti_am335x_tscadc.c       |  193 ++++++++++++++++++++++++++++++++++
>  include/linux/mfd/ti_am335x_tscadc.h |  133 +++++++++++++++++++++++
>  4 files changed, 336 insertions(+), 0 deletions(-)
>  create mode 100644 drivers/mfd/ti_am335x_tscadc.c
>  create mode 100644 include/linux/mfd/ti_am335x_tscadc.h
Looks good to me, I only have a few comments:

> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
> index b1a1462..e472184 100644
> --- a/drivers/mfd/Kconfig
> +++ b/drivers/mfd/Kconfig
> @@ -94,6 +94,15 @@ config MFD_TI_SSP
>  	  To compile this driver as a module, choose M here: the
>  	  module will be called ti-ssp.
>  
> +config MFD_TI_AM335X_TSCADC
> +	tristate "TI ADC / Touch Screen chip support"
> +	depends on ARCH_OMAP2PLUS
- Why do you need to depend on that architecture ?
- You must select MFD_CORE.

> +static unsigned int tscadc_readl(struct ti_tscadc_dev *tsadc, unsigned int reg)
> +{
> +	return readl(tsadc->tscadc_base + reg);
> +}
> +
> +static void tscadc_writel(struct ti_tscadc_dev *tsadc, unsigned int reg,
> +					unsigned int val)
> +{
> +	writel(val, tsadc->tscadc_base + reg);
> +}
> +
Have you considered using the regmap MMIO API ? The benefits are not very
obvious in that case, but it's always better to use a common framework.


> +static	int __devinit ti_tscadc_probe(struct platform_device *pdev)
> +{
> +	struct ti_tscadc_dev	*tscadc;
> +	struct resource		*res;
> +	struct clk		*clk;
> +	struct mfd_tscadc_board	*pdata = pdev->dev.platform_data;
> +	int			irq;
> +	int			err, ctrl;
> +	int			clk_value, clock_rate;
> +
> +	if (!pdata) {
> +		dev_err(&pdev->dev, "Could not find platform data\n");
> +		return -EINVAL;
> +	}
> +
> +	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> +	if (!res) {
> +		dev_err(&pdev->dev, "no memory resource defined.\n");
> +		return -EINVAL;
> +	}
> +
> +	irq = platform_get_irq(pdev, 0);
> +	if (irq < 0) {
> +		dev_err(&pdev->dev, "no irq ID is specified.\n");
> +		return -EINVAL;
> +	}
> +
> +	/* Allocate memory for device */
> +	tscadc = kzalloc(sizeof(struct ti_tscadc_dev), GFP_KERNEL);
devm_kzalloc ?

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

  parent reply	other threads:[~2012-09-30 23:15 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-26  5:20 [PATCH v4 0/5] Support for TSC/ADC MFD driver Patil, Rachna
2012-09-26  5:20 ` Patil, Rachna
     [not found] ` <1348636814-14129-1-git-send-email-rachna-l0cyMroinI0@public.gmane.org>
2012-09-26  5:20   ` [PATCH v4 1/5] input: TSC: ti_tscadc: Rename the existing touchscreen driver Patil, Rachna
2012-09-26  5:20     ` Patil, Rachna
2012-09-26  5:20   ` [PATCH v4 2/5] MFD: ti_tscadc: Add support for TI's TSC/ADC MFDevice Patil, Rachna
2012-09-26  5:20     ` Patil, Rachna
     [not found]     ` <1348636814-14129-3-git-send-email-rachna-l0cyMroinI0@public.gmane.org>
2012-09-30 23:15       ` Samuel Ortiz [this message]
2012-09-30 23:15         ` Samuel Ortiz
2012-09-29  7:10   ` [PATCH v4 0/5] Support for TSC/ADC MFD driver Patil, Rachna
2012-09-29  7:10     ` Patil, Rachna
2012-09-26  5:20 ` [PATCH v4 3/5] input: TSC: ti_tsc: Convert TSC into a MFDevice Patil, Rachna
2012-09-26  5:20   ` Patil, Rachna
2012-09-26  5:20 ` [PATCH v4 4/5] IIO : ADC: tiadc: Add support of TI's ADC driver Patil, Rachna
2012-09-26  5:20   ` Patil, Rachna
2012-09-29  9:48   ` Jonathan Cameron
2012-09-26  5:20 ` [PATCH v4 5/5] MFD: ti_tscadc: add suspend/resume functionality Patil, Rachna
2012-09-26  5:20   ` Patil, Rachna
     [not found]   ` <1348636814-14129-6-git-send-email-rachna-l0cyMroinI0@public.gmane.org>
2012-09-26  6:40     ` Shubhrajyoti
2012-09-26  6:40       ` Shubhrajyoti
     [not found]       ` <5062A373.4000707-l0cyMroinI0@public.gmane.org>
2012-09-26 10:09         ` Patil, Rachna
2012-09-26 10:09           ` Patil, Rachna
     [not found]           ` <4CE347531D4CA947960AF71FF095B9323E95738D-Er742YJ7I/eIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
2012-09-29  9:50             ` Jonathan Cameron
2012-09-29  9:50               ` Jonathan Cameron
2012-09-30 23:22               ` Samuel Ortiz
2012-10-03  6:49                 ` Patil, Rachna
2012-10-03  6:49                   ` Patil, Rachna
2012-09-29  9:42 ` [PATCH v4 0/5] Support for TSC/ADC MFD driver Jonathan Cameron
     [not found]   ` <5066C29D.7040009-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2012-09-29 10:06     ` Patil, Rachna
2012-09-29 10:06       ` Patil, Rachna

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120930231536.GE12231@sortiz-mobl \
    --to=sameo-vuqaysv1563yd54fqh9/ca@public.gmane.org \
    --cc=dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=dtor-JGs/UdohzUI@public.gmane.org \
    --cc=jic23-KWPb1pKIrIJaa/9Udqfwiw@public.gmane.org \
    --cc=linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=rachna-l0cyMroinI0@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.