Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp3039602ybe; Sun, 8 Sep 2019 05:59:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqzDyxQ23ML0bsRu00bKlE2S+FLPEUkGAmIhf+O5B6zLH7KwcDWIG1yBIPZMkHzJFAJFly4c X-Received: by 2002:a17:906:2ac3:: with SMTP id m3mr15466141eje.212.1567947594357; Sun, 08 Sep 2019 05:59:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567947594; cv=none; d=google.com; s=arc-20160816; b=DMQI8Rz3n+Sj+HCodD+lvMWHZgYC9BW3zIV4HsFSXD7fQ01PB+KGrrwvFdJwql0mof 45NMulVJPWMQJVTGLzohqQnX1zC24Sg/O5iFSQbSpI4VvnE9km2HKrhtzV1nVpZZy5hX aFYmRjEdLuPYajFykq+hNc0oTYQ5fHcdyqsquDA6X3Idd66RlrKKB/GlH9JPVZQ23Z95 XteitsdpEEI7/MsMBo+MsZEzdF5FtXj7GOTsFx0k6jefk/1+zFJ8boe/eb1k5TwwPBSv or/I5mv1ur/rLlf/NFutm4AGGaDftxfpqSiyZN4Lnx6ZtnNQ1loYuJuT2frkTO2S6twS tdtg== 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=nj7j8Embm5Q41gZukX14z0R9NlpA0jWqsUD5Lmd2Q/8=; b=RCuyyq1nSpk+hcUEat8IgV45I1y7tR1MIPfFCGIJ9SCULOmX4qkag8us2OOvVcpD28 i/+M/dIu47je9v7YUyRFKdJL+AVCYAZztJIW+j4j+ySOKyWAMLTOXa7dVf9VpokcpJRS awFhq4Fv3gcCXePI8yz0IiFR9/J9GZlAOI/9Hbfx4tyfLnhmkrXe59rGUT5LB8Q2n8Ur E40a12TRolA7mkXagwnqO5/0p+Cjf95+Rr4n1xziJMllvwYadAomD4FJW7mOqfRtDbFQ MKe9lr7KatFPiOR07bE59I01Sa1UsvEOeBGtpfnmMibf8KSyiD26wcX2yhw1jJy3OF8E wB9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=YSKEmhtT; 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 v57si7332518edc.171.2019.09.08.05.59.30; Sun, 08 Sep 2019 05:59:54 -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=YSKEmhtT; 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 S1727887AbfIHJZF (ORCPT + 99 others); Sun, 8 Sep 2019 05:25:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:50640 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727608AbfIHJZE (ORCPT ); Sun, 8 Sep 2019 05:25:04 -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 663E520863; Sun, 8 Sep 2019 09:25:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567934703; bh=PCTAy83waN3ZgE9Lk46050Vd0yttrDaO/Vn+ZQT+h+g=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=YSKEmhtTLs+xsDKKy+f3CokAyyeMnOktDvQHiJwmlxpczkT5JazPpu+TUCdsF/Jq5 +tdNOVQdP185EAVZ4H42WOS9GRNnKqieWtoBLDs1F+uEmKsnLFFH58gc8EvrP+GKjD F85oWwxbK9oqbXGWqVVl8ZmQx3SLVLQjC2ySc4uU= Date: Sun, 8 Sep 2019 10:24:58 +0100 From: Jonathan Cameron To: Stefan Popa Cc: , , , , , Subject: Re: [PATCH 1/3] iio: accel: adxl372: Fix/remove limitation for FIFO samples Message-ID: <20190908102458.7ef6f1ed@archlinux> In-Reply-To: <1567502287-10199-1-git-send-email-stefan.popa@analog.com> References: <1567502287-10199-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, 3 Sep 2019 12:18:07 +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 This st->watermark field is also used to provide the hwfifo_watermark sysfs attribute value. That value should be 'sets' not individual samples. I'm not sure that's the case here. Note this also effects the max and min values which will change depending on which channels are enabled. I've just checked the docs and watermark is clearly stated to be in scans but the hwfifo_watermark is not. Which is unfortunate if there are drivers interpreting it as being in samples as a result. I haven't looked yet to see what other drivers have this interpreted as... Gah. Jonathan > --- > drivers/iio/accel/adxl372.c | 9 --------- > 1 file changed, 9 deletions(-) > > diff --git a/drivers/iio/accel/adxl372.c b/drivers/iio/accel/adxl372.c > index 055227cb..adec37b 100644 > --- a/drivers/iio/accel/adxl372.c > +++ b/drivers/iio/accel/adxl372.c > @@ -805,15 +805,6 @@ static int adxl372_buffer_postenable(struct iio_dev *indio_dev) > st->fifo_format = adxl372_axis_lookup_table[i].fifo_format; > st->fifo_set_size = bitmap_weight(indio_dev->active_scan_mask, > indio_dev->masklength); > - /* > - * The 512 FIFO samples can be allotted in several ways, such as: > - * 170 sample sets of concurrent 3-axis data > - * 256 sample sets of concurrent 2-axis data (user selectable) > - * 512 sample sets of single-axis data > - */ > - if ((st->watermark * st->fifo_set_size) > ADXL372_FIFO_SIZE) > - st->watermark = (ADXL372_FIFO_SIZE / st->fifo_set_size); > - > st->fifo_mode = ADXL372_FIFO_STREAMED; > > ret = adxl372_configure_fifo(st);