public inbox for linux-fbdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: ChiaEn Wu <peterwu.pub@gmail.com>
Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	lee.jones@linaro.org, daniel.thompson@linaro.org,
	jingoohan1@gmail.com, pavel@ucw.cz, robh+dt@kernel.org,
	krzysztof.kozlowski+dt@linaro.org, matthias.bgg@gmail.com,
	sre@kernel.org, chunfeng.yun@mediatek.com,
	gregkh@linuxfoundation.org, lars@metafoo.de, lgirdwood@gmail.com,
	broonie@kernel.org, linux@roeck-us.net,
	heikki.krogerus@linux.intel.com, deller@gmx.de,
	ChiYuan Huang <cy_huang@richtek.com>,
	alice_chen@richtek.com, chiaen_wu@richtek.com,
	dri-devel@lists.freedesktop.org, linux-leds@vger.kernel.org,
	devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org,
	linux-pm@vger.kernel.org, linux-usb@vger.kernel.org,
	linux-iio@vger.kernel.org, linux-fbdev@vger.kernel.org
Subject: Re: [RESEND 10/14] iio: adc: mt6370: Add Mediatek MT6370 support
Date: Fri, 3 Jun 2022 18:19:17 +0100	[thread overview]
Message-ID: <20220603181917.3f737913@jic23-huawei> (raw)
In-Reply-To: <CABtFH5Lg43EXS7juhXQ2wQFZzkpD7YB8rM6UFT=U9BDOKcbaNw@mail.gmail.com>

