From patchwork Fri Nov 19 19:14:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Evgeny Boger X-Patchwork-Id: 12693146 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BCD3BC433F5 for ; Fri, 19 Nov 2021 19:19:46 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8619C61A0C for ; Fri, 19 Nov 2021 19:19:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8619C61A0C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=wirenboard.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=dZxU1uVixMLjKr3Mx4En4v+0433qdpSLGZ6TYypi9vY=; b=v1TPpdV6resiNt sFgAbHb+yM8a3HYNYAjo5pMZ+Qs7rKh6/o11BZx5B9RLHU3UQRhHQ7ewdmrENsBB+E7jrxTARjDm9 Q3ljHLbOWwZrGRIKpbBg8tCjIXKNdjEurbAV3AVHSsJ2xaZJzQ3V0lrHeK5ReY9Hcl75UhVeLZAO1 1NYfrf84v5nT8f6L0qBCiBFgkTHYvOPRBrKDzUFxiQqFN9qDe2bspi5cinyxF4ISytobYy7mmrDat W3w4ZjgfD4pZY7fC88Fo1jaDATpfZX1RDEa0Vvz+WV3YirPs71NQN/dO2kQ8X6XBrdAMEvUo66ZAk gXchdd3oe/2FhwHLCSLQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mo9O9-00BQck-As; Fri, 19 Nov 2021 19:17:35 +0000 Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mo9Lu-00BQ9M-92 for linux-arm-kernel@lists.infradead.org; Fri, 19 Nov 2021 19:15:16 +0000 Received: by mail-lf1-x134.google.com with SMTP id k37so47924375lfv.3 for ; Fri, 19 Nov 2021 11:15:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wirenboard-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DorX6uh/2l16TStrOTRtdT5VbZ8ppu8SEpAlwh1V2bI=; b=SiPfe5H+3K+8kbywZFv+xafW62qQS4Fy4Efo6s4ID0U4KR4VM6eAeC6702KlS9nrYv VfyhNOA0yk1ciR5UNXCgxV3ML72CdzZxEAfr44KNuZTFGw6dEX52GTx8MwTxjd1Y4ivP hHeMoiYRQVYAaeSNJSxnTjluqWd8iWLemErrUOxbhBRgiY9bo81Ax4Hp3dgGf16a3jcJ VpUyd/gkA0rGhCr+3t5YUiQSGu7dKNTPZGdUyxeAJtjRPo0vSwedH+IQAP1WTnD5gC48 99cdcL3WTbadGma1JEZJOLswFkf+CcApN3dS3L8kbMFf7aEkeofZYoDW0XZ0sbWs5puH c+Lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=DorX6uh/2l16TStrOTRtdT5VbZ8ppu8SEpAlwh1V2bI=; b=2Q4IRWfvjOb6t42NArqoxrMHFEqs86mPE6Q+p+DbyqvZq7hA0dYc6ATL2JzT8ObPj1 fyJNd4vggWQvqjn3mQIbta0B9PqZJS07tWtHthSm/HTLc7HFkU1K9Ob3EPaZKNEIldmm JeRowGYUdlvblfu+EbosI6QsS8X8iN0f9R5ZnQEq4cHOHAJfZZvVpzn5On4W4e/ee6rP H3fV2jtzwmLeElREl5+xF0a4t0yZcJHvJsxx8wtGhDHvDiEN3iKPads62DUfKgcOFOkO xRvdZaXRje7VE3izRbLk07Nlg6tyTpjQ+HIzYm5M7LdSPRJhqHC2LsZNfvshHQUwdn+c NmXA== X-Gm-Message-State: AOAM533l/3iSdwQzuSR9cUBX9b5+xhFB1oyAxlMsIMiHo9YtdkRA2y/w zwOx5BtnIR5tUdV+WUNeFZWWNg== X-Google-Smtp-Source: ABdhPJzh5508nh7ogd3E8pp2Dz/HxK4JjlQje/W7XPqQvO4Ui340PBzLVo5OmTfvotce1OQAc8CnvQ== X-Received: by 2002:a05:6512:36c9:: with SMTP id e9mr35288685lfs.87.1637349312040; Fri, 19 Nov 2021 11:15:12 -0800 (PST) Received: from boger-laptop.lan (81.5.99.121.dhcp.mipt-telecom.ru. [81.5.99.121]) by smtp.gmail.com with ESMTPSA id d4sm67676lfg.153.2021.11.19.11.15.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Nov 2021 11:15:11 -0800 (PST) From: Evgeny Boger To: Chen-Yu Tsai , linux-sunxi@lists.linux.dev, Maxime Ripard Cc: Evgeny Boger , Lee Jones , Rob Herring , devicetree@vger.kernel.org, Jernej Skrabec , linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/3] iio: adc: sun4i-gpadc-iio: no temp sensor on R40 Date: Fri, 19 Nov 2021 22:14:54 +0300 Message-Id: <20211119191456.510435-2-boger@wirenboard.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211119191456.510435-1-boger@wirenboard.com> References: <20211119191456.510435-1-boger@wirenboard.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211119_111514_375951_7E600025 X-CRM114-Status: GOOD ( 25.40 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org R40 SoC has touchscreen controller also serving as general-purpose ADC. The hardware is very similar to A31, except that R40 has separate calibrated thermal sensor IP (handled by sun8i_thermal). Despite the temperature sensor in the RTP is never mentioned in the R40 family user manuals, it appears to be working. However, it's not very useful as it lacks calibration data and there is another fully functioning temperature sensor anyway. This patch disables the temperature sensor in RTP/GPADC IP on R40. The reason for disabling the temperature sensor is that the IP needs to be switched back and forth between RTP and GPADC modes for temperature measurements. Not only this introduces delays, but it also disturbs external circuitry by injecting current into ADC inputs. Signed-off-by: Evgeny Boger Acked-by: Maxime Ripard Acked-by: Jonathan Cameron --- drivers/iio/adc/sun4i-gpadc-iio.c | 32 +++++++++++++++++++++++-------- drivers/mfd/sun4i-gpadc.c | 17 ++++++++++++++++ 2 files changed, 41 insertions(+), 8 deletions(-) diff --git a/drivers/iio/adc/sun4i-gpadc-iio.c b/drivers/iio/adc/sun4i-gpadc-iio.c index 2d393a4dfff6..e63a45c092ab 100644 --- a/drivers/iio/adc/sun4i-gpadc-iio.c +++ b/drivers/iio/adc/sun4i-gpadc-iio.c @@ -53,6 +53,7 @@ struct gpadc_data { unsigned int tp_adc_select; unsigned int (*adc_chan_select)(unsigned int chan); unsigned int adc_chan_mask; + bool has_temp_sensor; }; static const struct gpadc_data sun4i_gpadc_data = { @@ -62,6 +63,7 @@ static const struct gpadc_data sun4i_gpadc_data = { .tp_adc_select = SUN4I_GPADC_CTRL1_TP_ADC_SELECT, .adc_chan_select = &sun4i_gpadc_chan_select, .adc_chan_mask = SUN4I_GPADC_CTRL1_ADC_CHAN_MASK, + .has_temp_sensor = true, }; static const struct gpadc_data sun5i_gpadc_data = { @@ -71,6 +73,7 @@ static const struct gpadc_data sun5i_gpadc_data = { .tp_adc_select = SUN4I_GPADC_CTRL1_TP_ADC_SELECT, .adc_chan_select = &sun4i_gpadc_chan_select, .adc_chan_mask = SUN4I_GPADC_CTRL1_ADC_CHAN_MASK, + .has_temp_sensor = true, }; static const struct gpadc_data sun6i_gpadc_data = { @@ -80,12 +83,24 @@ static const struct gpadc_data sun6i_gpadc_data = { .tp_adc_select = SUN6I_GPADC_CTRL1_TP_ADC_SELECT, .adc_chan_select = &sun6i_gpadc_chan_select, .adc_chan_mask = SUN6I_GPADC_CTRL1_ADC_CHAN_MASK, + .has_temp_sensor = true, +}; + +static const struct gpadc_data sun8i_r40_gpadc_data = { + .temp_offset = -1623, + .temp_scale = 167, + .tp_mode_en = SUN6I_GPADC_CTRL1_TP_MODE_EN, + .tp_adc_select = SUN6I_GPADC_CTRL1_TP_ADC_SELECT, + .adc_chan_select = &sun6i_gpadc_chan_select, + .adc_chan_mask = SUN6I_GPADC_CTRL1_ADC_CHAN_MASK, + .has_temp_sensor = false, }; static const struct gpadc_data sun8i_a33_gpadc_data = { .temp_offset = -1662, .temp_scale = 162, .tp_mode_en = SUN8I_GPADC_CTRL1_CHOP_TEMP_EN, + .has_temp_sensor = true, }; struct sun4i_gpadc_iio { @@ -499,7 +514,7 @@ static int sun4i_gpadc_probe_dt(struct platform_device *pdev, void __iomem *base; int ret; - info->data = of_device_get_match_data(&pdev->dev); + info->data = (struct gpadc_data *)of_device_get_match_data(&pdev->dev); if (!info->data) return -ENODEV; @@ -519,7 +534,7 @@ static int sun4i_gpadc_probe_dt(struct platform_device *pdev, return ret; } - if (IS_ENABLED(CONFIG_THERMAL_OF)) + if (IS_ENABLED(CONFIG_THERMAL_OF) && info->data->has_temp_sensor) info->sensor_device = &pdev->dev; return 0; @@ -552,7 +567,7 @@ static int sun4i_gpadc_probe_mfd(struct platform_device *pdev, * that choice to the user. */ - if (IS_ENABLED(CONFIG_THERMAL_OF)) { + if (IS_ENABLED(CONFIG_THERMAL_OF) && info->data->has_temp_sensor) { /* * This driver is a child of an MFD which has a node in the DT * but not its children, because of DT backward compatibility @@ -575,7 +590,7 @@ static int sun4i_gpadc_probe_mfd(struct platform_device *pdev, indio_dev->channels = sun4i_gpadc_channels_no_temp; } - if (IS_ENABLED(CONFIG_THERMAL_OF)) { + if (IS_ENABLED(CONFIG_THERMAL_OF) && info->data->has_temp_sensor) { ret = sun4i_irq_init(pdev, "TEMP_DATA_PENDING", sun4i_gpadc_temp_data_irq_handler, "temp_data", &info->temp_data_irq, @@ -590,7 +605,7 @@ static int sun4i_gpadc_probe_mfd(struct platform_device *pdev, if (ret < 0) return ret; - if (IS_ENABLED(CONFIG_THERMAL_OF)) { + if (IS_ENABLED(CONFIG_THERMAL_OF) && info->data->has_temp_sensor) { ret = iio_map_array_register(indio_dev, sun4i_gpadc_hwmon_maps); if (ret < 0) { dev_err(&pdev->dev, @@ -636,7 +651,7 @@ static int sun4i_gpadc_probe(struct platform_device *pdev) pm_runtime_set_suspended(&pdev->dev); pm_runtime_enable(&pdev->dev); - if (IS_ENABLED(CONFIG_THERMAL_OF)) { + if (IS_ENABLED(CONFIG_THERMAL_OF) && info->data->has_temp_sensor) { info->tzd = thermal_zone_of_sensor_register(info->sensor_device, 0, info, &sun4i_ts_tz_ops); @@ -661,7 +676,7 @@ static int sun4i_gpadc_probe(struct platform_device *pdev) return 0; err_map: - if (!info->no_irq && IS_ENABLED(CONFIG_THERMAL_OF)) + if (!info->no_irq && IS_ENABLED(CONFIG_THERMAL_OF) && info->data->has_temp_sensor) iio_map_array_unregister(indio_dev); pm_runtime_put(&pdev->dev); @@ -678,7 +693,7 @@ static int sun4i_gpadc_remove(struct platform_device *pdev) pm_runtime_put(&pdev->dev); pm_runtime_disable(&pdev->dev); - if (!IS_ENABLED(CONFIG_THERMAL_OF)) + if (!IS_ENABLED(CONFIG_THERMAL_OF) || !info->data->has_temp_sensor) return 0; thermal_zone_of_sensor_unregister(info->sensor_device, info->tzd); @@ -693,6 +708,7 @@ static const struct platform_device_id sun4i_gpadc_id[] = { { "sun4i-a10-gpadc-iio", (kernel_ulong_t)&sun4i_gpadc_data }, { "sun5i-a13-gpadc-iio", (kernel_ulong_t)&sun5i_gpadc_data }, { "sun6i-a31-gpadc-iio", (kernel_ulong_t)&sun6i_gpadc_data }, + { "sun8i-r40-gpadc-iio", (kernel_ulong_t)&sun8i_r40_gpadc_data }, { /* sentinel */ }, }; MODULE_DEVICE_TABLE(platform, sun4i_gpadc_id); diff --git a/drivers/mfd/sun4i-gpadc.c b/drivers/mfd/sun4i-gpadc.c index cfe14d9bf6dc..293acad52e5a 100644 --- a/drivers/mfd/sun4i-gpadc.c +++ b/drivers/mfd/sun4i-gpadc.c @@ -17,6 +17,7 @@ #define ARCH_SUN4I_A10 0 #define ARCH_SUN5I_A13 1 #define ARCH_SUN6I_A31 2 +#define ARCH_SUN8I_R40 3 static const struct resource adc_resources[] = { DEFINE_RES_IRQ_NAMED(SUN4I_GPADC_IRQ_FIFO_DATA, "FIFO_DATA_PENDING"), @@ -69,6 +70,15 @@ static struct mfd_cell sun6i_gpadc_cells[] = { { .name = "iio_hwmon" }, }; +static struct mfd_cell sun8i_r40_gpadc_cells[] = { + { + .name = "sun8i-r40-gpadc-iio", + .resources = adc_resources, + .num_resources = ARRAY_SIZE(adc_resources), + }, + { .name = "iio_hwmon" }, +}; + static const struct regmap_config sun4i_gpadc_regmap_config = { .reg_bits = 32, .val_bits = 32, @@ -86,6 +96,9 @@ static const struct of_device_id sun4i_gpadc_of_match[] = { }, { .compatible = "allwinner,sun6i-a31-ts", .data = (void *)ARCH_SUN6I_A31, + }, { + .compatible = "allwinner,sun8i-r40-ts", + .data = (void *)ARCH_SUN8I_R40, }, { /* sentinel */ } }; @@ -117,6 +130,10 @@ static int sun4i_gpadc_probe(struct platform_device *pdev) cells = sun6i_gpadc_cells; size = ARRAY_SIZE(sun6i_gpadc_cells); break; + case ARCH_SUN8I_R40: + cells = sun8i_r40_gpadc_cells; + size = ARRAY_SIZE(sun8i_r40_gpadc_cells); + break; default: return -EINVAL; } From patchwork Fri Nov 19 19:14:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Evgeny Boger X-Patchwork-Id: 12693147 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3B02EC433EF for ; Fri, 19 Nov 2021 19:21:11 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 09AF861AED for ; Fri, 19 Nov 2021 19:21:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 09AF861AED Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=wirenboard.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=QDAwvvPt8MpzT+n2mJ+WVxnFQIVcS2dfSMLU60nbGRw=; b=fsG1SvazFgH9A+ Nhn0WUC7xLrqoaDlKjtrbjrKR4lFGodoVEOBOWPn8fuC6Dm8+1u4mg+1EPsm2CdrqXLnGgFwlkvYQ TXRXygek/Z0EWVLZh9iKJqteXWsFbCVQmXMx0ssDaDcuuxLHGnBFl7wvcL3kJFnTstB71vHjieQgK PgmI7JhsQaFCFeVr8JpQgCd6fTMGU1KoSO/vPjuKZB+ZS5DLC6paSaCy0gU8Wz6Lxz0f4K0dkGsxt C00igva7EIyMnkQAKvk4QCL4brjM/JNqoq3W3hKgVt50JWSOVVZllinFeQZcKdhfyP/jGK5X9j/NZ Y7Q6+F6fB/8tV5m4Bo0Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mo9Pj-00BQwk-1a; Fri, 19 Nov 2021 19:19:12 +0000 Received: from mail-lf1-x12d.google.com ([2a00:1450:4864:20::12d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mo9Lu-00BQ9n-V0 for linux-arm-kernel@lists.infradead.org; Fri, 19 Nov 2021 19:15:16 +0000 Received: by mail-lf1-x12d.google.com with SMTP id l22so47488464lfg.7 for ; Fri, 19 Nov 2021 11:15:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wirenboard-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iD461cMCR3D8128ew9tBkbAfCtFZzMKZMMxb7s46+RU=; b=gTjpKdaYWkhNkovaew5KGcNpMaISQDibEo6/XSTeggSsuFuF4TALOGgFjYA08qftUx EQF4+9DrPyA5iSQymFEC0JRO+4QdcCNy2j3roDH5P8fp6w38V2F6ax/9GuUO1I0Mc8Fr jcWdgVtkZGxXhckJ7lS/q7ceObBZOVWbrbq2/NFVaIsnzoIFXqsosTEEWyk550fMlTZy AB3krfKlw/tURAzP0fLf0v/IuOIFctX9KsWuOGWPoAFq6sGMxl7h26787JyLoN07cBwS PzuLFHaUEBExq272OIA6viFLsW3GapunK87eXUBsKxJ2WFjKTAflNPQJoAYQ8Mqc6+No ihvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iD461cMCR3D8128ew9tBkbAfCtFZzMKZMMxb7s46+RU=; b=0tuJDL92YdwML2sunwxa+mttCvKaK6yfJh7Eob1EYDfMR75VFzZVsofKsDO0NM8fTv MYMnWMwdEocZ3XMjilGJukBoOuFmI5++CUqyS5jOF5TAoFB9tGfeYQqP3xuhaTGkrYxO RZAoql0Su0hAnGlHK8kJ1mNLUiy2zMkkAMfQhc1bQWneYakJzyWooarapqj7M6abStl9 MY8IaxKXi6lIIYxdq1qe/zf8u7wjn1XWcexO4x0S62R0BsJCDssb1mqgFZJNtREnvyTi /ChQVIVR6hRCoYMZqFETAHCkPPKR5ZbXoNn1xP8zjIeM5cFJKy709RxHTjCZbMhNztLj p7jw== X-Gm-Message-State: AOAM531+X/AcIpf0O/jd4vNUPBZ0mp1dsfFu6IiqCs74bgmKvgM8VnbZ eBCenG2oTaFcAy44QeMmC/VZ6w== X-Google-Smtp-Source: ABdhPJxzHbyZ1+gjb1fbFkVsotlhbZUWvYxneo2G6p3Uka26R9gliZ8WhF6Uwus5kxwjh1rV5IBXVQ== X-Received: by 2002:a19:ad0d:: with SMTP id t13mr35570063lfc.161.1637349313159; Fri, 19 Nov 2021 11:15:13 -0800 (PST) Received: from boger-laptop.lan (81.5.99.121.dhcp.mipt-telecom.ru. [81.5.99.121]) by smtp.gmail.com with ESMTPSA id d4sm67676lfg.153.2021.11.19.11.15.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Nov 2021 11:15:12 -0800 (PST) From: Evgeny Boger To: Chen-Yu Tsai , linux-sunxi@lists.linux.dev, Maxime Ripard Cc: Evgeny Boger , Lee Jones , Rob Herring , devicetree@vger.kernel.org, Jernej Skrabec , linux-arm-kernel@lists.infradead.org Subject: [PATCH 2/3] dt-bindings: iio: adc: new compatible for Allwinner R40 RTP controller Date: Fri, 19 Nov 2021 22:14:55 +0300 Message-Id: <20211119191456.510435-3-boger@wirenboard.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211119191456.510435-1-boger@wirenboard.com> References: <20211119191456.510435-1-boger@wirenboard.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211119_111515_048584_91A9966D X-CRM114-Status: GOOD ( 10.99 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org R40 SoC has touchscreen controller also serving as general-purpose ADC. The hardware is very similar to A31, except that R40 has separate calibrated thermal sensor IP, so temperature sensing channel in RTP is not documented and is not to be used. Signed-off-by: Evgeny Boger Acked-by: Maxime Ripard Acked-by: Rob Herring --- .../devicetree/bindings/mfd/allwinner,sun4i-a10-ts.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/mfd/allwinner,sun4i-a10-ts.yaml b/Documentation/devicetree/bindings/mfd/allwinner,sun4i-a10-ts.yaml index f591332fc462..6214477465b8 100644 --- a/Documentation/devicetree/bindings/mfd/allwinner,sun4i-a10-ts.yaml +++ b/Documentation/devicetree/bindings/mfd/allwinner,sun4i-a10-ts.yaml @@ -19,6 +19,7 @@ properties: - allwinner,sun4i-a10-ts - allwinner,sun5i-a13-ts - allwinner,sun6i-a31-ts + - allwinner,sun8i-r40-ts reg: maxItems: 1 From patchwork Fri Nov 19 19:14:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Evgeny Boger X-Patchwork-Id: 12693148 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2318FC433EF for ; Fri, 19 Nov 2021 19:22:53 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E64A261A0C for ; Fri, 19 Nov 2021 19:22:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E64A261A0C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=wirenboard.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Bo9aJa/dutiV/8AqQ6JbuLd4D1lGUD1715bWr279bWA=; b=WaqV7+Qzit1xQx A3Kn1DUnkAj2LfqWsKpHXN9J391j0/n5MDrKumN5gDRi+NCVLmk0gOgCnSCLpD5qQkLJ3I8UwpmAO 1JZ3B+WxyWBVLj90z6h5vs1Rxe8QQuH6dEnejLhw6BBtEpViXWgAbUsmLZHdKT3MPJmJOc7YaSbWO 6MA95Tz6d4d5V/k1Lgou4ssfCDOMGT8UcurMzhHXIJBZNlr8VMfyddVlUaFf8Zh7+gPqXxBhpWPTe z+y638gohjsK6HGVVqwaOV0s/E04QZ08Ys37fgf/c/Mw9JhX6yHrPG3L5Db356/n1MYQJ5jQbWsna 3sIRpWw6SqNGup3Pnrjg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mo9RN-00BRHZ-4M; Fri, 19 Nov 2021 19:20:54 +0000 Received: from mail-lf1-x135.google.com ([2a00:1450:4864:20::135]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mo9Lw-00BQAD-0l for linux-arm-kernel@lists.infradead.org; Fri, 19 Nov 2021 19:15:18 +0000 Received: by mail-lf1-x135.google.com with SMTP id b1so47396534lfs.13 for ; Fri, 19 Nov 2021 11:15:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wirenboard-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9V4Hpv6UNWdRgHARpjljLPLAlbYv9H5cBhCpbSSCi+c=; b=f7rVKibT3ecrqCR0cs8vfe4FUDUZpkC2KqGSAXEQMFj2vekBjOILbMhzEq1i6vPYzT 3vy8ZsvpvNMVwxYAXZSVCOjOr9rQzEWPk9vLd+YWzFq9qtayWT8X6yzYGM8eF8zjCu1u Fx84ccQbk4K/fRYJaHwUatGQcDF21etw/xzCK7cL49iFR+WTzKu6vs6GMQpv2O4DV0hk /o9u9J3r0xpbHuEHLdS5f4FF/a7JqBUdOu91yujKs1xRPuHBu67Ti2viXY/nu6eLZX/0 9H6kmTQxh8fyFSTA04h0NyrN4o1mkpweRVYDSuoqMcfz8+DQYcD69fKBjyQowYhwB5za yO0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9V4Hpv6UNWdRgHARpjljLPLAlbYv9H5cBhCpbSSCi+c=; b=yWEJ7DgSkgEUsTqX1VTfIkXDfHTgdOkx8mEqcr1wIbyl3HcK9UP275r5vbGEF57A9+ n8vna72wi5iaBouVW0levIcHI+BUzqVgxrpiwbErB4ArRsQyWHKm2X6f7hFBUEbMrfgU juD7Z/PA8DdjbhSE9ZKAX029ssPvuB3MRHOARYZI95Bg9J0kUJPep4XnRIwJMnVOnt4v /BemAsaEE14m6hmc65eccqnN9uQp5O44At7DBtzyFcPQjhVxZjm8wYbjFZBq9YHBzaLX 3N+4LEQ0fiKQY/6xZ6UUHLfN2uoQ9ZtXJ1HuAQCV/Sflf1zpfhwmtZbwbX2QCAuST+zE DYKA== X-Gm-Message-State: AOAM5312kjWMPQI9AxveUlXz+lI12n0WlIXcskHTR565Vr75/V6wTp8o kExtKjGxHVgMM0VbZx4rTuqmfheOJwxYdQ== X-Google-Smtp-Source: ABdhPJxHKK81BOCRmq9i0bH5Ik3SOWDmpYRjcSqLtGov2dr/uD2ezBgt0kps6WS4s0VWUQp3y4f0xg== X-Received: by 2002:a19:6412:: with SMTP id y18mr36119126lfb.494.1637349314198; Fri, 19 Nov 2021 11:15:14 -0800 (PST) Received: from boger-laptop.lan (81.5.99.121.dhcp.mipt-telecom.ru. [81.5.99.121]) by smtp.gmail.com with ESMTPSA id d4sm67676lfg.153.2021.11.19.11.15.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Nov 2021 11:15:13 -0800 (PST) From: Evgeny Boger To: Chen-Yu Tsai , linux-sunxi@lists.linux.dev, Maxime Ripard Cc: Evgeny Boger , Lee Jones , Rob Herring , devicetree@vger.kernel.org, Jernej Skrabec , linux-arm-kernel@lists.infradead.org Subject: [PATCH 3/3] ARM: dts: sun8i: r40: add rtp node Date: Fri, 19 Nov 2021 22:14:56 +0300 Message-Id: <20211119191456.510435-4-boger@wirenboard.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211119191456.510435-1-boger@wirenboard.com> References: <20211119191456.510435-1-boger@wirenboard.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211119_111516_100962_E8DD5664 X-CRM114-Status: GOOD ( 12.37 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org R40 SoC has touchscreen controller also serving as general-purpose ADC. The hardware is very similar to A31, except that R40 has separate calibrated thermal sensor IP, so temperature sensing channel in RTP is not documented and is not to be used. Signed-off-by: Evgeny Boger --- arch/arm/boot/dts/sun8i-r40.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/arm/boot/dts/sun8i-r40.dtsi b/arch/arm/boot/dts/sun8i-r40.dtsi index 1d87fc0c24ee..3e98f24c1400 100644 --- a/arch/arm/boot/dts/sun8i-r40.dtsi +++ b/arch/arm/boot/dts/sun8i-r40.dtsi @@ -786,6 +786,14 @@ ths: thermal-sensor@1c24c00 { #thermal-sensor-cells = <1>; }; + rtp: rtp@1c25000 { + compatible = "allwinner,sun8i-r40-ts", + "allwinner,sun6i-a31-ts"; + reg = <0x01c25000 0x100>; + interrupts = ; + #thermal-sensor-cells = <0>; + }; + uart0: serial@1c28000 { compatible = "snps,dw-apb-uart"; reg = <0x01c28000 0x400>;