Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1160216

Re: [PATCH 5/6] phy: twl4030-usb: add support for reading resistor on ID pin.

From Felipe Balbi <balbi@ti.com>
Newsgroups linux.kernel
Subject Re: [PATCH 5/6] phy: twl4030-usb: add support for reading resistor on ID pin.
Date 2015-06-08 05:50 +0200
Message-ID <pyWeu-3fi-13@gated-at.bofh.it> (permalink)
References <pfN22-4r4-9@gated-at.bofh.it> <pfNbJ-4D9-37@gated-at.bofh.it> <pwy6C-2Xw-23@gated-at.bofh.it> <pwFB8-5IO-11@gated-at.bofh.it> <pymb0-16k-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On Sat, Jun 06, 2015 at 03:10:09PM +0200, Pavel Machek wrote:
> On Tue 2015-06-02 07:37:31, NeilBrown wrote:
> > On Mon, 1 Jun 2015 19:06:52 +0530 Kishon Vijay Abraham I <kishon@ti.com>
> > wrote:
> > 
> > > Hi,
> > > 
> > > On Thursday 16 April 2015 01:33 PM, NeilBrown wrote:
> > > > From: NeilBrown <neilb@suse.de>
> > > >
> > > > The twl4030 phy can measure, with low precision, the
> > > > resistance-to-ground of the ID pin.
> > > >
> > > > Add a function to read the value, and export the result
> > > > via sysfs.
> > > 
> > > Little sceptical about adding new sysfs entries. Do you have a good reason to 
> > > add this?
> > 
> > The hardware can report the value, so why not present it to user-space?
> > 
> > I originally used this with a udev rule which would configure the maximum
> > current based on the resistance measure - to work with the particular charger
> > hardware I have.
> > 
> > More recent patches try to do all of the max-current configuration in the
> > kernel, so I could live without exporting the value via sysfs if that is a
> > show-stopper.
> > 
> > I can't see where the scepticism comes from though.  It is a well defined
> > and cleary documented feature of the hardware.  Why not expose it?
> 
> sysfs interface is supposed to work for different chargers, without userspace
> noticing.
> 
> Are these values the ones that are likely to be useful there?

These values come from Battery Charger specification 1.1+, IIRC, so no
other values should show up unless documented in future BC revisions.

> > > > +	Possible values are:
> > > > +		ground
> > > > +		102k
> > > > +		200k
> > > > +		440k
> > > > +		floating
> > > > +		unknown
> 
> ...or would it make more sense to export for example numerical ohms, as that's
> what are other chargers likely to provide?

How do you expose "floating" in Ohms ? UINT_MAX might be one way, but
that would have to be documented.

-- 
balbi

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Re: [PATCH 5/6] phy: twl4030-usb: add support for reading resistor  on ID pin. Pavel Machek <pavel@ucw.cz> - 2015-06-06 15:20 +0200
  Re: [PATCH 5/6] phy: twl4030-usb: add support for reading resistor  on ID pin. Felipe Balbi <balbi@ti.com> - 2015-06-08 05:50 +0200

csiph-web