> >  
> > > +
> > > +#define MT6370_AICR_400MA            0x6
> > > +#define MT6370_ICHG_500MA            0x4
> > > +#define MT6370_ICHG_900MA            0x8
> > > +
> > > +#define ADC_CONV_TIME_US             35000
> > > +#define ADC_CONV_POLLING_TIME                1000
> > > +
> > > +struct mt6370_adc_data {
> > > +     struct device *dev;
> > > +     struct regmap *regmap;
> > > +     struct mutex lock;  
> >
> > All locks need documentation.  What is the scope of the lock?
> > Looks like it protects device state when doing setup, wait for read, read
> > cycles.  
> 
> This mutex lock is for preventing the different adc channel from being
> read at the same time.
> So, if I just change its name to adc_chan_lock or adc_lock and add the
> comment for this mutex lock, does this change meet your requirement

Yes

> 
> >  
> > > +};
> > > +
> > > +static int mt6370_adc_read_scale(struct mt6370_adc_data *priv,
> > > +                              int chan, int *val1, int *val2)
> > > +{
> > > +     unsigned int reg_val;
> > > +     int ret;
> > > +
> > > +     switch (chan) {
> > > +     case MT6370_CHAN_VBAT:
> > > +     case MT6370_CHAN_VSYS:
> > > +     case MT6370_CHAN_CHG_VDDP:
> > > +             *val1 = 5000;  
> >
> > This seems very large.  Voltages are in millivolts
> > as per Documentation/ABI/testing/sysfs-bus-iio
> > and this means each step is 5 volts.
> >
> > So value in mv is currently 5 * _raw
> >  
> 
> OK, I got it. Also, I will add the ABI file in the next version. Thanks!
Only add ABI documentation for anything non-standard.

The documentation scripts really don't like repeats!

> 
> > > +static const char * const mt6370_channel_labels[MT6370_CHAN_MAX] = {  
> >
> > Perhaps define an enum with which to index this and the chan spec
> > and hence ensure they end up matching.
> >  [vbusdiv5] = "vbusdiv5", etc
> >  
> 
> Do you mean that I can refine this const char array to the following array??
> 
> static const char * const mt6370_channel_labels[MT6370_CHAN_MAX] = {
>     [MT6370_CHAN_VBUSDIV5] =  "vbusdiv5",
>     [MT6370_CHAN_VBUSDIV2] =  "vbusdiv2",
>     ...
>     ...
>     [MT6370_CHAN_TEMP_JC] =  "temp_jc",
> };

Yes

thanks,

Jonathan

  reply	other threads:[~2022-06-03 17:10 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-31 11:18 [RESEND 00/14] Add Mediatek MT6370 PMIC support ChiaEn Wu
2022-05-31 11:18 ` [RESEND 01/14] dt-bindings: usb: Add Mediatek MT6370 TCPC binding ChiaEn Wu
2022-06-01  7:36   ` Krzysztof Kozlowski
2022-05-31 11:18 ` [RESEND 02/14] dt-bindings: power: supply: Add Mediatek MT6370 Charger binding ChiaEn Wu
2022-06-01  7:36   ` Krzysztof Kozlowski
2022-05-31 11:18 ` [RESEND 03/14] dt-bindings: leds: mt6370: Add Mediatek mt6370 indicator ChiaEn Wu
2022-05-31 22:46   ` Rob Herring
2022-06-01  7:36   ` Krzysztof Kozlowski
2022-05-31 11:18 ` [RESEND 04/14] dt-bindings: leds: Add Mediatek MT6370 flashlight binding ChiaEn Wu
2022-05-31 22:46   ` Rob Herring
2022-06-01  7:36   ` Krzysztof Kozlowski
2022-05-31 11:18 ` [RESEND 05/14] dt-bindings: backlight: Add Mediatek MT6370 backlight binding ChiaEn Wu
2022-06-01  7:37   ` Krzysztof Kozlowski
2022-05-31 11:18 ` [RESEND 06/14] dt-bindings: mfd: Add Mediatek MT6370 binding ChiaEn Wu
2022-05-31 22:46   ` Rob Herring
2022-05-31 11:18 ` [RESEND 07/14] mfd: mt6370: Add Mediatek MT6370 support ChiaEn Wu
2022-05-31 11:18 ` [RESEND 08/14] usb: typec: tcpci_mt6370: Add Mediatek MT6370 tcpci driver ChiaEn Wu
2022-05-31 11:18 ` [RESEND 09/14] regulator: mt6370: Add mt6370 DisplayBias and VibLDO support ChiaEn Wu
2022-05-31 11:18 ` [RESEND 10/14] iio: adc: mt6370: Add Mediatek MT6370 support ChiaEn Wu
2022-05-31 13:21   ` Jonathan Cameron
2022-06-02 18:22     ` ChiaEn Wu
2022-06-03 17:19       ` Jonathan Cameron [this message]
2022-05-31 11:18 ` [RESEND 11/14] power: supply: mt6370: Add Mediatek MT6370 charger driver ChiaEn Wu
2022-05-31 11:18 ` [RESEND 12/14] leds: mt6370: Add Mediatek MT6370 Indicator support ChiaEn Wu
2022-05-31 11:18 ` [RESEND 13/14] leds: flashlight: mt6370: Add Mediatek MT6370 flashlight support ChiaEn Wu
2022-05-31 11:19 ` [RESEND 14/14] video: backlight: mt6370: Add Mediatek MT6370 support ChiaEn Wu
2022-06-01  9:46   ` Daniel Thompson
2022-06-02 19:14     ` ChiaEn Wu
2022-06-07 10:41       ` Daniel Thompson
2022-06-01  7:35 ` [RESEND 00/14] Add Mediatek MT6370 PMIC support Krzysztof Kozlowski

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=20220603181917.3f737913@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=alice_chen@richtek.com \
    --cc=broonie@kernel.org \
    --cc=chiaen_wu@richtek.com \
    --cc=chunfeng.yun@mediatek.com \
    --cc=cy_huang@richtek.com \
    --cc=daniel.thompson@linaro.org \
    --cc=deller@gmx.de \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=jingoohan1@gmail.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lars@metafoo.de \
    --cc=lee.jones@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=matthias.bgg@gmail.com \
    --cc=pavel@ucw.cz \
    --cc=peterwu.pub@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=sre@kernel.org \
    /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