Received: by 10.223.176.5 with SMTP id f5csp174000wra; Fri, 26 Jan 2018 20:31:23 -0800 (PST) X-Google-Smtp-Source: AH8x227qV3XghG1fSXw/iYpOMzPgt5aHbQZcsw1SMivj6wtYHhgXwdKgz1duee+fpLiE8z0MQB+x X-Received: by 10.99.110.205 with SMTP id j196mr16831057pgc.54.1517027483808; Fri, 26 Jan 2018 20:31:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517027483; cv=none; d=google.com; s=arc-20160816; b=Ne7DLDkRyCRS05PhOr/VmNGZz3RFCvLMRtxVMch6rwlkD2ca2WT1PYN8Mz20hy/mo4 wyG4SoqsOsl7H5GnDmKBRFy573Xs6JN8xR8dLdG0XJQgOvlKqySB11JvaUdlbHBizpwH Ngie82PSveaNKBur526iSq/DUGJznvdpgnIlqrYJIP2pq1gK82PxNqO0hUqYw+p0o1D7 U8izErTGByyiDXF21XADXBQVG/GHcwzqggIh4jWxh8AfCytCepVVRZALmQ4HUGG/PeXJ cZQmt0aLhkZuAoRvsq4FrkPkHvQC4R2tr5qOD6nmMSZ6ZUUQJC8GMFvSwroJJ94VcjwZ K+Iw== 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=+X0IVnDpR3J2Qby+9aoreYEG91LHRm5z08kKjtQuqDE=; b=Gdcn7Hw2LJSr2Gl4IKI/pskHiNJkJQP/aVmCWaRxKDBg7xNd8DZW/r5/gkon1XfAOE 2AjdyFCpYEV9mbVDc5pPUPr3ysh2ENouJ+0vBTxVtPj8avfStLMOkBaQhDmLKFo3HEG5 ZMgKGTmz13uA7Q1qLM0nm8WM/wZ0ao6WmhmqFCuFu1JzEG7bEXJ69Nph3IAPUAbo8y8X 8vB0HGmKYYQR68BgvbFjTEn7eWOLRbheAv82ylAVs3zUsHQIQpsIOTXUz+MdXEdG94nR NGfPTeVfoOndeOKQWhZA3hg6rW/hMXgsRG8wbj7CIAyUP1qwELMfs/s+rJyWpKA4dDf9 wQ9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LAxj1TFw; 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=NONE 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 s64si7441146pfk.33.2018.01.26.20.31.09; Fri, 26 Jan 2018 20:31:23 -0800 (PST) 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=LAxj1TFw; 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=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752043AbeA0Ean (ORCPT + 99 others); Fri, 26 Jan 2018 23:30:43 -0500 Received: from mail-wr0-f194.google.com ([209.85.128.194]:43372 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751739AbeA0Eak (ORCPT ); Fri, 26 Jan 2018 23:30:40 -0500 Received: by mail-wr0-f194.google.com with SMTP id t16so2126004wrc.10; Fri, 26 Jan 2018 20:30:39 -0800 (PST) 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=+X0IVnDpR3J2Qby+9aoreYEG91LHRm5z08kKjtQuqDE=; b=LAxj1TFw6RKx81E3Vf70rntvB4dzWt0YUbaYQPh60DDfxkEj504NAH+TQ96SJH1vXl +mfOSNSmfzG1JiIvq5T4hpxtJ+UQeDWAgmgjXMoskt1bUMIY21bBf4SbDz44XewX0mY1 42XwW5uLEG8UbGVn3mJPxpzh0c/b8Jl6CliGDYSUG4QiPIOVVB6w+9XJOQ/PZ/pD414Z 1C2wRR/4SIC75bbH5d6NBsejyGFfq75Qga1NqnHrekF39Ileo8yHSqWLXR9AN+57Oq4+ iX/zPotxhpyQmGmP+2NgX55nu2C2oiXyMw7mmOvAv6FOzRaPvUszJJD7PbC8kqj12v8/ S2hQ== 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=+X0IVnDpR3J2Qby+9aoreYEG91LHRm5z08kKjtQuqDE=; b=BIrJcAKqkafPoN/eT0dyeMQPosadcROVNwFOifeCCa/OYL3N7gh4nggkKrahghHHTo QrbXCw61OqHr3zD3bg/1wYhHK2p5fZ4DEWNtSsd7HbsE2zGLINuOoKNyr7eY+mB66ZDq 77GFmjOROT0cFyGpcHfwk+huGtWKX0pbxNbwZQxGi46A4y5Zn9fAmrF9k0Xh25RSoWn4 mHxcoE3L79Gjw4/BWGeyvYazR8dkykc8hs9zRSLJPG7eV6oto1y1PxOvH+r6jZjLfCzN Ban9RG4UqeOUtQnmalyJHvGwyb3/aRKTy2t2JCvl/ywb5TD55pQ3e7zTq5p3qKh/U2ip Xlcw== X-Gm-Message-State: AKwxytfBjduv3RCrf8rq2tLGDY0P+bFgqpXyoSYwD8X4fR4O9RQlyw/4 Ln33ZKk4Rqy91pt2RBO0LbI= X-Received: by 10.223.163.16 with SMTP id c16mr179229wrb.21.1517027438615; Fri, 26 Jan 2018 20:30:38 -0800 (PST) Received: from [192.168.2.62] (p578F04D2.dip0.t-ipconnect.de. [87.143.4.210]) by smtp.gmail.com with ESMTPSA id j9sm8093029wrc.78.2018.01.26.20.30.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Jan 2018 20:30:38 -0800 (PST) Subject: Re: [linux-sunxi] [PATCH 10/16] iio: adc: sun4i-gpadc-iio: add support for A83T thermal sensor To: =?UTF-8?Q?Ond=c5=99ej_Jirman?= Cc: lee.jones@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com, maxime.ripard@free-electrons.com, wens@csie.org, linux@armlinux.org.uk, jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, davem@davemloft.net, hans.verkuil@cisco.com, mchehab@kernel.org, rask@formelder.dk, clabbe.montjoie@gmail.com, sean@mess.org, krzk@kernel.org, quentin.schulz@free-electrons.com, icenowy@aosc.io, edu.molinas@gmail.com, singhalsimran0@gmail.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: <20180126151941.12183-1-embed3d@gmail.com> <20180126151941.12183-11-embed3d@gmail.com> <20180126174602.qolcswhqblgmlad7@core.my.home> From: Philipp Rossak Message-ID: Date: Sat, 27 Jan 2018 05:30:36 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20180126174602.qolcswhqblgmlad7@core.my.home> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 26.01.2018 18:46, Ondřej Jirman wrote: > Hi, > > On Fri, Jan 26, 2018 at 04:19:35PM +0100, Philipp Rossak wrote: >> This patch adds support for the A83T ths sensor. >> >> The A83T does not support interrupts. This seems to be broken. > > Though, you use support_irq = true below. And in my tests, IRQ for THS works on > A83T. > > regards, > o. Oh I totally forgot to update this commit message, after I fixed the devicetree and got it running. I will fix that in the next version of this patch series. >> The calibration data is writen at the begin of the init process. >> >> Signed-off-by: Philipp Rossak >> --- >> drivers/iio/adc/sun4i-gpadc-iio.c | 38 ++++++++++++++++++++++++++++++++++++++ >> 1 file changed, 38 insertions(+) >> >> diff --git a/drivers/iio/adc/sun4i-gpadc-iio.c b/drivers/iio/adc/sun4i-gpadc-iio.c >> index f2e0ec65c53e..b8693afcdbea 100644 >> --- a/drivers/iio/adc/sun4i-gpadc-iio.c >> +++ b/drivers/iio/adc/sun4i-gpadc-iio.c >> @@ -170,6 +170,40 @@ static const struct gpadc_data sun8i_h3_ths_data = { >> SUNXI_THS_TEMP_PERIOD(0x7), >> }; >> >> +static const struct gpadc_data sun8i_a83t_ths_data = { >> + .temp_offset = -2724, >> + .temp_scale = -70, >> + .temp_data = {SUNXI_THS_TDATA0, >> + SUNXI_THS_TDATA1, >> + SUNXI_THS_TDATA2, >> + 0}, >> + .sample_start = sunxi_ths_sample_start, >> + .sample_end = sunxi_ths_sample_end, >> + .sensor_count = 3, >> + .supports_nvmem = false, >> + .support_irq = true, >> + .ctrl0_map = SUNXI_THS_ACQ0(0x1f3), >> + .ctrl2_map = SUNXI_THS_ACQ1(0x1f3), >> + .sensor_en_map = SUNXI_THS_TEMP_SENSE_EN0 | >> + SUNXI_THS_TEMP_SENSE_EN1 | >> + SUNXI_THS_TEMP_SENSE_EN2, >> + .filter_map = SUNXI_THS_FILTER_EN | >> + SUNXI_THS_FILTER_TYPE(0x2), >> + .irq_clear_map = SUNXI_THS_INTS_ALARM_INT_0 | >> + SUNXI_THS_INTS_ALARM_INT_1 | >> + SUNXI_THS_INTS_ALARM_INT_2 | >> + SUNXI_THS_INTS_SHUT_INT_0 | >> + SUNXI_THS_INTS_SHUT_INT_1 | >> + SUNXI_THS_INTS_SHUT_INT_2 | >> + SUNXI_THS_INTS_TDATA_IRQ_0 | >> + SUNXI_THS_INTS_TDATA_IRQ_1 | >> + SUNXI_THS_INTS_TDATA_IRQ_2, >> + .irq_control_map = SUNXI_THS_INTC_TDATA_IRQ_EN0 | >> + SUNXI_THS_INTC_TDATA_IRQ_EN1 | >> + SUNXI_THS_INTC_TDATA_IRQ_EN2 | >> + SUNXI_THS_TEMP_PERIOD(0x257), >> +}; >> + >> struct sun4i_gpadc_iio { >> struct iio_dev *indio_dev; >> struct completion completion; >> @@ -672,6 +706,10 @@ static const struct of_device_id sun4i_gpadc_of_id[] = { >> .compatible = "allwinner,sun8i-h3-ths", >> .data = &sun8i_h3_ths_data, >> }, >> + { >> + .compatible = "allwinner,sun8i-a83t-ths", >> + .data = &sun8i_a83t_ths_data, >> + }, >> { /* sentinel */ } >> }; >> >> -- >> 2.11.0 >> >> -- >> You received this message because you are subscribed to the Google Groups "linux-sunxi" group. >> To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe@googlegroups.com. >> For more options, visit https://groups.google.com/d/optout. Thanks, Philipp