Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp599798yba; Fri, 3 May 2019 07:30:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqzk+JFDtWNxq5Td+5xSDH1sC5P1KIVNIA35myTY4NphC8Yk8/x/bMMx9WWkKdPKzxKVUvgv X-Received: by 2002:a63:d816:: with SMTP id b22mr10511967pgh.349.1556893825222; Fri, 03 May 2019 07:30:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556893825; cv=none; d=google.com; s=arc-20160816; b=sgxq8wbRu3p2BjR7+ZJXVfw8Af7avOk6RPkKOrEzW2h4g4zK461CS8UTX+fJuT5JK1 IW7ULACY7zk4yfvXX1Oz+7yJ3kLMc0LzZMn5ksR98hINtcf4gXWSu+8UdV0EUQvE4L6r Q7JxvGhRloYND9RaFV/VBeDtMWLL8XE4exAmhlYHhFCTn665XqHfNLQ2CKWgburQOh4y qSN2iFcJ3KsvR44AdGav52wdhSND4Xr+DqY9YzEJ/CiAlzGhx8cq2h1yiVvk7I2IKAQv vMTCqbxe+sGN2XAOMqLQqVf2KVUmyRpguwXUFIr7Bt+tHcJundxdbAsXnt90Hzrf9Cxb 1uuw== 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=xrawbutDtUJGuXJLvZsPGjU2LkCtGmhm8M7eEmn6xWo=; b=PbmLofBbFKGV+HsRaWT8N99Lne27+ysUrgcJMu5iZzbZpkg2tUbtwkobTA/4GFBlGd vhxVVTR5KBwABgDvUs4i1i7S1NOAiFLBhdEWR/IAxrP5nuGHA9okrvpsqmYYgfFr25vX 5kDHirYymNx0jdi3JwG3HkahyZW/PBdA7LbUTRvu03dwjtIBWnGwz6siJFDYBLQKLmQ9 ZyMZC7mNT/GityrITn67xS4M68Ii25gbbmrxgTFdQfO3eEqCyIXgmiDphu7KPqFz47oa +y/m6Aqk42uovkubrgKVTI+ew3XFO2wkwIr/rGqrKYdb64C5UhW755NwiKa3jvpYSuls /tFQ== 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 x2si2462859pgi.482.2019.05.03.07.30.08; Fri, 03 May 2019 07:30:25 -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 S1727918AbfECN5q (ORCPT + 99 others); Fri, 3 May 2019 09:57:46 -0400 Received: from mxout012.mail.hostpoint.ch ([217.26.49.172]:33494 "EHLO mxout012.mail.hostpoint.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727974AbfECN5m (ORCPT ); Fri, 3 May 2019 09:57:42 -0400 Received: from [10.0.2.46] (helo=asmtp013.mail.hostpoint.ch) by mxout012.mail.hostpoint.ch with esmtp (Exim 4.91 (FreeBSD)) (envelope-from ) id 1hMYh1-000K4m-UA; Fri, 03 May 2019 15:57:39 +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 1hMYh1-0003ks-Oj; Fri, 03 May 2019 15:57:39 +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: 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/3] iio: stmpe-adc: Enable all stmpe-adc interrupts just once Date: Fri, 3 May 2019 15:57:25 +0200 Message-Id: <20190503135725.9959-3-dev@pschenker.ch> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190503135725.9959-1-dev@pschenker.ch> References: <20190503135725.9959-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 baa41ffc0d76..427c890c6e7d 100644 --- a/drivers/iio/adc/stmpe-adc.c +++ b/drivers/iio/adc/stmpe-adc.c @@ -72,9 +72,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)); @@ -328,6 +325,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