All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Saravanan Sekar <sravanhome@gmail.com>
Cc: sre@kernel.org, lee.jones@linaro.org, robh+dt@kernel.org,
	krzysztof.kozlowski+dt@linaro.org, lars@metafoo.de,
	andy.shevchenko@gmail.com, linux-pm@vger.kernel.org,
	devicetree@vger.kernel.org, linux-iio@vger.kernel.org
Subject: Re: [PATCH v5 6/8] iio: adc: mp2629: restrict input voltage mask for mp2629
Date: Sat, 29 Oct 2022 13:35:03 +0100	[thread overview]
Message-ID: <20221029133503.207cfd48@jic23-huawei> (raw)
In-Reply-To: <20221029093000.45451-7-sravanhome@gmail.com>

On Sat, 29 Oct 2022 11:29:58 +0200
Saravanan Sekar <sravanhome@gmail.com> wrote:

> Add support for mp2733 which is updated version of mp2629
> with a higher range of input voltage.
> 
> Signed-off-by: Saravanan Sekar <sravanhome@gmail.com>
> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Hmm. this is going to slow things down wrt to this series going in.
We want the associated fix to go in during this cycle, and this
is dependant on a change going via MFD.  Ah well.

Generally I prefer to avoid using chip IDs for this sort of check
because they don't generalize as well as an actual flag for this
'feature' stored in a chip_info type structure.

However, we can tidy that up if it becomes relevant as more parts
are added to the driver.

On basis this might end up going via MFD,

Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

> ---
>  drivers/iio/adc/mp2629_adc.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/adc/mp2629_adc.c b/drivers/iio/adc/mp2629_adc.c
> index 88e947f300cf..18290e176e1e 100644
> --- a/drivers/iio/adc/mp2629_adc.c
> +++ b/drivers/iio/adc/mp2629_adc.c
> @@ -66,6 +66,7 @@ static int mp2629_read_raw(struct iio_dev *indio_dev,
>  			int *val, int *val2, long mask)
>  {
>  	struct mp2629_adc *info = iio_priv(indio_dev);
> +	struct mp2629_data *ddata = dev_get_drvdata(info->dev);
>  	unsigned int rval;
>  	int ret;
>  
> @@ -75,8 +76,10 @@ static int mp2629_read_raw(struct iio_dev *indio_dev,
>  		if (ret)
>  			return ret;
>  
> -		if (chan->channel == MP2629_INPUT_VOLT)
> +		if (chan->channel == MP2629_INPUT_VOLT &&
> +		    ddata->chip_id == CHIP_ID_MP2629)
>  			rval &= GENMASK(6, 0);
> +
>  		*val = rval;
>  		return IIO_VAL_INT;
>  


  reply	other threads:[~2022-10-29 12:23 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-29  9:29 [PATCH v5 0/8] Add support for mp2733 battery charger Saravanan Sekar
2022-10-29  9:29 ` [PATCH v5 1/8] iio: adc: mp2629: fix wrong comparison of channel Saravanan Sekar
2022-10-29 12:28   ` Jonathan Cameron
2022-10-29  9:29 ` [PATCH v5 2/8] mfd: mp2629: fix failed to get iio channel by device name Saravanan Sekar
2022-10-29  9:29 ` [PATCH v5 3/8] iio: adc: mp2629: fix potential array out of bound access Saravanan Sekar
2022-10-29 12:30   ` Jonathan Cameron
2022-10-29  9:29 ` [PATCH v5 4/8] power: supply: fix wrong interpretation of register value Saravanan Sekar
2022-10-29 22:52   ` Andy Shevchenko
2022-10-29  9:29 ` [PATCH v5 5/8] mfd: mp2629: Add support for mps mp2733 battery charger Saravanan Sekar
2022-10-29 12:36   ` Jonathan Cameron
2022-10-29  9:29 ` [PATCH v5 6/8] iio: adc: mp2629: restrict input voltage mask for mp2629 Saravanan Sekar
2022-10-29 12:35   ` Jonathan Cameron [this message]
2022-10-29  9:29 ` [PATCH v5 7/8] power: supply: Add support for mp2733 battery charger Saravanan Sekar
2022-10-29  9:30 ` [PATCH v5 8/8] power: supply: mp2629: Add USB fast charge settings Saravanan Sekar
2022-10-29 22:02 ` [PATCH v5 0/8] Add support for mp2733 battery charger Sebastian Reichel
2022-10-29 22:11   ` saravanan sekar
2022-11-04  1:54 ` Krzysztof Kozlowski
2022-11-04  7:13   ` saravanan sekar
2022-11-04 12:58     ` 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=20221029133503.207cfd48@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=andy.shevchenko@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lars@metafoo.de \
    --cc=lee.jones@linaro.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=sravanhome@gmail.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.