Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3821200yba; Tue, 7 May 2019 07:37:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqylSUb1x/rc+Z7Dph+xnMmda+Jv81VgqdGGnq91VhCrOZKrtrhc6GxklLhQNFiQLZTEJxp3 X-Received: by 2002:aa7:9afc:: with SMTP id y28mr41744890pfp.101.1557239867034; Tue, 07 May 2019 07:37:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557239867; cv=none; d=google.com; s=arc-20160816; b=P42NV8R9dLb878LnpAR96HthlTaoQhCOqWMyHErVq7qTtKqMmu/82XgRgUerslqpiF cdcX+IQM60ibDYTNSmmX8I6n9y+y2uzHwwGdsFK3clfAFmPu+U9p7ddbeUVRPT6pFc1C ETtcyoC+hS2KBzs2YIqOEKegBjT4lfJWcDmbp0K8dajGLjPAs+NR4DVHlS8Oy8yK6QLr UMOIVVOYlu+4pkovnxos5ZWE5cny/+rz08kbWhSgYieBpzw2eANtTHww82AuoXWuIIv+ bpRrJUhZGlN77puV9dThiceEExxKBlfcYlfO2Q41Q3AxnbZoMQO08EwJrGVnjrfwJBC4 3H5w== 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:date:subject:cc:to:from; bh=UEy547xBQ7Eo8pUNYYY5SdWdvsCRNYEL6NNU7CJ8bo8=; b=JLCoCU6Qotip457DPjCBX5LnyJI7Yrbp/Jn8J4PZB6GDGXVBB4teUn9HdsJtrbrT3u J3BwEbHoiiGChUEPDEoNln+Br0QmEnScF8omYfTI7g6Itbk6M/LSRCQ9ol9E9Hbgo1r9 uT8kSJXK/2uBTKReGH0t8uijwacIK4B3Xy/N/AGiQhoJR+ixnF3/yP/kPM49ESzO0/fa U+U8LLbRV6hTxSuX3VSbjuBHePScBi13ATJjE6jBhx9V45HjK3hIStGxMWv/OW67ojTE I7NqJ5gzRYy1SU9+xJCpwqGjxfZoKZhZECbXRsudIyu2FuTSWXeZU8dtD0Jo0lQqRo7e 4P8w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t1si18288534plr.373.2019.05.07.07.37.30; Tue, 07 May 2019 07:37:47 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726861AbfEGOg3 (ORCPT + 99 others); Tue, 7 May 2019 10:36:29 -0400 Received: from mxout017.mail.hostpoint.ch ([217.26.49.177]:34234 "EHLO mxout017.mail.hostpoint.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726324AbfEGOg0 (ORCPT ); Tue, 7 May 2019 10:36:26 -0400 Received: from [10.0.2.46] (helo=asmtp013.mail.hostpoint.ch) by mxout017.mail.hostpoint.ch with esmtp (Exim 4.91 (FreeBSD)) (envelope-from ) id 1hO1Cf-000DwF-Qc; Tue, 07 May 2019 16:36:21 +0200 Received: from [46.140.72.82] (helo=philippe-pc.toradex.int) by asmtp013.mail.hostpoint.ch with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91 (FreeBSD)) (envelope-from ) id 1hO1Cf-0008oW-Jv; Tue, 07 May 2019 16:36:21 +0200 X-Authenticated-Sender-Id: dev@pschenker.ch From: Philippe Schenker To: linux-iio@vger.kernel.org, Jonathan Cameron , Stefan Agner , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler Cc: Marcel Ziswiler , David Laight , dev@pschenker.ch, 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: [PATCH 3/5] iio: stmpe-adc: Enable all stmpe-adc interrupts just once Date: Tue, 7 May 2019 16:36:13 +0200 Message-Id: <20190507143615.28477-3-dev@pschenker.ch> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190507143615.28477-1-dev@pschenker.ch> References: <20190507143615.28477-1-dev@pschenker.ch> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Philippe Schenker This commit will enable the interrupts of all channels handled by this driver only once in the probe function. This will improve performance because one byte less has to be written over i2c on each read out of the adc. On the fastest ADC mode this will improve read out speed by 15%. Signed-off-by: Philippe Schenker --- drivers/iio/adc/stmpe-adc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/iio/adc/stmpe-adc.c b/drivers/iio/adc/stmpe-adc.c index b3872eb37293..82b43e4522b6 100644 --- a/drivers/iio/adc/stmpe-adc.c +++ b/drivers/iio/adc/stmpe-adc.c @@ -74,9 +74,6 @@ static int stmpe_read_voltage(struct stmpe_adc *info, return -EINVAL; } - stmpe_reg_write(info->stmpe, STMPE_REG_ADC_INT_EN, - STMPE_ADC_CH(info->channel)); - stmpe_reg_write(info->stmpe, STMPE_REG_ADC_CAPT, STMPE_ADC_CH(info->channel)); @@ -336,6 +333,9 @@ static int stmpe_adc_probe(struct platform_device *pdev) if (ret) return ret; + stmpe_reg_write(info->stmpe, STMPE_REG_ADC_INT_EN, + ~(norequest_mask & 0xFF)); + return devm_iio_device_register(&pdev->dev, indio_dev); } -- 2.21.0