Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp3179543ybe; Sun, 15 Sep 2019 09:15:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqxovSO4YVyCNN/oik3yLcXPKrvFioyPfr5eZW7zVsx8UKt0vfPaTeIiYC0vfCJad2tKQXxA X-Received: by 2002:aa7:d414:: with SMTP id z20mr31608108edq.208.1568564126648; Sun, 15 Sep 2019 09:15:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568564126; cv=none; d=google.com; s=arc-20160816; b=xuBBG6Z1pCibNDAYmOckqrdOo8OrFtHZzjRCP38xdPx5JVCJC3OvRQzE/CxbLLBWrZ YZsTF0ni5tkvBywkSSmLpzY3hK/NsUvHcQvHUUZwdZgOcdfUggFU1F/orRC8eyMgbNrs ChZ6DKvaIJMREnrrmjzriZ/60hLg/ZeHNqlsMZ51ZeOkOEPfFfo8AopHtI2t5uGL2d7J lAZnviyeXSQ/WuVmEsp3eqLsCYXbHlcr9s152yrc6kch29QKRgL8DODkYs+YB5tR6fP2 Fi81wdJ4G47xUbx7rX7cysEIkXMM+Cmgs+g6nkLpgHH1xe5aqtO7u+06yQf9Dg84UFky 3khA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=kgdRIz+Qcox0evqMPocNo+gfgSoSrI68tmjVQrTdfQc=; b=SPRm19cxYNSv1+TQTbxTP8dqafsMJQZhH1fMsz7urGX5kB2YRHvZr59c0orN+8oWgx Tnp/s5j6tqQprSyJtiXtx7ZSAi06Tb01ZX8pAHU4ES1syQMLuz82p3o80NGwLWMPVYiM ZNcXSR6LrBbU3oWUzWER+mE0RYR4/7SzROhzEgIXegV4uasEFPysVzfVly6czlypmg9A 7FBzUmHJ0az+BKG7h/A3plyUVKb/8o2eIl8vyIo2SaZb2emjRCvAJrJBfv3Uswkq2/cf PCKo9tMFGaUmhsV7EpqGDKxBENzuOmostzvdDw6lp59n9js/oB+Cz/ztvWl51QU/M0mN 8ITQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="EhzYCi/i"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f33si21376868edb.281.2019.09.15.09.14.27; Sun, 15 Sep 2019 09:15:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="EhzYCi/i"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728574AbfION1L (ORCPT + 99 others); Sun, 15 Sep 2019 09:27:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:53284 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726131AbfION1L (ORCPT ); Sun, 15 Sep 2019 09:27:11 -0400 Received: from archlinux (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9A4B8214C6; Sun, 15 Sep 2019 13:27:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1568554030; bh=kl00ageN6kCZz7MMtaCvKQM5LKvEsc6XqVXiC96l9mI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=EhzYCi/iqYzwBGe7UQlBtS+jONXcuLZETdKfOpf2eAG0vR+pc0IPIiUm7zTqmIf8r +hRwditoB4ZX6WDRYzT6TuBJuWwSakA3RLl2u6CqNmtSf7px4DcEd0Q/5U6j2FcSX+ /JzLID+8PHzuXzi2wuS/ht9NPGBf+2zmpmIzvGw4= Date: Sun, 15 Sep 2019 14:27:05 +0100 From: Jonathan Cameron To: Stefan Popa Cc: , , , , , Subject: Re: [PATCH v2 1/3] iio: accel: adxl372: Fix/remove limitation for FIFO samples Message-ID: <20190915142705.028cb015@archlinux> In-Reply-To: <1568126612-13134-1-git-send-email-stefan.popa@analog.com> References: <1568126612-13134-1-git-send-email-stefan.popa@analog.com> X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 10 Sep 2019 17:43:32 +0300 Stefan Popa wrote: > Currently, the driver sets the FIFO_SAMPLES register with the number of > sample sets (maximum of 170 for 3 axis data, 256 for 2-axis and 512 for > single axis). However, the FIFO_SAMPLES register should store the number > of samples, regardless of how the FIFO format is configured. > > Signed-off-by: Stefan Popa Fixes tags? I think it's Fixes: f4f55ce38e5f ("iio:adxl372: Add FIFO and interrupts support") Check I got that right though. One trivial inline that I have tidied up whilst applying. Applied to the fixes-togreg branch of iio.git. Thanks, Jonathan > --- > Changes in v2: > - st->watermark needs to store the number of sample sets, > the total number of samples is computed in > adxl372_configure_fifo() func. > > drivers/iio/accel/adxl372.c | 11 ++++++++--- > 1 file changed, 8 insertions(+), 3 deletions(-) > > diff --git a/drivers/iio/accel/adxl372.c b/drivers/iio/accel/adxl372.c > index 055227cb..7de5e1b 100644 > --- a/drivers/iio/accel/adxl372.c > +++ b/drivers/iio/accel/adxl372.c > @@ -474,12 +474,17 @@ static int adxl372_configure_fifo(struct adxl372_state *st) > if (ret < 0) > return ret; > > - fifo_samples = st->watermark & 0xFF; > + /* > + * watermak stores the number of sets; we need to write the FIFO watermark > + * registers with the number of samples > + */ > + fifo_samples = (st->watermark * st->fifo_set_size); > fifo_ctl = ADXL372_FIFO_CTL_FORMAT_MODE(st->fifo_format) | > ADXL372_FIFO_CTL_MODE_MODE(st->fifo_mode) | > - ADXL372_FIFO_CTL_SAMPLES_MODE(st->watermark); > + ADXL372_FIFO_CTL_SAMPLES_MODE(fifo_samples); > > - ret = regmap_write(st->regmap, ADXL372_FIFO_SAMPLES, fifo_samples); > + ret = regmap_write(st->regmap, > + ADXL372_FIFO_SAMPLES, fifo_samples & 0xFF); > if (ret < 0) > return ret; >