public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Balaji Rao <balajirrao@openmoko.org>
To: Jonathan Cameron <Jonathan.Cameron@gmail.com>
Cc: linux-kernel@vger.kernel.org, Andy Green <andy@openmoko.com>,
	Samuel Ortiz <sameo@openedhand.com>
Subject: Re: [PATCH V2 2/7] mfd: PCF50633 adc driver
Date: Mon, 22 Dec 2008 21:53:01 +0530	[thread overview]
Message-ID: <20081222162300.GC3073@fedora.yogi> (raw)
In-Reply-To: <494B831C.5050402@gmail.com>

On Fri, Dec 19, 2008 at 11:18:52AM +0000, Jonathan Cameron wrote:
Hi Jonathan,

> 
> This is confusingly named. To my mind it is writing the setup
> to the device not reading it.
> 
> > +static void adc_read_setup(struct pcf50633 *pcf, int channel, int avg)
> > +{
> > +    channel &= PCF50633_ADCC1_ADCMUX_MASK;

Yes, right. Will change.

> This needs a bit more explanation. Particularly as the data
> sheet describes that accsw as 'for rationmetric measurement'.
> Also, seeing as I assume this is the only driver that can touch
> these registers and you don't change them else where, why can't
> they be in initial setup code rather than here? (probably a good
> reason, but be nice to have it document here!)

Yes, the for killing ratiometric measurement can be in _probe. But we
need to enable accsw everytime because it's turned off automatically 
once a conversion is complete - to save power.

> > +    /* kill ratiometric, but enable ACCSW biasing */
> > +    pcf50633_reg_write(pcf, PCF50633_REG_ADCC2, 0x00);
> > +    pcf50633_reg_write(pcf, PCF50633_REG_ADCC3, 0x01);
> > +
> > +    /* start ADC conversion on selected channel */
> > +    pcf50633_reg_write(pcf, PCF50633_REG_ADCC1, channel | avg |
> ...
> > +
> > +static void pcf50633_adc_irq(int irq, void *data)
> > +{
> > +    struct pcf50633_adc *adc = data;
> > +    struct pcf50633 *pcf = adc->pcf;
> > +    struct pcf50633_adc_request *req;
> > +    int head;
> > +    mutex_lock(&adc->queue_mutex);
> > +    head = adc->queue_head;
> > +
> > +    req = adc->queue[head];
> > +    if (WARN_ON(!req)) {
> > +        dev_err(pcf->dev, "pcf50633-adc irq: ADC queue empty!\n");
> > +        mutex_unlock(&adc->queue_mutex);
> > +        return;
> > +    }
> > +    adc->queue[head] = NULL;
> 
> Weird formatting?
>

Oops! Will fix.

Thank you for the review.

Balaji Rao

  parent reply	other threads:[~2008-12-22 16:23 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-18  5:56 [PATCH V2 0/7] PCF50633 support Balaji Rao
2008-12-18  5:56 ` [PATCH V2 1/7] mfd: PCF50633 core driver Balaji Rao
2008-12-18  5:56 ` [PATCH V2 2/7] mfd: PCF50633 adc driver Balaji Rao
2008-12-19 11:18   ` Jonathan Cameron
2008-12-19 12:05     ` Mark Brown
2008-12-19 12:47       ` Jonathan Cameron
2008-12-19 12:15     ` Andy Green
2008-12-19 12:51       ` Jonathan Cameron
2008-12-22 16:23     ` Balaji Rao [this message]
2008-12-18  5:57 ` [PATCH V2 3/7] mfd: PCF50633 gpio support Balaji Rao
2008-12-18  5:57 ` [PATCH V2 4/7] rtc: PCF50633 rtc driver Balaji Rao
2008-12-18  9:03   ` Alessandro Zummo
2008-12-18 15:11     ` Balaji Rao
2008-12-18 16:52       ` Alessandro Zummo
2008-12-18  5:57 ` [PATCH V2 5/7] power_supply: PCF50633 battery charger driver Balaji Rao
2008-12-18 20:26   ` Balaji Rao
2008-12-25 15:45   ` Anton Vorontsov
2008-12-25 18:50     ` Balaji Rao
2008-12-18  5:58 ` [PATCH V2 6/7] input: PCF50633 input driver Balaji Rao
2008-12-18  5:58 ` [PATCH V2 7/7] regulator: PCF50633 pmic driver Balaji Rao
2008-12-18 10:08   ` Mark Brown
2008-12-18 15:14     ` Balaji Rao
2008-12-18 20:30       ` Liam Girdwood
2008-12-18 20:47         ` Balaji Rao
2008-12-18 20:54           ` Liam Girdwood
2008-12-22 10:50 ` [PATCH V2 0/7] PCF50633 support Samuel Ortiz

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=20081222162300.GC3073@fedora.yogi \
    --to=balajirrao@openmoko.org \
    --cc=Jonathan.Cameron@gmail.com \
    --cc=andy@openmoko.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sameo@openedhand.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox