Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3086765yba; Sat, 11 May 2019 03:28:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqxZ93bamKRGo6VBami6/JvBcaUx0Y9sDljlsWM8v3A7L1GPL2DbRF+0ttTaYskHUpcIwutP X-Received: by 2002:a63:1d1d:: with SMTP id d29mr19766899pgd.63.1557570538155; Sat, 11 May 2019 03:28:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557570538; cv=none; d=google.com; s=arc-20160816; b=WNIH+TFXJB9+0mvTSopXdlwuO2PtMshM3TeqT7O0mCH8I0XBJUzkIPV1teou8h8vVY yJCh1+hCTdwS88Jl1ZZBJfo9M7vI5OfJuJh5OFGGUwxQDP4yDNSaSWhDjucqqu+YRY6B qV45kMH1ytH5cM+KWap30pi+ZrxblE9QrooanRkGgmo5gQALzyJIZKerOR8d+2U49fWA i2z1+GDrAqQhLQUqIvSD2WDIvsCrBap4OX45bZg0zcfXn/4YGurnsIzkobzDrCuVKR9O DthKsk5O1y27PgQRLJeVFIblKafvrOd9M+R8QKb/sBpDdh/ZmUKQ4NeP+kZ8xSuPEKiF bSPg== 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=CoJd2rqMZ6yUml6FncmvUvLaxqQy8a42MTGbfKFMRTc=; b=SPbWwtxaKmQpnJuibaZX5nYjhXCOdbeGtw/HfSumoZoyccTfbR/p0AnsK5mHui61zc 5tLT5VOzozs6DAwt/CJVdq0TnwRjdDWQDMDeRjCxi0uR+1ysHTze4K1iPy0LilSOHm9c gj7Xkjuq4AClzXloRwx1UWonUQfV4vWVFMNBM48NODteMyI3H8UroGNEya7iGdvobSXr SgMwk3aU+DZ1Ja4zCoFUDKpHFyNc4SYhTfcFBt5Llk9ymCdyWGOXB+NubfoJ1f8dr76V p4s/VG6g2wwictcSiwIGgORYkd1W9vVGr444zohHbwiY+anSIg9q489shePdl20RoVkk Db5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="v4U603/b"; 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 p8si10421921pls.79.2019.05.11.03.28.42; Sat, 11 May 2019 03:28:58 -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="v4U603/b"; 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 S1728557AbfEKKYh (ORCPT + 99 others); Sat, 11 May 2019 06:24:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:41976 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728477AbfEKKYg (ORCPT ); Sat, 11 May 2019 06:24:36 -0400 Received: from archlinux (cpc91196-cmbg18-2-0-cust659.5-4.cable.virginm.net [81.96.234.148]) (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 BE1E62173B; Sat, 11 May 2019 10:24:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557570276; bh=Ol9ib5bihEYIjrd1c8mt+AxCWFeb4Ti7BaHuwJkxvQA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=v4U603/bLabnldrLM6MOiPNDVz7DK0r/MC9QoaiSqqorwz+ySd4TjrJKypZ3+bF9s Oi7pE83vuWve+W8K6qopE3LO/K10MtfkVM1TJXht3uXte67oWPnpF2vxXDyky7JEUN So9eLCXfDPm7MdKyCanuDsLdFHH6/rXp2DvYpyD8= Date: Sat, 11 May 2019 11:24:29 +0100 From: Jonathan Cameron To: Philippe Schenker Cc: linux-iio@vger.kernel.org, Stefan Agner , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Marcel Ziswiler , David Laight , Philippe Schenker , Max Krummenacher , Alexandre Torgue , linux-kernel@vger.kernel.org, Lee Jones , Maxime Coquelin , linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 5/5] iio: stmpe-adc: Reset possible interrupts Message-ID: <20190511112429.25ddd84d@archlinux> In-Reply-To: <20190507143615.28477-5-dev@pschenker.ch> References: <20190507143615.28477-1-dev@pschenker.ch> <20190507143615.28477-5-dev@pschenker.ch> X-Mailer: Claws Mail 3.17.3 (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, 7 May 2019 16:36:15 +0200 Philippe Schenker wrote: > From: Philippe Schenker > > Clear any interrupt that still is on the device on every channel > this driver is activated for in probe and specific channels in > the timeout handler. > > Signed-off-by: Philippe Schenker I'm never particularly clean on blanket resets as they do tend to hide bugs. However, the probe one is something that would happen anyway if there was a 'reset' function. Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it. Thanks, Jonathan > > --- > > drivers/iio/adc/stmpe-adc.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/iio/adc/stmpe-adc.c b/drivers/iio/adc/stmpe-adc.c > index cc752a47444c..a5990e9f2c80 100644 > --- a/drivers/iio/adc/stmpe-adc.c > +++ b/drivers/iio/adc/stmpe-adc.c > @@ -80,6 +80,8 @@ static int stmpe_read_voltage(struct stmpe_adc *info, > ret = wait_for_completion_timeout(&info->completion, STMPE_ADC_TIMEOUT); > > if (ret <= 0) { > + stmpe_reg_write(info->stmpe, STMPE_REG_ADC_INT_STA, > + STMPE_ADC_CH(info->channel)); > mutex_unlock(&info->lock); > return -ETIMEDOUT; > } > @@ -326,6 +328,9 @@ static int stmpe_adc_probe(struct platform_device *pdev) > stmpe_reg_write(info->stmpe, STMPE_REG_ADC_INT_EN, > ~(norequest_mask & 0xFF)); > > + stmpe_reg_write(info->stmpe, STMPE_REG_ADC_INT_STA, > + ~(norequest_mask & 0xFF)); > + > return devm_iio_device_register(&pdev->dev, indio_dev); > } >