Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp471812pxb; Sat, 11 Sep 2021 10:37:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyz91YHvJFwg06cABUYSZPGPRez7+sCPFxyaPl2cO2+uZ468KWgIMkOPwjp+lwIdwlS0C5H X-Received: by 2002:a5e:8349:: with SMTP id y9mr2588787iom.34.1631381847230; Sat, 11 Sep 2021 10:37:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631381847; cv=none; d=google.com; s=arc-20160816; b=ZsmPGGrn12MPEiC0GyPl/D7UXdqmChkdpnSzMf/Br4tMtGuOEEKb6tnoVEIv2fBHc7 L22D9q0/terLtfK0qulPla6oc6L2YCgenIQgNgEJAjY24ZDBNNcT69NlOp9JL3mZa1RT lwKciC0ANnchW/Ca62+oxMNjFH1Zy4cju8rXVa2dmHV/0c7ZCOdEdXmi8G3lgN5OGy5Y DMy3g+QgwrYDvZML54APQuW1TGCXH+oW1ON7nOii6tYk66ICdgMx6gJCKI2ASx4gFQkG h9ZPxIp2mTSGVBN8V3yiTYEuoIKRfSJq04OLxae+cvwoHTNCgPHFcw//Q1QJMNOyFgsz 7grw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=mxjvcvfnbpSHO5hxiRfTUfognPGo7/IQo2Q8RNhbv4s=; b=0uB0jGClwHcPafuptfFRCvu6PWsIbePjXyAxR7ULfhwjjgbQrim+uWZ0LVcNxfF6PY if9d83M0wwlZAaupAP1iO7voaa5AVhMbGtFWHtGMihwP64tuUP9c0w3mH1TfERTc5uLd 8ZobNcLBzlzSKyzv3k74LKY6Gt6zQ+lzee6LMfUQw+62Rydb91qMwhOCHtIOUP6dh+Sx Kig4SsgHA5AJhnr8myWq0MEPYglRTH3QVNqiqakE2dcXh5fwcr1kbKgyB7XjMYnVbRWG msz8DJ+meEpkjTS4qk8FN+o/2IMIFEYZgUj/6YJHK60SrEOxR6hFKZz7sprAZ/wlNONq xmHA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id i2si1831210ilc.155.2021.09.11.10.37.14; Sat, 11 Sep 2021 10:37:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S231749AbhIKRhG (ORCPT + 99 others); Sat, 11 Sep 2021 13:37:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:51310 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230018AbhIKRhF (ORCPT ); Sat, 11 Sep 2021 13:37:05 -0400 Received: from jic23-huawei (cpc108967-cmbg20-2-0-cust86.5-4.cable.virginm.net [81.101.6.87]) (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 3B83261029; Sat, 11 Sep 2021 17:35:50 +0000 (UTC) Date: Sat, 11 Sep 2021 18:39:21 +0100 From: Jonathan Cameron To: Cc: , Subject: Re: [PATCH v2 1/3] iio: adc: ad7192: Add IRQ flag Message-ID: <20210911183921.1381d776@jic23-huawei> In-Reply-To: <20210906065630.16325-2-alexandru.tachici@analog.com> References: <20210906065630.16325-1-alexandru.tachici@analog.com> <20210906065630.16325-2-alexandru.tachici@analog.com> X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 6 Sep 2021 09:56:28 +0300 wrote: > From: Alexandru Tachici > > IRQ type in ad_sigma_delta_info struct was missing. > > In Sigma-Delta devices the SDO line is also used as an interrupt. > Leaving IRQ on level instead of falling might trigger a sample read > when the IRQ is enabled, as the SDO line is already low. Not sure > if SDO line will always imediately go high in ad_sd_buffer_postenable > before the IRQ is enabled. > > Also the datasheet seem to explicitly say the falling edge of the SDO > should be used as an interrupt: > From the AD7192 datasheet: "The DOUT/RDY falling edge can be used > as an interrupt to a processor," > > Fixes: da4d3d6bb9f6 ("iio: adc: ad-sigma-delta: Allow custom IRQ flags") > Signed-off-by: Alexandru Tachici As in thread discussing previous version. This one should probably be left to firmware to configure. It's not 'wrong' before this point as firmware should be specifying it correctly. That allows for the interrupt line to the processor to be inverted and other silliness that happens on real boards. Jonathan > --- > drivers/iio/adc/ad7192.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/iio/adc/ad7192.c b/drivers/iio/adc/ad7192.c > index ee8ed9481025..2121a812b0c3 100644 > --- a/drivers/iio/adc/ad7192.c > +++ b/drivers/iio/adc/ad7192.c > @@ -293,6 +293,7 @@ static const struct ad_sigma_delta_info ad7192_sigma_delta_info = { > .has_registers = true, > .addr_shift = 3, > .read_mask = BIT(6), > + .irq_flags = IRQF_TRIGGER_FALLING, > }; > > static const struct ad_sd_calib_data ad7192_calib_arr[8] = {