All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Md Shofiqul Islam <shofiqtest@gmail.com>
Cc: linux-iio@vger.kernel.org, jic23@kernel.org,
	devicetree@vger.kernel.org, robh@kernel.org, krzk+dt@kernel.org,
	conor+dt@kernel.org, u.kleine-koenig@baylibre.com,
	joshua.crofts1@gmail.com, nuno.sa@analog.com,
	Michael.Hennerich@analog.com, dlechner@baylibre.com,
	linux@analog.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v10 2/2] iio: health: add MAX86150 ECG and PPG biosensor driver
Date: Sat, 18 Jul 2026 09:56:29 +0300	[thread overview]
Message-ID: <alsjndog518gToDA@ashevche-desk.local> (raw)
In-Reply-To: <alsjNBDgHm9fkp3c@ashevche-desk.local>

On Sat, Jul 18, 2026 at 09:54:50AM +0300, Andy Shevchenko wrote:
> On Fri, Jul 17, 2026 at 11:11:37PM +0300, Md Shofiqul Islam wrote:

...

> > +static int max86150_read_one_sample(struct max86150_data *data,
> > +				    u32 *ppg_red, u32 *ppg_ir, s32 *ecg)
> > +{
> > +	int ret;
> > +
> > +	ret = regmap_noinc_read(data->regmap, MAX86150_REG_FIFO_DATA,
> > +				data->fifo_raw, MAX86150_SAMPLE_BYTES);
> > +	if (ret)
> > +		return ret;
> > +
> > +	*ppg_red = (data->fifo_raw[0] & 0x07) << 16 |
> > +		    data->fifo_raw[1] << 8 | data->fifo_raw[2];
> 
> Use get_unaligned_be16()

Actually it should be get_unaligned_be24().

> > +	*ppg_ir  = (data->fifo_raw[3] & 0x07) << 16 |
> > +		    data->fifo_raw[4] << 8 | data->fifo_raw[5];
> 
> Ditto.
> 
> > +	*ecg = sign_extend32((data->fifo_raw[6] & 0x03) << 16 |
> > +			      data->fifo_raw[7] << 8 | data->fifo_raw[8], 17);
> 
> Ditto.
> 
> > +	return 0;
> > +}

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2026-07-18  6:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-17 20:11 [PATCH v10 0/2] iio: health: add MAX86150 ECG and PPG biosensor driver Md Shofiqul Islam
2026-07-17 20:11 ` [PATCH v10 1/2] dt-bindings: iio: health: add adi,max86150 Md Shofiqul Islam
2026-07-17 20:20   ` sashiko-bot
2026-07-17 20:11 ` [PATCH v10 2/2] iio: health: add MAX86150 ECG and PPG biosensor driver Md Shofiqul Islam
2026-07-17 20:30   ` sashiko-bot
2026-07-18  6:54   ` Andy Shevchenko
2026-07-18  6:56     ` Andy Shevchenko [this message]
2026-07-18  8:36 ` [PATCH v10 0/2] " Siratul Islam

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=alsjndog518gToDA@ashevche-desk.local \
    --to=andriy.shevchenko@intel.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=joshua.crofts1@gmail.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@analog.com \
    --cc=nuno.sa@analog.com \
    --cc=robh@kernel.org \
    --cc=shofiqtest@gmail.com \
    --cc=u.kleine-koenig@baylibre.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 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.