From patchwork Mon Sep 24 22:13:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 10612901 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CDBC9112B for ; Mon, 24 Sep 2018 22:13:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C02BE297C4 for ; Mon, 24 Sep 2018 22:13:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B4051297F2; Mon, 24 Sep 2018 22:13:33 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4C3FA297C4 for ; Mon, 24 Sep 2018 22:13:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727586AbeIYERy (ORCPT ); Tue, 25 Sep 2018 00:17:54 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:51102 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727570AbeIYERx (ORCPT ); Tue, 25 Sep 2018 00:17:53 -0400 Received: by mail-wm1-f67.google.com with SMTP id s12-v6so11312879wmc.0 for ; Mon, 24 Sep 2018 15:13:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XkJIvXHu8Xs76Uziff2F5Ap7b5f4LsRoGzzp2VVRcg8=; b=arL8lq7x8WJrlCTpZx8hfYEEtcVpQjHGQPooMfEYZHGzujBX20hocl/XTVn5bXOmcj kx+J+jMx60KA+8FuL+iCIlv1BnaCTm2WObmrdH0rVgdFG/MQ23pGdCU1ngi2KZiWSvFs ep3ak/DW/vFcafC6BYNsQEsnEFBcbGk4/k4E6E5B1ib+QsEyeViafHsKd7pCGjOgEdJz zS23LDXmXAqHLXe2fuG/AEIaOR+gow85g1MUxVHFp6tuyVWzuVLEidhSNYN2MBdBFH24 3ruU0LydZZhxAAuaR9zRt3/s7mTOtMaIU/ECJZKL+nYOm80Nf18AYGXZOj64ZJTA9tAi IoSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XkJIvXHu8Xs76Uziff2F5Ap7b5f4LsRoGzzp2VVRcg8=; b=ZTK3qxQdwqopqZ/9P0gJLdTTnzu14lcTa/GFOGUe9ADELB5B28C6wWzguYEfARmEbP v18idY9dtKbhnpI6+0x1oiZeaJpKgx3tClSC/hJnNZNh1RM/hnYd+MFL6LE6bVfauPz0 K0OHN5SFMXZhvupDIDoR3Uxf+P1mCH5WEx3LYrh6XkWSwNO/PyHembJj5NOZSNLH/BUl 0SaBb8j7ljbwe+f+ZUohvKnLlAoW2qcWRybYnpcJr5LBjdQSBEHn0BJP0LVhJWSm4Yp0 NQVQBszP2hly/gLYFlydTQGTXmv8x6zfHwrCtB8eBtoYPyGQkeRI+BoRZpZlPI4W8uvx OaIQ== X-Gm-Message-State: ABuFfoj9DItSNth4vabwODYdprUWGJnV96bJtCF0DmafK9R9o6OeEJJB sWB3uigsF4JgLiG4/liGwhQujSPQ X-Google-Smtp-Source: ACcGV60H5Nw9wtSWGWd40jLA8JR/o5BHKqFr/9SFxuTH3g6t52UJQ8b4Jx9l9DaboSywS41lTaFSkg== X-Received: by 2002:a1c:b4d:: with SMTP id 74-v6mr231337wml.15.1537827210354; Mon, 24 Sep 2018 15:13:30 -0700 (PDT) Received: from blackbox.darklights.net (p200300DCD74AC3003CB4EEA9EBE1F156.dip0.t-ipconnect.de. [2003:dc:d74a:c300:3cb4:eea9:ebe1:f156]) by smtp.googlemail.com with ESMTPSA id 139-v6sm464742wmp.4.2018.09.24.15.13.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Sep 2018 15:13:29 -0700 (PDT) From: Martin Blumenstingl To: linux-amlogic@lists.infradead.org, linux-iio@vger.kernel.org Cc: jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, Martin Blumenstingl Subject: [PATCH 1/2] iio: adc: meson-saradc: do not use meson_sar_adc_iio_channels directly Date: Tue, 25 Sep 2018 00:13:25 +0200 Message-Id: <20180924221326.2871-2-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180924221326.2871-1-martin.blumenstingl@googlemail.com> References: <20180924221326.2871-1-martin.blumenstingl@googlemail.com> MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In the future we may support two different channel sets: - one which includes the voltage pads and the temperature sensor output (for Meson8, Meson8b and Meson8m2) - one which only includes the voltage pads (GXBB, GXL, GXM and AXG) Channel 7 has a special function on all of these platforms. However, since we will have different channel array definitions we want our code to always use whatever channels struct iio_dev uses. No functional changes for now. This is the preparation for adding temperature sensor support to this driver. Signed-off-by: Martin Blumenstingl --- drivers/iio/adc/meson_saradc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/adc/meson_saradc.c b/drivers/iio/adc/meson_saradc.c index 1c4ba83c0725..809d1230be34 100644 --- a/drivers/iio/adc/meson_saradc.c +++ b/drivers/iio/adc/meson_saradc.c @@ -854,7 +854,7 @@ static int meson_sar_adc_calib(struct iio_dev *indio_dev) meson_sar_adc_set_chan7_mux(indio_dev, CHAN7_MUX_VDD_DIV4); usleep_range(10, 20); ret = meson_sar_adc_get_sample(indio_dev, - &meson_sar_adc_iio_channels[7], + &indio_dev->channels[7], MEAN_AVERAGING, EIGHT_SAMPLES, &value0); if (ret < 0) goto out; @@ -862,7 +862,7 @@ static int meson_sar_adc_calib(struct iio_dev *indio_dev) meson_sar_adc_set_chan7_mux(indio_dev, CHAN7_MUX_VDD_MUL3_DIV4); usleep_range(10, 20); ret = meson_sar_adc_get_sample(indio_dev, - &meson_sar_adc_iio_channels[7], + &indio_dev->channels[7], MEAN_AVERAGING, EIGHT_SAMPLES, &value1); if (ret < 0) goto out;