Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp488637imm; Fri, 31 Aug 2018 05:55:57 -0700 (PDT) X-Google-Smtp-Source: ANB0VdY5fgoD4VKOD4sb8MATkn/6G7rMpS+Pp6oKWgNwxI1oUYvpGpSBwbHR0ynnLB+/mo9RO+BQ X-Received: by 2002:a63:2043:: with SMTP id r3-v6mr14245824pgm.105.1535720157399; Fri, 31 Aug 2018 05:55:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535720157; cv=none; d=google.com; s=arc-20160816; b=AceaaTwI2ZlG61ea20nuwdSKYkouuelC2WM03I5kUIslaVnWrydTZIZRxwy7ewRVgL DWjk4YC/XHUcbIE5EHRPi9u8XU+oFLoRI7D0X/vZ4UM4Sd6/k/AjWVdOM3dzyT1uc9Mh mb7AcoNr9qi3Cgk0+tq0w214EHxupyMX/Dpqah4vGVhwptxPvNjQrGWHvwUQvLHaQJDL 4j3JR41qtiXyRzGKzSBjwD/igYM+ROn+Pm/Mr/OORq+zGYw2w1TDPwuTyo0L1yXdSWcU j/rn8HlHrRxZTfVGy0JfsVjI1aHWBddNy4OYUyrUVNVKB+C8CXBI8B8X67ShbF/069uy sFSQ== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=MI3c9Zjxiz7+dIG4vNNVGe/6nlppwW0Vol6m0g37leE=; b=ATToN4Z6EX7EGsZQeTpf8t6stqAiE/FWFdzaZjgrhuSW2lSSZRlYdY6uiNJLa5bPSI Z0fbFdCYWiq6Fki4EZ65iqWr2Vjdpdny+xZ1fUeGUXUFXx1BTMdr23CbQvr39xy0V/ET jL+OausjCU9ncSqrzDiFSm1eJEKBqrbp+fwXVmrML/Cf7E3EPRSLUkaVms0as1ZVIpWC 5sCVfUgUL7PAbOLLPstSTeWz/4yTIM9rzkR+zQEf/sHZ9G+o39BuoYbIBCB7WI7KyJAL apHgVvF6UfUqJ7NZ2hIoDaMkIi1qQ1QDpti1wKjOUiq+aVnzSbsN+RMrmt09ZuZLCmsG ZIlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=t9mu3Ea4; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r11-v6si10736943pfc.253.2018.08.31.05.55.42; Fri, 31 Aug 2018 05:55:57 -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=@gmail.com header.s=20161025 header.b=t9mu3Ea4; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728091AbeHaQIW (ORCPT + 99 others); Fri, 31 Aug 2018 12:08:22 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:46902 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726990AbeHaQIW (ORCPT ); Fri, 31 Aug 2018 12:08:22 -0400 Received: by mail-wr1-f68.google.com with SMTP id a108-v6so10943226wrc.13; Fri, 31 Aug 2018 05:01:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=MI3c9Zjxiz7+dIG4vNNVGe/6nlppwW0Vol6m0g37leE=; b=t9mu3Ea4U+0R1CYh0Ugw9jKvBcPjWwJcobT8nF0yitQa9n5smMo0Fs0TLzL2pwtiZq voVtHvoEfS03k457VqkjfZzKjNZAgIbvWN2Kefe1r5jopXFbCbPpOuJkP9pS1sZBGE2N Rq0f0vX2Vbn/2RuAoVm/fsUGJ9EHkkCijIO5LfQQO7qfviMyrlk46gBZVu4vFJ01y/so a1hrlTVArH7vTCUGb+9ZGNZhcssZzI1Z/KhLthVbesbqDNCXb/7cA49Z4P8cyzFn+Bcq kOayc/69hXipl7eAXDVFdvKeT5GjHtaPAo8EIed0DWP/Kn9xEE8uYnfO8uiz9t/1Chxb Trsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=MI3c9Zjxiz7+dIG4vNNVGe/6nlppwW0Vol6m0g37leE=; b=OW45u/gBJMmeBJYIpxcEXQny6X3trax3HaN4GJhdxyN1j3+XKV2AEsOZpLH6hCOlzC csU5KdEDgixNNHmxqsqC3x23Nd9UDCBPisWtRGdukbpm/xepVXVgQrnEmSpYEZVqFCHe ahOpVAIe4Zd5/TWVhEOb+Nf5b1LffbjoKXsLaXOO7OZYGWVXFxBVe3zl8F9OLrnzg5GZ 6uBuXTNMtC4cvhMW9u/8mckjjjq63EYSZDwDOUNjd6/jZz3nYubSi4ixI2fjLKX2ED+d L1iw77aDlkhqE/XCjVq+uCBE9g+EKDlLFbQlE0ekJmiNZDLjijzgqbkvREiLG/yPWu7G ybaw== X-Gm-Message-State: APzg51Cs9g9vl+rH+2y44KB+GvUFFANrpyQavDZjJM2TE8sRy6OFuGVl Til4QcL0Gtm66gsO2m3Zi2g= X-Received: by 2002:adf:e44e:: with SMTP id t14-v6mr10422978wrm.96.1535716871293; Fri, 31 Aug 2018 05:01:11 -0700 (PDT) Received: from [134.60.170.20] (eduroam170-020.wlan.uni-ulm.de. [134.60.170.20]) by smtp.gmail.com with ESMTPSA id g126-v6sm4621605wmg.5.2018.08.31.05.01.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 31 Aug 2018 05:01:10 -0700 (PDT) Subject: Re: [PATCH v3 21/30] iio: adc: sun4i-gpadc-iio: add support for H3 thermal sensor To: Maxime Ripard Cc: lee.jones@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com, wens@csie.org, linux@armlinux.org.uk, jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, eugen.hristev@microchip.com, rdunlap@infradead.org, vilhelm.gray@gmail.com, clabbe.montjoie@gmail.com, quentin.schulz@bootlin.com, geert+renesas@glider.be, lukas@wunner.de, icenowy@aosc.io, arnd@arndb.de, broonie@kernel.org, arnaud.pouliquen@st.com, linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com References: <20180830154518.29507-1-embed3d@gmail.com> <20180830154518.29507-22-embed3d@gmail.com> <20180831091137.wkbbipssyd6mqfbt@flea> From: Philipp Rossak Message-ID: Date: Fri, 31 Aug 2018 14:01:08 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180831091137.wkbbipssyd6mqfbt@flea> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 31.08.2018 11:11, Maxime Ripard wrote: >> + regmap_write(info->regmap, SUN8I_H3_THS_CTRL0, >> + SUN4I_GPADC_CTRL0_T_ACQ(0xff)); >> + >> + regmap_write(info->regmap, SUN8I_H3_THS_CTRL2, >> + SUN8I_H3_THS_ACQ1(0x3f)); >> + >> + regmap_write(info->regmap, SUN8I_H3_THS_STAT, >> + SUN8I_H3_THS_INTS_TDATA_IRQ_0); >> + >> + regmap_write(info->regmap, SUN8I_H3_THS_FILTER, >> + SUN4I_GPADC_CTRL3_FILTER_EN | >> + SUN4I_GPADC_CTRL3_FILTER_TYPE(0x2)); >> + >> + regmap_write(info->regmap, SUN8I_H3_THS_INTC, >> + SUN8I_H3_THS_INTC_TDATA_IRQ_EN0 | >> + SUN8I_H3_THS_TEMP_PERIOD(0x55)); >> + >> + regmap_read(info->regmap, SUN8I_H3_THS_CTRL2, &value); >> + >> + regmap_write(info->regmap, SUN8I_H3_THS_CTRL2, >> + SUN8I_H3_THS_TEMP_SENSE_EN0 | value); > Ideally, all these values should have a comment explaining what they > are. > > And we really start to have a lot of registers defines. We'd be better > off using regmap_fields. I will rework this in the next version. Thanks, Philipp