linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gene Chen <gene.chen.richtek@gmail.com>
To: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Jonathan Cameron <jic23@kernel.org>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net,
	linux-iio@vger.kernel.org,
	linux-arm Mailing List <linux-arm-kernel@lists.infradead.org>,
	"moderated list:ARM/Mediatek SoC support" 
	<linux-mediatek@lists.infradead.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Gene Chen <gene_chen@richtek.com>,
	Wilma.Wu@mediatek.com, shufan_lee@richtek.com,
	cy_huang@richtek.com, benjamin.chao@mediatek.com,
	Cristian Pop <cristian.pop@analog.com>
Subject: Re: [PATCH v4 2/3] Documentation: ABI: testing: mt6360: Add ADC sysfs guideline
Date: Fri, 18 Sep 2020 18:33:06 +0800	[thread overview]
Message-ID: <CAE+NS36T+8Ec4y3NBeoX3DOEOMa4mMu38OBgFvyPYw8su-X4Yg@mail.gmail.com> (raw)
In-Reply-To: <20200918090321.00007f70@Huawei.com>

Jonathan Cameron <Jonathan.Cameron@huawei.com> 於 2020年9月18日 週五 下午4:05寫道:
>
> On Fri, 18 Sep 2020 15:21:44 +0800
> Gene Chen <gene.chen.richtek@gmail.com> wrote:
>
> > Jonathan Cameron <jic23@kernel.org> 於 2020年9月18日 週五 上午1:43寫道:
> > >
> > > On Wed, 16 Sep 2020 01:36:08 +0800
> > > Gene Chen <gene.chen.richtek@gmail.com> wrote:
> > >
> > > > From: Gene Chen <gene_chen@richtek.com>
> > > >
> > > > Add ABI documentation for mt6360 ADC sysfs interfaces.
> > > >
> > > > Signed-off-by: Gene Chen <gene_chen@richtek.com>
> > > Would you consider using the proposed label attribute for channels?
> > >
> > > https://lore.kernel.org/linux-iio/20200916132115.81795-1-cristian.pop@analog.com/T/#u
> > >
> > > I'm hoping that will remove the need to have ext name used in the majority of
> > > cases and would like to know if it would work for you?
> > > It may not work for this particular case of course.
> > >
> > > Other comments inline.
> > >
> >
> > because of ADC layout is fixed, I can't switch channel to specific
> > purpose for userspace.
>
> That patch set doesn't allow userspace to change the purpose. It provides
> a *_label attribute for each channel to allow for identification of the channel.
> That can be provided by ACPI / DT or can be provided by the driver itself.
> The advantage is that it removes the nasty freeform parsing that is needed
> to work out the filenames.
>

May I ask how to get this patch for test the labels?
I supposed userspace catch meanings by iio device sysfs node name.
The label defined in DT means it can be modified. But actually shouldn't.

> >
> > > > ---
> > > >  Documentation/ABI/testing/sysfs-bus-iio-adc-mt6360 | 83 ++++++++++++++++++++++
> > > >  1 file changed, 83 insertions(+)
> > > >  create mode 100644 Documentation/ABI/testing/sysfs-bus-iio-adc-mt6360
> > > >
> > > > diff --git a/Documentation/ABI/testing/sysfs-bus-iio-adc-mt6360 b/Documentation/ABI/testing/sysfs-bus-iio-adc-mt6360
> > > > new file mode 100644
> > > > index 0000000..4b1c270
> > > > --- /dev/null
> > > > +++ b/Documentation/ABI/testing/sysfs-bus-iio-adc-mt6360
> > > > @@ -0,0 +1,83 @@
> > > > +What:                /sys/bus/iio/devices/iio:deviceX/in_voltage_USBID_input
> > >
> > >
> > > The mixture of case is a bit ugly.  Could we do
> > > in_voltage_usbin_input?
> > >
> >
> > ACK
> >
> > > > +KernelVersion:       5.8.0
> > > > +Contact:     gene_chen@richtek.com
> > > > +Description:
> > > > +             Indicated MT6360 USBID ADC which connected to connector ID pin.
> > > > +             Reading returns voltage in uV
> > > > +
> > > > +What:                /sys/bus/iio/devices/iio:deviceX/in_voltage_VBUSDIV5_input
> > >
> > > > +KernelVersion:       5.8.0
> > > > +Contact:     gene_chen@richtek.com
> > > > +Description:
> > > > +             Indicated MT6360 VBUS ADC with high accuracy
> > > > +             Reading returns voltage in uV
> > >
> > > Why would we ever read the low accuracy version?
> > >

VBUSDIV5 with lower accuracy(+-75mA) higher measure range(1~22V)
VBUSDIV2 with higher accracy (+-30mA) lower measure range(1~9.76V)
I will fix the description

