From patchwork Fri Dec 22 15:07:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eugen Hristev X-Patchwork-Id: 10130731 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8B40360318 for ; Fri, 22 Dec 2017 15:18:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8A8152A05A for ; Fri, 22 Dec 2017 15:18:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7F5BC2A06C; Fri, 22 Dec 2017 15:18:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 33A612A05A for ; Fri, 22 Dec 2017 15:18:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=r/IHSXRRkLTBlhYvfskBQbMwWVtCEjkJ96ES2Ze6txQ=; b=AvzYy862wGnBcV Kro6bxZOsM/Q1cmC9jlhdOpUa6lBuKpetT99UDXqe+1mLRmmjpoco0WSpO1p3jXzG2mmGeyyZ8eLa dkBCUmzG6ZJzTbulpJiFGVSraaIivTwXQXpLQ3yIDDzpnSd4rf9rhpzTMYebXW01lOIcV7BNloUOM XDEjjI/0GHlnMrYUG8dJIvpwQwR++2Tlsh9qq6WHlKW/8bYVd7RGsm65UeOS+E9eZZ9E3u06qxGYq TtOYgi7YOQlFYb9dsYVgp6lCa3aoO+Y6Wb42ewE35OuKDkLJnqOaEQrsayBeI5p8D7k2bIW1PujuZ 1daCKjRXdha0qZleBGiA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eSP5R-0004mv-5k; Fri, 22 Dec 2017 15:18:13 +0000 Received: from esa1.microchip.iphmx.com ([68.232.147.91]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eSOxt-0006m8-OW for linux-arm-kernel@lists.infradead.org; Fri, 22 Dec 2017 15:10:32 +0000 X-IronPort-AV: E=Sophos;i="5.45,441,1508828400"; d="scan'208";a="10402505" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa1.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 22 Dec 2017 08:10:20 -0700 Received: from eh-station.mchp-main.com (10.10.76.4) by chn-sv-exch07.mchp-main.com (10.10.76.108) with Microsoft SMTP Server id 14.3.352.0; Fri, 22 Dec 2017 08:10:19 -0700 From: Eugen Hristev To: , , , , , , , , , Subject: [PATCH 11/14] iio: adc: at91-sama5d2_adc: optimize scan index for diff channels Date: Fri, 22 Dec 2017 17:07:18 +0200 Message-ID: <1513955241-10985-12-git-send-email-eugen.hristev@microchip.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513955241-10985-1-git-send-email-eugen.hristev@microchip.com> References: <1513955241-10985-1-git-send-email-eugen.hristev@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171222_071026_536304_80F48D5E X-CRM114-Status: UNSURE ( 7.86 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eugen Hristev Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Optimize the scan index for the differential channels. Before, it was single channel count + index of the first single channel number of the differential pair. (e.g. 11+0, +2, +4, etc.) Divide that number by two (since it's always even), and add it up as a scan index to have consecutive numbered channels in the index. Signed-off-by: Eugen Hristev --- drivers/iio/adc/at91-sama5d2_adc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/adc/at91-sama5d2_adc.c b/drivers/iio/adc/at91-sama5d2_adc.c index 7b9febc..9610393 100644 --- a/drivers/iio/adc/at91-sama5d2_adc.c +++ b/drivers/iio/adc/at91-sama5d2_adc.c @@ -209,7 +209,7 @@ .channel = num, \ .channel2 = num2, \ .address = addr, \ - .scan_index = num + AT91_SAMA5D2_SINGLE_CHAN_CNT, \ + .scan_index = (num >> 1) + AT91_SAMA5D2_SINGLE_CHAN_CNT,\ .scan_type = { \ .sign = 's', \ .realbits = 12, \