Re: [PATCH v2 2/2] iio: accel: adxl380: add support for ADXL318 and ADXL319
From: Jonathan Cameron
Date: Sat Nov 15 2025 - 12:12:24 EST
On Fri, 14 Nov 2025 19:14:02 -0300
Jonathan Santos <Jonathan.Santos@xxxxxxxxxx> wrote:
> The ADXL318 and ADXL319 are low noise density, low power, 3-axis
> accelerometers based on ADXL380 and ADXL382, respectively. The main
> difference between the new parts and the existing ones are the absence
> of interrupts and events like tap detection, activity/inactivity, and
> free-fall detection.
>
> Other differences in the new parts are fewer power modes, basically
> allowing only idle and measurement modes, and the removal of the 12-bit
> SAR ADC path for the 3-axis signals (known as lower signal chain),
> being excluisive for the temperature sensor in the ADXL318/319.
>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>
> Signed-off-by: Jonathan Santos <Jonathan.Santos@xxxxxxxxxx>
One tiny thing I'll tweak whilst applying. Applied to the togreg
branch of iio.git which will go out initially as testing.
Thanks,
Jonathan
> static const unsigned int adxl380_th_reg_high_addr[2] = {
> [ADXL380_ACTIVITY] = ADXL380_THRESH_ACT_H_REG,
> [ADXL380_INACTIVITY] = ADXL380_THRESH_INACT_H_REG,
> @@ -276,9 +243,14 @@ static int adxl380_set_measure_en(struct adxl380_state *st, bool en)
> if (ret)
> return ret;
>
> - /* Activity/ Inactivity detection available only in VLP/ULP mode */
> - if (FIELD_GET(ADXL380_ACT_EN_MSK, act_inact_ctl) ||
> - FIELD_GET(ADXL380_INACT_EN_MSK, act_inact_ctl))
> + /*
> + * Activity/Inactivity detection available only in VLP/ULP
> + * mode and for devices that support low power modes. Otherwise
> + * go straight to measure mode (same bits as ADXL380_OP_MODE_HP).
> + */
> + if (st->chip_info->has_low_power &&
> + (FIELD_GET(ADXL380_ACT_EN_MSK, act_inact_ctl) ||
> + FIELD_GET(ADXL380_INACT_EN_MSK, act_inact_ctl)))
Looks like this is aligned one space before where it should be.
> op_mode = ADXL380_OP_MODE_VLP;