> > > > +
> > > > +What:                /sys/bus/iio/devices/iio:deviceX/in_voltage_VBUSDIV2_input
> > > > +KernelVersion:       5.8.0
> > > > +Contact:     gene_chen@richtek.com
> > > > +Description:
> > > > +             Indicated MT6360 VBUS ADC with low accuracy
> > > > +             Reading returns voltage in uV
> > > > +
> > > > +What:                /sys/bus/iio/devices/iio:deviceX/in_voltage_VSYS_input
> > > > +KernelVersion:       5.8.0
> > > > +Contact:     gene_chen@richtek.com
> > > > +Description:
> > > > +             Indicated MT6360 VSYS ADC
> > > > +             Reading returns voltage in uV
> > > > +
> > > > +What:                /sys/bus/iio/devices/iio:deviceX/in_voltage_VBAT_input
> > > > +KernelVersion:       5.8.0
> > > > +Contact:     gene_chen@richtek.com
> > > > +Description:
> > > > +             Indicated MT6360 VBAT ADC
> > > > +             Reading returns voltage in uV
> > > > +
> > > > +What:                /sys/bus/iio/devices/iio:deviceX/in_current_IBUS_input
> > > > +KernelVersion:       5.8.0
> > > > +Contact:     gene_chen@richtek.com
> > > > +Description:
> > > > +             Indicated MT6360 IBUS ADC
> > > > +             Reading returns current in uA
> > > Given voltage and current are already clear from the channel type,
> > > could we avoid the repetition?
> > >
> > > in_current_bus_input perhaps?
> > >
> >
> > ACK
> >
> > > > +
> > > > +What:                /sys/bus/iio/devices/iio:deviceX/in_current_IBAT_input
> > > > +KernelVersion:       5.8.0
> > > > +Contact:     gene_chen@richtek.com
> > > > +Description:
> > > > +             Indicated MT6360 IBAT ADC
> > > > +             Reading returns current in uA
> > > > +
> > > > +What:                /sys/bus/iio/devices/iio:deviceX/in_voltage_CHG_VDDP_input
> > > > +KernelVersion:       5.8.0
> > > > +Contact:     gene_chen@richtek.com
> > > > +Description:
> > > > +             Indicated MT6360 CHG_VDDP ADC
> > > > +             Reading returns voltage in uV
> > > > +
> > > > +What:                /sys/bus/iio/devices/iio:deviceX/in_temp_TEMP_JC_input
> > > > +KernelVersion:       5.8.0
> > > > +Contact:     gene_chen@richtek.com
> > > > +Description:
> > > > +             Indicated MT6360 IC junction temperature
> > > > +             Reading returns temperature in degree
> > > > +
> > > > +What:                /sys/bus/iio/devices/iio:deviceX/in_voltage_VREF_TS_input
> > > > +KernelVersion:       5.8.0
> > > > +Contact:     gene_chen@richtek.com
> > > > +Description:
> > > > +             Indicated MT6360 VREF_TS ADC
> > > > +             Reading returns voltage in uV
> > > > +
> > > > +What:                /sys/bus/iio/devices/iio:deviceX/in_voltage_TS_input
> > > > +KernelVersion:       5.8.0
> > > > +Contact:     gene_chen@richtek.com
> > > > +Description:
> > > > +             Indicated MT6360 TS ADC
> > > > +             Reading returns voltage in uV
> > > > +
> > > > +What:                /sys/bus/iio/devices/iio:deviceX/timestamp
> > > > +KernelVersion:       5.8.0
> > > > +Contact:     gene_chen@richtek.com
> > > > +Description:
> > > > +             Indicated MT6360 timestamp
> > > > +             Reading returns current timestamp in ms
> > >
> > > That's an odd bit of ABI.  Why would we want to read the current timestamp from
> > > sysfs?  Timestamps in IIO also tend to be in nano seconds.
> > >
> > >
> > >
> > >
> >
> > ACK, I will remove this.
>
>

  reply	other threads:[~2020-09-18 10:33 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-15 17:36 [PATCH v4 0/3] iio: adc: mt6360: Add ADC driver for MT6360 Gene Chen
2020-09-15 17:36 ` [PATCH v4 1/3] dt-bindings: iio: adc: add bindings doc for MT6360 ADC Gene Chen
2020-09-17 17:33   ` Jonathan Cameron
2020-09-15 17:36 ` [PATCH v4 2/3] Documentation: ABI: testing: mt6360: Add ADC sysfs guideline Gene Chen
2020-09-17 17:42   ` Jonathan Cameron
2020-09-18  7:21     ` Gene Chen
2020-09-18  8:03       ` Jonathan Cameron
2020-09-18 10:33         ` Gene Chen [this message]
2020-09-18 15:12           ` Jonathan Cameron
2020-09-15 17:36 ` [PATCH v4 3/3] iio: adc: mt6360: Add ADC driver for MT6360 Gene Chen
2020-09-17 17:53   ` Jonathan Cameron
2020-09-18  8:04     ` Gene Chen
2020-09-19 13:20       ` Jonathan Cameron

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=CAE+NS36T+8Ec4y3NBeoX3DOEOMa4mMu38OBgFvyPYw8su-X4Yg@mail.gmail.com \
    --to=gene.chen.richtek@gmail.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=Wilma.Wu@mediatek.com \
    --cc=benjamin.chao@mediatek.com \
    --cc=cristian.pop@analog.com \
    --cc=cy_huang@richtek.com \
    --cc=gene_chen@richtek.com \
    --cc=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=pmeerw@pmeerw.net \
    --cc=shufan_lee@richtek.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;
as well as URLs for NNTP newsgroup(s).