Re: [PATCH v4 2/5] iio: pressure: bmp280: simplify driver initialization logic

From: Andy Shevchenko
Date: Mon Jul 25 2022 - 17:06:05 EST


On Sat, Jul 23, 2022 at 7:40 PM Angel Iglesias <ang.iglesiasg@xxxxxxxxx> wrote:
>
> Simplified common initialization logic of different sensor types
> unifying calibration and initial configuration recovery.
>
> Default config param values of each sensor type are stored inside
> chip_info structure and used to initialize sensor data struct instance.
>
> The auxiliar functions for read each sensor type calibration are converted
> to a callback available on the chip_info struct.

...

> + .oversampling_temp_default = ilog2(2),
> + .oversampling_press_default = ilog2(16),
> + .oversampling_humid_default = ilog2(16),
> + .oversampling_temp_default = ilog2(1),
> + .oversampling_press_default = ilog2(8),

It's a very interesting way of writing BIT(x)...

--
With Best Regards,
Andy Shevchenko