Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp474099pxb; Sat, 11 Sep 2021 10:42:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzeuXYfbv4+ZnLXH7emIX2bBepUGYwTXpdHz6RlFvWlyMUkOoGcdomJkQt6I9UbsCFzgeb6 X-Received: by 2002:a17:906:158f:: with SMTP id k15mr3937850ejd.241.1631382159222; Sat, 11 Sep 2021 10:42:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631382159; cv=none; d=google.com; s=arc-20160816; b=LLyTkkkZLx/acjCZDy20nIfvrPbdlB7TNlsg+ojuMaBktxceSHV1Spozo9jLu3BTW6 7C7HGCI9mhuMtzVqhl/QTNCT+i/KN1NefLKoskjT1IdOdy18MTiYBxp0ZDsan7k+tpvo /uuOKdFj/wIWrMU5ERQm3t+gsrFH9gZC12zpSYMxM2PYvdXhxFdyOd76gOEhq4PRxaG2 ZuKlWIB+pqG2toxCBSXVmj0B+0quCKZl6v42SVM2HWojrutpKAoy2mgzR3FU8Xu6BgKe WhtukeipDbYdsuJ/Cfh6apdNlTBrzwrVQ2jpn9v8RbRX32LLK3swg6GmU9Kqj+aAGy1+ bMvA== 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=CI77XSw9XqSZMc5GSNa1mq4fdI0FDC+go/ZZU/tjMRw=; b=LxElR0Dk6VwW+C+bAtuUkXTIgMYPzcYtXJTwUXhxAmG68d878jtq0M5SL3/ht3KKDZ +uImt3WC0MNif8T/cX9LY4uyqIg4t2wpzBEvfBa7ICGhWnBCHe/ahh1YUwHQpKcb/yYb zrr6aZ2VFm+1c7BJQfIMaCt1t1PRcIsPboU1HklQwOBgtPlU7wY9XRG8nwxz4IQay0t4 7GncGUqgvTJg306ovIwVxXe6mhih+7IpDowPBXh3eYFH1hy2+0gcCmB1oMZWu5jVqeZZ ai/Mj2ND6/xRCQBeeV039/jvGybouodaA14uaV9//M77UyFDN9HYkST+11nJ6fwQym+J 8Ajw== 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 k2si2016753edf.625.2021.09.11.10.42.14; Sat, 11 Sep 2021 10:42:39 -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 S232585AbhIKRmL (ORCPT + 99 others); Sat, 11 Sep 2021 13:42:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:56846 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229774AbhIKRmL (ORCPT ); Sat, 11 Sep 2021 13:42:11 -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 A698D6109F; Sat, 11 Sep 2021 17:40:55 +0000 (UTC) Date: Sat, 11 Sep 2021 18:44:25 +0100 From: Jonathan Cameron To: Cc: , Subject: Re: [PATCH v2 1/3] iio: adc: ad7192: Add IRQ flag Message-ID: <20210911184425.3734a369@jic23-huawei> In-Reply-To: <20210911183921.1381d776@jic23-huawei> References: <20210906065630.16325-1-alexandru.tachici@analog.com> <20210906065630.16325-2-alexandru.tachici@analog.com> <20210911183921.1381d776@jic23-huawei> 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 Sat, 11 Sep 2021 18:39:21 +0100 Jonathan Cameron wrote: > 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. Ignore that - I'd forgotten this is a joint DOUT / Data ready pin so it's polarity needs to track that of the SPI pin and inverting that isn't something we cope with. So applied to the fixes-togreg branch of iio.git and marked for stable. Thanks, Jonathan > > 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] = { >