public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: David Brownell <david-b@pacbell.net>
To: Mikko Ylinen <mikko.k.ylinen@nokia.com>
Cc: me@felipebalbi.com, Felipe Balbi <felipe.balbi@nokia.com>,
	linux-omap@vger.kernel.org, Tony Lindgren <tony@atomide.com>
Subject: Re: [PATCH 9/9] i2c: move twl4030-madc to new registration style
Date: Sat, 27 Sep 2008 08:04:16 -0700	[thread overview]
Message-ID: <200809270804.16788.david-b@pacbell.net> (raw)
In-Reply-To: <48DDE2AD.1030202@nokia.com>

On Saturday 27 September 2008, Mikko Ylinen wrote:
> Hi,
> 
> Felipe Balbi wrote:
> > On Fri, Sep 26, 2008 at 10:09:12AM -0700, David Brownell wrote:
> >> Passing those registers in platform data seems bizarre.
> >> Doesn't the MADC code know its own register offsets??
> > 
> > there two of them. i[ms]r[12].
> 
> twl4030 has two interrupt lines. For INT1 and INT2
> lines you should use I[MS]R1 and I[MS]R2, respectively.
> 
> This is board specific information. Beagleboard uses
> INT1.

So IMO it would make more sense to pass "1" or "2" in
the platform_data -- possibly for other sub-chips too --
and have the driver use that to figure out which set of
registers to use.  If both were wired up, it would be
a board policy which sub-chips used which IRQs, right?
(Haven't read the whole manual yet.)


> >> And no ADC lines are even hooked up on Beagle, so the right
> >> fix is just to not provide madc platform data on beagle.
> >> Probably the same is true on some other boards.
> > 
> > Yeah, i wasn't sure if beagle and overo were using them, so I put
> > anyways.
> 
> Not completely true. MADC has 16 channels out of which only 6
> are truly general purpose channels. Some channels are reserved
> for battery charger interface (BCI) and some for chip's internal
> purposes.
> 
> Boards having twl4030 should have at least VBAT (ch 12),
> V backup battery (ch 9), and VBUS (ch 8) measurement available.
> 
> On Beagleboard you can measure these three channels.

I stand not-completely-corrected, then!  No channels are wired
on the beagle; but some are wired internally to its T2 chip.  ;)


The first two being more or less fixed values (4.2V, GND);
no battery.  In general, I can imagine it would be good to
export those for hwmon usage (sysfs) or as part of the power
management infrastructure.

Without disentangling things I've not looked at before ...
is the USB support using that VBUS measurement?  Should it?
The MUSB interface exposes VBUS comparators, so I think that
it's not expected to need these additional values.

In short:  it doesn't seem like non-battery systems (like
Beagle and Overo) would need those channels.  Agree?


A question that may well come up when this heads upstream:
why is this exporting a miscdev, for an ioctl, when this
could all be done using sysfs and hwmon rules?  That is,
was this the "appropriate" way to export ADC channels?

And a slightly more pragmatic question:  does Nokia have
tools that would break if this were switched to hwmon style?


> >> Plus:  MADC is just a set of ADC channels, right?
> >> If so, the driver should have a comment saying that.
> > 
> > Mikko should comment on that as he wrote the driver.
> 
> How detailed information would you like to have here?

Enough to answer the question "what's a MADC?" for someone
who doesn't have TWL specs and hasn't read even any kind
of summary data sheet.  Three sentences would likely be
excessive; one good sentence might suffice.

- Dave

> 
> -- 
> Regards, Mikko
> 
> 



  reply	other threads:[~2008-09-27 15:04 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-26 11:19 [PATCH 0/9] twl4030 updates Felipe Balbi
2008-09-26 11:19 ` [PATCH 1/9] twl4030: fix potential null pointer dereference Felipe Balbi
2008-09-26 11:19   ` [PATCH 2/9] twl4030-gpio: Remove default pullup enable/disable of GPIO Felipe Balbi
2008-09-26 11:19     ` [PATCH 3/9] i2c: clean add_children a bit Felipe Balbi
2008-09-26 11:19       ` [PATCH 4/9] i2c: move twl4030_keypad to new style registration Felipe Balbi
2008-09-26 11:19         ` [PATCH 5/9] i2c: move twl4030-usb to platform_device Felipe Balbi
2008-09-26 11:19           ` [PATCH 6/9] i2c: twl4030-usb: add 'vbus' sysfs file Felipe Balbi
2008-09-26 11:19             ` [PATCH 7/9] twl4030 gpio platform data Felipe Balbi
2008-09-26 11:19               ` [PATCH 8/9] twl4030 uses gpiolib Felipe Balbi
2008-09-26 11:19                 ` [PATCH 9/9] i2c: move twl4030-madc to new registration style Felipe Balbi
2008-09-26 17:09                   ` David Brownell
2008-09-26 17:46                     ` Felipe Balbi
2008-09-27  7:37                       ` Mikko Ylinen
2008-09-27 15:04                         ` David Brownell [this message]
2008-09-27 15:40                           ` Steve Sakoman
2008-09-27 17:17                             ` David Brownell
2008-10-01 14:20                           ` Mikko Ylinen
2008-10-01 16:13                             ` David Brownell
2008-09-26 19:50                   ` David Brownell
2008-09-26 20:01                     ` Steve Sakoman
2008-09-26 17:10                 ` [PATCH 8/9] twl4030 uses gpiolib David Brownell
2008-09-26 17:47                   ` Felipe Balbi
2008-09-26 18:57                     ` David Brownell
2008-09-28  1:01           ` [PATCH 5/9] i2c: move twl4030-usb to platform_device David Brownell
2008-09-28  3:03             ` Felipe Balbi
2008-09-26 17:12 ` [PATCH 0/9] twl4030 updates David Brownell
2008-09-26 17:50   ` Felipe Balbi
2008-09-26 18:55     ` David Brownell
2008-09-26 19:00   ` David Brownell
2008-09-26 19:10     ` Steve Sakoman
2008-09-26 19:23       ` Felipe Balbi
2008-09-26 19:45       ` David Brownell
2008-09-27 19:14 ` David Brownell
2008-09-27 21:17   ` Felipe Balbi
2008-09-27 21:45     ` David Brownell
2008-09-27 21:46       ` Felipe Balbi
2008-09-27 21:41 ` [PATCH 11/9] move twl4030-gpio to drivers/gpio David Brownell
2008-09-27 22:29   ` Felipe Balbi
2008-09-27 23:09     ` Felipe Balbi
2008-09-27 23:45       ` David Brownell
2008-09-28  3:14         ` Felipe Balbi
2008-09-28  5:16           ` David Brownell
2008-10-01 13:46             ` Felipe Contreras
2008-10-01 13:52               ` Felipe Balbi
2008-10-01 15:58               ` David Brownell
2008-10-01 16:05                 ` Jean Delvare
2008-10-01 16:32                   ` David Brownell
2008-09-27 23:29     ` David Brownell

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=200809270804.16788.david-b@pacbell.net \
    --to=david-b@pacbell.net \
    --cc=felipe.balbi@nokia.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=me@felipebalbi.com \
    --cc=mikko.k.ylinen@nokia.com \
    --cc=tony@atomide.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