From patchwork Thu Aug 30 15:44:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Rossak X-Patchwork-Id: 10582115 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 58F8A175A for ; Thu, 30 Aug 2018 15:46:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 464EF2C0A7 for ; Thu, 30 Aug 2018 15:46:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 399F82C0B0; Thu, 30 Aug 2018 15:46:58 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 63A172C0A7 for ; Thu, 30 Aug 2018 15:46:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=bu+dkUJbi8C5PDyY0ygE08IeLUHh8i4B4qCTP7qHxq8=; b=WSo 4wR1ck09SENpFb1vZSWDfUjZx0gx+fMJlrb11Lzi3F0/GvBwy7puE38z42ZqPt6C4HyINvjGJ8fkN O4l7qoPrIZVRZvxfJZN2042qn5TTqG2oTsSQOFZj5cZe70F9zD4T/AgzdxH7KZOdsP0ZbugysjcbX YdTHPewdoXMan1cIe+Nahz2KEzYfdcWrARWjLi3TL4ALkaLD3h4PxEKBw6qcVDMbf5ncVewaieuzI /BJE0UsObjL8B6jR4W9m1Y/SX1nrZZRBNZ9gICeWLvM6yJzD7k6bl60RrUjDwDRFcTdHdPYz0VZOw icjKWYxLWJYYEcOqcBQGE7ow5y5HtsA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fvP9h-00028h-12; Thu, 30 Aug 2018 15:46:45 +0000 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fvP8X-0001Zs-5G for linux-arm-kernel@lists.infradead.org; Thu, 30 Aug 2018 15:45:35 +0000 Received: by mail-wm0-x243.google.com with SMTP id n11-v6so2498893wmc.2 for ; Thu, 30 Aug 2018 08:45:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=+Pw8jXa3quPSpYkMdowjBJQRc76LDW18F+2oJE8DWa4=; b=OQ7sq/3+G1iqgR6yw935vAHV2UF1OWx92TxgxgDj9hzKR9or+/2CQVv/LPMiLq5DZU bhvhU4xQahud7qv65QeJGpMhuCqQox2sEnspWiRQGaAemQ7aj94fIIRnHMT53FMUTcc5 u2HSGRITXXGE93I/iwLRps/BYGjjMg7Eba0nZgi9NNDb6yxfac9UzhWL9CW8Tg1aWMfN jkbrNjDlyaSG7ydaG8gol0qvCIs5UIqJQ0uzNOQPEaqi0fpaCrYPnylY+2/vFlN+NPk3 8A64zsnZmi+cBXh5hXLWwEKESojxnd4fA5OYHM+lmRLpQNz155Nenq87HQRRi+W86UVR 59+Q== 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; bh=+Pw8jXa3quPSpYkMdowjBJQRc76LDW18F+2oJE8DWa4=; b=EnjgvYvX/9oXULNnYWaiqW+vPlhETlEf6N+YFQOsRwSxySB2dyGO4CJLCOouoAC6nm QmVxpyb61LJEYvtvh7lfSOhcNTuiIh2jIP1TK1u+/tj5NPUubfVmgnlIvn3y1cgDTgbR 9JtY+18O0IPI21WjmXW5oFROZWBzca6+EzWBz1/m/TAVE0D0y7Z6/vuUWXpprf3EhOuQ 0SxGW71b2ZCirTW8KajLqjdRBHlVYMoGbAF+aKBNhypVUC+aI3x8b9zr+CY7uLtWrJOE bocT/HQ3S1i5fCg3mWf/OAML9EQUxEE+s4nzWorkWornjP2wECO2/3CCzeb7t4wFJyA0 0X7w== X-Gm-Message-State: APzg51BEe2IgFK08GqS3ytLDfhL7wOhhxQ+NfRYcjuBTLVl3WosAzTB2 VqD56ZljgzDNGIkv0eLASX0= X-Google-Smtp-Source: ANB0VdZ8pL+6fOzN0Z8+hI9Bt081tglZ1SLx4eRwW6kGmF9SbDs/HkMLlB6R10Nh1AUi/xdX8LWJVw== X-Received: by 2002:a1c:91cd:: with SMTP id t196-v6mr1460645wmd.100.1535643919839; Thu, 30 Aug 2018 08:45:19 -0700 (PDT) Received: from debian-hp.wlan.uni-ulm.de (eduroam170-020.wlan.uni-ulm.de. [134.60.170.20]) by smtp.gmail.com with ESMTPSA id j20-v6sm1362759wmh.9.2018.08.30.08.45.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Aug 2018 08:45:19 -0700 (PDT) From: Philipp Rossak To: lee.jones@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com, maxime.ripard@bootlin.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 Subject: [PATCH v3 00/30] IIO-based thermal sensor driver for Allwinner H3 and A83T SoC Date: Thu, 30 Aug 2018 17:44:48 +0200 Message-Id: <20180830154518.29507-1-embed3d@gmail.com> X-Mailer: git-send-email 2.11.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180830_084533_242674_E85E6D75 X-CRM114-Status: GOOD ( 15.98 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-sunxi@googlegroups.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Allwiner H3 and A83T SoCs have a thermal sensor, which is a large refactored version of the old Allwinner "GPADC" (although it have already only thermal part left in A33). This patch tried to add support for the sensor in H3 and A83T based on This Patchtseries was in the beginning based on Icenowy Zengs v4 patchseries [1]. Since we decided to merge the mfd driver into the GPADC this changed. So only one patch could be reused. Patches that adds support for H5, A64, A80 and H6 SoCs are allready prepared, and will be upstreamed if this patchseries is applied and the testing is done. Sorry for delaying this. Regards, Philipp changes since v2: * mfd driver is now merged into the gpadc driver * complete rework changes since v1: * collecting all acks * rewording commits/fix typos * move code in place where it is used * fix naming conventions of defines * clarify commits * update documentation to cover the new nvmem calibraion * change nvmem calibration Icenowy Zheng (1): iio: adc: sun4i-gpadc-iio: rename A33-specified registers to contain A33 Philipp Rossak (29): mfd: Makefile: Remove build option for MFD:sun4i-gpadc mfd: Kconfig: Remove MFD_SUN4I_GPADC config option iio: adc: Remove ID table iio: adc: Kconfig: Update Kconfig to new build options iio: adc: move SUN4I_GPADC_CHANNEL define to header file iio: adc: remove ofnode options iio: adc: remove mfd_probe & sunwi_irq_init function iio: adc: remove hwmon structure iio: adc: Threat A33 as thermal sensor and remove non thermal sun4i channel iio: adc: rework irq and adc_channel handling iio: adc: add new compatibles mfd: Remove old mfd driver & Move sun4i-gpadc.h to iio/adc/ arm: config: Enable SUN4I_GPADC in defconfig dt-bindings: update the Allwinner GPADC device tree binding for H3 & A83T iio: adc: sun4i-gpadc-iio: rework: readout temp_data iio: adc: sun4i-gpadc-iio: rework: support clocks and reset iio: adc: sun4i-gpadc-iio: rework: support multiple sensors iio: adc: sun4i-gpadc-iio: rework: support nvmem calibration data iio: adc: sun4i-gpadc-iio: rework: device specific suspend & resume iio: adc: sun4i-gpadc-iio: add support for H3 thermal sensor iio: adc: sun4i-gpadc-iio: add support for A83T thermal sensor ARM: dts: sunxi-h3-h5: add support for the thermal sensor in H3 and H5 ARM: dts: sun8i: h3: add support for the thermal sensor in H3 ARM: dts: sun8i: h3: add thermal zone to H3 ARM: dts: sun8i: h3: enable H3 sid controller ARM: dts: sun8i: h3: use calibration for ths ARM: dts: sun8i: a83t: add support for the thermal sensor in A83T ARM: dts: sun8i: a83t: add thermal zone to A83T ARM: sun8i: a83t: full range OPP tables and CPUfreq .../devicetree/bindings/iio/adc/sun4i-gpadc.txt | 41 +- arch/arm/boot/dts/sun8i-a83t.dtsi | 143 +++++ arch/arm/boot/dts/sun8i-h3.dtsi | 52 ++ arch/arm/boot/dts/sunxi-h3-h5.dtsi | 10 + arch/arm/configs/sunxi_defconfig | 1 + drivers/iio/adc/Kconfig | 11 +- drivers/iio/adc/sun4i-gpadc-iio.c | 617 +++++++++++++-------- drivers/mfd/Kconfig | 17 - drivers/mfd/Makefile | 1 - drivers/mfd/sun4i-gpadc.c | 181 ------ include/linux/{mfd => iio/adc}/sun4i-gpadc.h | 47 +- 11 files changed, 681 insertions(+), 440 deletions(-) delete mode 100644 drivers/mfd/sun4i-gpadc.c rename include/linux/{mfd => iio/adc}/sun4i-gpadc.h (72%)