From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AE44420C490 for ; Wed, 7 Jan 2026 13:55:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767794134; cv=none; b=msBiXPnkNCqKYZIPdMgfWzai+KlzNdadCDVzINTv2BKJmqTj0AN/aV0G8jMzziXVa1sjwXbPlDN3ocKr+sq6f68eEH7aH/D8E1jBeX4Ql1OyPuG+DKm3wbJUULN3YDY9AUDf/E41CCMlhnacT9Fa783pdw5TWz/tAIjbML/9syM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767794134; c=relaxed/simple; bh=MjmuTEdJLhRUCFKamYp5rxG8fH8Naro0YOHHi4oFs7E=; h=Message-ID:Subject:From:To:Date:In-Reply-To:References: Content-Type:MIME-Version; b=MhwEoZvjd4y7jbH5QKHi8dCcb3+gT+hbKcKxbnRudAsXXKIgJqc8KUT/cnciVgJAY7HxRPGsDXwu+KHbUaH1t0v8nE4o/Zk4dQsk0bTqg7CSGxaSDZCw4szSP1w1OljplM1cgCaJlPk0oNJZXUqwPXn+VxeJK/ibqyyZYKAHh9c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Vsc1fXA0; arc=none smtp.client-ip=209.85.128.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Vsc1fXA0" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-47a95efd2ceso18688455e9.2 for ; Wed, 07 Jan 2026 05:55:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767794131; x=1768398931; darn=vger.kernel.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=oakT7m3B+w4n/sN4kwRkp8thf4WnUxQ8zbdabrCd+vU=; b=Vsc1fXA0GNUzDSHjNXWJUhsR8wJvEPYdHsml3kDFscLQ2ub7p/YgUDByzJZFkJX24o rGe9KD1Knf1/PTnqxTTkI/NXZ3suDSjSeYGovQJqHlnWkm0Knu9B8d0Go7BbPRTxuT4q RIevQvgs2KLACl5aWL7cnJ72anFMvf77+DGbOVXFfUsDgMxYPUiR7OWg+L9DJJM/hf6S qxi9qcLBa/2/Q/w89FZ7w0SyZoRtS5/DlQHRimqQbq5SdwnRZQLS6tbnsdaM1e/9A8X9 BmUWeZ7gUI7esgaWrhOeXolELu+VEv3dvdn/qDfeE6Ngfb1VQ9dqd+bJ2JAoojJ1YVuk tVTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767794131; x=1768398931; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=oakT7m3B+w4n/sN4kwRkp8thf4WnUxQ8zbdabrCd+vU=; b=WU50wWIJoTbZDyWiDgJSyFni9VAXOLkfmXgD5CXFufn8ixG01DKxncPgyt4wAzkENz 7gPihgODohAMQuOVxe+rcCPsURs3SpCdzfM8nJm/UthA4Uhhk1hAGp0orYo2/XiwYtO+ RwslKmIvsRXu7qusTobLbH8cBa83GFzdA9lhwqhnuPvfDuGBMyS38jEdtd/6pM9vSgOv Z5/MUz+1UHTEXrpzkm38bwvwgO4+mbiLYtsgxP3GYBnrL2NArUQjY/KFxk2R20yKmM0N rwxUmbnZbLWqWTy7+HvB5QZa70WXWMSfC+GX6rnXtLCDJqSBBTzsA9pW5hnp0Xo7WQlv Y0ow== X-Forwarded-Encrypted: i=1; AJvYcCWPGzIbLt6qgMA4YLdGAL4L8fzRUJIGK/OehZhqYeZoOIF6SGWiNW4yu+Z0UQOCGD+iOwrZJvHjlePLWcw=@vger.kernel.org X-Gm-Message-State: AOJu0YyuJ9HH64l44ZcAXgenw1HMxyynkGJyDsZ2UhPOwatScJtHcUvq zM3DIAKfRZe/kyUtymI5OTGj0sSlyMuIvQ+tYhM7eP8OPurhJrif4Qnf X-Gm-Gg: AY/fxX6X8x16JwYnaSzzg7tLGfJ+iFRSY3hnj0bl4b+PAvXjpRlqqmHTFoLlv4nyRtJ gP01V/NaSENeJ8hTBC+/EA8q1RN0k0ElmZy4fpF+MiSXqoFtHuEU2qssqE5pVtz6XJrFqsxly3U c1OuueDSep8fvUhIrZneUbEEhVOz2OtkUdhZBTLKmR6KA48c1hVap8MYSpIuTiPP1SDvvXnsqAz SAqwkHGMWd78gdXmOm0J8PVbPGEefrgHidmUrwcckhbcgDap1HP+qGoqjXeBUqkhH8s99loV2rB nXVdlcT5NkMC3hAz3ImGdUxGhdZ2zh81bbrWKEqBv06xVthcN+J+Ee5bMFNWBF0qR4q4+bSGrJS BZ84TAyERZbb5JBxhSPPSk5hxjGFszoY8rQMLOtFOEOXj5xe68uWPAtmGdV/ADIcZXi310vfnGA 52BJUDtxullEcIBsoF6nM= X-Google-Smtp-Source: AGHT+IFVFEQpINybWv/vNvdh7UuH51hN+BbScDbpxivdqT45ngiAUR+gzJegfPVsIPQqPfCIlZ4hxg== X-Received: by 2002:a05:600c:4443:b0:477:755b:5587 with SMTP id 5b1f17b1804b1-47d84b0aad1mr28671665e9.8.1767794130679; Wed, 07 Jan 2026 05:55:30 -0800 (PST) Received: from [192.168.1.187] ([161.230.67.253]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47d7f410c86sm101388785e9.3.2026.01.07.05.55.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jan 2026 05:55:30 -0800 (PST) Message-ID: <52e5cea72b99fc23c922cf74d7dce3403f43c9cd.camel@gmail.com> Subject: Re: [PATCH 2/2] iio: accel: adxl380: Add support for 1 kHz sampling frequency From: Nuno =?ISO-8859-1?Q?S=E1?= To: Francesco Lavra , Ramona Gradinariu , Antoniu Miclaus , Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , David Lechner , Nuno =?ISO-8859-1?Q?S=E1?= , Andy Shevchenko , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Date: Wed, 07 Jan 2026 13:56:12 +0000 In-Reply-To: <20260107123518.4017292-3-flavra@baylibre.com> References: <20260107123518.4017292-1-flavra@baylibre.com> <20260107123518.4017292-3-flavra@baylibre.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.58.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Hi Francesco, On Wed, 2026-01-07 at 13:35 +0100, Francesco Lavra wrote: > In sensor variants (such as ADXL380 and ADXL382) that support low-power > mode, the SAR signal path allows sampling acceleration data at lower rate= s; > more specifically, when the sensor operates in VLP mode, the sampling > frequency is 1 kHz. > To add support for the 1kHz sampling frequency value, modify the operatin= g > mode selection logic to take into account the sampling frequency, and > configure the decimation filters only when applicable (i.e. when using a > sampling frequency that relies on the DSM signal path). >=20 > Signed-off-by: Francesco Lavra > --- > =C2=A0drivers/iio/accel/adxl380.c | 49 +++++++++++++++++++++++-----------= --- > =C2=A0drivers/iio/accel/adxl380.h | 10 +++++++- > =C2=A02 files changed, 40 insertions(+), 19 deletions(-) >=20 > diff --git a/drivers/iio/accel/adxl380.c b/drivers/iio/accel/adxl380.c > index bbf1f88ca781..a6919dfce2e9 100644 > --- a/drivers/iio/accel/adxl380.c > +++ b/drivers/iio/accel/adxl380.c > @@ -245,12 +245,14 @@ static int adxl380_set_measure_en(struct adxl380_st= ate *st, bool en) > =C2=A0 > =C2=A0 /* > =C2=A0 * 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). > + * mode and for devices that support low power modes. > =C2=A0 */ > =C2=A0 if (st->chip_info->has_low_power && > =C2=A0 =C2=A0=C2=A0=C2=A0 (FIELD_GET(ADXL380_ACT_EN_MSK, act_inact_ctl) = || > =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 FIELD_GET(ADXL380_INACT_EN_MSK, act_inac= t_ctl))) > + st->odr =3D ADXL380_ODR_VLP; > + So before this change we would go to low power mode but still report whatev= er sampling frequency userspace had configured (which I guess would not correspond to reality)? W= ith the above we'll update the reported odr right? Some things/doubts that come to mind: 1. If I'm right not sure if this shouldn't be treated as a fix. 2. Should we cache the current odr so that we restore it when appropriate? 3. Other thing that comes to mind is if it makes sense to allow controlling= odr if Activity/Inactivity detection is enabled? Thx! - Nuno S=C3=A1