Received: by 10.223.176.46 with SMTP id f43csp984746wra; Fri, 26 Jan 2018 09:55:32 -0800 (PST) X-Google-Smtp-Source: AH8x2248hpa8LLZCLy0KsTK2HffNO4dbu0K0uohP/ICXU3TEE5JU5CN8xiIn//nfDQSdVQKerhrc X-Received: by 10.99.182.75 with SMTP id v11mr11400542pgt.158.1516989332856; Fri, 26 Jan 2018 09:55:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516989332; cv=none; d=google.com; s=arc-20160816; b=gSptOJGOdzAiwbgoUWdc3lP2uDZErrTDQW7dE6wcCS07ATWHq7h6UoEBBPY3Unxxb/ QWHMEa8+xCet8lvPgEMeVdg9Gr/CIVzyrge7Vj9ts7AQh77H0CBNxrBhH6nQrdpx+dS5 TZDiqyC9I3okW6y7hcsBAaxFrS5oNG/aXMKYc2iRkgPzkzrhj1PdJlyFOgIcxhWOgfop 172dJX8bLIBf+AJKeh5D3f3CdyTDBBcFMYYlEIjZRC88c6NiD9I9rL0LTq0uFhbO710B QxRr0/pMcb9wJC+31jt7PJkRP3CjU/5Hh1as5+BdTXrnFyAeWPDeQuxXs5WleIeCypHz zooQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:arc-authentication-results; bh=Hmu8YFw1evTF5C883BIohTHyypUvBFC7UUbqRh3EMcI=; b=StjbeIM9j0NDUs7d8UVn2iNzfabmSaAHiTQjnSv9zYzDZyJrI8WS+Uz7Qo3heUANIF Ce81VvdXaIHKeFPidrYv3pIqUKKDxBX4P1z0Q2VybfqHzPSctrE+/F2Yl2qRJUrQAzqx BSCPb4Bmge/TXc6j/TvFXWDtfpxvS9cFgphJnYkP9WMiZFmKkVa7V9hGtsI05EbgG1Vn e9EaPpjwESgtt2ANcPEVDhCG9OGgtGZe1E8BYKhviDuSV4GR9DHg67DpjWrtqSKZEQXW r3RLEsKwtsrMZzt/4TvPQt9rFWM7mPYvRQasg18OW+hTzmwuMrmL5Wt4y1UvKyll3pND VkuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xff.cz header.s=mail header.b=PmI7yvEN; 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=REJECT sp=REJECT dis=NONE) header.from=xff.cz Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s9-v6si3901553plr.778.2018.01.26.09.55.18; Fri, 26 Jan 2018 09:55:32 -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=@xff.cz header.s=mail header.b=PmI7yvEN; 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=REJECT sp=REJECT dis=NONE) header.from=xff.cz Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751847AbeAZRyq (ORCPT + 99 others); Fri, 26 Jan 2018 12:54:46 -0500 Received: from vps.xff.cz ([195.181.215.36]:41228 "EHLO vps.xff.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751378AbeAZRyo (ORCPT ); Fri, 26 Jan 2018 12:54:44 -0500 X-Greylist: delayed 506 seconds by postgrey-1.27 at vger.kernel.org; Fri, 26 Jan 2018 12:54:43 EST DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xff.cz; s=mail; t=1516988775; bh=CXK/+jtShariRll9A8KWjLLJdQ3aCIPOPo79irwRPUE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=PmI7yvENFbLCg6RjY9BAe6NVht96j8WbqyeJcDHN75U+SEVDmQdaYUqRnduuI2hjR YbXLRqeBIhE6V6CkH2yo1q42sStte+AU4nXdEHAp/uFyh63UrVgBSQi2MRSTB9IIK5 Kh9ANWZMXy4DaV69dsSy6N+hC1rGGsUqDc6HseXE= Date: Fri, 26 Jan 2018 18:46:02 +0100 From: =?utf-8?Q?Ond=C5=99ej?= Jirman To: Philipp Rossak 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 Subject: Re: [linux-sunxi] [PATCH 10/16] iio: adc: sun4i-gpadc-iio: add support for A83T thermal sensor Message-ID: <20180126174602.qolcswhqblgmlad7@core.my.home> References: <20180126151941.12183-1-embed3d@gmail.com> <20180126151941.12183-11-embed3d@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180126151941.12183-11-embed3d@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > 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.