Re: [PATCH v3 1/2] iio: magnetometer: add support for Infineon TLV493D 3D Magentic sensor
From: Andy Shevchenko
Date: Mon Aug 11 2025 - 08:39:52 EST
On Sat, Aug 09, 2025 at 08:03:54PM +0530, Dixit Parmar wrote:
> On Sat, Aug 09, 2025 at 02:44:00PM +0200, Andy Shevchenko wrote:
...
> > > > > + data->wr_regs[TLV493D_WR_REG_MODE1] |= mode1_cfg;
> > > > > + data->wr_regs[TLV493D_WR_REG_MODE2] |= mode2_cfg;
> > > >
> > > > No mask for the existing values in the respective wr_regs? Wouldn't
> > > > you need to use FIELD_MODIFY() instead?
> > > >
> > > I believe, we are doing OR op with the value created using FIELD_PREP,
> > > so it should not interefere with the existing non-masked values.
> >
> > I am talking about existing values in the array.
> >
> Right. So in that I think it will make more sense to directly use
> FIELD_MODIFY instead of using FIELD_PREP first and then doing this OR
> op. Right?
Just double check carefully, but sounds about right.
> > > However, as FIELD_MODIFY is there, I should utilize it.
--
With Best Regards,
Andy Shevchenko