LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Mattias Wallin <mattias.wallin@stericsson.com>
To: Arun MURTHY <arun.murthy@stericsson.com>
Cc: "sameo@linux.intel.com" <sameo@linux.intel.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Linus WALLEIJ <linus.walleij@stericsson.com>,
	Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
Subject: Re: [PATCH] mfd: ab8500-gpadc Add new GPADC driver
Date: Thu, 20 Jan 2011 13:37:51 +0100	[thread overview]
Message-ID: <4D382C9F.6000108@stericsson.com> (raw)
In-Reply-To: <1295519304-27062-1-git-send-email-arun.murthy@stericsson.com>

On 01/20/2011 11:28 AM, Arun MURTHY wrote:
> AB8500 GPADC driver used to convert Acc and battery/ac/usb voltage
> 
> Signed-off-by: Arun Murthy <arun.murthy@stericsson.com>
> Acked-by: Linus Walleij <linus.walleij@stericsson.com>
> ---
>  drivers/mfd/Kconfig              |    7 +
>  drivers/mfd/Makefile             |    1 +
>  drivers/mfd/ab8500-gpadc.c       |  277 ++++++++++++++++++++++++++++++++++++++
>  include/linux/mfd/ab8500-gpadc.h |   47 +++++++
>  include/linux/mfd/ab8500.h       |    6 +
>  5 files changed, 338 insertions(+), 0 deletions(-)
>  create mode 100644 drivers/mfd/ab8500-gpadc.c
>  create mode 100644 include/linux/mfd/ab8500-gpadc.h
> 
...
> +/**
> + * ab8500_gpadc_convert() - gpadc conversion
> + * @input:	analog input to be converted to digital data
> + *
> + * This function converts the selected analog i/p to digital
> + * data. Thereafter calibration has to be made to obtain the
> + * data in the required quantity measurement.
> + */
> +int ab8500_gpadc_convert(struct ab8500_gpadc *di, u8 input)
I would like this interface to change in order to remove the struct ab8500_gpadc
from the struct ab8500. I.e not restrict the users to subdriver of ab8500.
> +{
> +	int ret;
> +	u16 data = 0;
> +	int looplimit = 0;
> +	u8 val, low_data, high_data;
> +
> +	if (!di)
> +		return -ENODEV;
> +
> +	mutex_lock(&di->ab8500_gpadc_lock);
> +	/* Enable VTVout LDO this is required for GPADC */
> +	regulator_enable(di->regu);
...
> diff --git a/include/linux/mfd/ab8500.h b/include/linux/mfd/ab8500.h
> index 37f56b7..8ebc4d8 100644
> --- a/include/linux/mfd/ab8500.h
> +++ b/include/linux/mfd/ab8500.h
> @@ -106,6 +106,9 @@
>  #define AB8500_NR_IRQS			112
>  #define AB8500_NUM_IRQ_REGS		14
>  
> +/* Forward Declaration */
> +struct ab8500_gpadc;
> +
>  /**
>   * struct ab8500 - ab8500 internal structure
>   * @dev: parent device
> @@ -119,6 +122,7 @@
>   * @tx_buf: tx buf for SPI
>   * @mask: cache of IRQ regs for bus lock
>   * @oldmask: cache of previous IRQ regs for bus lock
> + * @gpadc: pointer to the ab8500 gpadc device information
>   */
>  struct ab8500 {
>  	struct device	*dev;
> @@ -137,6 +141,8 @@ struct ab8500 {
>  
>  	u8 mask[AB8500_NUM_IRQ_REGS];
>  	u8 oldmask[AB8500_NUM_IRQ_REGS];
> +
> +	struct ab8500_gpadc *gpadc;
Please remove this gpadc dependency from the struct ab8500.
>  };
>  
>  struct regulator_init_data;

Thanks and Regards,
Mattias Wallin

  reply	other threads:[~2011-01-20 12:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-20 10:28 Arun Murthy
2011-01-20 12:37 ` Mattias Wallin [this message]
2011-01-21 10:31   ` Arun MURTHY
2011-01-21 12:07     ` Mattias Wallin
2011-01-24  3:37       ` Arun MURTHY
2011-02-01 11:36       ` Samuel Ortiz
2011-02-02  8:15         ` Mattias Wallin

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=4D382C9F.6000108@stericsson.com \
    --to=mattias.wallin@stericsson.com \
    --cc=arun.murthy@stericsson.com \
    --cc=linus.walleij@stericsson.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sameo@linux.intel.com \
    --cc=srinidhi.kasagar@stericsson.com \
    --subject='Re: [PATCH] mfd: ab8500-gpadc Add new GPADC driver' \
    /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

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