From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5644BC433EF for ; Sun, 8 Sep 2019 09:31:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2894B21479 for ; Sun, 8 Sep 2019 09:31:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567935111; bh=zfv4LkabeN6OFlooLpFdVdcSi/pHnXDU1gNLLwRryLE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-ID:From; b=LnDYu4wdGYAiLGeliThPueyVfHRpOGngJG+07isZWGXernPeli9oxyr0PNfebIhN1 UVNcMxHqqwfNaTFlA8YuiKra6uKjNwJbGv7MJvWEWhGVjIIWOwwvNTpkggCpil5/yf tf7G4A+puBiXzCisOwtkdg/nXjf+8qI0/ZqCuQkI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727933AbfIHJbu (ORCPT ); Sun, 8 Sep 2019 05:31:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:51800 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727312AbfIHJbu (ORCPT ); Sun, 8 Sep 2019 05:31:50 -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 5498E207FC; Sun, 8 Sep 2019 09:31:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567935109; bh=zfv4LkabeN6OFlooLpFdVdcSi/pHnXDU1gNLLwRryLE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Z65KLRqGR8MjaKNuOU5khtMBQT6UTgixmXphPNY3/iENrc691DTvJWWok5ZRsCPaC wbwJpKMe8TMAJGqLBG9w47Sm5wTqk1TdOdk+HXFiXQGhz8YcyqIqhssLDFosnHNdn5 HyM4JM3z8oERzuFlSuIuDmlPm9NdNV/Bm/ZF/a6U= Date: Sun, 8 Sep 2019 10:31:45 +0100 From: Jonathan Cameron To: Stefan Popa Cc: , , , , , Subject: Re: [PATCH 3/3] iio: accel: adxl372: Make sure interrupts are disabled Message-ID: <20190908103145.7d2f763b@archlinux> In-Reply-To: <1567502351-10429-1-git-send-email-stefan.popa@analog.com> References: <1567502351-10429-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:19:11 +0300 Stefan Popa wrote: > This patch disables the adxl372 interrupts at setup. The interrupts > should be enabled together with the iio buffer. Not doing this, might > cause an unwanted interrupt to trigger without being able to properly > clear it. > > Signed-off-by: Stefan Popa Given the device has a software reset, would we be better off just hitting that to make sure we are in a consistent state after driver start up? Thanks, Jonathan > --- > drivers/iio/accel/adxl372.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/iio/accel/adxl372.c b/drivers/iio/accel/adxl372.c > index 72d3f45..77651f4 100644 > --- a/drivers/iio/accel/adxl372.c > +++ b/drivers/iio/accel/adxl372.c > @@ -609,6 +609,10 @@ static int adxl372_setup(struct adxl372_state *st) > if (ret < 0) > return ret; > > + ret = adxl372_set_interrupts(st, 0, 0); > + if (ret < 0) > + return ret; > + > /* Set the mode of operation to full bandwidth measurement mode */ > return adxl372_set_op_mode(st, ADXL372_FULL_BW_MEASUREMENT); > }