From patchwork Thu Aug 30 15:44:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Rossak X-Patchwork-Id: 10582161 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 ADB95175A for ; Thu, 30 Aug 2018 15:51:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9DE822C122 for ; Thu, 30 Aug 2018 15:51:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9B5A72C0E7; Thu, 30 Aug 2018 15:51:08 +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=ham 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 453282C132 for ; Thu, 30 Aug 2018 15:51:08 +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:References: In-Reply-To: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:List-Owner; bh=mmrBVujSP/2hCkd7lmKCShq2azLTy53I3+JzOE0CN+M=; b=Ur7evT2HRGD7O6sYYo6oK/5tuq Vfqv78LQ0V6Rq/rCUzKu1ZfXg4IQ9VFI1p6ceFmahsf0zLj80+KHU0OTGMn9OCoMN8EYcpMq7+QVL FEpnWnSju2DWCyl1OqhZ80Vdh6BoyP4WuJD+BDsREsIMtbXQ54u0/L/zM4mlyARpnH0hTzCWWaBRB ReS2JxcdigtCUqaUG38iULnBeYgOmYHMJYdxb2qS6hhxLx2mSm320nG4QZpEbDllEqd3U1WMYKIK6 xwT8Yx5jM+jnfBimKom6qg35yRL/kh1e2hkRKBaMMtJDAewIzjCUKd/eOuIdejqr7mfyQ+cpPikqv K5T8INJw==; 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 1fvPDj-00050C-1H; Thu, 30 Aug 2018 15:50:55 +0000 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fvP8Y-0001Zv-3d for linux-arm-kernel@lists.infradead.org; Thu, 30 Aug 2018 15:45:37 +0000 Received: by mail-wr1-x443.google.com with SMTP id u12-v6so8498640wrr.4 for ; Thu, 30 Aug 2018 08:45:22 -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:in-reply-to:references; bh=uKaqCBtqbdCV/0TVjaETReatm7uuORq7A9AVhZo/H2k=; b=MdimOYrvBalJQGow12JrkZb9Z+nFDifixx/09VVtkcHjKWHMmHdAWPWvYtddt+tC7b L8M8//VrgxJa9o2Zl04ghmXhnT5ZbOv2dPrUtj+1eWmAfP6I9lq4kv2vK0fsRx9Mqx1F HSF4x7K5B5ByCAHPKcDnEmOTJmeoQL/74NTXfBBAFx5MsnUV4w0sqRcgc15lqH2gOA3S KA4ij8MwsUxPr7AJTrCLQ+yzQSjsiriYMqMPQb0ilQE8K8hkSD01HvOD09DOG59MnJLe pzhBhO3ycAG6LAVnr8S86ctgppJMCRc3xnUJlcGh5zZEET/Zfxw6/YDtJOKJfWzBCQyX KBkQ== 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:in-reply-to :references; bh=uKaqCBtqbdCV/0TVjaETReatm7uuORq7A9AVhZo/H2k=; b=QFz7stCRA3qvBMoCVoPgbDLfhQTXpEvv4KazMTUuWYaMWzsVzBaLX5uhTu79bk7y23 lTqaWJBGzrIMMRdZuKEbQbzabOmxQyKTjy22Arnv1cscwDLgSHRVdG36W16zoxkVD/B0 2urg11VMXSUfeiJHYEzr6n/gPAo6jXSFclVfgh+Q+jb3GGtR0kcK+P18uDqrUPc9gnBH CSygRlCuLj7Qc/4T7cIquOaXTGUcmDRwoQj5KDXCW15hTSRJ/5Sive5/sxrl6lq9rjCM 7Z9oNcB+xxgH3v5k+UUULoH4AiTlW3MpkVBBBHGH9inKA/bqQLmUvQqIJKb8X3qJpoQh e6hA== X-Gm-Message-State: APzg51Be6PPDqKNVY5q4EzvL4cbspDm2oMHrkzC094CNegKQ22ylIpF5 SDDkWP4somzQS6KxtWH1NIs= X-Google-Smtp-Source: ANB0VdZBgvThGOX3zWlLEdEaVRf+EF4fwRTyq3QBhWWN/DWfFzj8me3ReeFRerAT2PSj6ch7wyRT2g== X-Received: by 2002:adf:ffc7:: with SMTP id x7-v6mr3501604wrs.137.1535643920777; Thu, 30 Aug 2018 08:45:20 -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.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Aug 2018 08:45:20 -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 01/30] mfd: Makefile: Remove build option for MFD:sun4i-gpadc Date: Thu, 30 Aug 2018 17:44:49 +0200 Message-Id: <20180830154518.29507-2-embed3d@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180830154518.29507-1-embed3d@gmail.com> References: <20180830154518.29507-1-embed3d@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180830_084534_160029_3CCD2EF1 X-CRM114-Status: GOOD ( 12.59 ) 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 Since we are merging the mfd driver into the sun4i-gpadc driver we need to remove the build options for the sun4i-gpadc driver. Signed-off-by: Philipp Rossak --- drivers/mfd/Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile index e9fd20dba18d..c680994db988 100644 --- a/drivers/mfd/Makefile +++ b/drivers/mfd/Makefile @@ -220,7 +220,6 @@ obj-$(CONFIG_INTEL_SOC_PMIC_CHTDC_TI) += intel_soc_pmic_chtdc_ti.o obj-$(CONFIG_MFD_MT6397) += mt6397-core.o obj-$(CONFIG_MFD_ALTERA_A10SR) += altera-a10sr.o -obj-$(CONFIG_MFD_SUN4I_GPADC) += sun4i-gpadc.o obj-$(CONFIG_MFD_STM32_LPTIMER) += stm32-lptimer.o obj-$(CONFIG_MFD_STM32_TIMERS) += stm32-timers.o From patchwork Thu Aug 30 15:44:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Rossak X-Patchwork-Id: 10582167 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 16A46920 for ; Thu, 30 Aug 2018 15:51:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 047892C0B4 for ; Thu, 30 Aug 2018 15:51:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EBC472C0BC; Thu, 30 Aug 2018 15:51:49 +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=ham 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 998ED2C0B4 for ; Thu, 30 Aug 2018 15:51:49 +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:References: In-Reply-To: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:List-Owner; bh=k5h2BkDLjNlALQE+ZMFppaqtiIy7wh0xaWoa+2X9OQ8=; b=t7zhWp9X1AKJBTqg3BgO4iFqPn nIWSshZ6+8KgpqoLHnSxXL6absmxzd/VWsnBi7lwIAwhLtKjh5mJuvdyw6pH7URINtaXdA321l/Ij aXduU64z1EaMWvAndlZVNp1OY2X+han79+/jlO63hFw54IdsoSKykTcW1E+c8VZZSZ/+qLagjYw// QEPRxdB3/UdCSy8heksL0b+ohQVcxLkPETAQtCJzh68SiNNrWb57xn4rw0V3Jyq1v2cRjSMVrXWPP lFOrAj6JL5QlM+GwBHje6nbiCcIJI9IQlT56YH/lDKOEwAvHGC1g9GnK1BdETlBInLPuThvlOKdVk Xxk2znYw==; 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 1fvPEU-0005IZ-CU; Thu, 30 Aug 2018 15:51:42 +0000 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fvP8Z-0001a4-2z for linux-arm-kernel@lists.infradead.org; Thu, 30 Aug 2018 15:45:39 +0000 Received: by mail-wm0-x242.google.com with SMTP id b19-v6so2472041wme.3 for ; Thu, 30 Aug 2018 08:45:22 -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:in-reply-to:references; bh=znNWD4c7xwHHzdKt+r4w+sW2qQCB/x6+Cp4Db3nfkDE=; b=V92Tq2KDAuTOS5ZXCjBYkHKFg44ritecrZ7ZE5O8ofAH/laW5wgzuFHy5iebseuYd2 UMiflbVHAilN/P8jgZ12r5Z33fJOFqmsL4031S5dzCt/yLUuyqaCRUvnIsGE3qR+dOws SlYVxfX3DhOvr+oPlqQ4zISSUm/awMlTxnw/cmojhxFMzlGqdOmcEP6/47oa8U2og+jx vXob4+bNCmF9XoBlRD0EGa6KGRnKDEaDpbxBujheuWRMuHxnceL7XXYLWgDZnnoZVBPU hgpLUrjbFe+452AdUNT1DdZSJa/NDd+hug4pGvw2BcRdKgNchVRYzipAsQvLwQDe7NNS wbkw== 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:in-reply-to :references; bh=znNWD4c7xwHHzdKt+r4w+sW2qQCB/x6+Cp4Db3nfkDE=; b=tdaxwiId4luTpC8GXWcEuTsvTd5zGmVPiDZYFEuiU5efd2P41RklJbgkUx4alEOQVU 6GUjAZe9p4zNmp8C6LD+unoGrHtnGL2URKiEHj31aEWfTtEY9RrPmCJp8uHN3onBpo6N EoQ1JzzZ58Gw/wywbQGfNw+AW9jZ1W93bTA/l1M2rFzRpU5kpDr872c/iCdqi3CMDLpY a09C5fr8AINemUS+QG8mIj1diopwSGHtdhxdJtU+Muu5bgYVsMtumaJKoASTf3sg2+Xv htP2gGGDlSHt8ou7pj5XaSaGikoXOPlsnxCgGD2XkVu7XHXDsKqVxEoJ6Mu/UXUMbr9m i/Jw== X-Gm-Message-State: APzg51BFl26RQDzmXwCPFws49ZA9XqtBBCmWbzCQkiVHhUJmQ3wCm7U2 ir22fL42qHIUIXw/wZD5EbM= X-Google-Smtp-Source: ANB0VdZuXnaUMR0j5QPHrOlZECbitDpFtxY1nXAYEg80kpo4MiZSe5qr0nk3dEhEG6VGCPHu5ajrlA== X-Received: by 2002:a1c:48d:: with SMTP id 135-v6mr2082908wme.106.1535643921740; Thu, 30 Aug 2018 08:45:21 -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.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Aug 2018 08:45:21 -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 02/30] mfd: Kconfig: Remove MFD_SUN4I_GPADC config option Date: Thu, 30 Aug 2018 17:44:50 +0200 Message-Id: <20180830154518.29507-3-embed3d@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180830154518.29507-1-embed3d@gmail.com> References: <20180830154518.29507-1-embed3d@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180830_084535_168875_DDF7DD0C X-CRM114-Status: GOOD ( 12.90 ) 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 We are merging the mfd:sun4i-gpadc driver into the iio/adc/sun4i-gpadc driver. So we need to remove the MFD_SUN4I_GPADC config option. Signed-off-by: Philipp Rossak --- drivers/mfd/Kconfig | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index b860eb5aa194..c7ab57d65610 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig @@ -40,23 +40,6 @@ config MFD_ACT8945A linear regulators, along with a complete ActivePath battery charger. -config MFD_SUN4I_GPADC - tristate "Allwinner sunxi platforms' GPADC MFD driver" - select MFD_CORE - select REGMAP_MMIO - select REGMAP_IRQ - depends on ARCH_SUNXI || COMPILE_TEST - depends on !TOUCHSCREEN_SUN4I - help - Select this to get support for Allwinner SoCs (A10, A13 and A31) ADC. - This driver will only map the hardware interrupt and registers, you - have to select individual drivers based on this MFD to be able to use - the ADC or the thermal sensor. This will try to probe the ADC driver - sun4i-gpadc-iio and the hwmon driver iio_hwmon. - - To compile this driver as a module, choose M here: the module will be - called sun4i-gpadc. - config MFD_AS3711 bool "AMS AS3711" select MFD_CORE From patchwork Thu Aug 30 15:44:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Rossak X-Patchwork-Id: 10582169 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 2661E14BD for ; Thu, 30 Aug 2018 15:52:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 154802C0BC for ; Thu, 30 Aug 2018 15:52:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 07E142C0DC; Thu, 30 Aug 2018 15:52:33 +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=ham 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 9E7F32C0BC for ; Thu, 30 Aug 2018 15:52:32 +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:References: In-Reply-To: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:List-Owner; bh=Z5RV8tzmDx4tyJxAOHOlj0Ke0Kn1wndUFoUBQ3IEC2Y=; b=WfTt9Mxid/EzAL5AdR8OITPa/0 41gSGN8b786NmWD7OYzFeP05K3BbFb/6VcI0kEeF6045OvlpkuVC9qePSXlvWC4vB/auekT3Fkxoo 77revW5qDi/3FRIbDapTSuQfFacSeX1cI7ZtRnFwoyoR15M8FWVh+b1OH9DYFvwhCt5AGUfckpbcU WBsZPoLXm0OW8DwDy8CEJPD7/tF1mOm+RaL8euDxxE6m/DQI1PEuWzApT80oGjAxFzGa+5VfmTBKG 8zijnn/qMur5WoIZiG2EZLMK7pR8m7lC/phFn79OyOm0TueZhIUHJ3w/Gpwhi3qelSjilcE7VZSRU 5BpahhKA==; 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 1fvPFA-0005aJ-1T; Thu, 30 Aug 2018 15:52:24 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fvP8Z-0001a9-Fy for linux-arm-kernel@lists.infradead.org; Thu, 30 Aug 2018 15:45:40 +0000 Received: by mail-wr1-x444.google.com with SMTP id v90-v6so8528153wrc.0 for ; Thu, 30 Aug 2018 08:45:23 -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:in-reply-to:references; bh=eOlesON9JEbI3RiqZ3yU2XvULXMLDkhbr+tAcyHX1jI=; b=Nq1+ke7O/3ya6/cyzzgBbnofTTSbq4B8nYtp63N3AU68AKwaR+lq1bS44T09X84raD ogLjL22wB1uB1eCKw8HIgJghhEU7FBsguP8qW1kJ1mOOGfS11dpuJPWvStDCuVkmTezB DlDGNdk0GTnDOkz+XmzpDaZKGq99jrzNBZELlDXGiYtSgib2Fon8jvJRejlIT7had5RP LA1EZpPD43sEqxtM6Zt1+jirAzGcTTpCXZ5LW9Dn+U95rVDwdhqpQQw4SdwrjzqVGQPk Sv3HjM19hXRbosqiSPdFLauT3y/FOsKHLmlkgXBnlC/vN9kzRkSyc0AI1/eq92t2ZC5W fMuw== 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:in-reply-to :references; bh=eOlesON9JEbI3RiqZ3yU2XvULXMLDkhbr+tAcyHX1jI=; b=rhnnu8kF6VCt5yXgpDa7ckX1sop2L0cLAzpVtraf9QQ96eIsBn+BAWNRxhsBbkEEv3 LceswU1QxLfCbV+ccxd/rn6KtbmfsrcJtpfYp+KxuiJFPp20t6hrKCAS93xintZWPKYF +DcHs7VxXSYqAiTD3JQR/mAj9gbVZwsVP7f+yfvtDVcFZy3CzKk720E3u3QhrDtx1xjL FiYV8ei1rDsYJyqOab635nN6cNEuz5b12VJpnG7LYiujKNm9+gYoctepz8qN7RTADArx UYVW+r4MB7Hbo7mhggo/o8ypTSJ5i4rL+jKSuKj8CT52KiibJpdSroXepjaW/qOSlmwf kcZA== X-Gm-Message-State: APzg51BKr2AL9f8ZPIwFZ32EU607/0xGVP/RkWs3wTTvwuAXrt3+Tvpf xG60+/OJxp6NmTkt1kWNW+c= X-Google-Smtp-Source: ANB0VdZydzVwlgmNC9jd6c1kvxIV3So3eSC9twIoJ2AGHHYmBHN7Vik0oavzqD6xr/AuRK25jSD16Q== X-Received: by 2002:adf:8504:: with SMTP id 4-v6mr7768377wrh.72.1535643922732; Thu, 30 Aug 2018 08:45:22 -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.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Aug 2018 08:45:22 -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 03/30] iio: adc: Remove ID table Date: Thu, 30 Aug 2018 17:44:51 +0200 Message-Id: <20180830154518.29507-4-embed3d@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180830154518.29507-1-embed3d@gmail.com> References: <20180830154518.29507-1-embed3d@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180830_084535_564936_7D03F4A1 X-CRM114-Status: GOOD ( 12.86 ) 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 To disable the driver we are removing the compatibles. Signed-off-by: Philipp Rossak --- drivers/iio/adc/sun4i-gpadc-iio.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/drivers/iio/adc/sun4i-gpadc-iio.c b/drivers/iio/adc/sun4i-gpadc-iio.c index 04d7147e0110..d95dd0fde2a6 100644 --- a/drivers/iio/adc/sun4i-gpadc-iio.c +++ b/drivers/iio/adc/sun4i-gpadc-iio.c @@ -698,21 +698,12 @@ static int sun4i_gpadc_remove(struct platform_device *pdev) return 0; } -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 }, - { /* sentinel */ }, -}; -MODULE_DEVICE_TABLE(platform, sun4i_gpadc_id); - static struct platform_driver sun4i_gpadc_driver = { .driver = { .name = "sun4i-gpadc-iio", .of_match_table = sun4i_gpadc_of_id, .pm = &sun4i_gpadc_pm_ops, }, - .id_table = sun4i_gpadc_id, .probe = sun4i_gpadc_probe, .remove = sun4i_gpadc_remove, }; From patchwork Thu Aug 30 15:44:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Rossak X-Patchwork-Id: 10582153 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 05421920 for ; Thu, 30 Aug 2018 15:49:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E58182BDD0 for ; Thu, 30 Aug 2018 15:49:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D8CDC2BDF6; Thu, 30 Aug 2018 15:49:31 +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=ham 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 894142BDD0 for ; Thu, 30 Aug 2018 15:49:31 +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:References: In-Reply-To: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:List-Owner; bh=kU1I/6+YmLfk549mEQVI81cwZkGmdnbvztgMlIjf1CY=; b=n8mSrndU9NtzrM/nZrj7Z8MLi1 e1w527hgqtByd/npgAmcwVKlKAROb6WCwKaogK/kD0pzoHgK8KpAV3u4lGvupbOCI6ppgk7BzfzHh 8f20X5b1AhD1IXy/PC3AnXhEQ2XSjhnnNAxGHzxpHLvmLNO4Z2ZLO+IvbIHVO3Bo9P9pKvUzk4ISl Cc54e7lJxmzDQl4KQ5Ujeo6Pfbxju98wrb214zuFF3M/9waLEUKr4uQDXOvokCoCU6IgMs20Ka8Rq KHBTkn1ZgbHevWhN7Cp0sfD653CpKJATfp5/xTNRkMnWUOQJ7YyvvEMc4g6JO6sXH9dyVh3DNEJax F040YA4A==; 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 1fvPCD-00033H-AD; Thu, 30 Aug 2018 15:49:21 +0000 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fvP8Y-0001aA-3b for linux-arm-kernel@lists.infradead.org; Thu, 30 Aug 2018 15:45:37 +0000 Received: by mail-wr1-x443.google.com with SMTP id n2-v6so8510009wrw.7 for ; Thu, 30 Aug 2018 08:45:24 -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:in-reply-to:references; bh=tHWKgVQ+LP5A64YbmsQPQ4TQy6BjNkjDuA1WjJuVxFc=; b=jm1AAAVuPY9EOrIexteon5sSq6w2VUiphdwBnzPsfyVT6LIAk9QR/qg4M1GELtOviP prOerDSGFrglpAQ8GjsmboVORQgKaEWyNqhlzrNm4FEd8p5IshSNYuWrWDJmiLfL57BO meRhdxxGdTx2glX5HXepaEwqTUj+IeAL3vth3OQlmQel6DitQYhA//5Gc4sJhMecLpIS 3uVbJr/k4HC0yGome2RNhFF+lwOd/kvDzLiV3EnULya0ns/Sz7KFrljAjL9dpZBu+vtt kZKwnMYc+i7KJfFswbxm9PdJJoZBTCyOddwFkbmcqK72Hrfni/4896lbD4bUTV6QXhDs NCug== 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:in-reply-to :references; bh=tHWKgVQ+LP5A64YbmsQPQ4TQy6BjNkjDuA1WjJuVxFc=; b=GHtB/fOjpf1JfYkMDA8MjuCgWAxFnaFk7OBt5chTVPQKJusgH5EbeZ0W1ZmgxnrbmR J5zkWb2n0MHMxDI2d1pueyLCSoQoq3UJzl8B7UHeeFD8/gg5sfkbDduMH3kWrOcK67Pn KGa3tEz8YbtcMrKxhiq+0DdlZDYwm6a9cKkyFbPoqf7o67pQ9Fp4d56AYqtU+bZ2H351 UIi3Q6r468cGI7l4AA1wblktGr1I052ong89fMq+Tky0QEQZgGGvI6ErLqRq0r26WMih ot50cWy4xX84rWMv050puUm28WkerdbqDxs91JzBd+nTKveh3APxDTOK+hYuh9Eo6e13 gRRA== X-Gm-Message-State: APzg51BHTc01f3nyi00UmoQdzL+K4Twg5AkzXssW22DFAWeu+OCf3hgE LkJtzjQJXCujbQOvbrRAGdw= X-Google-Smtp-Source: ANB0VdbABIGLqoYMoOjdStNEiEpxSnI4a5wV60mvWIm2iY431vbsOeGYB+GEp93JCTnxaB51r0mu5Q== X-Received: by 2002:a5d:6243:: with SMTP id m3-v6mr8147675wrv.179.1535643923775; Thu, 30 Aug 2018 08:45:23 -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.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Aug 2018 08:45:23 -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 04/30] iio: adc: Kconfig: Update Kconfig to new build options Date: Thu, 30 Aug 2018 17:44:52 +0200 Message-Id: <20180830154518.29507-5-embed3d@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180830154518.29507-1-embed3d@gmail.com> References: <20180830154518.29507-1-embed3d@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180830_084534_164745_7F7B4752 X-CRM114-Status: GOOD ( 13.68 ) 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 Since we are merging the mfd driver into the iio adc driver we need to update the Kconfig build options. Signed-off-by: Philipp Rossak --- drivers/iio/adc/Kconfig | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig index 9da79070357c..5d0cffd6d2e4 100644 --- a/drivers/iio/adc/Kconfig +++ b/drivers/iio/adc/Kconfig @@ -713,13 +713,16 @@ config STX104 array module parameter. config SUN4I_GPADC - tristate "Support for the Allwinner SoCs GPADC" + tristate "Allwinner sunxi platforms' GPADC/Thermal driver" + select REGMAP_MMIO + select REGMAP_IRQ depends on IIO - depends on MFD_SUN4I_GPADC || MACH_SUN8I - depends on THERMAL || !THERMAL_OF + depends on ARCH_SUNXI || MACH_SUN8I + depends on THERMAL && THERMAL_OF help Say yes here to build support for Allwinner (A10, A13 and A31) SoCs - GPADC. This ADC provides 4 channels which can be used as an ADC or as + GPADC or newer SOCs (A33, H3, A83T, ...) Thermal sensor driver. + This ADC provides 4 channels which can be used as an ADC or as a touchscreen input and one channel for thermal sensor. The thermal sensor slows down ADC readings and can be disabled by From patchwork Thu Aug 30 15:44:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Rossak X-Patchwork-Id: 10582133 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 5A27617DE for ; Thu, 30 Aug 2018 15:47:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4599C2C0B0 for ; Thu, 30 Aug 2018 15:47:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 384372C0B2; Thu, 30 Aug 2018 15:47:48 +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=ham 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 BCCD02C0B0 for ; Thu, 30 Aug 2018 15:47:47 +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:References: In-Reply-To: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:List-Owner; bh=rdbkHR6g2PjVg8qk3BSFT/lMHe/+QLXQOsZ6o048fvU=; b=AjiFYLe8u3wsJqpeu8zn4Y8M/t 0T9XLYq0Nr2+Ld1+ODDFad2+n5T9bOKw5Ix6IC92JOL84aJjJZDZ+FJ//BHFERHpMopcQ43KgI5W1 Pui77my1PRRqtkFzCUM2MCohGfcImWpcYd08B+IRmhcjtldfsoA02W+AaF+TQ4JJ75rvNqBckt9As QDCTnSWBXQ+N2M0lwBKKU4QpAcvknZ/FfC+yEfmTAH+WRykpd2XINeNvkGPJN5ZwImeGPRqBecTGQ NcsqJNigZ87+Ux430MH/foHg9DACUwRGgzl5ySivdwXVi9NJpmCv9uo2hVVCxYjuGzcjw7McDGdPW udp84QTQ==; 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 1fvPAZ-0002Rx-1j; Thu, 30 Aug 2018 15:47:39 +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-0001aC-5H for linux-arm-kernel@lists.infradead.org; Thu, 30 Aug 2018 15:45:37 +0000 Received: by mail-wm0-x243.google.com with SMTP id y2-v6so2485701wma.1 for ; Thu, 30 Aug 2018 08:45:25 -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:in-reply-to:references; bh=c6Ey3Xe6CN/vhTyJgfjyN2P4uA8psZ12lezphNsl3O8=; b=WT2aLqwbvZWYRL1x96iSTzU+B4CACYgVizEDuSTCdgumBQ2wlbmQC+50S6MwT29d0p O/8kqtcyg8In7OQH5WzkOu3UBR+PhFZth9mUoNsViY0Nt/bJxxqZgEsa0b5mFkdR8J4f wC0dT1XNeCWc0HDsfXOKuzZp0sqPMxguf6bNYS2J3YoFtr0KUmKlT/Ao7sQmz1Jz3nOe 9pAr2pPxwEtMJ10GrdDl8AcOaYlpx7aaAbj+MAGrGPxPH1lAEU61kQZTTtaoXmuc3u0Z nRc3HEtT/oQ3y9Png8XVbSe2BAoFYc0OoFg7RMFXYrVbcsbbrlrJG4lgSntS4BQrdtBF EHcw== 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:in-reply-to :references; bh=c6Ey3Xe6CN/vhTyJgfjyN2P4uA8psZ12lezphNsl3O8=; b=fty94wZSsQKHKhW/v/QbEiiBctdDQBbtQQEHyJZQLH6Op/fB95g3t/YlG1jLrgnhAZ nRS5KZFzfackcfGPvxJ7JTMG1nImExMXh2KjqfyJGrmIr76bBRQtnYeFNQurz5YqEZNc YiW4cNN4jF1wWoSwbsJFpGMepbr3sHONn4WDa2TFftcfqKJJpXZGgWEj7hTGhv6JaVF1 OxiQNA6tpdyPKLyXGLJsgLmBtTQ6bAAJRrtU4zav3hHj3vMfseaEl051VuZZltGP7ngv B3rKe5Grbcj6LaOj9nhJ6JH8vuiv9DvogQ5bWXlTIZzBl8Z2HR2aE8VcVf5K/L2Q2caG EToA== X-Gm-Message-State: APzg51Cc5fVWud5JD/jyrVm+n8kvV/o1FLKZq34EzvI+chAAXqj95A9Y qLEVwX9TuaBoIBpQm7rXD/M= X-Google-Smtp-Source: ANB0VdY0ssrNPLY2K5WNdfkiCKFiZwOWX1cXOMfVV1gHhZ+53D8544pYl1mtXuXsbZORGEEy6PQmcw== X-Received: by 2002:a1c:1f48:: with SMTP id f69-v6mr2113339wmf.152.1535643924712; Thu, 30 Aug 2018 08:45:24 -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.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Aug 2018 08:45:24 -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 05/30] iio: adc: move SUN4I_GPADC_CHANNEL define to header file Date: Thu, 30 Aug 2018 17:44:53 +0200 Message-Id: <20180830154518.29507-6-embed3d@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180830154518.29507-1-embed3d@gmail.com> References: <20180830154518.29507-1-embed3d@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180830_084533_249520_0864B08F X-CRM114-Status: GOOD ( 13.03 ) 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 We are moving the SUN4I_GPADC_CHANNEL define to the header file. Signed-off-by: Philipp Rossak --- drivers/iio/adc/sun4i-gpadc-iio.c | 9 --------- include/linux/mfd/sun4i-gpadc.h | 9 +++++++++ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/iio/adc/sun4i-gpadc-iio.c b/drivers/iio/adc/sun4i-gpadc-iio.c index d95dd0fde2a6..666329940e1e 100644 --- a/drivers/iio/adc/sun4i-gpadc-iio.c +++ b/drivers/iio/adc/sun4i-gpadc-iio.c @@ -109,15 +109,6 @@ struct sun4i_gpadc_iio { struct device *sensor_device; }; -#define SUN4I_GPADC_ADC_CHANNEL(_channel, _name) { \ - .type = IIO_VOLTAGE, \ - .indexed = 1, \ - .channel = _channel, \ - .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \ - .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ - .datasheet_name = _name, \ -} - static struct iio_map sun4i_gpadc_hwmon_maps[] = { { .adc_channel_label = "temp_adc", diff --git a/include/linux/mfd/sun4i-gpadc.h b/include/linux/mfd/sun4i-gpadc.h index 139872c2e0fe..54c7c9375c1b 100644 --- a/include/linux/mfd/sun4i-gpadc.h +++ b/include/linux/mfd/sun4i-gpadc.h @@ -90,6 +90,15 @@ /* 10s delay before suspending the IP */ #define SUN4I_GPADC_AUTOSUSPEND_DELAY 10000 +#define SUN4I_GPADC_ADC_CHANNEL(_channel, _name) { \ + .type = IIO_VOLTAGE, \ + .indexed = 1, \ + .channel = _channel, \ + .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \ + .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ + .datasheet_name = _name, \ +} + struct sun4i_gpadc_dev { struct device *dev; struct regmap *regmap; From patchwork Thu Aug 30 15:44:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Rossak X-Patchwork-Id: 10582089 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 1532814BD for ; Thu, 30 Aug 2018 15:45:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 04ABE2C0AB for ; Thu, 30 Aug 2018 15:45:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ED0572C0AE; Thu, 30 Aug 2018 15:45:48 +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=ham 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 220432C0AB for ; Thu, 30 Aug 2018 15:45:48 +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:References: In-Reply-To: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:List-Owner; bh=ANEi/56SfasDkXpoJIDjUAp3zyvJz4MSWx3UgShO1ic=; b=Yr92Wttcb4xEykEbox6/63kC4t Z9dAmDfdOdJzOivcYaAxkq+rCV+XMNZFE48nW1YoU8ThVuNwLf5hEfXlmi8dMF7CWAV79csen8Odn gMW0i3DqTwtiBzpugtA/73rejR3/iXOW2CmyDPa7KRDAIj3w6umFfOydZeG+cqQ72BHKLV3m0YXJI RqH2bV3RATgCSiqNhafFN5F+we/oaTL5sjveGWhtLG4MOS9wEvHJdXzqXKfiH7+cMAA0XfmWjK172 Wj/DTbdtaMVs62gGtGIUR7zUp3x7mhMY0oKGjGjdsprhVj57Zy5KyOCapVVBhho07xvQDoDEh9dM0 +yh2BTcA==; 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 1fvP8b-0001fN-AV; Thu, 30 Aug 2018 15:45:37 +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-0001aI-5I for linux-arm-kernel@lists.infradead.org; Thu, 30 Aug 2018 15:45:34 +0000 Received: by mail-wm0-x243.google.com with SMTP id t25-v6so2495914wmi.3 for ; Thu, 30 Aug 2018 08:45:26 -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:in-reply-to:references; bh=C/2oeBXZG2toeVaxCNErDpJ78AmhA9HYwAbujF41JBk=; b=HRuOW3x+mL/ZvNRvFqJCIIeFQQNu9h/tJfKgB5v3MbBkDgBtiof62xHrmjNnc7pYqM iTmH5yX5OTmpd7WIYd2t0hm1AfJfJvvOpii7hA6Wv2/PWlQ9cqlCMLulmuinfmcFv+RI FIT2tBUcQUgWT9yDCNYl6zr2GmD6DCH9H2L4zUOXIIs8fJ9AvVTym/37wuYHDGtPZbVK RZ8zZMjrAKBIetYy4PLEIcqAI+bs3IzgFq0l2awbp4HQ9fJGd+oNltqacQQtJrgh0fcq 3agh3monCyBTiiB8J8OKohDiQND+UWp9FKkwTBMYLSKctOwVxhFnING93jk6AhWF8HiD pqcw== 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:in-reply-to :references; bh=C/2oeBXZG2toeVaxCNErDpJ78AmhA9HYwAbujF41JBk=; b=FNP43UOiRmIvziV+KsMgSI9yv5i8dTU2gow80VE/RrubVYULMYbJ7rtImyY/hTMq9u HiHhrnkT4otSr8WQS9sZlMy5NYBs54o7qk0Pa+DY7oIbwWIdcoZVjo05G07BPQyzu2LB CYZouMy9BJPFL4JFiKEkkrX5suW0CU+FXigkFwj2pAn6Frk8XHPRw1FXatBs4AJTQHOT RbcyicuR6tsf6GtF/fVUCvOaC7tnjXCbycAgaRrbMGlS1EWMM9Erd1vPK91A+iGevA9Q Hnok1rJ/RPKlbHTZCqF8e2BU0MHf3EdcbNowti9QaAO7yH/wruFH/TPhk467iGVImEHO dn/w== X-Gm-Message-State: APzg51C5uwfE/v3fsVd5iJGYFXGhm/BafiDYhR2WfttwOPcficoITlsC YLar+coaldK/mgAq26UXAwI= X-Google-Smtp-Source: ANB0VdY5OJC4oBNA4YlKI1hMCWl+v+fAxR7nO0Q/xPnW4zGhwma0BGpFRT3R5qxowVxN+zetieEcrw== X-Received: by 2002:a1c:64c:: with SMTP id 73-v6mr2090110wmg.7.1535643925668; Thu, 30 Aug 2018 08:45:25 -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.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Aug 2018 08:45:25 -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 06/30] iio: adc: remove ofnode options Date: Thu, 30 Aug 2018 17:44:54 +0200 Message-Id: <20180830154518.29507-7-embed3d@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180830154518.29507-1-embed3d@gmail.com> References: <20180830154518.29507-1-embed3d@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180830_084533_249484_0C0FED3C X-CRM114-Status: GOOD ( 13.21 ) 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 Since we are merging the mfd dirver into the adc driver we don't need two different probing functions. Thus we remove the ofnode options Signed-off-by: Philipp Rossak --- drivers/iio/adc/sun4i-gpadc-iio.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/iio/adc/sun4i-gpadc-iio.c b/drivers/iio/adc/sun4i-gpadc-iio.c index 666329940e1e..d6f00d3b802d 100644 --- a/drivers/iio/adc/sun4i-gpadc-iio.c +++ b/drivers/iio/adc/sun4i-gpadc-iio.c @@ -622,10 +622,7 @@ static int sun4i_gpadc_probe(struct platform_device *pdev) indio_dev->info = &sun4i_gpadc_iio_info; indio_dev->modes = INDIO_DIRECT_MODE; - if (pdev->dev.of_node) - ret = sun4i_gpadc_probe_dt(pdev, indio_dev); - else - ret = sun4i_gpadc_probe_mfd(pdev, indio_dev); + ret = sun4i_gpadc_probe_dt(pdev, indio_dev); if (ret) return ret; From patchwork Thu Aug 30 15:44:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Rossak X-Patchwork-Id: 10582175 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 3298014BD for ; Thu, 30 Aug 2018 15:54:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 207692C0E2 for ; Thu, 30 Aug 2018 15:54:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 132072C0E9; Thu, 30 Aug 2018 15:54:06 +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 966AF2C0E2 for ; Thu, 30 Aug 2018 15:54:05 +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:References: In-Reply-To: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:List-Owner; bh=a6b9ak5frcHwrrsuTmiInaSpGkiTomMYrbEFJmiotGE=; b=SmJlUEaVxejyTLqyK5DFK4cVn/ Q2QSyr++yRlQQlZJf4QTgUqTbCq7tRhP199oBuEp+0KvB7lahmDzwITCbHB3F0n197dPStjoqD29t zJKSkXDOq9yOO/EAiuyPzFAIwNDVgl7ZT7yRAPb/YbrkcWD/hBcM8je+/xOhHIxbog7X+5CBhjprA /WxIjM4ygyJEkvYQeQa/lA4Vb64moVHY6YN64jotYzRRueWVuphNE7xMLDYm4sPQKBP2HZc3gNt23 OXBSHQUXkqrs3bcB7Niq1zl3kiw3vSq94bKm/L1VxTzhWQiz8J1h1EYMGTNC3kl6yH0GvN64GEKXm Zju04Rzg==; 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 1fvPGf-0006Dy-QY; Thu, 30 Aug 2018 15:53:57 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fvP8Z-0001af-G0 for linux-arm-kernel@lists.infradead.org; Thu, 30 Aug 2018 15:45:41 +0000 Received: by mail-wr1-x444.google.com with SMTP id n2-v6so8510163wrw.7 for ; Thu, 30 Aug 2018 08:45:27 -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:in-reply-to:references; bh=tFfQ9c8YXGxQQwqrjR6oys9dfg5aGNdXZejyyuPf1vg=; b=YnVLxEatWQEYx0jHq0IAvzD9z53G/4ynMvpPRtxkaxEI3G1r7xDvs4lBRl8BKK8sVC D5/DAi1jGWwWcEyBNzp2KrXMslYIwz/nCM/rpdE77V3LZ+YVPFOs8xrO6jvk/axBNTTw MkKG3wT8DM5RE9G3TSon4Jf/EwCE1MGW4cJblbzEUbgBxcJrZYnTGlhzAx5o97g4csS/ 6ctjYf3028zCgUg9aOdMQrqIudXpw4GRZzkp9JzOry0Hkx4XDWR4vMbEIfnI+BuoyGGp A1UfSjhlocjJ3Pad4GikQ/RED085n+gCm7azaCschaGpWhG+I6cg5GmnV1VqBGAWMNQn qEoA== 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:in-reply-to :references; bh=tFfQ9c8YXGxQQwqrjR6oys9dfg5aGNdXZejyyuPf1vg=; b=ENMRe8t4HfFFLLrRT1LKgbmeEaWgrk+kqD/RnVWU4HZy6IpR5JAZrcK5BRaWgTjGEL MDqaCdoP/E0+ncnvI0FMlTk9RcKO+gy+XeUL2iE+kzA+CnbymMtF4BlZGgamOf0oc7uh e3p5y2oG+tWT1oqSEI6GUeeH80blQnwi3X8Tke2HzE8dZ3fsucXY/phCD+5RpAo5Ki1s d1OP4A/klO7dXl/dO5BjTOj526Y9yv3a0w7TI9yZzfYQuOygMDRB05mvPSzrDBiPZAZ6 RiYLE9UJBEGJnMhEsPW0F6l6NEw+O05/cQ+zljh6IERksoAhAJXmg06cT1qVfWT5Fc/Q c5xg== X-Gm-Message-State: APzg51BR519ogGMpIvatopDdbv+CUpSHmErQ9NQjWlr5Ut75//LyrrTB 8Q1bYaGlFzWDHt9yK0t/aA0= X-Google-Smtp-Source: ANB0Vda7gM6oXRTKYIaCexUkUiShe9Jn2An6YoMbuiIqmF7diafLDl42iCOez3qQIYf63qK/9HpN2A== X-Received: by 2002:a5d:4512:: with SMTP id s18-v6mr8486837wrq.82.1535643926751; Thu, 30 Aug 2018 08:45:26 -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.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Aug 2018 08:45:26 -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 07/30] iio: adc: remove mfd_probe & sunwi_irq_init function Date: Thu, 30 Aug 2018 17:44:55 +0200 Message-Id: <20180830154518.29507-8-embed3d@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180830154518.29507-1-embed3d@gmail.com> References: <20180830154518.29507-1-embed3d@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180830_084535_574921_87D8634F X-CRM114-Status: GOOD ( 19.16 ) 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 In the previous commit we removed the function call, now we remove the unused functions. Signed-off-by: Philipp Rossak --- drivers/iio/adc/sun4i-gpadc-iio.c | 126 -------------------------------------- 1 file changed, 126 deletions(-) diff --git a/drivers/iio/adc/sun4i-gpadc-iio.c b/drivers/iio/adc/sun4i-gpadc-iio.c index d6f00d3b802d..f787442a9e5f 100644 --- a/drivers/iio/adc/sun4i-gpadc-iio.c +++ b/drivers/iio/adc/sun4i-gpadc-iio.c @@ -431,55 +431,6 @@ static const struct dev_pm_ops sun4i_gpadc_pm_ops = { .runtime_resume = &sun4i_gpadc_runtime_resume, }; -static int sun4i_irq_init(struct platform_device *pdev, const char *name, - irq_handler_t handler, const char *devname, - unsigned int *irq, atomic_t *atomic) -{ - int ret; - struct sun4i_gpadc_dev *mfd_dev = dev_get_drvdata(pdev->dev.parent); - struct sun4i_gpadc_iio *info = iio_priv(dev_get_drvdata(&pdev->dev)); - - /* - * Once the interrupt is activated, the IP continuously performs - * conversions thus throws interrupts. The interrupt is activated right - * after being requested but we want to control when these interrupts - * occur thus we disable it right after being requested. However, an - * interrupt might occur between these two instructions and we have to - * make sure that does not happen, by using atomic flags. We set the - * flag before requesting the interrupt and unset it right after - * disabling the interrupt. When an interrupt occurs between these two - * instructions, reading the atomic flag will tell us to ignore the - * interrupt. - */ - atomic_set(atomic, 1); - - ret = platform_get_irq_byname(pdev, name); - if (ret < 0) { - dev_err(&pdev->dev, "no %s interrupt registered\n", name); - return ret; - } - - ret = regmap_irq_get_virq(mfd_dev->regmap_irqc, ret); - if (ret < 0) { - dev_err(&pdev->dev, "failed to get virq for irq %s\n", name); - return ret; - } - - *irq = ret; - ret = devm_request_any_context_irq(&pdev->dev, *irq, handler, 0, - devname, info); - if (ret < 0) { - dev_err(&pdev->dev, "could not request %s interrupt: %d\n", - name, ret); - return ret; - } - - disable_irq(*irq); - atomic_set(atomic, 0); - - return 0; -} - static const struct of_device_id sun4i_gpadc_of_id[] = { { .compatible = "allwinner,sun8i-a33-ths", @@ -523,83 +474,6 @@ static int sun4i_gpadc_probe_dt(struct platform_device *pdev, return 0; } -static int sun4i_gpadc_probe_mfd(struct platform_device *pdev, - struct iio_dev *indio_dev) -{ - struct sun4i_gpadc_iio *info = iio_priv(indio_dev); - struct sun4i_gpadc_dev *sun4i_gpadc_dev = - dev_get_drvdata(pdev->dev.parent); - int ret; - - info->no_irq = false; - info->regmap = sun4i_gpadc_dev->regmap; - - indio_dev->num_channels = ARRAY_SIZE(sun4i_gpadc_channels); - indio_dev->channels = sun4i_gpadc_channels; - - info->data = (struct gpadc_data *)platform_get_device_id(pdev)->driver_data; - - /* - * Since the controller needs to be in touchscreen mode for its thermal - * sensor to operate properly, and that switching between the two modes - * needs a delay, always registering in the thermal framework will - * significantly slow down the conversion rate of the ADCs. - * - * Therefore, instead of depending on THERMAL_OF in Kconfig, we only - * register the sensor if that option is enabled, eventually leaving - * that choice to the user. - */ - - if (IS_ENABLED(CONFIG_THERMAL_OF)) { - /* - * This driver is a child of an MFD which has a node in the DT - * but not its children, because of DT backward compatibility - * for A10, A13 and A31 SoCs. Therefore, the resulting devices - * of this driver do not have an of_node variable. - * However, its parent (the MFD driver) has an of_node variable - * and since devm_thermal_zone_of_sensor_register uses its first - * argument to match the phandle defined in the node of the - * thermal driver with the of_node of the device passed as first - * argument and the third argument to call ops from - * thermal_zone_of_device_ops, the solution is to use the parent - * device as first argument to match the phandle with its - * of_node, and the device from this driver as third argument to - * return the temperature. - */ - info->sensor_device = pdev->dev.parent; - } else { - indio_dev->num_channels = - ARRAY_SIZE(sun4i_gpadc_channels_no_temp); - indio_dev->channels = sun4i_gpadc_channels_no_temp; - } - - if (IS_ENABLED(CONFIG_THERMAL_OF)) { - ret = sun4i_irq_init(pdev, "TEMP_DATA_PENDING", - sun4i_gpadc_temp_data_irq_handler, - "temp_data", &info->temp_data_irq, - &info->ignore_temp_data_irq); - if (ret < 0) - return ret; - } - - ret = sun4i_irq_init(pdev, "FIFO_DATA_PENDING", - sun4i_gpadc_fifo_data_irq_handler, "fifo_data", - &info->fifo_data_irq, &info->ignore_fifo_data_irq); - if (ret < 0) - return ret; - - if (IS_ENABLED(CONFIG_THERMAL_OF)) { - ret = iio_map_array_register(indio_dev, sun4i_gpadc_hwmon_maps); - if (ret < 0) { - dev_err(&pdev->dev, - "failed to register iio map array\n"); - return ret; - } - } - - return 0; -} - static int sun4i_gpadc_probe(struct platform_device *pdev) { struct sun4i_gpadc_iio *info; From patchwork Thu Aug 30 15:44:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Rossak X-Patchwork-Id: 10582171 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 B7C2614BD for ; Thu, 30 Aug 2018 15:53:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A53512C0E2 for ; Thu, 30 Aug 2018 15:53:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 975B52C0E5; Thu, 30 Aug 2018 15:53:23 +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=ham 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 3EF2C2C0E2 for ; Thu, 30 Aug 2018 15:53:23 +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:References: In-Reply-To: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:List-Owner; bh=MOflCeG1IXTto/o1PJc6m2YhNDkaFL97duU19jeBmjs=; b=AvhadVGDCDFpTRcYNHMErrPHge okOP/O5/sIH/KLEiFtwg23kAG+gsZtanqscAVpszuZ7BVEdsbIYeN0qqUjsX3pMwc+ZwGgh8/JxqN rrw4QJFCzMqi67IG8hnHb6ZL9jGjpvtyDJRmwLWrFMzPoROQmnM732xKbN9rQCD55zhC06ssYTq33 z9sYoqdgLaY7gPaNFxa6+aybMStKjHPo0puXIJI5KUSo0GJOzjkohIe5qgst9y6hs5VzKvygdnm33 H7XqFYxJbDo2tpARo0eM89buJh6nTPgU0RzvgGe5ZSgkhwqcpmk5+YDtdstQGqg9aPxoRbR0kNMMi oeeOdd1w==; 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 1fvPFy-0005w3-MD; Thu, 30 Aug 2018 15:53:14 +0000 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fvP8d-0001am-Bf for linux-arm-kernel@lists.infradead.org; Thu, 30 Aug 2018 15:45:41 +0000 Received: by mail-wm0-x244.google.com with SMTP id n11-v6so2499363wmc.2 for ; Thu, 30 Aug 2018 08:45:28 -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:in-reply-to:references; bh=awFDsrjcpE5oAq0WnCWku0Gz21mtatXT2tD8s1pCm9w=; b=CVRJpklCpNJsCTdg11FncVMkwcUQVQA1BlM9n47a9EIY+R8d0ofPHmS9q1EC0UfDpz H2452z7JiwuolbMoiF3yM8uBLqKqjxwwzTTyYnsXToWWncvcQatk5kdzcjJF3OMmra9u /YVDw+o+2STQj+nJ27FduOkNCuLLMzKbCauXkUMDbKROroYSTPwrubhV+qFrgpXltUrz Lf+9SNEDKW2pq3y4UctwY1h35sbR9XFJ6oOTDaOnH9k7xxBNm8/qHPyi42CBOwMs/i35 hYGEmuv2bPwXDMCze5yzAUgs1ncm+KZ/YCKWY/I5sh27ZeQDdvTS+EgwbaZ6C5fmRax0 cELQ== 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:in-reply-to :references; bh=awFDsrjcpE5oAq0WnCWku0Gz21mtatXT2tD8s1pCm9w=; b=lZw51U2TmCHZv/HOeJwOQwK1JZlCOYXHWxKAxL2LmDbT6ogc+Xnt7dmOIwL+REED9H f6c3EGcupHtfxvg0HOvLgnVBWSbS0ZahEMSifZC24Sg9VRPMj4zKwSSDNVJ4+ei/A3VY VixDQ4i/vn+4MCXV3Yoqv5hTuIlzeL9I15TDH1gPoh2sRd60Nm/q0zDrcX/b0H+tywQc cYJWl3S2aHVwyHk7+U0CpeLvXLHqG11xHf8g5OTpAHjuZeA2DdUo5705kd7XHd0JjPmI IpSaRUyqb4BVEiFNIioI7oMAaqsrIy3yIrPCn/wRtHqrZ9eSFCi9DLNmi5RZIOJOTr3X AzPg== X-Gm-Message-State: APzg51BQimWt61VWaM8NI2Zc2fcXwf+8ahqyrSOD83MAq81uebfakerW Q6RFWjxRT5lfv1ta6q0dIhM= X-Google-Smtp-Source: ANB0VdaiSw2OprTQRSxIQK11FYUAWcbWxEvRfhNWqaQJhP7+j8aNXVGYvRjkqXfQz97UM7mg5BLNIw== X-Received: by 2002:a7b:c096:: with SMTP id r22-v6mr1839371wmh.118.1535643927725; Thu, 30 Aug 2018 08:45:27 -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.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Aug 2018 08:45:27 -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 08/30] iio: adc: remove hwmon structure Date: Thu, 30 Aug 2018 17:44:56 +0200 Message-Id: <20180830154518.29507-9-embed3d@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180830154518.29507-1-embed3d@gmail.com> References: <20180830154518.29507-1-embed3d@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180830_084539_473542_FD70CFFA X-CRM114-Status: GOOD ( 11.70 ) 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 We remove the hwmon structure that was requiered for the mfd driver. Signed-off-by: Philipp Rossak --- drivers/iio/adc/sun4i-gpadc-iio.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/drivers/iio/adc/sun4i-gpadc-iio.c b/drivers/iio/adc/sun4i-gpadc-iio.c index f787442a9e5f..ab474ce86fb6 100644 --- a/drivers/iio/adc/sun4i-gpadc-iio.c +++ b/drivers/iio/adc/sun4i-gpadc-iio.c @@ -109,14 +109,6 @@ struct sun4i_gpadc_iio { struct device *sensor_device; }; -static struct iio_map sun4i_gpadc_hwmon_maps[] = { - { - .adc_channel_label = "temp_adc", - .consumer_dev_name = "iio_hwmon.0", - }, - { /* sentinel */ }, -}; - static const struct iio_chan_spec sun4i_gpadc_channels[] = { SUN4I_GPADC_ADC_CHANNEL(0, "adc_chan0"), SUN4I_GPADC_ADC_CHANNEL(1, "adc_chan1"), From patchwork Thu Aug 30 15:44:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Rossak X-Patchwork-Id: 10582151 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 54BEF14BD for ; Thu, 30 Aug 2018 15:48:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 436B52BDD0 for ; Thu, 30 Aug 2018 15:48:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3772E2BDF1; Thu, 30 Aug 2018 15:48:43 +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=ham 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 A1F1D2BDF6 for ; Thu, 30 Aug 2018 15:48:42 +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:References: In-Reply-To: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:List-Owner; bh=IWtlvHsZnrLpI45/TLzjpetbVJMPVuDwFYzyhLSl2EE=; b=iWcwUy4wJL6fxIdF0WFdDD1eed Cnevw4xd2iWdX9iS5Rq+061bgm2UOY2pi9DJI+xIPD+BON/rvOk/vp5MdpLKTEn1fzIE/aYxWVsDF ClcEqZ/CEx5ljFRNgWoxnH/JX3o/ZZHKrFXpBw+Y5mX5+F3HfmpAZNqW3JfLuPMpFKmvJ7GdP4K2b 9fAWJOIFzg2dO+6selJALRQ6OdgXEPBPhZL0seK2xDofc3QH9/TUkmaqhPsfoVmIBy6RiUJlGAlwb wqls3xkih7iMgc32miGzUfQRuVKOyGuiKt1hKLTFupKA+EXo94j26wO2pk2Rc7+uMsOCS7a3jplgA UcxQKXFg==; 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 1fvPBS-0002mE-87; Thu, 30 Aug 2018 15:48:34 +0000 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fvP8Y-0001as-3N for linux-arm-kernel@lists.infradead.org; Thu, 30 Aug 2018 15:45:37 +0000 Received: by mail-wr1-x443.google.com with SMTP id v16-v6so8505701wro.11 for ; Thu, 30 Aug 2018 08:45:29 -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:in-reply-to:references; bh=5XND9vHjfuJCOwJpFz7zMX/u/hpV4Qa0BGP58J/DvOk=; b=TNWOp0PAQHFrUDVCcHK0c4JtKL0NoAr5sk9Sj+OC0whe1rqb0aWUX2gGlSE0Vm+aMp j5Ti6Sc7JwEFNxgodD1mBSZDfxesQvlBe6cqTSBS8eHPj8NkJ4X6gqUUfC4et2Rih3SR TNVIpnaevlZtr2lMfAVo7sGUg/dvjSfUO3V73cTNsDLBctf2ET2j1nth9a05CdtkdlZ9 o+U/hl+6+3TM83z0q2vQXzMSen+DzFC10If2E2/1lGhCrZP9kSt4ZRiQc+6E2+3Z1nhL KnIXLIcBGl8+0l4QawJdXQeGcIiZFMz6B+Fj9e0HgsLXQ8ELyS0qruBhznyrSX/cTRpp ddKg== 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:in-reply-to :references; bh=5XND9vHjfuJCOwJpFz7zMX/u/hpV4Qa0BGP58J/DvOk=; b=QHDVqsjKzN4tlipIhs7+G3ZnMRUr+4z2VJ71imNFv9ejs+6gsv44P0aF8m7D/yFS7p MD2sbtT+xI0PgS84ZfnuCoMeoRDbCS/iuhXaj10y+qpNrYOeszKnd0v3BDJfPQ0Nxwbg wRqDH1FDDLJtpRGf7l7xe52TM1rTuG8kKm/Qfqg4MSFnvbuKIjgngOEBT+ad34OecCLK tIlc+XSK4SC5cpDB+++eSOHXNYL/0wINW2UnjL7EMI57LbchUo3Ej04FezykrAbv1e0D PcbjP0RG9ypBhIsbpHe6CAO5CZfNXLoPmIxixiFiZ+NyrEmxZuPIJJGgntSFJwIUIcRa vJdw== X-Gm-Message-State: APzg51CP8oItiGJDWf3pEksJsFbKrQI8VqI87MMQa0F82Bq3e1WXOUkF KrO0wwBTKd5GbqoMTKnmxqw= X-Google-Smtp-Source: ANB0VdbimhtaitKvqHvNaGjItKwbG+oI0Tg7BVULZDbnbRdQ/1/LwDiOKY96rI7o/z4NQ0cRTyM6xQ== X-Received: by 2002:adf:e648:: with SMTP id b8-v6mr8388682wrn.254.1535643928697; Thu, 30 Aug 2018 08:45:28 -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.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Aug 2018 08:45:28 -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 09/30] iio: adc: Threat A33 as thermal sensor and remove non thermal sun4i channel Date: Thu, 30 Aug 2018 17:44:57 +0200 Message-Id: <20180830154518.29507-10-embed3d@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180830154518.29507-1-embed3d@gmail.com> References: <20180830154518.29507-1-embed3d@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180830_084534_174425_88848D45 X-CRM114-Status: GOOD ( 12.63 ) 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 We want to use this driver mostly as thermal sensor, that still supports the adc for the older chips, thus we threat the A33 as thermal sensor. We also remove the adc channel without thermal support. Signed-off-by: Philipp Rossak --- drivers/iio/adc/sun4i-gpadc-iio.c | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/drivers/iio/adc/sun4i-gpadc-iio.c b/drivers/iio/adc/sun4i-gpadc-iio.c index ab474ce86fb6..658a7e3e3370 100644 --- a/drivers/iio/adc/sun4i-gpadc-iio.c +++ b/drivers/iio/adc/sun4i-gpadc-iio.c @@ -123,23 +123,6 @@ static const struct iio_chan_spec sun4i_gpadc_channels[] = { }, }; -static const struct iio_chan_spec sun4i_gpadc_channels_no_temp[] = { - SUN4I_GPADC_ADC_CHANNEL(0, "adc_chan0"), - SUN4I_GPADC_ADC_CHANNEL(1, "adc_chan1"), - SUN4I_GPADC_ADC_CHANNEL(2, "adc_chan2"), - SUN4I_GPADC_ADC_CHANNEL(3, "adc_chan3"), -}; - -static const struct iio_chan_spec sun8i_a33_gpadc_channels[] = { - { - .type = IIO_TEMP, - .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | - BIT(IIO_CHAN_INFO_SCALE) | - BIT(IIO_CHAN_INFO_OFFSET), - .datasheet_name = "temp_adc", - }, -}; - static const struct regmap_config sun4i_gpadc_regmap_config = { .reg_bits = 32, .val_bits = 32, @@ -444,8 +427,6 @@ static int sun4i_gpadc_probe_dt(struct platform_device *pdev, return -ENODEV; info->no_irq = true; - indio_dev->num_channels = ARRAY_SIZE(sun8i_a33_gpadc_channels); - indio_dev->channels = sun8i_a33_gpadc_channels; mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); base = devm_ioremap_resource(&pdev->dev, mem); From patchwork Thu Aug 30 15:44:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Rossak X-Patchwork-Id: 10582183 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 13118920 for ; Thu, 30 Aug 2018 15:56:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 004A82C0EA for ; Thu, 30 Aug 2018 15:56:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E5AA82C0EC; Thu, 30 Aug 2018 15:56:14 +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 151B62C0EA for ; Thu, 30 Aug 2018 15:56:14 +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:References: In-Reply-To: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:List-Owner; bh=imHcaHEZyg3vs3PZDWZun3Nn5YEdV84TUeixLnl33G4=; b=H5p08fFUqS1S+mDv8SlvUedbVj gZAuArDT47MCcFGuo890tcgLKys3T/gNKfObdX0S6booqothCeht1k4kd4YaKdqrr8XTOrGnEk0YC XNzJDev7wz36iHuN1yLHRRERoLdDKiA/+iYO95XmLGhCYyayEtCpuj+Dusw1+IrZuZFt5QREhy0Rb TVTU3U0wZ3XQ5+2qi8an+SLWZagWOknKnIxzOMPLq5gDcCGPwFv9zlS8ZTSQJGw2dMBJhQFCtnwQV NrbzuJCkRH0VAk1UQeDjGWvKUfwq5Dfx7vYqjIWqLvvKLGSRMYryPu7hKo/Tmfx3SsbgM/8JNveiv v0ijRmKA==; 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 1fvPIm-0008MW-Te; Thu, 30 Aug 2018 15:56:09 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fvP8f-0001bE-IS for linux-arm-kernel@lists.infradead.org; Thu, 30 Aug 2018 15:45:43 +0000 Received: by mail-wr1-x442.google.com with SMTP id n2-v6so8510312wrw.7 for ; Thu, 30 Aug 2018 08:45:31 -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:in-reply-to:references; bh=mXI7YLqzNDhs6RSyLDcVkfytbFORNGi/mH3nk05eeaE=; b=W5w0iO859tPzJ9JRie5xBabMOuDB9vR2y1RC9nw2fbrYX3KKvTLjLtaua8B1BOM5oz 1hqkpNtJrpqN6tkV1XoO/isRMS1KRZ6nP/M8TIDjs/04BQIO5xgayFNqjk/3gXnvaAYg AoPfbrqzxSrjjrqPfmro+qTy6Jeay0e/cdEpXgSsAgiJijjVuu+C4GfXFi585qN5vCP/ 0KbIyYmj0B39FYw20TduAGUU4PvU3Ii9pY7rhUoZv0Tif8MCerIdGjS6gEzpd/co8ymc g8/BFgxwRsYAWcyB+qKeri1kZeYsQIaHFExXI9SKxIEeC4kkM7VZeXhlXLn8WSLQD/hi UNjQ== 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:in-reply-to :references; bh=mXI7YLqzNDhs6RSyLDcVkfytbFORNGi/mH3nk05eeaE=; b=BJe/uMH2tF6NKihehpwfjwYuRQK7m7G/kPChQj0hkFwsrQg3o6ZmhP5O77ydoksZuP 7g+k8CQLv6IRWFSBk43HbwIKezfsVwYMsBccziFBBShkeomiA9iDDVpPDEy4xqoGkxkx PSoIjc7qVvf9dwI7C72Sg+9mbFLKj9pEYkywpTyGTzH+xnZjN+XnRD4a5WwEpoBwddep os/+Heif+Uo+R8N7THL74R+esSNgpzhaX9yPPRnGBIN72vuEKRKBb/wIfwcRo1kGMshk LTtjuCL92Bat2AtNJZD95xjKaVms/kDoBU5Fd9ffx5/yJCJx8K0KTagd5w+LrgIVkC3z 7Vdw== X-Gm-Message-State: APzg51BHPfHLQ5WZmsJSSDfEl3Rbqn2gYrSHIzKUARG7QvXguEuYOPJH H3RKuhmUXJCUXh02YslDJ8g= X-Google-Smtp-Source: ANB0VdZfMB7UKkMwjYrSKvIHKJU3Z6dtJe9EuPt2DSx7PfyFooItBq5MUBxSu0Jx3vyrYtRtSlBslA== X-Received: by 2002:adf:e30e:: with SMTP id b14-v6mr7914950wrj.158.1535643929706; Thu, 30 Aug 2018 08:45:29 -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.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Aug 2018 08:45:29 -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 10/30] iio: adc: rework irq and adc_channel handling Date: Thu, 30 Aug 2018 17:44:58 +0200 Message-Id: <20180830154518.29507-11-embed3d@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180830154518.29507-1-embed3d@gmail.com> References: <20180830154518.29507-1-embed3d@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180830_084541_717916_19F123F8 X-CRM114-Status: GOOD ( 21.36 ) 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 We rework the irq handling and the adc_channel handling. This is requiered since we merge the mfd driver into the adc driver. Signed-off-by: Philipp Rossak --- drivers/iio/adc/sun4i-gpadc-iio.c | 157 ++++++++++++++++++++++++-------------- include/linux/mfd/sun4i-gpadc.h | 7 -- 2 files changed, 98 insertions(+), 66 deletions(-) diff --git a/drivers/iio/adc/sun4i-gpadc-iio.c b/drivers/iio/adc/sun4i-gpadc-iio.c index 658a7e3e3370..a2027614ee0c 100644 --- a/drivers/iio/adc/sun4i-gpadc-iio.c +++ b/drivers/iio/adc/sun4i-gpadc-iio.c @@ -49,6 +49,8 @@ static unsigned int sun6i_gpadc_chan_select(unsigned int chan) return SUN6I_GPADC_CTRL1_ADC_CHAN_SELECT(chan); } +struct sun4i_gpadc_iio; + struct gpadc_data { int temp_offset; int temp_scale; @@ -56,8 +58,15 @@ struct gpadc_data { unsigned int tp_adc_select; unsigned int (*adc_chan_select)(unsigned int chan); unsigned int adc_chan_mask; + bool adc_channel; + irqreturn_t (*ths_irq_thread)(int irq, void *dev_id); + int (*ths_suspend)(struct sun4i_gpadc_iio *info); + int (*ths_resume)(struct sun4i_gpadc_iio *info); + bool support_irq; }; +static irqreturn_t sun4i_gpadc_data_irq_handler(int irq, void *dev_id); + static const struct gpadc_data sun4i_gpadc_data = { .temp_offset = -1932, .temp_scale = 133, @@ -65,6 +74,9 @@ 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, + .adc_channel = true, + .ths_irq_thread = sun4i_gpadc_data_irq_handler, + .support_irq = true, }; static const struct gpadc_data sun5i_gpadc_data = { @@ -74,6 +86,9 @@ 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, + .adc_channel = true, + .ths_irq_thread = sun4i_gpadc_data_irq_handler, + .support_irq = true, }; static const struct gpadc_data sun6i_gpadc_data = { @@ -83,6 +98,9 @@ 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, + .adc_channel = true, + .ths_irq_thread = sun4i_gpadc_data_irq_handler, + .support_irq = true, }; static const struct gpadc_data sun8i_a33_gpadc_data = { @@ -96,13 +114,10 @@ struct sun4i_gpadc_iio { struct completion completion; int temp_data; u32 adc_data; + unsigned int irq_data_type; struct regmap *regmap; - unsigned int fifo_data_irq; - atomic_t ignore_fifo_data_irq; - unsigned int temp_data_irq; - atomic_t ignore_temp_data_irq; + unsigned int irq; const struct gpadc_data *data; - bool no_irq; /* prevents concurrent reads of temperature and ADC */ struct mutex mutex; struct thermal_zone_device *tzd; @@ -130,6 +145,20 @@ static const struct regmap_config sun4i_gpadc_regmap_config = { .fast_io = true, }; +static int sun4i_gpadc_irq_init(struct sun4i_gpadc_iio *info) +{ + u32 reg; + + if (info->irq_data_type == SUN4I_GPADC_IRQ_FIFO_DATA) + reg = SUN4I_GPADC_INT_FIFOC_TEMP_IRQ_EN; + else + reg = SUN4I_GPADC_INT_FIFOC_TEMP_IRQ_EN; + + regmap_write(info->regmap, SUN4I_GPADC_INT_FIFOC, reg); + + return 0; +} + static int sun4i_prepare_for_irq(struct iio_dev *indio_dev, int channel, unsigned int irq) { @@ -151,7 +180,7 @@ static int sun4i_prepare_for_irq(struct iio_dev *indio_dev, int channel, if (ret) return ret; - if (irq == info->fifo_data_irq) { + if (irq == SUN4I_GPADC_IRQ_FIFO_DATA) { ret = regmap_write(info->regmap, SUN4I_GPADC_CTRL1, info->data->tp_mode_en | info->data->tp_adc_select | @@ -172,6 +201,8 @@ static int sun4i_prepare_for_irq(struct iio_dev *indio_dev, int channel, ret = regmap_write(info->regmap, SUN4I_GPADC_CTRL1, info->data->tp_mode_en); } + if (info->data->support_irq) + sun4i_gpadc_irq_init(info); if (ret) return ret; @@ -194,11 +225,12 @@ static int sun4i_gpadc_read(struct iio_dev *indio_dev, int channel, int *val, mutex_lock(&info->mutex); + info->irq_data_type = irq; ret = sun4i_prepare_for_irq(indio_dev, channel, irq); if (ret) goto err; - enable_irq(irq); + enable_irq(info->irq); /* * The temperature sensor throws an interruption periodically (currently @@ -212,7 +244,7 @@ static int sun4i_gpadc_read(struct iio_dev *indio_dev, int channel, int *val, goto err; } - if (irq == info->fifo_data_irq) + if (irq == SUN4I_GPADC_IRQ_FIFO_DATA) *val = info->adc_data; else *val = info->temp_data; @@ -222,7 +254,7 @@ static int sun4i_gpadc_read(struct iio_dev *indio_dev, int channel, int *val, err: pm_runtime_put_autosuspend(indio_dev->dev.parent); - disable_irq(irq); + disable_irq(info->irq); mutex_unlock(&info->mutex); return ret; @@ -231,16 +263,15 @@ static int sun4i_gpadc_read(struct iio_dev *indio_dev, int channel, int *val, static int sun4i_gpadc_adc_read(struct iio_dev *indio_dev, int channel, int *val) { - struct sun4i_gpadc_iio *info = iio_priv(indio_dev); - - return sun4i_gpadc_read(indio_dev, channel, val, info->fifo_data_irq); + return sun4i_gpadc_read(indio_dev, channel, val, + SUN4I_GPADC_IRQ_FIFO_DATA); } static int sun4i_gpadc_temp_read(struct iio_dev *indio_dev, int *val) { struct sun4i_gpadc_iio *info = iio_priv(indio_dev); - if (info->no_irq) { + if (!info->data->support_irq) { pm_runtime_get_sync(indio_dev->dev.parent); regmap_read(info->regmap, SUN4I_GPADC_TEMP_DATA, val); @@ -251,7 +282,7 @@ static int sun4i_gpadc_temp_read(struct iio_dev *indio_dev, int *val) return 0; } - return sun4i_gpadc_read(indio_dev, 0, val, info->temp_data_irq); + return sun4i_gpadc_read(indio_dev, 0, val, SUN4I_GPADC_IRQ_TEMP_DATA); } static int sun4i_gpadc_temp_offset(struct iio_dev *indio_dev, int *val) @@ -320,31 +351,21 @@ static const struct iio_info sun4i_gpadc_iio_info = { .read_raw = sun4i_gpadc_read_raw, }; -static irqreturn_t sun4i_gpadc_temp_data_irq_handler(int irq, void *dev_id) +static irqreturn_t sun4i_gpadc_data_irq_handler(int irq, void *dev_id) { struct sun4i_gpadc_iio *info = dev_id; - if (atomic_read(&info->ignore_temp_data_irq)) - goto out; - - if (!regmap_read(info->regmap, SUN4I_GPADC_TEMP_DATA, &info->temp_data)) - complete(&info->completion); - -out: - return IRQ_HANDLED; -} - -static irqreturn_t sun4i_gpadc_fifo_data_irq_handler(int irq, void *dev_id) -{ - struct sun4i_gpadc_iio *info = dev_id; - - if (atomic_read(&info->ignore_fifo_data_irq)) - goto out; - - if (!regmap_read(info->regmap, SUN4I_GPADC_DATA, &info->adc_data)) - complete(&info->completion); - -out: + if (info->irq_data_type == SUN4I_GPADC_IRQ_FIFO_DATA) { + /* read fifo data */ + if (!regmap_read(info->regmap, SUN4I_GPADC_DATA, + &info->adc_data)) + complete(&info->completion); + } else { + /* read temp data */ + if (!regmap_read(info->regmap, SUN4I_GPADC_TEMP_DATA, + &info->temp_data)) + complete(&info->completion); + } return IRQ_HANDLED; } @@ -356,6 +377,8 @@ static int sun4i_gpadc_runtime_suspend(struct device *dev) regmap_write(info->regmap, SUN4I_GPADC_CTRL1, 0); /* Disable temperature sensor on IP */ regmap_write(info->regmap, SUN4I_GPADC_TPR, 0); + /* Disable irq*/ + regmap_write(info->regmap, SUN4I_GPADC_INT_FIFOC, 0); return 0; } @@ -378,6 +401,7 @@ static int sun4i_gpadc_runtime_resume(struct device *dev) SUN4I_GPADC_TPR_TEMP_ENABLE | SUN4I_GPADC_TPR_TEMP_PERIOD(800)); + return 0; } @@ -426,8 +450,6 @@ static int sun4i_gpadc_probe_dt(struct platform_device *pdev, if (!info->data) return -ENODEV; - info->no_irq = true; - mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); base = devm_ioremap_resource(&pdev->dev, mem); if (IS_ERR(base)) @@ -441,8 +463,25 @@ static int sun4i_gpadc_probe_dt(struct platform_device *pdev, return ret; } - if (IS_ENABLED(CONFIG_THERMAL_OF)) - info->sensor_device = &pdev->dev; + if (info->data->support_irq) { + + /* ths interrupt */ + info->irq = platform_get_irq(pdev, 0); + + ret = devm_request_threaded_irq(&pdev->dev, info->irq, + NULL, info->data->ths_irq_thread, + IRQF_ONESHOT, dev_name(&pdev->dev), info); + + if (info->data->adc_channel) + disable_irq(info->irq); + + if (ret) { + dev_err(&pdev->dev, "failed to add ths irq: %d\n", ret); + return ret; + } + } + + info->sensor_device = &pdev->dev; return 0; } @@ -469,6 +508,11 @@ static int sun4i_gpadc_probe(struct platform_device *pdev) indio_dev->info = &sun4i_gpadc_iio_info; indio_dev->modes = INDIO_DIRECT_MODE; + if (&info->data->adc_channel) { + indio_dev->num_channels = ARRAY_SIZE(sun4i_gpadc_channels); + indio_dev->channels = sun4i_gpadc_channels; + } + ret = sun4i_gpadc_probe_dt(pdev, indio_dev); if (ret) @@ -480,20 +524,18 @@ 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)) { - info->tzd = thermal_zone_of_sensor_register(info->sensor_device, - 0, info, - &sun4i_ts_tz_ops); - /* - * Do not fail driver probing when failing to register in - * thermal because no thermal DT node is found. - */ - if (IS_ERR(info->tzd) && PTR_ERR(info->tzd) != -ENODEV) { - dev_err(&pdev->dev, - "could not register thermal sensor: %ld\n", - PTR_ERR(info->tzd)); - return PTR_ERR(info->tzd); - } + info->tzd = thermal_zone_of_sensor_register(info->sensor_device, + 0, info, + &sun4i_ts_tz_ops); + /* + * Do not fail driver probing when failing to register in + * thermal because no thermal DT node is found. + */ + if (IS_ERR(info->tzd) && PTR_ERR(info->tzd) != -ENODEV) { + dev_err(&pdev->dev, + "could not register thermal sensor: %ld\n", + PTR_ERR(info->tzd)); + return PTR_ERR(info->tzd); } ret = devm_iio_device_register(&pdev->dev, indio_dev); @@ -505,7 +547,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->data->support_irq) iio_map_array_unregister(indio_dev); pm_runtime_put(&pdev->dev); @@ -522,12 +564,9 @@ 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)) - return 0; - thermal_zone_of_sensor_unregister(info->sensor_device, info->tzd); - if (!info->no_irq) + if (!info->data->support_irq) iio_map_array_unregister(indio_dev); return 0; diff --git a/include/linux/mfd/sun4i-gpadc.h b/include/linux/mfd/sun4i-gpadc.h index 54c7c9375c1b..ca59336f246b 100644 --- a/include/linux/mfd/sun4i-gpadc.h +++ b/include/linux/mfd/sun4i-gpadc.h @@ -99,11 +99,4 @@ .datasheet_name = _name, \ } -struct sun4i_gpadc_dev { - struct device *dev; - struct regmap *regmap; - struct regmap_irq_chip_data *regmap_irqc; - void __iomem *base; -}; - #endif From patchwork Thu Aug 30 15:44:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Rossak X-Patchwork-Id: 10582155 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 75829920 for ; Thu, 30 Aug 2018 15:50:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 63FA32C0B0 for ; Thu, 30 Aug 2018 15:50:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 57CB42BED5; Thu, 30 Aug 2018 15:50:12 +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=ham 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 E280A2C097 for ; Thu, 30 Aug 2018 15:50:11 +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:References: In-Reply-To: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:List-Owner; bh=+5rlaCYePLpIGq0O+dva+Ckzl7qfWLOJPFaBqOexz4k=; b=CmxbUBtRi3FWv12xwRnAVaPZeE NKEwNrWF+s2Y9wEd//jAPkmY414Uow+qo+DhMUTzX4BPB6Y6DpnauBwXgshvWTc0CJ86T8gL240Sz dmHZGqgnBwQj0IlKw66wahIx2hrLfUJcqb2Rid3uC4J8Qk9R7Cay13w9zyBAEXlxC7tNZi8LKtRhi sMiSBmkWNFFaBZe+vuSTwaAIrWYSrAP2KIW7utqHsLzu9HA8TM84RWgTmacb7pQ7yXNb8rLCB6JlD Kn4NzAJwo0XiHtIhAoJ33BeOHSb16VKdmGf5piz42B4e1egnJUFXZ5ABDW3lfGpLr7mcDAI2Kl051 c7tG63UQ==; 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 1fvPCx-0003X4-5J; Thu, 30 Aug 2018 15:50:07 +0000 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fvP8Z-0001bb-3B for linux-arm-kernel@lists.infradead.org; Thu, 30 Aug 2018 15:45:37 +0000 Received: by mail-wm0-x242.google.com with SMTP id i134-v6so2158144wmf.0 for ; Thu, 30 Aug 2018 08:45:31 -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:in-reply-to:references; bh=m9HSKer3qo7NlJvusjul6JsIn+NxC9/6alEw8B/KC/k=; b=iiibwLdS7N0B9ID4gjVEPs7HkFAeGvUubNGYDDNOV07qucdQKY13uaBNDTpIufpp0a qiFBm5mrsc2aKEcA1N+QN0YjRd+nIcgeDrWXY03HAma75dfrQayKUW5VF0Q6N743PyF7 6hm006I4SoSicQPELV1Mn55HVrDiQ/69Z7F1W/7egJLYHlYNt7MGRhKF48kpI/EJ5J3V 9R+LYZuuswJa+8RalklVMXEwq89BL0rqMyjcb5sSeB8RqdHoyZU8uyGk1WZsQakhHRdn bwMHZnamyja8uU5yaHUZGljp1MKRHNOEyD2AjA1OiT+kiPaxu5ADF8Nr9UjFG/S2P+q6 wMCg== 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:in-reply-to :references; bh=m9HSKer3qo7NlJvusjul6JsIn+NxC9/6alEw8B/KC/k=; b=WiJefLN757tKr2yTBcWW9hbafOoRFzVxNipzK4lEw5kHetK9XLcf9xvinGS3Jh8g1t nbeJntdyBQX8dgD4uSwDuVXtWsUWhiDeM+SX01A/Hk1fBzCV8OvSb5JXPLJRIPQt2rzp 6OeCbJzWV6+6InXNRatxMaH1TV+yoVDHsxDODb0fTf69m7XeUXuSCKU5yUpVZyADxd+O /9PYCYQmiNjAj2tXf+04GoJ7rR5mlJ2UQ6zrUKZzIcRgiOwb1pPngwjZkwTNM90Xd7UU /NxSCTC7ph2DgnrE6D2n+oskjg3TrooK9j8sXS2u5x64/ND6Rl6bb32AmuZ/BVP173Xd YX8A== X-Gm-Message-State: APzg51DqSAdfgfuTqDZc5gwIBxyCBLv2hI6eEvAbYsmiaBKaICEjv+NX unnLP5fR3Udt9NP2SgOlTBA= X-Google-Smtp-Source: ANB0VdaFJAhWXJk78Cp9OiQ7ErZu6Y2oVsDKehJC0EBmwDHpPpfWkJ02s5JAn59gEXR0m8DSt46Ejw== X-Received: by 2002:a1c:a8d0:: with SMTP id r199-v6mr2041463wme.97.1535643930663; Thu, 30 Aug 2018 08:45:30 -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.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Aug 2018 08:45:30 -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 11/30] iio: adc: add new compatibles Date: Thu, 30 Aug 2018 17:44:59 +0200 Message-Id: <20180830154518.29507-12-embed3d@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180830154518.29507-1-embed3d@gmail.com> References: <20180830154518.29507-1-embed3d@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180830_084535_160517_56555959 X-CRM114-Status: GOOD ( 12.37 ) 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 We are now adding the new compatibles. Signed-off-by: Philipp Rossak --- drivers/iio/adc/sun4i-gpadc-iio.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/iio/adc/sun4i-gpadc-iio.c b/drivers/iio/adc/sun4i-gpadc-iio.c index a2027614ee0c..79b8efdab803 100644 --- a/drivers/iio/adc/sun4i-gpadc-iio.c +++ b/drivers/iio/adc/sun4i-gpadc-iio.c @@ -435,6 +435,18 @@ static const struct of_device_id sun4i_gpadc_of_id[] = { .compatible = "allwinner,sun8i-a33-ths", .data = &sun8i_a33_gpadc_data, }, + { + .compatible = "allwinner,sun4i-a10-gpadc", + .data = &sun4i_gpadc_data + }, + { + .compatible = "allwinner,sun5i-a13-gpadc", + .data = &sun5i_gpadc_data + }, + { + .compatible = "allwinner,sun6i-a31-gpadc", + .data = &sun6i_gpadc_data + }, { /* sentinel */ } }; From patchwork Thu Aug 30 15:45:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Rossak X-Patchwork-Id: 10582187 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 0C893920 for ; Thu, 30 Aug 2018 15:57:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EF7872C0EA for ; Thu, 30 Aug 2018 15:57:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E300C2C0EC; Thu, 30 Aug 2018 15:57:00 +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 6639C2C0EA for ; Thu, 30 Aug 2018 15:57:00 +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:References: In-Reply-To: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:List-Owner; bh=1BiYObxz3yXhmpC2k/YSqoZrkgNDdiHjKGMlTbwJjBk=; b=WChxAsQBgyZnImWyTTs7Qgqe2w zr6naRRM4iaeWUlI6CCAsQ+TawH/qacSrFI0sGdvtsAQqH7Pw5mYkmTkAWTVvzlei+dweZdIdcbZw utTEp0GFYsUAorSG+kxuIFXLw/V3DpvPWV7WELaMtaf7Iuvt4N28EKU8+K6UX5+AcFOOuwaFzlCD2 C+Pvvgu7UZCZl4ZrdvfKm7G9hfQpAt8RS9nPqi1tVdX6wzvnPjtxMiRTkjJuW/LjzqlsGnqSRRILF 6FkSVe4ag61VbZwAVcLd9y/JFat1PkioD2HgoYIgUU8AfWrl9Ch3j/tPPNlOl75/Vsxc+vTuZytCB DYtB8kAw==; 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 1fvPJS-0000CD-DW; Thu, 30 Aug 2018 15:56:50 +0000 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fvP8h-0001bf-H2 for linux-arm-kernel@lists.infradead.org; Thu, 30 Aug 2018 15:45:47 +0000 Received: by mail-wm0-x241.google.com with SMTP id t25-v6so2496243wmi.3 for ; Thu, 30 Aug 2018 08:45:33 -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:in-reply-to:references; bh=qLNFVsnalsTHWh23gsrqklrbEjw/wwp/7aVPhkgH9x4=; b=QnUeDD7ZZM1CBfOJRqCxDyBRr+ap7TNw/6J6K3t7p3ncLYv8rpyzyQQz+f85p4drd3 3ccGlLTb2MftRC5G7Fpjv8Q/P+ylg1QTI0vlpnZsniMNnHJqvY4WQ6XPKFYCZDg2BZ6E wGJ/q9l7Uhn+R2Czg1KUbVt7QkmzvYIVzyfQOAsuLcsk/UA3VoOMTuQOb/15YkUGRYLB 3aKL7BVFTDYVVi5rc1d8MXWvC50bme5HUtpwwcA1hBJZY6DbewWZX/p1/s5AdnodWSIx +IR38s2dI83eGdyaCV5YYkizbUn2PSMPytoOzABKMdSSeZMGa2Fukmt2TkrbqCfMp7Hf Lp7A== 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:in-reply-to :references; bh=qLNFVsnalsTHWh23gsrqklrbEjw/wwp/7aVPhkgH9x4=; b=pQo65/Kz+2szAovlNQViYRPpkZq9B/jreOYYbJyOn4+leCOdERHFYG6VY8cqFFoql6 ecHin+bOn8PMDK3L5AO9CDRU8jAGmnlmzfL2FggwINabRRgYZQYGL0yuJPh5m1++Si1V 89PyYkl7Y23tf6yjxmS1+GxyinLzXJb9yZWKFa4Z0154IRkXcuCTn3zOcnzpRCEenk5T 4sTMV9eEMuIP63ENyQPrMTA1XJCnWBHfeeK9CwJACnbkAODSb8NLIgXiUNuWzUJdDpue 2G5+myx+NT9QWAIs20nrMiaJpBt99CioVv14o4JawTynRCTqbXtNY8nE4mf9SJZaR+Q8 gl3g== X-Gm-Message-State: APzg51CmJD3EoaRKyzM0Qqc5Hk1X5P+sGsnZWZFX5MxUaIvhPvFklyro swagbtaTZGgqkAyI6IVnk6U= X-Google-Smtp-Source: ANB0VdZeA0GpfeJjw90+9v/XXayda1G+dh1963DlyIDiLrg8hKzK+hSUBtqoBGzLRpjSP25+WKb3fg== X-Received: by 2002:a1c:1351:: with SMTP id 78-v6mr2121271wmt.127.1535643931693; Thu, 30 Aug 2018 08:45:31 -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.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Aug 2018 08:45:31 -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 12/30] mfd: Remove old mfd driver & Move sun4i-gpadc.h to iio/adc/ Date: Thu, 30 Aug 2018 17:45:00 +0200 Message-Id: <20180830154518.29507-13-embed3d@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180830154518.29507-1-embed3d@gmail.com> References: <20180830154518.29507-1-embed3d@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180830_084543_794944_4A9A32C7 X-CRM114-Status: GOOD ( 18.14 ) 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 Since we reworked the sun4i-gpadc iio driver we can now remove the mfd driver and move it's header to include/linux/iio/adc. Signed-off-by: Philipp Rossak --- drivers/iio/adc/sun4i-gpadc-iio.c | 2 +- drivers/mfd/sun4i-gpadc.c | 181 --------------------------- include/linux/{mfd => iio/adc}/sun4i-gpadc.h | 0 3 files changed, 1 insertion(+), 182 deletions(-) delete mode 100644 drivers/mfd/sun4i-gpadc.c rename include/linux/{mfd => iio/adc}/sun4i-gpadc.h (100%) diff --git a/drivers/iio/adc/sun4i-gpadc-iio.c b/drivers/iio/adc/sun4i-gpadc-iio.c index 79b8efdab803..e1fe5e8e9dc0 100644 --- a/drivers/iio/adc/sun4i-gpadc-iio.c +++ b/drivers/iio/adc/sun4i-gpadc-iio.c @@ -37,7 +37,7 @@ #include #include #include -#include +#include static unsigned int sun4i_gpadc_chan_select(unsigned int chan) { diff --git a/drivers/mfd/sun4i-gpadc.c b/drivers/mfd/sun4i-gpadc.c deleted file mode 100644 index 9cfc88134d03..000000000000 --- a/drivers/mfd/sun4i-gpadc.c +++ /dev/null @@ -1,181 +0,0 @@ -/* ADC MFD core driver for sunxi platforms - * - * Copyright (c) 2016 Quentin Schulz - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 as published by - * the Free Software Foundation. - */ - -#include -#include -#include -#include -#include -#include -#include - -#include - -#define ARCH_SUN4I_A10 0 -#define ARCH_SUN5I_A13 1 -#define ARCH_SUN6I_A31 2 - -static struct resource adc_resources[] = { - DEFINE_RES_IRQ_NAMED(SUN4I_GPADC_IRQ_FIFO_DATA, "FIFO_DATA_PENDING"), - DEFINE_RES_IRQ_NAMED(SUN4I_GPADC_IRQ_TEMP_DATA, "TEMP_DATA_PENDING"), -}; - -static const struct regmap_irq sun4i_gpadc_regmap_irq[] = { - REGMAP_IRQ_REG(SUN4I_GPADC_IRQ_FIFO_DATA, 0, - SUN4I_GPADC_INT_FIFOC_TP_DATA_IRQ_EN), - REGMAP_IRQ_REG(SUN4I_GPADC_IRQ_TEMP_DATA, 0, - SUN4I_GPADC_INT_FIFOC_TEMP_IRQ_EN), -}; - -static const struct regmap_irq_chip sun4i_gpadc_regmap_irq_chip = { - .name = "sun4i_gpadc_irq_chip", - .status_base = SUN4I_GPADC_INT_FIFOS, - .ack_base = SUN4I_GPADC_INT_FIFOS, - .mask_base = SUN4I_GPADC_INT_FIFOC, - .init_ack_masked = true, - .mask_invert = true, - .irqs = sun4i_gpadc_regmap_irq, - .num_irqs = ARRAY_SIZE(sun4i_gpadc_regmap_irq), - .num_regs = 1, -}; - -static struct mfd_cell sun4i_gpadc_cells[] = { - { - .name = "sun4i-a10-gpadc-iio", - .resources = adc_resources, - .num_resources = ARRAY_SIZE(adc_resources), - }, - { .name = "iio_hwmon" } -}; - -static struct mfd_cell sun5i_gpadc_cells[] = { - { - .name = "sun5i-a13-gpadc-iio", - .resources = adc_resources, - .num_resources = ARRAY_SIZE(adc_resources), - }, - { .name = "iio_hwmon" }, -}; - -static struct mfd_cell sun6i_gpadc_cells[] = { - { - .name = "sun6i-a31-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, - .reg_stride = 4, - .fast_io = true, -}; - -static const struct of_device_id sun4i_gpadc_of_match[] = { - { - .compatible = "allwinner,sun4i-a10-ts", - .data = (void *)ARCH_SUN4I_A10, - }, { - .compatible = "allwinner,sun5i-a13-ts", - .data = (void *)ARCH_SUN5I_A13, - }, { - .compatible = "allwinner,sun6i-a31-ts", - .data = (void *)ARCH_SUN6I_A31, - }, { /* sentinel */ } -}; - -MODULE_DEVICE_TABLE(of, sun4i_gpadc_of_match); - -static int sun4i_gpadc_probe(struct platform_device *pdev) -{ - struct sun4i_gpadc_dev *dev; - struct resource *mem; - const struct of_device_id *of_id; - const struct mfd_cell *cells; - unsigned int irq, size; - int ret; - - of_id = of_match_node(sun4i_gpadc_of_match, pdev->dev.of_node); - if (!of_id) - return -EINVAL; - - switch ((long)of_id->data) { - case ARCH_SUN4I_A10: - cells = sun4i_gpadc_cells; - size = ARRAY_SIZE(sun4i_gpadc_cells); - break; - case ARCH_SUN5I_A13: - cells = sun5i_gpadc_cells; - size = ARRAY_SIZE(sun5i_gpadc_cells); - break; - case ARCH_SUN6I_A31: - cells = sun6i_gpadc_cells; - size = ARRAY_SIZE(sun6i_gpadc_cells); - break; - default: - return -EINVAL; - } - - dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL); - if (!dev) - return -ENOMEM; - - mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); - dev->base = devm_ioremap_resource(&pdev->dev, mem); - if (IS_ERR(dev->base)) - return PTR_ERR(dev->base); - - dev->dev = &pdev->dev; - dev_set_drvdata(dev->dev, dev); - - dev->regmap = devm_regmap_init_mmio(dev->dev, dev->base, - &sun4i_gpadc_regmap_config); - if (IS_ERR(dev->regmap)) { - ret = PTR_ERR(dev->regmap); - dev_err(&pdev->dev, "failed to init regmap: %d\n", ret); - return ret; - } - - /* Disable all interrupts */ - regmap_write(dev->regmap, SUN4I_GPADC_INT_FIFOC, 0); - - irq = platform_get_irq(pdev, 0); - ret = devm_regmap_add_irq_chip(&pdev->dev, dev->regmap, irq, - IRQF_ONESHOT, 0, - &sun4i_gpadc_regmap_irq_chip, - &dev->regmap_irqc); - if (ret) { - dev_err(&pdev->dev, "failed to add irq chip: %d\n", ret); - return ret; - } - - ret = devm_mfd_add_devices(dev->dev, 0, cells, size, NULL, 0, NULL); - if (ret) { - dev_err(&pdev->dev, "failed to add MFD devices: %d\n", ret); - return ret; - } - - return 0; -} - -static struct platform_driver sun4i_gpadc_driver = { - .driver = { - .name = "sun4i-gpadc", - .of_match_table = of_match_ptr(sun4i_gpadc_of_match), - }, - .probe = sun4i_gpadc_probe, -}; - -module_platform_driver(sun4i_gpadc_driver); - -MODULE_DESCRIPTION("Allwinner sunxi platforms' GPADC MFD core driver"); -MODULE_AUTHOR("Quentin Schulz "); -MODULE_LICENSE("GPL v2"); diff --git a/include/linux/mfd/sun4i-gpadc.h b/include/linux/iio/adc/sun4i-gpadc.h similarity index 100% rename from include/linux/mfd/sun4i-gpadc.h rename to include/linux/iio/adc/sun4i-gpadc.h From patchwork Thu Aug 30 15:45:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Rossak X-Patchwork-Id: 10582191 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 E6B4E920 for ; Thu, 30 Aug 2018 15:58:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D42772B53B for ; Thu, 30 Aug 2018 15:58:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C63942B555; Thu, 30 Aug 2018 15:58:18 +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=ham 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 6DBDB2B53B for ; Thu, 30 Aug 2018 15:58:18 +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:References: In-Reply-To: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:List-Owner; bh=zkU0BmetVkIIh0qjwzPWL2SCAKHC7esBCFMUS8zSgTI=; b=IDmfiR01LOkGkYYkgUGbQGUagl DUkGSjypMCHygDuQXGwnxgjVphNGoB3FIycv7dkF+1V1+EmL0StFxtdHWlZYGHhGdEfFNyoAy7+YL XaHWcDvHc5s3RWhw2haKqRAPxrDOSLOdAMP1LZtI/AKyZw/pFnMGxDoq6rRI+hHX9B7TO30adaoxv nsrcIIm3c58Ddiq0BVIDYEpj3GajJGVvigSNmzva4XkkWF1amNwU8yYb+7X1yaarfgVQ6tHzS/93x bi+v26wEmpOKcS2J7AuQ1Il3uce6LEZNx2Z9sRUpkQjCGSMZu66zjbkJDKSKC0dCnP+ysmEWvmYA7 WzRUNdLw==; 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 1fvPKl-0000jR-17; Thu, 30 Aug 2018 15:58:11 +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 1fvP8i-0001bj-3W for linux-arm-kernel@lists.infradead.org; Thu, 30 Aug 2018 15:45:49 +0000 Received: by mail-wm0-x243.google.com with SMTP id b19-v6so2472601wme.3 for ; Thu, 30 Aug 2018 08:45:33 -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:in-reply-to:references; bh=/SC5i8JP4t8++oAR2mX2JW6l48vvz33dbW/6zVBuRL4=; b=TCRD4xO+1P11C2egwwKOMJhII4iYcUVlekbe6kDOlOTwzPR2/AsGcMNYK5/zyOMcP4 hf4mYEPT7qPIvpJpEIYIOitl5KuE6/tiZXV0sMX3Vb1sI3QtqVuRSxIpB/7jAaR5Dmyh nvobXecTK8ZUe1YOCf/EJzPKgppOZRk6nmSUTnpWVvkpfc8gmJlofyfN04w89Hi9NmVA szZ79KDQAnVY9FXMLIt2NcoRNEeECdWLTHHReKLFSh6sedsqR1RtlwBd9nzgo5G5GqXo pVy6Qi5zUNVvlfymNE7zGE0868zhCjNAlTzXYpcHrKlMjsFtpBTQXnqTNnuUjbNHw8eh yneg== 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:in-reply-to :references; bh=/SC5i8JP4t8++oAR2mX2JW6l48vvz33dbW/6zVBuRL4=; b=kAY+Jx9t3pGdYbmnz+hVdonXy0gmjMwZV8Mwu+Q7p1WaebHKDt9XScGXJqAcV/j5Wx AmlntrN1MQoK+FG1G93ivGjxT+xjK/5xB4UyPTWESRyoCv3WN4EUxuXSgOt5z63EIx33 8VG/11O5gcadcGBVWhqoFJxyMhhaw0R2NLMIbP4nS0Y3BLbWwbSSlBRtFuRrS1MPluR8 3YgbhnhYWfWQXfuTuFggIJop2/tnxDrX8uLm4nNtO0C5gkbDcxcdvNNdqDhQ7H3ggXGt DtchNBJcCpOOr0gNj90yaiEbwujwpvV2+aSueUmnHm7Gpq8n0DYqmDqhx3wU4N8WG6XC UKbA== X-Gm-Message-State: APzg51DXClUpaxEgV2Dvxgsxy9xdWU6sLekW6M6D/gsySOp3L2qteuTI fZXlayO786jpESlfDjce3Ek= X-Google-Smtp-Source: ANB0VdaLjA7zyEY01kY8ytkdtd7jeSNKwZ6haIieI8UVzOWiFROpu2oWoL9rBquUlscVb+GPgEv0bw== X-Received: by 2002:a1c:8dd1:: with SMTP id p200-v6mr2023371wmd.145.1535643932712; Thu, 30 Aug 2018 08:45:32 -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.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Aug 2018 08:45:32 -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 13/30] arm: config: Enable SUN4I_GPADC in defconfig Date: Thu, 30 Aug 2018 17:45:01 +0200 Message-Id: <20180830154518.29507-14-embed3d@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180830154518.29507-1-embed3d@gmail.com> References: <20180830154518.29507-1-embed3d@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180830_084544_237824_16FD81DB X-CRM114-Status: GOOD ( 13.43 ) 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 Since we have now new compatibles we can enable the SUN4I_GPADC driver next to the sun4i-ts driver. Signed-off-by: Philipp Rossak --- arch/arm/configs/sunxi_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/configs/sunxi_defconfig b/arch/arm/configs/sunxi_defconfig index df433abfcb02..2189349820ac 100644 --- a/arch/arm/configs/sunxi_defconfig +++ b/arch/arm/configs/sunxi_defconfig @@ -132,6 +132,7 @@ CONFIG_DMA_SUN6I=y # CONFIG_IOMMU_SUPPORT is not set CONFIG_EXTCON=y CONFIG_IIO=y +CONFIG_SUN4I_GPADC=y CONFIG_AXP20X_ADC=y CONFIG_PWM=y CONFIG_PWM_SUN4I=y From patchwork Thu Aug 30 15:45:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Rossak X-Patchwork-Id: 10582295 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 806EF5A4 for ; Thu, 30 Aug 2018 16:33:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6DA732BFB5 for ; Thu, 30 Aug 2018 16:33:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 610C42C12A; Thu, 30 Aug 2018 16:33:03 +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 E045C2BFB5 for ; Thu, 30 Aug 2018 16:33:02 +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:References: In-Reply-To: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:List-Owner; bh=WmPnaxV0vTyOlhcYPTlMkfbZmHYGRmk0nB2wxSoOUUk=; b=ryPiJl7C71qkU49RM9aQM3UAHc klekEQv2yZkUv2e6ETg/OGkQ5o6JzGJsPsW/wtks4Kxla7T1AIlEMydilYzB5AtNtdvsVK5s5ZP1O BOUhX03dVk9yfcGhKehF1Dj5ecOE8cg4N14CH47bQob9+/8CiwcCJgDThetGx8VCI6qAYPlBsZKSw dXlw29Y8LVVPRYjgXE8axVlGX46nPZmpx6I5xAKInUuEzkQAlwFDBTMB8qWA/Baec85UEHytMYINz +5hL0q/ZM2QjNkebD3Cs4VrZR3WUt1ISigkO33vJr4erJLCA1VWoTWhS1py6p1J2TCmziOnKiEWWg YU7lDvhQ==; 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 1fvPsN-0006o4-Fd; Thu, 30 Aug 2018 16:32:55 +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 1fvP8i-0001d2-31 for linux-arm-kernel@lists.infradead.org; Thu, 30 Aug 2018 15:45:49 +0000 Received: by mail-wm0-x243.google.com with SMTP id o18-v6so2537149wmc.0 for ; Thu, 30 Aug 2018 08:45:34 -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:in-reply-to:references; bh=KQMFFCtjVJMB79OboK16hKVLwCLSA0PsOx2A/8CBESc=; b=uSl/Vax1IuA+CFRUIKwTxxFUvJfRWakNh5g16Kc0q07Q68gw45yu6ugu2nZm/dMKko QadCBK52Wf+8QPU4hVqpjMsnFMfMhPxGReEQknxirOo1kHhARPI0a1btuB90dm730IkN 1OO6dsLT8qznPCn7cgcBZ93F0MWNoU2Kle15pJEe73mC8+Osqt/9YiQnijDe87Z7c7Ov AFNXVGKcDcnmBvVQyuGcR6n/G6zuYTX7MOItqnR9zmK8pmklbB0+m+sz43o2YD4D9DTF hSj+RBgWWLsMkwnaE/tcMpPG1EignyUBXHtPfw1XPE4H74HINyNmEPeZMLQkUcn57dja nHVA== 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:in-reply-to :references; bh=KQMFFCtjVJMB79OboK16hKVLwCLSA0PsOx2A/8CBESc=; b=ARQe9xb1g7zbHM4CGr6PfCJ/M3Pc3g3uXme45n5k2MLscdd4uktqn9Dh0gNljqv98m HhIClyYNFf8edF0qyq7ZEXuMZlQtBQAHdEXcydwQiUZ9QdLYyfbJD350jCe7i5V7/Bk6 HaRrqjy2urBmEt57UiNzu4zmib9bqBtH0tivg9fV6+aEQJn5AiA4VduIhj9P4smSJFiq srw92aRF7k75ouqMyM99QkZCYXK09lIklY3vL7JdIURYSXDgwC1uidv2EwT2KW0RGe8J vgFzyYC9e0ZcUZNPneNr1vjOUDpOl2DAX+k1/lD0kg29oP4zU3PViS/OCmi88QECDt8a 66bQ== X-Gm-Message-State: APzg51Dpe27j5s87ch+rWqUlZCloXXG8XTspwUQh1mIBvbuj63+dq+ZH oon801ml4yoV54GXFvXbubU= X-Google-Smtp-Source: ANB0VdYDy7wn0q0bTBfQwfLF4nhftHhBI9Gwyly1JXh4FK3AUDx60kkf66i1PFdimUNMVOn1/QjC9A== X-Received: by 2002:a1c:ba84:: with SMTP id k126-v6mr2051153wmf.96.1535643933705; Thu, 30 Aug 2018 08:45:33 -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.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Aug 2018 08:45:33 -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 14/30] dt-bindings: update the Allwinner GPADC device tree binding for H3 & A83T Date: Thu, 30 Aug 2018 17:45:02 +0200 Message-Id: <20180830154518.29507-15-embed3d@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180830154518.29507-1-embed3d@gmail.com> References: <20180830154518.29507-1-embed3d@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180830_084544_206084_C34C92A0 X-CRM114-Status: GOOD ( 16.50 ) 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 Allwinner H3 features a thermal sensor like the one in A33, but has its register re-arranged, the clock divider moved to CCU (originally the clock divider is in ADC) and added a pair of bus clock and reset. Allwinner A83T features a thermal sensor similar to the H3, the ths clock, the bus clock and the reset was removed from the CCU. The THS in A83T has a clock that is directly connected and runs with 24 MHz. Update the binding document to cover H3 and A83T. Signed-off-by: Philipp Rossak --- .../devicetree/bindings/iio/adc/sun4i-gpadc.txt | 41 ++++++++++++++++++++-- 1 file changed, 38 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/iio/adc/sun4i-gpadc.txt b/Documentation/devicetree/bindings/iio/adc/sun4i-gpadc.txt index a7ef9dd21f04..9116ad308cf1 100644 --- a/Documentation/devicetree/bindings/iio/adc/sun4i-gpadc.txt +++ b/Documentation/devicetree/bindings/iio/adc/sun4i-gpadc.txt @@ -4,12 +4,35 @@ The Allwinner SoCs all have an ADC that can also act as a thermal sensor and sometimes as a touchscreen controller. Required properties: - - compatible: "allwinner,sun8i-a33-ths", + - compatible: must contain one of the following compatibles: + - "allwinner,sun8i-a33-ths" + - "allwinner,sun8i-h3-ths" + - "allwinner,sun8i-a83t-ths" - reg: mmio address range of the chip, - - #thermal-sensor-cells: shall be 0, + - #thermal-sensor-cells: + Please refer , - #io-channel-cells: shall be 0, -Example: +Required properties for the following compatibles: + - "allwinner,sun8i-h3-ths" + - "allwinner,sun8i-a83t-ths" + - interrupts: the sampling interrupt of the ADC, + +Required properties for the following compatibles: + - "allwinner,sun8i-h3-ths" + - clocks: the bus clock and the input clock of the ADC, + - clock-names: should be "bus" and "mod", + - resets: the bus reset of the ADC, + +Optional properties for the following compatibles: + - "allwinner,sun8i-h3-ths" + - "allwinner,sun8i-a83t-ths" + - nvmem-cells: A phandle to the calibration data provided by a nvmem device. + - nvmem-cell-names: Should be "calibration". + +Details see: bindings/nvmem/nvmem.txt + +Example for A33: ths: ths@1c25000 { compatible = "allwinner,sun8i-a33-ths"; reg = <0x01c25000 0x100>; @@ -17,6 +40,18 @@ Example: #io-channel-cells = <0>; }; +Example for H3: + ths: thermal-sensor@1c25000 { + compatible = "allwinner,sun8i-h3-ths"; + reg = <0x01c25000 0x400>; + clocks = <&ccu CLK_BUS_THS>, <&ccu CLK_THS>; + clock-names = "bus", "mod"; + resets = <&ccu RST_BUS_THS>; + interrupts = ; + #thermal-sensor-cells = <0>; + #io-channel-cells = <0>; + }; + sun4i, sun5i and sun6i SoCs are also supported via these bindings: Required properties: From patchwork Thu Aug 30 15:45:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Rossak X-Patchwork-Id: 10582197 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 F1707175A for ; Thu, 30 Aug 2018 15:59:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DE6A52C0F3 for ; Thu, 30 Aug 2018 15:59:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D24762C0F5; Thu, 30 Aug 2018 15:59:39 +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=ham 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 33DE02C0F4 for ; Thu, 30 Aug 2018 15:59:39 +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:References: In-Reply-To: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:List-Owner; bh=dGKDj2ymOBDVTzCUtaI/Fy14xwXu3vk2j2KLdhyYUe8=; b=pAOayQoLOFU6De4SFx+3C/+w5x bZ1QMREZLZgHxQKJWcTeY75jacHhJ9MU3PxyRzUiYJSiIX0k3d18ADwLlWaNGZC4MIs1L2bgACp+H t5zWk3AlOdGohFSl+uPTL8DQzpGKlxxLzdgMNfsYxpnQEnXUbFh4LOu2S2pqEtkH6W9PgGLGuvV8v iWkpmL0KZmWxURvUQ4vweDEbW99V+lR0+OLr8gwDBGh9G/t7O62NIeY+SeeYAnCwfYTd0vXTFPuFX GNY4+MTu7cIWwW+1S4AEcEerLVS2qNOj3LKDDFlIk4IjmTCBW0PiCzGuVgj+n0mwn7C9DACLjzhOn WmbhR2zQ==; 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 1fvPM4-0001G6-RZ; Thu, 30 Aug 2018 15:59:32 +0000 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fvP8k-0001eK-N0 for linux-arm-kernel@lists.infradead.org; Thu, 30 Aug 2018 15:45:50 +0000 Received: by mail-wr1-x441.google.com with SMTP id m27-v6so8524109wrf.3 for ; Thu, 30 Aug 2018 08:45:36 -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:in-reply-to:references; bh=tH+coJrBrADIqfyrRfncPAy+/dBVRmXaC+ssyvweTRQ=; b=tSomAZIfZ4Bt/SxfSxf/Vm1zKdiYAyr1R/H/C4bmYm6GUnDwr+TeazwGUEfCwUxOC+ RDJuxwTtxQ+D22LUu3G0J5w/nhxHwQthP4dwpZv/Ib/N6ZEmEiUl/gYmDRR0hZuWWxne FGyyH7Alsg5YAM9BQF7w7V+mpAL0Oy4a05OAPc+3IWztjjdV/Y0OX6EVQcpI5bcdZQyJ 2ZNBa/nnw+wm0sFvfIgAT4AO7W7TFUs+tGT5X9HYbBqf/5J1PjaYVa2aeknIAEIIjw39 nDOCQhg9u2JXbXs7wYdB9nuiWDma0KRPEYLprib8b6IGjdop9YqO2euA+2f4OX0fyPb+ yoPQ== 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:in-reply-to :references; bh=tH+coJrBrADIqfyrRfncPAy+/dBVRmXaC+ssyvweTRQ=; b=aDtnhX56/c58iYEcdgir9ySlLOlXkU5zlCPh+/HWiQX5KUikDwBQlFItPl6DAD827a oGzqYek1ZqsWFT+G+bK42kJcA4vQ+Iy4cRsD7lGqemfz8pIY0db1iIbtLibIsXel0f1g fcdl7XqXbmoUxGRou0di9tVm4u4jYd0GaHY/Ha462+rOevlKfb1tPHmUIcX3J9r45vQf 6nbp0hccsq3wmVRikzocqNfGmcmeI1FhN8dC2ipGdhen0kJkr5FP0TqOXB6UK+Z7PAVz rDawXjrEyXjFfN9opiY9peYAJCLDz4WUtqjn4VkuHhIJECxQdllYxGKhLV4tU7Ho4oRM yE3w== X-Gm-Message-State: APzg51DJ8ZW0klbBLf6vWJzyk/QhfTyvFcAMmBC5cO64/0qvtdMHq7gr vKoxEzGNdk1oSJ0+8w1TysM= X-Google-Smtp-Source: ANB0VdYSolJLm8cuC5xWQsxS+GbMgnObtfCJ9RZYtvbZrdjeMUkgcnzZlH1oDuWWGIYLOM3Dq+uLxg== X-Received: by 2002:adf:c64e:: with SMTP id u14-v6mr7702233wrg.177.1535643934972; Thu, 30 Aug 2018 08:45:34 -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.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Aug 2018 08:45:34 -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 15/30] iio: adc: sun4i-gpadc-iio: rename A33-specified registers to contain A33 Date: Thu, 30 Aug 2018 17:45:03 +0200 Message-Id: <20180830154518.29507-16-embed3d@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180830154518.29507-1-embed3d@gmail.com> References: <20180830154518.29507-1-embed3d@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180830_084546_791657_AEF650B7 X-CRM114-Status: GOOD ( 15.80 ) 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 From: Icenowy Zheng As the H3 SoC, which is also in sun8i line, has totally different register map for the thermal sensor (a cut down version of GPADC), we should rename A23/A33-specified registers to contain A33, in order to prevent obfuscation with H3 registers. Currently these registers are only prefixed "SUN8I", not "SUN8I_A33". Add "_A33" after "SUN8I" on the register names. Signed-off-by: Icenowy Zheng Reviewed-by: Chen-Yu Tsai Acked-by: Maxime Ripard Acked-by: Lee Jones Acked-by: Jonathan Cameron --- drivers/iio/adc/sun4i-gpadc-iio.c | 2 +- include/linux/iio/adc/sun4i-gpadc.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/iio/adc/sun4i-gpadc-iio.c b/drivers/iio/adc/sun4i-gpadc-iio.c index e1fe5e8e9dc0..d48f338af563 100644 --- a/drivers/iio/adc/sun4i-gpadc-iio.c +++ b/drivers/iio/adc/sun4i-gpadc-iio.c @@ -106,7 +106,7 @@ static const struct gpadc_data sun6i_gpadc_data = { static const struct gpadc_data sun8i_a33_gpadc_data = { .temp_offset = -1662, .temp_scale = 162, - .tp_mode_en = SUN8I_GPADC_CTRL1_CHOP_TEMP_EN, + .tp_mode_en = SUN8I_A33_GPADC_CTRL1_CHOP_TEMP_EN, }; struct sun4i_gpadc_iio { diff --git a/include/linux/iio/adc/sun4i-gpadc.h b/include/linux/iio/adc/sun4i-gpadc.h index ca59336f246b..d6850f39dcfb 100644 --- a/include/linux/iio/adc/sun4i-gpadc.h +++ b/include/linux/iio/adc/sun4i-gpadc.h @@ -38,9 +38,9 @@ #define SUN6I_GPADC_CTRL1_ADC_CHAN_SELECT(x) (GENMASK(3, 0) & BIT(x)) #define SUN6I_GPADC_CTRL1_ADC_CHAN_MASK GENMASK(3, 0) -/* TP_CTRL1 bits for sun8i SoCs */ -#define SUN8I_GPADC_CTRL1_CHOP_TEMP_EN BIT(8) -#define SUN8I_GPADC_CTRL1_GPADC_CALI_EN BIT(7) +/* TP_CTRL1 bits for A33 */ +#define SUN8I_A33_GPADC_CTRL1_CHOP_TEMP_EN BIT(8) +#define SUN8I_A33_GPADC_CTRL1_GPADC_CALI_EN BIT(7) #define SUN4I_GPADC_CTRL2 0x08 From patchwork Thu Aug 30 15:45:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Rossak X-Patchwork-Id: 10582179 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 6AC19920 for ; Thu, 30 Aug 2018 15:54:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5997F2C0E7 for ; Thu, 30 Aug 2018 15:54:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4BB1A2C0EA; Thu, 30 Aug 2018 15:54:45 +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 CE1392C0E7 for ; Thu, 30 Aug 2018 15:54:44 +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:References: In-Reply-To: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:List-Owner; bh=5B0hcDTGM5jsYOJoBJCUpASqSFg9M2g3cJ9JZZM2ZYM=; b=Cr6CPcDAv1JwBypPflb9hgOrw+ vm9u7AVlPDst0obqEFuKtsyerkZ0/hrQ9QJdEioV3LqnY1HNnGtLzUQiwvmkL5EdQaQFk+XECX3TN IJpoA8hbA4I6UvnzfH0Y/d8LqBdt2Zm85Wsl+SffWT8IReukmkYjIfE8+mZBFEQZ67+EtZ3O/M2Df dEetPMujgq+0ZU1h2bvLNRI7uuvI1vDGeiKlx/x52+0kMHJpWQQSrI1dGCC5dV81dadXqJQOU/lNG YveyywY53eiKENcMn7huO7CP148IJzbWf7c3zkRCA6G8bW1C9BwsVqZHuyuVZIUi45OYwo+ZK4ilp rZWUdWJQ==; 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 1fvPHK-0006Uy-Mf; Thu, 30 Aug 2018 15:54:38 +0000 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fvP8h-0001ez-GV for linux-arm-kernel@lists.infradead.org; Thu, 30 Aug 2018 15:45:46 +0000 Received: by mail-wm0-x241.google.com with SMTP id j192-v6so2528608wmj.1 for ; Thu, 30 Aug 2018 08:45:37 -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:in-reply-to:references; bh=GG6wm40smk2VetGm2lnviKqcGAT7hYe3vQr/oTzaQVI=; b=bmaS1q+BXPmP+DBPMWuqMWjvwRfnyLvqywziuN95cD4E2O2H/937CWvaU7dZGRLfIB TNRg2u02nRjE/1uV1ZWJ3llffiaf+/xJvWhJNkNe1rffeAUhxNF84g5U6aQsjPVj1W/8 SImjeOvtj2Tzv3c8OPFIrUY/VnOon5z6mX4nijxLnSN3qwRqX5ZcmTakFNd/OmrHR6Wz s9eWI6ggYw9pOxvwuATKCl1KZ9jY/ejuGwVwLnvsRxgYJm4Z9UaRD0u1jnwd3HnBSAxw Zu5W1BxReIWEFeXrxzTprw77LxhzdxvJw3yXI+Wtf4/yfprWDsSh8TjI+i25nCXdJaOW Y0lw== 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:in-reply-to :references; bh=GG6wm40smk2VetGm2lnviKqcGAT7hYe3vQr/oTzaQVI=; b=ahb7T1u/hQ7+hFDbijq//M+aPoSJAJYPfVTUrx1hNQgEA0/bZ9Dbp8JVsxSXelDZCH diRAGZtPoRFV3+y0Im2xQ/Gt1naNvl/3L3TLi+ZmkZmmVxn2UM5n+CDVNkQvzIYXBkJj Yh8TA0/deD6Bb+xqXG45oXu+EJZ/M2I8NsTnym6L6Gl3GKr42fIf3ysBkTfTfuXe4ucp wJqmrPJLvrqpgDJgZ+G3q/z9WrLZtSdMjyzH0OtLm05JS+9MlQl+pd0tClIN7h/rsEGd DapShmXV7kzJGs/Lv11kyaOYxALnHMXyw1P7HgSTG+n/t/wcqNjE2Q+0g56LEU8Vd0k0 LuWQ== X-Gm-Message-State: APzg51ANv9Kbtv+deu2HfCArZ04ma8v21I35YAOGUtpB0PnH+EieMc3A 3N9nfWdDFdmQIaVw8HzeXcw= X-Google-Smtp-Source: ANB0VdartHcfUT/nLcBRFFSP0xJuRdhM2ofPyAGtXEWOSTAVOlQdEA31+/7iJBAgj7G7lNw7quj1hw== X-Received: by 2002:a1c:c3c6:: with SMTP id t189-v6mr2114853wmf.59.1535643936145; Thu, 30 Aug 2018 08:45:36 -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.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Aug 2018 08:45:35 -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 16/30] iio: adc: sun4i-gpadc-iio: rework: readout temp_data Date: Thu, 30 Aug 2018 17:45:04 +0200 Message-Id: <20180830154518.29507-17-embed3d@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180830154518.29507-1-embed3d@gmail.com> References: <20180830154518.29507-1-embed3d@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180830_084543_768185_E25BF662 X-CRM114-Status: GOOD ( 16.49 ) 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 For adding newer sensor some basic rework of the code is necessary. This commit reworks the code and uses regmap field to read out temp_data. Signed-off-by: Philipp Rossak --- drivers/iio/adc/sun4i-gpadc-iio.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/drivers/iio/adc/sun4i-gpadc-iio.c b/drivers/iio/adc/sun4i-gpadc-iio.c index d48f338af563..c278e165e161 100644 --- a/drivers/iio/adc/sun4i-gpadc-iio.c +++ b/drivers/iio/adc/sun4i-gpadc-iio.c @@ -63,6 +63,7 @@ struct gpadc_data { int (*ths_suspend)(struct sun4i_gpadc_iio *info); int (*ths_resume)(struct sun4i_gpadc_iio *info); bool support_irq; + u32 temp_data_base; }; static irqreturn_t sun4i_gpadc_data_irq_handler(int irq, void *dev_id); @@ -77,6 +78,7 @@ static const struct gpadc_data sun4i_gpadc_data = { .adc_channel = true, .ths_irq_thread = sun4i_gpadc_data_irq_handler, .support_irq = true, + .temp_data_base = SUN4I_GPADC_TEMP_DATA, }; static const struct gpadc_data sun5i_gpadc_data = { @@ -89,6 +91,7 @@ static const struct gpadc_data sun5i_gpadc_data = { .adc_channel = true, .ths_irq_thread = sun4i_gpadc_data_irq_handler, .support_irq = true, + .temp_data_base = SUN4I_GPADC_TEMP_DATA, }; static const struct gpadc_data sun6i_gpadc_data = { @@ -101,12 +104,14 @@ static const struct gpadc_data sun6i_gpadc_data = { .adc_channel = true, .ths_irq_thread = sun4i_gpadc_data_irq_handler, .support_irq = true, + .temp_data_base = SUN4I_GPADC_TEMP_DATA, }; static const struct gpadc_data sun8i_a33_gpadc_data = { .temp_offset = -1662, .temp_scale = 162, .tp_mode_en = SUN8I_A33_GPADC_CTRL1_CHOP_TEMP_EN, + .temp_data_base = SUN4I_GPADC_TEMP_DATA, }; struct sun4i_gpadc_iio { @@ -271,18 +276,18 @@ static int sun4i_gpadc_temp_read(struct iio_dev *indio_dev, int *val) { struct sun4i_gpadc_iio *info = iio_priv(indio_dev); - if (!info->data->support_irq) { - pm_runtime_get_sync(indio_dev->dev.parent); + if (info->data->adc_channel) + return sun4i_gpadc_read(indio_dev, 0, val, + SUN4I_GPADC_IRQ_TEMP_DATA); - regmap_read(info->regmap, SUN4I_GPADC_TEMP_DATA, val); + pm_runtime_get_sync(indio_dev->dev.parent); - pm_runtime_mark_last_busy(indio_dev->dev.parent); - pm_runtime_put_autosuspend(indio_dev->dev.parent); + regmap_read(info->regmap, info->data->temp_data_base, val); - return 0; - } + pm_runtime_mark_last_busy(indio_dev->dev.parent); + pm_runtime_put_autosuspend(indio_dev->dev.parent); - return sun4i_gpadc_read(indio_dev, 0, val, SUN4I_GPADC_IRQ_TEMP_DATA); + return 0; } static int sun4i_gpadc_temp_offset(struct iio_dev *indio_dev, int *val) From patchwork Thu Aug 30 15:45:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Rossak X-Patchwork-Id: 10582193 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 109D214BD for ; Thu, 30 Aug 2018 15:59:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F272C2C0EE for ; Thu, 30 Aug 2018 15:58:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E572A2C0F3; Thu, 30 Aug 2018 15:58:59 +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 695F92C0EE for ; Thu, 30 Aug 2018 15:58:59 +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:References: In-Reply-To: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:List-Owner; bh=6+9atuhb5eSEDmHi+VyP9FJaauvbR0uCKMiJ2fyA74I=; b=g5zZUwBKUJX/8Tr+cD7HPv0Xg5 rFuitJuOMQvaRkcrMVx2CpETw5qJsjC6hdAFjJcSSgRszLHJDne87yykd+OjelNAxDhwIqVUZA7EZ /qixgtDtA2FcyjE9z/34VohYs1kGwmSz/MTBtbhxUE7k9IuPJWBjJYk6plOVNb/74eEofLTkhpe5k UWJIvIXWieD9vKgzEqDHR/Fnah647w6thamHAfic3p3uypkUnIPuSlMRF3ZD1+s3Ccfv5a4BpLuEa 2yNrG8RrgpF/rdAgqHrDrIy1AI2Ts+nNlOgQjjofQTsvZT9vgLzbBFytIQeX/dQo1yZ0aoXcrp1DL /ymzXkUQ==; 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 1fvPLO-000102-QJ; Thu, 30 Aug 2018 15:58:50 +0000 Received: from mail-wm0-f68.google.com ([74.125.82.68]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fvP8n-0001fs-DP for linux-arm-kernel@lists.infradead.org; Thu, 30 Aug 2018 15:45:51 +0000 Received: by mail-wm0-f68.google.com with SMTP id c14-v6so2472731wmb.4 for ; Thu, 30 Aug 2018 08:45:39 -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:in-reply-to:references; bh=awc7lOb1lT80drwezjxAgYVu4AbsJ53UXF1LdxXOCho=; b=X0MxvQAWNa/QHG1a/x8gvN03aFC9bPKcstD3++OvpK/mWPr/Nu71ydd6Bi41ISzadw qIrOAT4F4OdsZ2kzh+q00Iis58hoEqbdTQiaJXXSzS2z9xTXQ5TxEH5tqgZjYazGaWjL bgRuTIATJ9oEsL4Wiu0TCg4IYGtnZMurHeihga0x6jkxCqTnuwwGYQJO+iPhrO6Es8uG PfJfsu2w7Xck8vTApyDRlNjCvRFoI5IwEtRAnxtxmXrFhmaoTmiGArLtORnF021wvrAd TAL+o92qdd4pPHPE+vbp5YWVnctSPkhqkJ92iBaWO2vxPhz1KGnXaQA3f6nl67oaEha3 JKrQ== 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:in-reply-to :references; bh=awc7lOb1lT80drwezjxAgYVu4AbsJ53UXF1LdxXOCho=; b=eVvinShrX3W1JFCoTPRPILnzV1M9mhrNfPhJyiPPGtvChHVE136wq4C6LfmnVQZDil eWD5cm179hQL+QWak9rCP8vNjkLVIxSGZsdFRE4fe8mSRO6s+f4QFQaG25z6mOhfFUXS u4yhSNirmDuxNnzM7xgoN53q5Ve4g25zWrE7wMhcWa9M+z44y+VHpFJWzQo1iGOAAQmn 97VOHWGVO89Lo8IpyD+BNb9l2/Bby/Ni3Bfw2Kij4chFE91vftbdNCbJ9+3I9xFReDPR SfXDHT6YiaadUF22fv5APi5YkQUGYR4YeeWl876o1Y7vzu5q+1olkNLTTEpmlnYGrQm/ /YNQ== X-Gm-Message-State: APzg51BSPLLb1dmxJS9csV3EF5z79t3O6yljlOBMOkh2peqy0DuILj3u pfjzDfHSOB1NhrHtpYgUMzE= X-Google-Smtp-Source: ANB0VdZ9TFSjSij1veJmjfSvCzyhdYiErnmAIpTWPnan95g96ps8uKTdevRe8LnmmxEcbDyC2EYNlg== X-Received: by 2002:a1c:7e13:: with SMTP id z19-v6mr2044367wmc.156.1535643937235; Thu, 30 Aug 2018 08:45:37 -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.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Aug 2018 08:45:36 -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 17/30] iio: adc: sun4i-gpadc-iio: rework: support clocks and reset Date: Thu, 30 Aug 2018 17:45:05 +0200 Message-Id: <20180830154518.29507-18-embed3d@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180830154518.29507-1-embed3d@gmail.com> References: <20180830154518.29507-1-embed3d@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180830_084549_611721_9A7D09C4 X-CRM114-Status: GOOD ( 18.49 ) 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 For adding newer sensor some basic rework of the code is necessary. The SoCs after H3 has newer thermal sensor ADCs, which have two clock inputs (bus clock and sampling clock) and a reset. The registers are also re-arranged. This commit reworks the code, adds the process of the clocks and resets. Signed-off-by: Philipp Rossak --- drivers/iio/adc/sun4i-gpadc-iio.c | 72 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 70 insertions(+), 2 deletions(-) diff --git a/drivers/iio/adc/sun4i-gpadc-iio.c b/drivers/iio/adc/sun4i-gpadc-iio.c index c278e165e161..c12de48c4e86 100644 --- a/drivers/iio/adc/sun4i-gpadc-iio.c +++ b/drivers/iio/adc/sun4i-gpadc-iio.c @@ -22,6 +22,7 @@ * shutdown for not being used. */ +#include #include #include #include @@ -31,6 +32,7 @@ #include #include #include +#include #include #include @@ -63,6 +65,9 @@ struct gpadc_data { int (*ths_suspend)(struct sun4i_gpadc_iio *info); int (*ths_resume)(struct sun4i_gpadc_iio *info); bool support_irq; + bool has_bus_clk; + bool has_bus_rst; + bool has_mod_clk; u32 temp_data_base; }; @@ -127,6 +132,9 @@ struct sun4i_gpadc_iio { struct mutex mutex; struct thermal_zone_device *tzd; struct device *sensor_device; + struct clk *bus_clk; + struct clk *mod_clk; + struct reset_control *reset; }; static const struct iio_chan_spec sun4i_gpadc_channels[] = { @@ -472,8 +480,13 @@ static int sun4i_gpadc_probe_dt(struct platform_device *pdev, if (IS_ERR(base)) return PTR_ERR(base); - info->regmap = devm_regmap_init_mmio(&pdev->dev, base, - &sun4i_gpadc_regmap_config); + if (info->data->has_bus_clk) + info->regmap = devm_regmap_init_mmio_clk(&pdev->dev, "bus", + base, &sun4i_gpadc_regmap_config); + else + info->regmap = devm_regmap_init_mmio(&pdev->dev, base, + &sun4i_gpadc_regmap_config); + if (IS_ERR(info->regmap)) { ret = PTR_ERR(info->regmap); dev_err(&pdev->dev, "failed to init regmap: %d\n", ret); @@ -498,9 +511,58 @@ static int sun4i_gpadc_probe_dt(struct platform_device *pdev, } } + if (info->data->has_bus_rst) { + info->reset = devm_reset_control_get(&pdev->dev, NULL); + if (IS_ERR(info->reset)) { + ret = PTR_ERR(info->reset); + return ret; + } + + ret = reset_control_deassert(info->reset); + if (ret) + return ret; + } + + if (info->data->has_bus_clk) { + info->bus_clk = devm_clk_get(&pdev->dev, "bus"); + if (IS_ERR(info->bus_clk)) { + ret = PTR_ERR(info->bus_clk); + goto assert_reset; + } + + ret = clk_prepare_enable(info->bus_clk); + if (ret) + goto assert_reset; + } + + if (info->data->has_mod_clk) { + info->mod_clk = devm_clk_get(&pdev->dev, "mod"); + if (IS_ERR(info->mod_clk)) { + ret = PTR_ERR(info->mod_clk); + goto disable_bus_clk; + } + + /* Running at 4MHz */ + ret = clk_set_rate(info->mod_clk, 4000000); + if (ret) + goto disable_bus_clk; + + ret = clk_prepare_enable(info->mod_clk); + if (ret) + goto disable_bus_clk; + } + info->sensor_device = &pdev->dev; return 0; + +disable_bus_clk: + clk_disable_unprepare(info->bus_clk); + +assert_reset: + reset_control_assert(info->reset); + + return ret; } static int sun4i_gpadc_probe(struct platform_device *pdev) @@ -586,6 +648,12 @@ static int sun4i_gpadc_remove(struct platform_device *pdev) if (!info->data->support_irq) iio_map_array_unregister(indio_dev); + clk_disable_unprepare(info->mod_clk); + + clk_disable_unprepare(info->bus_clk); + + reset_control_assert(info->reset); + return 0; } From patchwork Thu Aug 30 15:45:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Rossak X-Patchwork-Id: 10582201 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 A8C5C5A4 for ; Thu, 30 Aug 2018 16:00:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9720A2C0EE for ; Thu, 30 Aug 2018 16:00:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8A5FA2C0F5; Thu, 30 Aug 2018 16:00:28 +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 E24ED2C0EE for ; Thu, 30 Aug 2018 16:00:27 +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:References: In-Reply-To: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:List-Owner; bh=/kZSySTKBtq/L27B6xLTLVMG6qaXbka2KRPzndS3uvk=; b=MIJq4ZWxNEWVK/GoK0zrjnzmah bv3JR/OzyARkzJF2O54fU6WXKXigBqNN1n/FHXCQE792jWYK9A0FXdUxX8iZvhawH5haHCcUY5pS7 /PAz3PfHt7f/8HHx0985wYVPd74FM6sAfI2OaK1pttN3m7FI8L7Tk069A05xa4neunwAvOo7BO6wn wcDqkwIBea9Ok+zv0e2IgccpjTtwXB2Lzx+/X4BfqcsmtuKg1Qo/C/4rqSz5CqDKmW3lLv+Cganh9 fggCr1MCX/tdkCsovwRYY9XigCkQUe2M8VOP8G9+GESfejedKq8w/utciECAwdIvX8QyyOcMhquy2 nWpph8uQ==; 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 1fvPMn-0001q3-3U; Thu, 30 Aug 2018 16:00:17 +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 1fvP8i-0001gJ-2d for linux-arm-kernel@lists.infradead.org; Thu, 30 Aug 2018 15:45:50 +0000 Received: by mail-wm0-x243.google.com with SMTP id q8-v6so2519557wmq.4 for ; Thu, 30 Aug 2018 08:45:40 -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:in-reply-to:references; bh=N6141Ki7LdUw674d0MdnXgMDsiqsMsbsw/lSIG8XBVs=; b=NT6lYmI5yFXY3XhT2a8Myi90wRHmOlJKv2BJqHJ1T3iKAEZyEQN+XDucZN+mkifPI4 2QhItys/+hIIWExLpXM5V4dRGNd/2Ks8P/7iof1q03TL5DZ6NPbPQF7ISFWOb/J4V5f4 QgI8TeafNUXWSKBK6eWXrqaQtRkJjHdLTL95IPtKaQrAtnNnGHOwEkh4/7Tdcc3ZHBIN Fbge05vGS4AwKfeOT665K2vrIkGIB5e4CdpOd+5XdGbyyuFH8qvw0qMw+B7XaxLSCni/ W0G8xPHcFdtafkFsJnOTsypN1xCAaSozfW9ZZ3DDwWWU/nHqSgvUFmWLhXtT1LLWIv2N nYcA== 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:in-reply-to :references; bh=N6141Ki7LdUw674d0MdnXgMDsiqsMsbsw/lSIG8XBVs=; b=ud3ZtYSNyNlxEHMfk4LJUgzUnC1ZC+ofuesHgEP2ofVLpdX0Yq1uaO2rYGHiafouxi 9t6hSJd+aPaIWop+kBBQIaL3A4M5TTjka/EX8i3sRj9Uqz1U9Knur0lgLlEylg/LT3mN gmo9MklRHyBcoXXx22oQRVZD2igJDYgSzWSaQRFA4ivLkjeU7G1DNxx1KSXGOqniJy07 6ik7+c3qo0PM0D/En9mwazDKZu8P1QJlG8pshKzTbdJLvLa6gzyr9chGa9e0RAgrQu7x 1W3WECiwRv2MXpT/rs6JEvp4sogY9iESUfCHhVVkdzFub0r0auHines8UkseMkTelQ38 6n6A== X-Gm-Message-State: APzg51CUj7CccBzI9ESK2BPAC+q0izXcQhXPTcOlA5EjcyW+bFvD29Vr FIVLvlrfCE9uKfOdiX8GyIA= X-Google-Smtp-Source: ANB0VdZ8sncvXVWUgtJ/cgboupUxORCKh5ILa2CfhCfUImztEU9/DcFFeKHRuzX3YsdxRGBHNYcpxQ== X-Received: by 2002:a1c:4182:: with SMTP id o124-v6mr2123984wma.101.1535643938382; Thu, 30 Aug 2018 08:45:38 -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.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Aug 2018 08:45:37 -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 18/30] iio: adc: sun4i-gpadc-iio: rework: support multiple sensors Date: Thu, 30 Aug 2018 17:45:06 +0200 Message-Id: <20180830154518.29507-19-embed3d@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180830154518.29507-1-embed3d@gmail.com> References: <20180830154518.29507-1-embed3d@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180830_084544_236744_1C0C5AB3 X-CRM114-Status: GOOD ( 22.94 ) 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 For adding newer sensor some basic rework of the code is necessary. This patch reworks the driver to be able to handle more than one thermal sensor. Newer SoC like the A80 have 4 thermal sensors. Because of this the maximal sensor count value was set to 4. The sensor_id value is set during sensor registration and is for each registered sensor indiviual. This makes it able to differntiate the sensors when the value is read from the register. In function sun4i_gpadc_read_raw(), the sensor number of the ths sensor was directly set to 0 (sun4i_gpadc_temp_read(x,x,0)). This selects in the temp_read function automatically sensor 0. A check for the sensor_id is here not required since the old sensors only have one thermal sensor. In addition to that is the sun4i_gpadc_read_raw() function only used by the "older" sensors (before A33) where the thermal sensor was a cobination of an adc and a thermal sensor. Signed-off-by: Philipp Rossak --- drivers/iio/adc/sun4i-gpadc-iio.c | 63 +++++++++++++++++++++++++------------ include/linux/iio/adc/sun4i-gpadc.h | 3 ++ 2 files changed, 46 insertions(+), 20 deletions(-) diff --git a/drivers/iio/adc/sun4i-gpadc-iio.c b/drivers/iio/adc/sun4i-gpadc-iio.c index c12de48c4e86..18ab72e52d78 100644 --- a/drivers/iio/adc/sun4i-gpadc-iio.c +++ b/drivers/iio/adc/sun4i-gpadc-iio.c @@ -69,6 +69,7 @@ struct gpadc_data { bool has_bus_rst; bool has_mod_clk; u32 temp_data_base; + int sensor_count; }; static irqreturn_t sun4i_gpadc_data_irq_handler(int irq, void *dev_id); @@ -84,6 +85,7 @@ static const struct gpadc_data sun4i_gpadc_data = { .ths_irq_thread = sun4i_gpadc_data_irq_handler, .support_irq = true, .temp_data_base = SUN4I_GPADC_TEMP_DATA, + .sensor_count = 1, }; static const struct gpadc_data sun5i_gpadc_data = { @@ -97,6 +99,7 @@ static const struct gpadc_data sun5i_gpadc_data = { .ths_irq_thread = sun4i_gpadc_data_irq_handler, .support_irq = true, .temp_data_base = SUN4I_GPADC_TEMP_DATA, + .sensor_count = 1, }; static const struct gpadc_data sun6i_gpadc_data = { @@ -110,6 +113,7 @@ static const struct gpadc_data sun6i_gpadc_data = { .ths_irq_thread = sun4i_gpadc_data_irq_handler, .support_irq = true, .temp_data_base = SUN4I_GPADC_TEMP_DATA, + .sensor_count = 1, }; static const struct gpadc_data sun8i_a33_gpadc_data = { @@ -117,6 +121,13 @@ static const struct gpadc_data sun8i_a33_gpadc_data = { .temp_scale = 162, .tp_mode_en = SUN8I_A33_GPADC_CTRL1_CHOP_TEMP_EN, .temp_data_base = SUN4I_GPADC_TEMP_DATA, + .sensor_count = 1, +}; + +struct sun4i_sensor_tzd { + struct sun4i_gpadc_iio *info; + struct thermal_zone_device *tzd; + unsigned int sensor_id; }; struct sun4i_gpadc_iio { @@ -130,7 +141,7 @@ struct sun4i_gpadc_iio { const struct gpadc_data *data; /* prevents concurrent reads of temperature and ADC */ struct mutex mutex; - struct thermal_zone_device *tzd; + struct sun4i_sensor_tzd tzds[MAX_SENSOR_COUNT]; struct device *sensor_device; struct clk *bus_clk; struct clk *mod_clk; @@ -280,7 +291,8 @@ static int sun4i_gpadc_adc_read(struct iio_dev *indio_dev, int channel, SUN4I_GPADC_IRQ_FIFO_DATA); } -static int sun4i_gpadc_temp_read(struct iio_dev *indio_dev, int *val) +static int sun4i_gpadc_temp_read(struct iio_dev *indio_dev, int *val, + int sensor) { struct sun4i_gpadc_iio *info = iio_priv(indio_dev); @@ -290,7 +302,8 @@ static int sun4i_gpadc_temp_read(struct iio_dev *indio_dev, int *val) pm_runtime_get_sync(indio_dev->dev.parent); - regmap_read(info->regmap, info->data->temp_data_base, val); + regmap_read(info->regmap, info->data->temp_data_base + 0x4 * sensor, + val); pm_runtime_mark_last_busy(indio_dev->dev.parent); pm_runtime_put_autosuspend(indio_dev->dev.parent); @@ -334,7 +347,7 @@ static int sun4i_gpadc_read_raw(struct iio_dev *indio_dev, ret = sun4i_gpadc_adc_read(indio_dev, chan->channel, val); else - ret = sun4i_gpadc_temp_read(indio_dev, val); + ret = sun4i_gpadc_temp_read(indio_dev, val, 0); if (ret) return ret; @@ -420,10 +433,11 @@ static int sun4i_gpadc_runtime_resume(struct device *dev) static int sun4i_gpadc_get_temp(void *data, int *temp) { - struct sun4i_gpadc_iio *info = data; + struct sun4i_sensor_tzd *tzd = data; + struct sun4i_gpadc_iio *info = tzd->info; int val, scale, offset; - if (sun4i_gpadc_temp_read(info->indio_dev, &val)) + if (sun4i_gpadc_temp_read(info->indio_dev, &val, tzd->sensor_id)) return -ETIMEDOUT; sun4i_gpadc_temp_scale(info->indio_dev, &scale); @@ -569,7 +583,7 @@ static int sun4i_gpadc_probe(struct platform_device *pdev) { struct sun4i_gpadc_iio *info; struct iio_dev *indio_dev; - int ret; + int ret, i; indio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(*info)); if (!indio_dev) @@ -603,18 +617,24 @@ static int sun4i_gpadc_probe(struct platform_device *pdev) pm_runtime_set_suspended(&pdev->dev); pm_runtime_enable(&pdev->dev); - info->tzd = thermal_zone_of_sensor_register(info->sensor_device, - 0, info, - &sun4i_ts_tz_ops); - /* - * Do not fail driver probing when failing to register in - * thermal because no thermal DT node is found. - */ - if (IS_ERR(info->tzd) && PTR_ERR(info->tzd) != -ENODEV) { - dev_err(&pdev->dev, - "could not register thermal sensor: %ld\n", - PTR_ERR(info->tzd)); - return PTR_ERR(info->tzd); + for (i = 0; i < info->data->sensor_count; i++) { + info->tzds[i].info = info; + info->tzds[i].sensor_id = i; + + info->tzds[i].tzd = thermal_zone_of_sensor_register( + info->sensor_device, + i, &info->tzds[i], &sun4i_ts_tz_ops); + /* + * Do not fail driver probing when failing to register in + * thermal because no thermal DT node is found. + */ + if (IS_ERR(info->tzds[i].tzd) && \ + PTR_ERR(info->tzds[i].tzd) != -ENODEV) { + dev_err(&pdev->dev, + "could not register thermal sensor: %ld\n", + PTR_ERR(info->tzds[i].tzd)); + return PTR_ERR(info->tzds[i].tzd); + } } ret = devm_iio_device_register(&pdev->dev, indio_dev); @@ -639,11 +659,14 @@ static int sun4i_gpadc_remove(struct platform_device *pdev) { struct iio_dev *indio_dev = platform_get_drvdata(pdev); struct sun4i_gpadc_iio *info = iio_priv(indio_dev); + int i; pm_runtime_put(&pdev->dev); pm_runtime_disable(&pdev->dev); - thermal_zone_of_sensor_unregister(info->sensor_device, info->tzd); + for (i = 0; i < info->data->sensor_count; i++) + thermal_zone_of_sensor_unregister(info->sensor_device, + info->tzds[i].tzd); if (!info->data->support_irq) iio_map_array_unregister(indio_dev); diff --git a/include/linux/iio/adc/sun4i-gpadc.h b/include/linux/iio/adc/sun4i-gpadc.h index d6850f39dcfb..99feeba28105 100644 --- a/include/linux/iio/adc/sun4i-gpadc.h +++ b/include/linux/iio/adc/sun4i-gpadc.h @@ -99,4 +99,7 @@ .datasheet_name = _name, \ } +/* SUNXI_THS COMMON REGISTERS + DEFINES */ +#define MAX_SENSOR_COUNT 4 + #endif From patchwork Thu Aug 30 15:45:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Rossak X-Patchwork-Id: 10582203 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 514BF920 for ; Thu, 30 Aug 2018 16:01:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3CD492C0F5 for ; Thu, 30 Aug 2018 16:01:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2F4DC2C0F8; Thu, 30 Aug 2018 16:01:08 +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 B55002C0F6 for ; Thu, 30 Aug 2018 16:01:07 +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:References: In-Reply-To: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:List-Owner; bh=yVf7PrwVrAD9n3KyirleTmQEgQFiwhI98QmttNxscI0=; b=lyp9EDrDtqTOhrnKt5w4Wd12xg kfrKzQZ7DL5rLvskzcRiMI3YXRj4j/Od+OHvyomkOwHFrBXVSzZdMAYmBQ56QwSfWTFVh8E+50vrD RwvGIXXxvv0xmvt/xCP4RgL7mjDBR0XDyHY6o8O57khChmudEjZ7qQA9nWovhoJ48IwsSLs2nCQPB 9js1g0GrcpDS3HCGP45ilvZZ9/K66y/+oMfMq76vK2Ct80B7aR1QYMSXmUUDCfGHyTzlf85kCZDhO LcCEQuVurbsxlyBW+LAb6oxGfjdAe3J/g1zto4sTNVuMX0euHb4iw78k6OBuSU6J8de+I7QvxsEFn 0seHeB0Q==; 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 1fvPNT-000319-Kj; Thu, 30 Aug 2018 16:00:59 +0000 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fvP8o-0001gl-Tc for linux-arm-kernel@lists.infradead.org; Thu, 30 Aug 2018 15:45:52 +0000 Received: by mail-wr1-x443.google.com with SMTP id u12-v6so8499650wrr.4 for ; Thu, 30 Aug 2018 08:45:40 -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:in-reply-to:references; bh=pQqP9NLkOkVzk7D1LMI8Y+J0UMHbo42I8dLSpZuhXRc=; b=ifjRSj4labF3yu/ZzTuSbrT/tXp0Y94XnTmFsd7hGvpHksuOTJFkstfQyLwsdSeuhg 2cQOsLTCbSQ/peuCBn+Scy3WOGD6UqaEAOfoOFyy6ImZdzy0LMrgYMDLGIZKkcZ426J2 fytPVBhEHAqXxCS9LJdkT7br17YVBn8152BzGmYR7hbvRwVS0KMevexNN3I3XIFUSiKa QgmXIUaFF9bqwtBDZ80VEBYG9mmhI6CLG+A2QdbWAmIM+vVoTZpiGLwvy5HsQavSNFIH CTHaCqDSkjNf6oBEX367tVx3X/lizfdCeNa7ftNg8Aa2J/WAfRJjgvkqJJtJOky876zo fRAg== 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:in-reply-to :references; bh=pQqP9NLkOkVzk7D1LMI8Y+J0UMHbo42I8dLSpZuhXRc=; b=G3L9tGAdj+R+yELmtg90saIDElxSDtTE8N54dlkHYfLiIqE273h9AlIhU+ODW72BTW XBiayCLOdnqBZZEq0PkRt7x74kqWmVIUHLCcsw6tEB5kXhIL0fdA26ayfQnqAcvlZ6Gp byzzw2WbLN8BIZAu3J8eR/pnmKlJGjn0kDCHI6IaqjeABmKRcGYrVoRXlAysDkY/UEdb yW/ytWRMIwPoBO7IoNa/iV4XlsR21On7He5ENFmBJOGEKu2CcArRhUcFICtgJGwFlwHa JHPAknSnpPtd8qsVTPQ/XQ2ZhmjZPLRHQV+Btkmpsxxr6Q5jxApxY2F7Z2ewhzSgkcc8 gqcQ== X-Gm-Message-State: APzg51AeaTw+z2pD6yP8TVAfSAEuGJUUAmucB3f/7w7lw+yRXifPZ+ob Va3bWsp8BizXgdHrRumIyH0= X-Google-Smtp-Source: ANB0VdbPUje7m+TY75vPDhE9sYa/+ktpN26Akzo30ji9NJssK0h+wSx/ea7ItLTibVU6zFY3qvT0gw== X-Received: by 2002:adf:bb41:: with SMTP id x1-v6mr7702826wrg.24.1535643939495; Thu, 30 Aug 2018 08:45:39 -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.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Aug 2018 08:45:38 -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 19/30] iio: adc: sun4i-gpadc-iio: rework: support nvmem calibration data Date: Thu, 30 Aug 2018 17:45:07 +0200 Message-Id: <20180830154518.29507-20-embed3d@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180830154518.29507-1-embed3d@gmail.com> References: <20180830154518.29507-1-embed3d@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180830_084551_083537_7A998048 X-CRM114-Status: GOOD ( 15.93 ) 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 This patch reworks the driver to support nvmem calibration cells. The driver checks if the nvmem calibration is supported and reads out the nvmem. Signed-off-by: Philipp Rossak --- drivers/iio/adc/sun4i-gpadc-iio.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/drivers/iio/adc/sun4i-gpadc-iio.c b/drivers/iio/adc/sun4i-gpadc-iio.c index 18ab72e52d78..2fd73d143815 100644 --- a/drivers/iio/adc/sun4i-gpadc-iio.c +++ b/drivers/iio/adc/sun4i-gpadc-iio.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -70,6 +71,7 @@ struct gpadc_data { bool has_mod_clk; u32 temp_data_base; int sensor_count; + bool supports_nvmem; }; static irqreturn_t sun4i_gpadc_data_irq_handler(int irq, void *dev_id); @@ -146,6 +148,7 @@ struct sun4i_gpadc_iio { struct clk *bus_clk; struct clk *mod_clk; struct reset_control *reset; + u32 calibration_data[2]; }; static const struct iio_chan_spec sun4i_gpadc_channels[] = { @@ -484,6 +487,9 @@ static int sun4i_gpadc_probe_dt(struct platform_device *pdev, struct resource *mem; void __iomem *base; int ret; + struct nvmem_cell *cell; + ssize_t cell_size; + u32 *cell_data; info->data = of_device_get_match_data(&pdev->dev); if (!info->data) @@ -494,6 +500,24 @@ static int sun4i_gpadc_probe_dt(struct platform_device *pdev, if (IS_ERR(base)) return PTR_ERR(base); + if (info->data->supports_nvmem) { + + cell = nvmem_cell_get(&pdev->dev, "calibration"); + if (IS_ERR(cell)) { + if (PTR_ERR(cell) == -EPROBE_DEFER) + return PTR_ERR(cell); + } else { + cell_data = (u32 *)nvmem_cell_read(cell, &cell_size); + if (cell_size != 8) + dev_err(&pdev->dev, + "Calibration data has wrong size\n"); + else { + info->calibration_data[0] = cell_data[0]; + info->calibration_data[1] = cell_data[1]; + } + } + } + if (info->data->has_bus_clk) info->regmap = devm_regmap_init_mmio_clk(&pdev->dev, "bus", base, &sun4i_gpadc_regmap_config); From patchwork Thu Aug 30 15:45:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Rossak X-Patchwork-Id: 10582181 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 DA49F920 for ; Thu, 30 Aug 2018 15:55:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C873E2C0E9 for ; Thu, 30 Aug 2018 15:55:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BC3802C0EB; Thu, 30 Aug 2018 15:55:36 +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 5ABF52C0E9 for ; Thu, 30 Aug 2018 15:55:36 +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:References: In-Reply-To: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:List-Owner; bh=BgPAHEobGgB16iKpfYweBRz35IKx1PfUTuTAVglIl9g=; b=cyFrL/Tx2GJcg20mIkcBnWz+nR HdMyz9hrZJVudLs2hxtJ/VAfiz952hbH49PtcyOJ+qfxTpcGAdw+PsErY9bBZg79ldEBiKlJMfayt 0e7Z9eQYZ7Y62eb23CNgqeU2QDP4HGKiyC+xh3zRimmU177SUheGVuVIPpQqVoLZsQcP193nrWGl9 s7x3nkmvwkP6hACqQX0d0Y7yhcIS7/hCOvyB3xjecJEDQZJh9sZSlierfd2tsh04WoQplIZmlZJ9n 0bOXenQMgUq+uNr3EE+Efgb2ejVu5grMhesEqfNvz/VdaNyCD4ETkt7Z9mFcMncN1bat3nmTYI2hW lYQ+Qm+w==; 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 1fvPI7-0007c3-Ij; Thu, 30 Aug 2018 15:55:27 +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 1fvP8i-0001gz-2M for linux-arm-kernel@lists.infradead.org; Thu, 30 Aug 2018 15:45:46 +0000 Received: by mail-wm0-x243.google.com with SMTP id f21-v6so2477874wmc.5 for ; Thu, 30 Aug 2018 08:45:41 -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:in-reply-to:references; bh=yEZZzXd7EqL0QVZwjKI2SdtLyI0ltZvJ5hxxkextUgQ=; b=CZtkdVtp06Yg5sR3ngIwd7L3KZq3/8j6SAEeTg0uaSi+JSVl+cDdDJEIvqRX5/PArS wFGgH/7HekLrY8j6dDC+YVVW5BXKbeGLkUGM7jgJa/oyhiENbrtXAv4zrDiW+xJlBkYM vfE18JH3/kUupsg24QSbbZN7uS68p/gXoiKYDqV9Fi2zKK0uGlQsf9Gp6fH9xYbX3f5x mng/6G+VfhJwFyj6xQvbNI1S2dLMIFFWyqQIUgPAdPqZJT3s/22HkVgocnkVB4I6tGpw k4IVea8z5V5+J/XKnrgbx4vnVjNoUtdAFN4HBZr4ymAhoYK170zmK+s8ZuNDiid8xIOV tYVw== 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:in-reply-to :references; bh=yEZZzXd7EqL0QVZwjKI2SdtLyI0ltZvJ5hxxkextUgQ=; b=l8NtqHvdIArj70SLApvRYk+xEjZYI34e3cK7/1llXBKcpeFlmJPOx8AXd6yq4hWyB3 /m1KBEPP6Jtdrb2Fzxo877GccPJF+6lVHGYgcfQ0XTnb7ewCw94zXNG+iXj1FfYkQN/l 9Db5gcuSqLeplCNeXfk13jQBXGQJZRyuG2OJjwgDd65VwitoTiJYNyTxa5kPL5zG1Nux KD0SsHgDvicvd8M6izUiasTbm1pRLB+EPpZgNM2G//H1zQ5tVKyaPLdeLpkh0NY4xx9v OpnXtS1FV23ljc0vYER4vHfNW3IOff+FvF+jxVcau7hl1iG2OsJ3YNTA+jBsZErlMxs/ bENQ== X-Gm-Message-State: APzg51DW/K1BM0X5seeef7BLS1NDgDJwxQsFhGXBVvSGvtZMR9nAnnmo DNFfdXvE7B+K1/VjC+YGywY= X-Google-Smtp-Source: ANB0Vdb4pUa0lLdosCK8FR5C6yVnMsY5GJ3f0A6QraMpJ04jdB2+jJlgh34MIlB8Vt40xIlnGqDMjQ== X-Received: by 2002:a1c:1943:: with SMTP id 64-v6mr2087807wmz.89.1535643940503; Thu, 30 Aug 2018 08:45:40 -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.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Aug 2018 08:45:40 -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 20/30] iio: adc: sun4i-gpadc-iio: rework: device specific suspend & resume Date: Thu, 30 Aug 2018 17:45:08 +0200 Message-Id: <20180830154518.29507-21-embed3d@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180830154518.29507-1-embed3d@gmail.com> References: <20180830154518.29507-1-embed3d@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180830_084544_141798_56282EF0 X-CRM114-Status: GOOD ( 13.04 ) 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 Different sensors will have different suspend and resume functions. So we are modularize the suspend and resume functions. The resume function configures and initializes the thermal sensor and the suspend function disables the sensors. Signed-off-by: Philipp Rossak --- drivers/iio/adc/sun4i-gpadc-iio.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/iio/adc/sun4i-gpadc-iio.c b/drivers/iio/adc/sun4i-gpadc-iio.c index 2fd73d143815..c7b46c82e3e5 100644 --- a/drivers/iio/adc/sun4i-gpadc-iio.c +++ b/drivers/iio/adc/sun4i-gpadc-iio.c @@ -76,6 +76,9 @@ struct gpadc_data { static irqreturn_t sun4i_gpadc_data_irq_handler(int irq, void *dev_id); +static int sun4i_ths_resume(struct sun4i_gpadc_iio *info); +static int sun4i_ths_suspend(struct sun4i_gpadc_iio *info); + static const struct gpadc_data sun4i_gpadc_data = { .temp_offset = -1932, .temp_scale = 133, @@ -87,6 +90,8 @@ static const struct gpadc_data sun4i_gpadc_data = { .ths_irq_thread = sun4i_gpadc_data_irq_handler, .support_irq = true, .temp_data_base = SUN4I_GPADC_TEMP_DATA, + .ths_resume = sun4i_ths_resume, + .ths_suspend = sun4i_ths_suspend, .sensor_count = 1, }; @@ -101,6 +106,8 @@ static const struct gpadc_data sun5i_gpadc_data = { .ths_irq_thread = sun4i_gpadc_data_irq_handler, .support_irq = true, .temp_data_base = SUN4I_GPADC_TEMP_DATA, + .ths_resume = sun4i_ths_resume, + .ths_suspend = sun4i_ths_suspend, .sensor_count = 1, }; @@ -115,6 +122,8 @@ static const struct gpadc_data sun6i_gpadc_data = { .ths_irq_thread = sun4i_gpadc_data_irq_handler, .support_irq = true, .temp_data_base = SUN4I_GPADC_TEMP_DATA, + .ths_resume = sun4i_ths_resume, + .ths_suspend = sun4i_ths_suspend, .sensor_count = 1, }; @@ -123,6 +132,8 @@ static const struct gpadc_data sun8i_a33_gpadc_data = { .temp_scale = 162, .tp_mode_en = SUN8I_A33_GPADC_CTRL1_CHOP_TEMP_EN, .temp_data_base = SUN4I_GPADC_TEMP_DATA, + .ths_resume = sun4i_ths_resume, + .ths_suspend = sun4i_ths_suspend, .sensor_count = 1, }; @@ -401,6 +412,11 @@ static irqreturn_t sun4i_gpadc_data_irq_handler(int irq, void *dev_id) static int sun4i_gpadc_runtime_suspend(struct device *dev) { struct sun4i_gpadc_iio *info = iio_priv(dev_get_drvdata(dev)); + return info->data->ths_suspend(info); +} + +static int sun4i_ths_suspend(struct sun4i_gpadc_iio *info) +{ /* Disable the ADC on IP */ regmap_write(info->regmap, SUN4I_GPADC_CTRL1, 0); @@ -415,7 +431,11 @@ static int sun4i_gpadc_runtime_suspend(struct device *dev) static int sun4i_gpadc_runtime_resume(struct device *dev) { struct sun4i_gpadc_iio *info = iio_priv(dev_get_drvdata(dev)); + return info->data->ths_resume(info); +} +static int sun4i_ths_resume(struct sun4i_gpadc_iio *info) +{ /* clkin = 6MHz */ regmap_write(info->regmap, SUN4I_GPADC_CTRL0, SUN4I_GPADC_CTRL0_ADC_CLK_DIVIDER(2) | From patchwork Thu Aug 30 15:45:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Rossak X-Patchwork-Id: 10582211 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 D2AE1920 for ; Thu, 30 Aug 2018 16:03:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C02582C10E for ; Thu, 30 Aug 2018 16:03:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B335C2C111; Thu, 30 Aug 2018 16:03:28 +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 37D6C2C10E for ; Thu, 30 Aug 2018 16:03:28 +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:References: In-Reply-To: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:List-Owner; bh=vgtqdG/8i4HP81IS7HeR3pKuvfwI7QBwRFeLrRb00yA=; b=NocmRrgXLP4RAiyrW5BG+6jcWf C2K2ocU/gZo9D5N+Tl2aflMxAaIVlZdpAsPyXqmIODAkHA+zipIMXGIkB5/mGE60DN7Dp8MqrZRUB 9+gidH9O2cvfDZLRmWywOnlxH9s2ll2YwWb9XKC7I3CQgZvBP/n689PHfDPoIGH7pEJexrbKODvzT YRrGDa70Qn5WxstPQObhr6dThXzyaaIFkqPOeIYClK9V2Uk5TFAvv5WrksdOtV+3DRSMywKdl2jQ+ Zii2EF3esmFWLMh2xRNtfVea+xqCtivUVhtPTpEfjuc1jjmt0DrN8i2VfpCsK7+8n1iXSkdOdUQIo x+NPu4DQ==; 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 1fvPPj-0003xJ-6b; Thu, 30 Aug 2018 16:03:19 +0000 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fvP8r-0001hf-DK for linux-arm-kernel@lists.infradead.org; Thu, 30 Aug 2018 15:45:58 +0000 Received: by mail-wm0-x242.google.com with SMTP id t25-v6so2496790wmi.3 for ; Thu, 30 Aug 2018 08:45:43 -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:in-reply-to:references; bh=b2zxZmF66f/SGjGiyfXMgDZt5Mg/3SRsrJ3/gODIh50=; b=sdBzcH8Z+kmG2MsK3JOyYOMnaCTEWGosz8IllZNPMzA1HxZQSUXlRHhpmtVmrE1HDH GFVdnwYAxwh+HS12i8Ya0FoobYfUe6ydC80Yim+7rs7nlz6PHfoGRFu7mlth/0M8K8fY sbUO31FGRzXRrk10sBMDhf+WUWYa4Js9G8s9v3B+XDLSrXIgvvDOXmGWvI8FzseibVke 7zWeBcvh6uZ7fLQC/zuMCJ1fWrzR/r5C7jo7tnzUhs1K5L3B2LTZg/T94Icc1vjLKR3K zp8LMHInnj3LW/YOKIZ7nLPFxHOxbs77UsBPVJAJzgPOW2AFxEmdURXws0MIsj7twWvB KD9w== 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:in-reply-to :references; bh=b2zxZmF66f/SGjGiyfXMgDZt5Mg/3SRsrJ3/gODIh50=; b=a1b7A8ZhTZCQVTBxb0pPEpInUQGhtqTXjEdKyS2+Nc+k98TenV7Q3BDM3FA1tKh2lW N/RngU8oVWgwl6AOqR3tyoWNBqkbg9tX0Wm619JHV0V181Y4jit8t7jzmgEcMqG3tFbB fsMrBsUB9sNUUtMNOfA6rGnH1iQk0kYz5IL2ttm8JhgbUE2qkRX4TnGLMKy1PgXgm+nI 3At8z6sdLFmShSxf9/gvAp1dY300vGjyVqYwAl78Fhuq9kDFWvWZEp6ZWA6D2Q84Z7go o+Txk5j5nm81r7qzejQWWuVd8C2y/btG3NL0DTADHpLAMmqbi8qac6+KAVuyPVqq+OWY c++Q== X-Gm-Message-State: APzg51CtGdNUUmTMp5xqVywIF27hYiIclpr3zWUOFmgLuo82w1Ow+vnL Rtfan8md5dUtGPDtD8n0s4g= X-Google-Smtp-Source: ANB0VdYcUxmaX3paoffVbArTEOrzuPojZJJBRZZSqslIppADvaZtOVIADliwRY8DD4rsi27xqh64IA== X-Received: by 2002:a1c:4008:: with SMTP id n8-v6mr2155458wma.32.1535643941790; Thu, 30 Aug 2018 08:45:41 -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.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Aug 2018 08:45:41 -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 21/30] iio: adc: sun4i-gpadc-iio: add support for H3 thermal sensor Date: Thu, 30 Aug 2018 17:45:09 +0200 Message-Id: <20180830154518.29507-22-embed3d@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180830154518.29507-1-embed3d@gmail.com> References: <20180830154518.29507-1-embed3d@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180830_084553_577893_B6747B9B X-CRM114-Status: GOOD ( 17.60 ) 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 This patch adds support for the H3 ths sensor. The H3 supports interrupts. The interrupt is configured to update the the sensor values every second. The calibration data is writen at the begin of the init process. Signed-off-by: Philipp Rossak --- drivers/iio/adc/sun4i-gpadc-iio.c | 91 +++++++++++++++++++++++++++++++++++++ include/linux/iio/adc/sun4i-gpadc.h | 18 ++++++++ 2 files changed, 109 insertions(+) diff --git a/drivers/iio/adc/sun4i-gpadc-iio.c b/drivers/iio/adc/sun4i-gpadc-iio.c index c7b46c82e3e5..d5c7971b2558 100644 --- a/drivers/iio/adc/sun4i-gpadc-iio.c +++ b/drivers/iio/adc/sun4i-gpadc-iio.c @@ -72,6 +72,7 @@ struct gpadc_data { u32 temp_data_base; int sensor_count; bool supports_nvmem; + u32 ths_irq_clear; }; static irqreturn_t sun4i_gpadc_data_irq_handler(int irq, void *dev_id); @@ -79,6 +80,10 @@ static irqreturn_t sun4i_gpadc_data_irq_handler(int irq, void *dev_id); static int sun4i_ths_resume(struct sun4i_gpadc_iio *info); static int sun4i_ths_suspend(struct sun4i_gpadc_iio *info); +static int sun8i_h3_ths_resume(struct sun4i_gpadc_iio *info); +static int sun8i_h3_ths_suspend(struct sun4i_gpadc_iio *info); +static irqreturn_t sunx8i_h3_irq_thread(int irq, void *data); + static const struct gpadc_data sun4i_gpadc_data = { .temp_offset = -1932, .temp_scale = 133, @@ -137,6 +142,22 @@ static const struct gpadc_data sun8i_a33_gpadc_data = { .sensor_count = 1, }; +static const struct gpadc_data sun8i_h3_ths_data = { + .temp_offset = -1791, + .temp_scale = -121, + .temp_data_base = SUN8I_H3_THS_TDATA0, + .ths_irq_thread = sunx8i_h3_irq_thread, + .support_irq = true, + .has_bus_clk = true, + .has_bus_rst = true, + .has_mod_clk = true, + .sensor_count = 1, + .supports_nvmem = true, + .ths_resume = sun8i_h3_ths_resume, + .ths_suspend = sun8i_h3_ths_suspend, + .ths_irq_clear = SUN8I_H3_THS_INTS_TDATA_IRQ_0, +}; + struct sun4i_sensor_tzd { struct sun4i_gpadc_iio *info; struct thermal_zone_device *tzd; @@ -409,6 +430,31 @@ static irqreturn_t sun4i_gpadc_data_irq_handler(int irq, void *dev_id) return IRQ_HANDLED; } +static irqreturn_t sunx8i_h3_irq_thread(int irq, void *data) +{ + struct sun4i_gpadc_iio *info = data; + int i; + + regmap_write(info->regmap, SUN8I_H3_THS_STAT, + info->data->ths_irq_clear); + + for (i = 0; i < info->data->sensor_count; i++) + thermal_zone_device_update(info->tzds[i].tzd, + THERMAL_EVENT_TEMP_SAMPLE); + + return IRQ_HANDLED; +} + +static int sun8i_h3_calibrate(struct sun4i_gpadc_iio *info) +{ +// regmap_write(info->regmap, SUNXI_THS_CDATA_0_1, +// info->calibration_data[0]); +// regmap_write(info->regmap, SUNXI_THS_CDATA_2_3, +// info->calibration_data[1]); + + return 0; +} + static int sun4i_gpadc_runtime_suspend(struct device *dev) { struct sun4i_gpadc_iio *info = iio_priv(dev_get_drvdata(dev)); @@ -428,6 +474,16 @@ static int sun4i_ths_suspend(struct sun4i_gpadc_iio *info) return 0; } +static int sun8i_h3_ths_suspend(struct sun4i_gpadc_iio *info) +{ + /* Disable ths interrupt */ + regmap_write(info->regmap, SUN8I_H3_THS_INTC, 0x0); + /* Disable temperature sensor */ + regmap_write(info->regmap, SUN8I_H3_THS_CTRL2, 0x0); + + return 0; +} + static int sun4i_gpadc_runtime_resume(struct device *dev) { struct sun4i_gpadc_iio *info = iio_priv(dev_get_drvdata(dev)); @@ -454,6 +510,37 @@ static int sun4i_ths_resume(struct sun4i_gpadc_iio *info) return 0; } +static int sun8i_h3_ths_resume(struct sun4i_gpadc_iio *info) +{ + u32 value; + + sun8i_h3_calibrate(info); + + 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); + + return 0; +} + static int sun4i_gpadc_get_temp(void *data, int *temp) { struct sun4i_sensor_tzd *tzd = data; @@ -497,6 +584,10 @@ static const struct of_device_id sun4i_gpadc_of_id[] = { .compatible = "allwinner,sun6i-a31-gpadc", .data = &sun6i_gpadc_data }, + { + .compatible = "allwinner,sun8i-h3-ths", + .data = &sun8i_h3_ths_data, + }, { /* sentinel */ } }; diff --git a/include/linux/iio/adc/sun4i-gpadc.h b/include/linux/iio/adc/sun4i-gpadc.h index 99feeba28105..169b4de9a34d 100644 --- a/include/linux/iio/adc/sun4i-gpadc.h +++ b/include/linux/iio/adc/sun4i-gpadc.h @@ -100,6 +100,24 @@ } /* SUNXI_THS COMMON REGISTERS + DEFINES */ +#define SUN8I_H3_THS_CTRL0 0x00 + +#define SUN8I_H3_THS_CTRL2 0x40 +#define SUN8I_H3_THS_ACQ1(x) (GENMASK(31, 16) & ((x) << 16)) +#define SUN8I_H3_THS_TEMP_SENSE_EN0 BIT(0) + +#define SUN8I_H3_THS_INTC 0x44 +#define SUN8I_H3_THS_TEMP_PERIOD(x) (GENMASK(31, 12) & ((x) << 12)) +#define SUN8I_H3_THS_INTC_TDATA_IRQ_EN0 BIT(8) + +#define SUN8I_H3_THS_STAT 0x48 +#define SUN8I_H3_THS_INTS_TDATA_IRQ_0 BIT(8) + +#define SUN8I_H3_THS_FILTER 0x70 +#define SUNXI_THS_CDATA_0_1 0x74 +#define SUNXI_THS_CDATA_2_3 0x78 +#define SUN8I_H3_THS_TDATA0 0x80 + #define MAX_SENSOR_COUNT 4 #endif From patchwork Thu Aug 30 15:45:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Rossak X-Patchwork-Id: 10582207 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 8D522174A for ; Thu, 30 Aug 2018 16:02:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A1272C0F4 for ; Thu, 30 Aug 2018 16:02:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6D1CD2C0F8; Thu, 30 Aug 2018 16:02:07 +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 EA8CF2C0F5 for ; Thu, 30 Aug 2018 16:02:06 +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:References: In-Reply-To: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:List-Owner; bh=oFr9MiqrJ8DhLnQJmDYx8DQjpCRB8fo0sO5lv31Xo3U=; b=M49Mmcb1B2aNSfMVMoXPehz/vW XQcLNFmzXJyP4Izxw1YdFyQW9cEnHrFE2U+FiO7Np0ZBaojuok2+N9DQVs8NWxktV3rDArPjIgjjL d/7bhN1tftLU0Rg+IFi+EX6GkjfoKnOyLTXIuyKCnsbcabOsYI4LQkB0zICQlGWyaENI/CQzRm/GS Ol6Da/dH/bF4eSIwwB1ohBLgIfTsyDqVndY1R5wo5lErQJs0h84BaHtcs40zHecMg4aRYjgY6IxB/ FLU10oiNLLxOMExC+RytrFnOYIoYPmDyL12YWqfDeJhtL+7u6CFEsOjfXihHMeSthb39QYHgpX3uB ln/6DAsw==; 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 1fvPOO-0003OD-Gq; Thu, 30 Aug 2018 16:01:56 +0000 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fvP8r-0001iR-DJ for linux-arm-kernel@lists.infradead.org; Thu, 30 Aug 2018 15:45:55 +0000 Received: by mail-wm0-x242.google.com with SMTP id o18-v6so2537627wmc.0 for ; Thu, 30 Aug 2018 08:45:45 -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:in-reply-to:references; bh=uoEW1Lce/hl33oDLPjB5cxodu2SyLnmSsJFrygMlmqs=; b=Jh6RwoWxDC3TNp+VvxHA+iolxoDzrXV+U7Lig65VMEdphV+dgKItdD0cdGltj+F4/m Jkisj0SVxZvgvCy2jnDA1jWzMx+3wU2dfB2MWxCQLCcWkv23PAXb2L6x5MgL7BaGpdz8 B6h3Xx7ndTOT23W8++WlBtHZZUH3UwxFT9PdPmVhppFFEzxHMBHkdGlzJFThpsaNf9Fj wrUPRh0BVAW10kNHPDr3s/1Q7J/RdS7qlA0eqxIk5b7PZaGAQ36ea33uMd2/mcibOHo+ RYJxY/57n7StOFIrrSozokTZRRcRjSZNxOqzmmyq98Kx8L957SeiWjaVicnwSuiPADWm pOFQ== 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:in-reply-to :references; bh=uoEW1Lce/hl33oDLPjB5cxodu2SyLnmSsJFrygMlmqs=; b=XmCLqa6GLBWJnMfJUOcAa8wIn9CISzY0naHwz6h7IwRMyHjXhglx4C/7R+ZWQTUAPc UGJYyTFISF/SHTQBReYH40EJXzv/N9EGh789wPfaIU8OT4y+Yclo4rW3NS8m7zFmxSNC GECm5JUczDM6rTP91NNFv4wIUFmS1IpYCQnFrOivi6gbCuEDra1B/HsZpTnTeJhh0QKp sYw0NDhkaO3IOKA6vgUGaGL62hplVCQbnRXzOVhM9ZslMvAUrNUGjz1SOI66CIrlDYfr 7bBUd5q0FWUOSCWJf1Oy3e+vkBA+FV1QFmWJgRuk0542cG6ocAtK8THxg2H12cNwr5nE xuBA== X-Gm-Message-State: APzg51DW4q97jOzZJODi8H5oGXSdA9MBujCc0T3N04QkaaaHPft8F+e6 vRjOB6/eXacSq7iQXye8WRw= X-Google-Smtp-Source: ANB0Vdaq010tVp+C/vjyjcNY1De7ly6z1Dl5gNXx3Cp9eE4zj+WxCXnCKw1WvQ9PtrcXGG7mXER/Eg== X-Received: by 2002:a1c:1748:: with SMTP id 69-v6mr2139131wmx.75.1535643943254; Thu, 30 Aug 2018 08:45:43 -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.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Aug 2018 08:45:42 -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 22/30] iio: adc: sun4i-gpadc-iio: add support for A83T thermal sensor Date: Thu, 30 Aug 2018 17:45:10 +0200 Message-Id: <20180830154518.29507-23-embed3d@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180830154518.29507-1-embed3d@gmail.com> References: <20180830154518.29507-1-embed3d@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180830_084553_569894_5ED06858 X-CRM114-Status: GOOD ( 15.26 ) 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 This patch adds support for the A83T ths sensor. The A83T supports interrupts. The interrupt is configured to update the the sensor values every second. Signed-off-by: Philipp Rossak --- drivers/iio/adc/sun4i-gpadc-iio.c | 59 +++++++++++++++++++++++++++++++++++++ include/linux/iio/adc/sun4i-gpadc.h | 6 ++++ 2 files changed, 65 insertions(+) diff --git a/drivers/iio/adc/sun4i-gpadc-iio.c b/drivers/iio/adc/sun4i-gpadc-iio.c index d5c7971b2558..a184a87c56d4 100644 --- a/drivers/iio/adc/sun4i-gpadc-iio.c +++ b/drivers/iio/adc/sun4i-gpadc-iio.c @@ -84,6 +84,8 @@ static int sun8i_h3_ths_resume(struct sun4i_gpadc_iio *info); static int sun8i_h3_ths_suspend(struct sun4i_gpadc_iio *info); static irqreturn_t sunx8i_h3_irq_thread(int irq, void *data); +static int sun8i_a83t_ths_resume(struct sun4i_gpadc_iio *info); + static const struct gpadc_data sun4i_gpadc_data = { .temp_offset = -1932, .temp_scale = 133, @@ -158,6 +160,21 @@ static const struct gpadc_data sun8i_h3_ths_data = { .ths_irq_clear = SUN8I_H3_THS_INTS_TDATA_IRQ_0, }; +static const struct gpadc_data sun8i_a83t_ths_data = { + .temp_offset = -2724, + .temp_scale = -70, + .temp_data_base = SUN8I_H3_THS_TDATA0, + .ths_irq_thread = sunx8i_h3_irq_thread, + .support_irq = true, + .sensor_count = 3, + .supports_nvmem = true, + .ths_resume = sun8i_a83t_ths_resume, + .ths_suspend = sun8i_h3_ths_suspend, + .ths_irq_clear = SUN8I_H3_THS_INTS_TDATA_IRQ_0 | + SUN8I_A83T_THS_INTS_TDATA_IRQ_1 | + SUN8I_A83T_THS_INTS_TDATA_IRQ_2, +}; + struct sun4i_sensor_tzd { struct sun4i_gpadc_iio *info; struct thermal_zone_device *tzd; @@ -541,6 +558,44 @@ static int sun8i_h3_ths_resume(struct sun4i_gpadc_iio *info) return 0; } +static int sun8i_a83t_ths_resume(struct sun4i_gpadc_iio *info) +{ + u32 value; + + sun8i_h3_calibrate(info); + + regmap_write(info->regmap, SUN8I_H3_THS_CTRL0, + SUN4I_GPADC_CTRL0_T_ACQ(0x13f)); + + regmap_write(info->regmap, SUN8I_H3_THS_CTRL2, + SUN8I_H3_THS_ACQ1(0x13f)); + + regmap_write(info->regmap, SUN8I_H3_THS_STAT, + SUN8I_H3_THS_INTS_TDATA_IRQ_0 | + SUN8I_A83T_THS_INTS_TDATA_IRQ_1 | + SUN8I_A83T_THS_INTS_TDATA_IRQ_2); + + 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_A83T_THS_INTC_TDATA_IRQ_EN1 | + SUN8I_A83T_THS_INTC_TDATA_IRQ_EN2 | + SUN8I_H3_THS_TEMP_PERIOD(0x257)); + + regmap_read(info->regmap, SUN8I_H3_THS_CTRL2, &value); + + regmap_write(info->regmap, SUN8I_H3_THS_CTRL2, + SUN8I_H3_THS_TEMP_SENSE_EN0 | + SUN8I_A83T_THS_TEMP_SENSE_EN1 | + SUN8I_A83T_THS_TEMP_SENSE_EN2 | + value); + + return 0; +} + static int sun4i_gpadc_get_temp(void *data, int *temp) { struct sun4i_sensor_tzd *tzd = data; @@ -588,6 +643,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 */ } }; diff --git a/include/linux/iio/adc/sun4i-gpadc.h b/include/linux/iio/adc/sun4i-gpadc.h index 169b4de9a34d..673459bb3ec3 100644 --- a/include/linux/iio/adc/sun4i-gpadc.h +++ b/include/linux/iio/adc/sun4i-gpadc.h @@ -105,13 +105,19 @@ #define SUN8I_H3_THS_CTRL2 0x40 #define SUN8I_H3_THS_ACQ1(x) (GENMASK(31, 16) & ((x) << 16)) #define SUN8I_H3_THS_TEMP_SENSE_EN0 BIT(0) +#define SUN8I_A83T_THS_TEMP_SENSE_EN1 BIT(1) +#define SUN8I_A83T_THS_TEMP_SENSE_EN2 BIT(2) #define SUN8I_H3_THS_INTC 0x44 #define SUN8I_H3_THS_TEMP_PERIOD(x) (GENMASK(31, 12) & ((x) << 12)) #define SUN8I_H3_THS_INTC_TDATA_IRQ_EN0 BIT(8) +#define SUN8I_A83T_THS_INTC_TDATA_IRQ_EN1 BIT(9) +#define SUN8I_A83T_THS_INTC_TDATA_IRQ_EN2 BIT(10) #define SUN8I_H3_THS_STAT 0x48 #define SUN8I_H3_THS_INTS_TDATA_IRQ_0 BIT(8) +#define SUN8I_A83T_THS_INTS_TDATA_IRQ_1 BIT(9) +#define SUN8I_A83T_THS_INTS_TDATA_IRQ_2 BIT(10) #define SUN8I_H3_THS_FILTER 0x70 #define SUNXI_THS_CDATA_0_1 0x74 From patchwork Thu Aug 30 15:45:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Rossak X-Patchwork-Id: 10582297 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 DB6775A4 for ; Thu, 30 Aug 2018 16:33:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CA2712C0EF for ; Thu, 30 Aug 2018 16:33:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BE0522C12B; Thu, 30 Aug 2018 16:33:18 +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=ham 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 6691D2C0EF for ; Thu, 30 Aug 2018 16:33:18 +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:References: In-Reply-To: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:List-Owner; bh=sT2/f1jNs9z0bRJJFvUmDrkR1yP4vpDl2bIQZ+ye/GE=; b=LiYSJQYN3zoXnLmI3g46850Sn/ TDZXuwbVGGV+ylwOD/xCej6KLGcet1/m1IM95EHSIxC0Tv92/LfyygCVXcOc8BIr+418+toq//iAO PDvKS/+cFNFdd68w97UCGTssem0isTo+/86pOhMvmR9no0SqZNlCD+4wpMZJx7YnfMc2I2buJGT4u uPQL3l5M5CM2CaBkpIwhhdoqz2Pj4qnA5J2lS86OQJqM7wIxz/FoQWozloDbIVrEI8Nnecbqm0lsb oPzdjjCmp48XMlevkf3v2QPqCpC8DMqK2oHXLfqZTtGhkH5rjf1SQjiKnvBlxObdoXl3AJVws5H0C M6io03JQ==; 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 1fvPsY-0006qG-1c; Thu, 30 Aug 2018 16:33:06 +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 1fvP8u-0001k2-0D for linux-arm-kernel@lists.infradead.org; Thu, 30 Aug 2018 15:45:57 +0000 Received: by mail-wm0-x243.google.com with SMTP id f21-v6so2478089wmc.5 for ; Thu, 30 Aug 2018 08:45:45 -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:in-reply-to:references; bh=l6QLRCww2N/gUDx4YyzxlMvXx8PICjJAWIzj33m3Y8k=; b=P4KY/wjMkYPFDbNjOeAzFPGXuvhGIkJHHgDVR/QUrBYJaPSFyZhLU/OKgDyVAtRfsL cwSC1UBpmTYC4KGzF43ZJNLd6bYwypq0T2oubDiL28AaiJ8wjL/FgxTn6rtbyrS2nnqz wRhinzDJs7882wZMTxrM5fu2QqFdfSRgns+WlBW7PhgOBoECmglfi85eFUZEKCjuBVy+ bhL4hdRKCHKMD7QwvrYawCYayaIMKVhc6ZhkzwTUIpMK+kmvcFs+OSQ3DSxClClQpnz5 5DKEEWANnKfCgSsYXHh2nXpcoQWGIP51an2xdKrHm5GroqXHhMEJI49pLwx4u/svWKbO 7HVg== 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:in-reply-to :references; bh=l6QLRCww2N/gUDx4YyzxlMvXx8PICjJAWIzj33m3Y8k=; b=cEjQyR4q3YvdRpVuyK/b2qio+MLdHnqXckq0tRbJolDWkvZdqLJoO0tdsWntGxwVoy NvL1Rsop10WFwk6AwU7PmyQa6MYhwLy8bXEY1MRlsEgHrGdyz4L8X/hDJwv1QShOki2u 8T5j8XTr6B6TbMOaXRdqGQi0zJOTZJXS0G2zUmDNxQ3XhV/EKPqSl+y03CGpaq4iY8dW s7/E7zFDqkLvCMXrDzhamwpUr/Oajl27nrLBltBh0D6hFzM1LcdaihPOdW/QOL3A0BwU Y9G3L7mPl7a1Ba6x0VP68WXaM1OxxukmO4N0JhSupWGJn3TppUdloRfIz/FzbmzL/pWO HYHg== X-Gm-Message-State: APzg51B4SB4CnALKQFTdfDCMQrO00/zXO7C32yH2RMcqkU4eiba2mR/j dbnC73GN0Cq4J0EvSHLV7xY= X-Google-Smtp-Source: ANB0VdatYCV55jeDhSuK82bQ3CoqrHQ8yzytm678XM5qd4qnGTaM7Jb2ZLl8iGE3cli+4sSVNjUMNw== X-Received: by 2002:a1c:b80a:: with SMTP id i10-v6mr2123262wmf.30.1535643944392; Thu, 30 Aug 2018 08:45:44 -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.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Aug 2018 08:45:43 -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 23/30] ARM: dts: sunxi-h3-h5: add support for the thermal sensor in H3 and H5 Date: Thu, 30 Aug 2018 17:45:11 +0200 Message-Id: <20180830154518.29507-24-embed3d@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180830154518.29507-1-embed3d@gmail.com> References: <20180830154518.29507-1-embed3d@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180830_084556_107752_779B8736 X-CRM114-Status: GOOD ( 13.46 ) 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 As we have gained the support for the thermal sensor in H3 and H5, we can now add its device nodes to the device tree. The H3 and H5 share most of its compatible. The compatible and the thermal sensor cells will be added in an additional patch per device. Signed-off-by: Philipp Rossak --- arch/arm/boot/dts/sunxi-h3-h5.dtsi | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/arch/arm/boot/dts/sunxi-h3-h5.dtsi b/arch/arm/boot/dts/sunxi-h3-h5.dtsi index c3bff1105e5d..3520e4ad6042 100644 --- a/arch/arm/boot/dts/sunxi-h3-h5.dtsi +++ b/arch/arm/boot/dts/sunxi-h3-h5.dtsi @@ -488,6 +488,15 @@ }; }; + ths: thermal-sensor@1c25000 { + reg = <0x01c25000 0x400>; + interrupts = ; + clocks = <&ccu CLK_BUS_THS>, <&ccu CLK_THS>; + clock-names = "bus", "mod"; + resets = <&ccu RST_BUS_THS>; + #io-channel-cells = <0>; + }; + timer@1c20c00 { compatible = "allwinner,sun4i-a10-timer"; reg = <0x01c20c00 0xa0>; From patchwork Thu Aug 30 15:45:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Rossak X-Patchwork-Id: 10582213 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 1CA02920 for ; Thu, 30 Aug 2018 16:04:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 085922C10F for ; Thu, 30 Aug 2018 16:04:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ED28A2C115; Thu, 30 Aug 2018 16:04:46 +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=ham 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 87EF22C10F for ; Thu, 30 Aug 2018 16:04:46 +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:References: In-Reply-To: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:List-Owner; bh=Fe6cHCjQIlPZfumNZLMN/j+cGiBnc41YFGFSoOQj8zE=; b=u/nvWFLcNsRli7W7Y9antiV272 JTo42CzKmjnZmjHsVB+CBGht19n/s6LK4BYGMF0R+hxSv4+xo/BORW6gqESrdu4UaVU1LknuW+tKW Nlpha4Ut5yT2HqcjOJZKwfeoFqLIZb3hykYwMWTZKf3WCFsm7bk6OJNjGMgLqw182V9Lc25X9pfOv mFUhPjyo6pNJVZB54DQ8aOlb4TNbF+jCa9bZRfWZH92Mf+yLYKoZzxvsCs64E53RUIYAsoJNE8vKV lSKS8L7hUXW2CBSSwCP0i30j6nVBgxLqq/KUjohdYavKAiG1shSKk+RL/dJ+HP6R6Pc0MgQU+im9+ QlOhWYJA==; 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 1fvPR0-0004yE-Gf; Thu, 30 Aug 2018 16:04:38 +0000 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fvP8v-0001kN-K6 for linux-arm-kernel@lists.infradead.org; Thu, 30 Aug 2018 15:45:59 +0000 Received: by mail-wm0-x244.google.com with SMTP id s12-v6so2482377wmc.0 for ; Thu, 30 Aug 2018 08:45:47 -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:in-reply-to:references; bh=FywbVIB0mybZGQlha7NFbll0y71vzt8iOO5Bixlf4OM=; b=TGIpwGhzBwkzCA2k0q5aqOzmNO+gwTDQe4W2eznKJAMCoTOXzszi8sLJRBl7S+ejXD uS/I6378Cpn3/kvXXhk7mbJiZy9gF8G/ni3z10hQ/cMvBJD8mnxxvLSYIEcePM8GjmNR WSTQcyCm+2ae7LYYQAu3wxn8SQ+8uLzzHoxC6oGnlCFn9SIMmheek819Ta+LhtfoeqIp HLrq21b75L2B90xqlKsZ43PR4UDzaIGLRHfisQjBKwH1CwksFiHjijVUhdazU9Ri665b ArbI+MXODDsgYB4Lzoez9/nB2I4+73LNMeW3yvEH5uFpHI+AuiBQLMr6Gkf4dl2bXg9v BfnA== 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:in-reply-to :references; bh=FywbVIB0mybZGQlha7NFbll0y71vzt8iOO5Bixlf4OM=; b=TRywZJZehwLXgnwoM6F7JW0H4H5Ielr4oELP4QGl/DQiuchxdi2U7fbexgAODDsJ5E PxHycGH5e44K+/aP2Y5St7JvUJOdSrogoBSK9i9ukyhipXGlMQq9KT1BSgHQK8HAMnLm b4fA1kS99syFVirl3WoshGw7CJXx+dQQJXDmewIVGytC7cC96e3V0lX6Nc7NEC3R9nEe YwxikgNqGuyWLYyoqPlUpBAIAaTHwjukIbkHu+QBQ/yoKi+YsfwdTUyEfCPsfZQzPDQ6 Vnqg7w8bFdwk08i08iejCkn13lHvcNuO8hjwue0MtTIpSolVIouWa2GvqE4J0AuDIqi5 83Tg== X-Gm-Message-State: APzg51DFU8Vp8tMd1PzFeezOPDd1mdJJdEYykLSQKf6J2RKfSQj5+7Jf N5L1m50/Q09K9+MmKkFYv54= X-Google-Smtp-Source: ANB0Vdb49E8FXdr5hCrNgeojqWMHwts1H1t3PCXOFkIgWsf3OM1BOR5eP1POMRnYkyXEudrQryqrSA== X-Received: by 2002:a1c:e70b:: with SMTP id e11-v6mr2127387wmh.22.1535643945694; Thu, 30 Aug 2018 08:45:45 -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.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Aug 2018 08:45:45 -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 24/30] ARM: dts: sun8i: h3: add support for the thermal sensor in H3 Date: Thu, 30 Aug 2018 17:45:12 +0200 Message-Id: <20180830154518.29507-25-embed3d@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180830154518.29507-1-embed3d@gmail.com> References: <20180830154518.29507-1-embed3d@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180830_084558_186282_0CA10B2D X-CRM114-Status: GOOD ( 12.97 ) 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 This patch adds the missing compatible and the thermal sensor cells. The H3 has one sensor. Signed-off-by: Philipp Rossak --- arch/arm/boot/dts/sun8i-h3.dtsi | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arm/boot/dts/sun8i-h3.dtsi b/arch/arm/boot/dts/sun8i-h3.dtsi index 41d57c76f290..5b7994cb1471 100644 --- a/arch/arm/boot/dts/sun8i-h3.dtsi +++ b/arch/arm/boot/dts/sun8i-h3.dtsi @@ -185,3 +185,8 @@ &pio { compatible = "allwinner,sun8i-h3-pinctrl"; }; + +&ths { + compatible = "allwinner,sun8i-h3-ths"; + #thermal-sensor-cells = <0>; +}; From patchwork Thu Aug 30 15:45:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Rossak X-Patchwork-Id: 10582221 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 E8BE2920 for ; Thu, 30 Aug 2018 16:07:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D6C562C0D5 for ; Thu, 30 Aug 2018 16:07:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CA8532C116; Thu, 30 Aug 2018 16:07:09 +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=ham 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 367592C117 for ; Thu, 30 Aug 2018 16:07:09 +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:References: In-Reply-To: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:List-Owner; bh=z92R+DKp05DrC6FYLl9HLTyaljslnwjqN5N1qtDu/yo=; b=IniR8CskHxArHP4XNmc9h6x2xA tdaiEM/1hh0PEFDPolcxEeNpvYntapjRGq8nYHCEmg95zuMEiR7xDUvaZdr/ad1U8djeIk/nWumeA 4A+AfjR3cwjJXSr4USghELNmnI26e85Nse32BV1xOKoE9WsA10Gl8aEfjqBGejV49qoJp67xrCiIl ab3O8f1UHVSf/VSmHiqQ5j6lk3bPqgGeMJKE7OmLL8IxIksjPE0YhECNGW6LPCT1+xcHpoKTCMdK7 KPSCHsL0SRXckkKFZgT27ASKGSWItAU7g30QsnBsJZ7zzJPNhqHob9qltEFWk7qQ3W6qJWR+j4H5x 0ffnF1cQ==; 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 1fvPTB-0007VR-Jr; Thu, 30 Aug 2018 16:06:53 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fvP8w-0001l3-Kd for linux-arm-kernel@lists.infradead.org; Thu, 30 Aug 2018 15:46:02 +0000 Received: by mail-wr1-x442.google.com with SMTP id o37-v6so8509699wrf.6 for ; Thu, 30 Aug 2018 08:45:48 -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:in-reply-to:references; bh=CrbjzCGKhuy1hrMWFjimT5Qh6ZU+NM8doLLYCKA9NAU=; b=qb8wKlxN8ikE8T9BDdtgn/W5hhtut7faqPOVpHaPelKnSWMqpgdxRy/1KVJexwbnE1 QPPwPWsXnMFU6fr4x/X01yC6CQ1uCPHP2l8oDZYuE4CeUzFGoEve711z5j54qN6+tLet GUpUOfDgWTDE73HpW6HllXyHBZ7nOXvQTCXqpiU34Fki4IGdpFhpx2NbVGVCaIXlMgMk s87CECAcyq+qfzPZMEa/JVajSaG6AfQn34QJUKEp5vhtruikchZOTlamYgnLHpRNh5H7 TqOxYpNsC004LJyoJwCDlaedW9/f9w0OI0zAPhJ5cvUYiVFJTiW4gVud4sYnLlR8OMoF oUwA== 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:in-reply-to :references; bh=CrbjzCGKhuy1hrMWFjimT5Qh6ZU+NM8doLLYCKA9NAU=; b=B5i6IFzyMugbN1TwnX9fKw6lN862fbcxvZGBd6r+c5o+Hos3bEj8yjuhThe74tbVrb Vx6dOqmEluleVvk+TPNM5uYCwQz+ywhciB6F3/dQuJtuNldh2PDReMtFBbDNkAWnbHUO oaFTlPZn8rI4l8j4YBK4qNsrMONMJq9fDLYnzmE6vOWBhAgMdSD53dy80fPbm9ReL1hH T88UV8HmyMouR7vbl432j49tVrssKYEOUyUHRWUXLorqK/TIU4VBX0B4M2etS2D6zuAL 1ZR/mKf3f4c7+z5QjLm+iQKmHrskTvruHOpnEBx/zFlIZ4c/pugTiu5PXchF/L0oJqq3 bGGw== X-Gm-Message-State: APzg51CwdRccurJbm+VbQNlSgGXwwU4cLX9IxBO+LEEpkNb6YDk2l3Wp zACbTno5eJr9uSlzWfoYe3U= X-Google-Smtp-Source: ANB0VdZP4PYxxNOjOMzNiV+xt7u6wr8jjl4VjFuXGazBQIsNzc0NEBrxi9riWD9Hd9ZUOnghnMxBxg== X-Received: by 2002:adf:ea4f:: with SMTP id j15-v6mr8358259wrn.224.1535643946851; Thu, 30 Aug 2018 08:45:46 -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.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Aug 2018 08:45:46 -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 25/30] ARM: dts: sun8i: h3: add thermal zone to H3 Date: Thu, 30 Aug 2018 17:45:13 +0200 Message-Id: <20180830154518.29507-26-embed3d@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180830154518.29507-1-embed3d@gmail.com> References: <20180830154518.29507-1-embed3d@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180830_084558_986323_253F078D X-CRM114-Status: GOOD ( 15.77 ) 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 This patch adds the thermal zones to the H3. We have only one sensor and that is placed in the cpu. Signed-off-by: Philipp Rossak --- arch/arm/boot/dts/sun8i-h3.dtsi | 31 +++++++++++++++++++++++++++++++ arch/arm/boot/dts/sunxi-h3-h5.dtsi | 1 + 2 files changed, 32 insertions(+) diff --git a/arch/arm/boot/dts/sun8i-h3.dtsi b/arch/arm/boot/dts/sun8i-h3.dtsi index 5b7994cb1471..954848d5df50 100644 --- a/arch/arm/boot/dts/sun8i-h3.dtsi +++ b/arch/arm/boot/dts/sun8i-h3.dtsi @@ -78,6 +78,8 @@ clock-names = "cpu"; operating-points-v2 = <&cpu0_opp_table>; #cooling-cells = <2>; + cooling-min-level = <0>; + cooling-max-level = <15>; }; cpu@1 { @@ -102,6 +104,35 @@ }; }; + thermal-zones { + cpu-thermal { + /* milliseconds */ + polling-delay-passive = <250>; + polling-delay = <1000>; + thermal-sensors = <&ths>; + + trips { + cpu_hot_trip: cpu-warm { + temperature = <65000>; + hysteresis = <2000>; + type = "passive"; + }; + cpu_very_hot_trip: cpu-very-hot { + temperature = <90000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + + cooling-maps { + cpu-warm-limit { + trip = <&cpu_hot_trip>; + cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + }; + }; + }; + }; + timer { compatible = "arm,armv7-timer"; interrupts = , diff --git a/arch/arm/boot/dts/sunxi-h3-h5.dtsi b/arch/arm/boot/dts/sunxi-h3-h5.dtsi index 3520e4ad6042..2c83f4893757 100644 --- a/arch/arm/boot/dts/sunxi-h3-h5.dtsi +++ b/arch/arm/boot/dts/sunxi-h3-h5.dtsi @@ -47,6 +47,7 @@ #include #include #include +#include / { interrupt-parent = <&gic>; From patchwork Thu Aug 30 15:45:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Rossak X-Patchwork-Id: 10582217 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 1C208920 for ; Thu, 30 Aug 2018 16:06:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 096CC2C114 for ; Thu, 30 Aug 2018 16:06:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EF2992C116; Thu, 30 Aug 2018 16:06:17 +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=ham 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 6B9B72C114 for ; Thu, 30 Aug 2018 16:06:17 +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:References: In-Reply-To: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:List-Owner; bh=xdyhZtr/SSocOHLH1Zg6ji7EzkjBCQUOdYoWTlTtXJk=; b=K5rASkmBcDu4J4ynoUZXAMRuRK f9IdAd63nF+w4rtNyPN64GlHdodwo4seCNHyO42PTVBAqHns4DXwWr3kQ1gmBQZKjcf+dYKeNqNXx STdHT03kZYmnXubaofjzu+hIWWOPSKqCJcHCsFuBlJdUnMyIkdDIzJXQx/pnQPF++jRqPJgSlR/y8 oJf1Po6SOM1Nuna0jc0YjfmOe5BvtELJ0ZWpvNbiv6T5PEmP4237HAZZAtyPEfPSQGGarWJbvOjkW O/Vg8nxOEJvMbQj1gmopiegLyOkJ08kfjy/t9CcunS0Y+WgwkQMBjmtcTQNb29dKG8i3j0xQ+DqOc wB1zz3ow==; 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 1fvPSV-00079B-Fy; Thu, 30 Aug 2018 16:06:11 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fvP8w-0001lH-JX for linux-arm-kernel@lists.infradead.org; Thu, 30 Aug 2018 15:46:01 +0000 Received: by mail-wr1-x442.google.com with SMTP id z96-v6so8505641wrb.8 for ; Thu, 30 Aug 2018 08:45:49 -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:in-reply-to:references; bh=7fcz895GUsu55hC5nTmUgHw6xA+IJt+1id8NXirwNlM=; b=SjKPkeLySCJEK4Y13+HT7/9l6WrLyE/c73c83Fykti/+fVoYb+P/DCvpKQhMPgbbt3 Z+k6EjZIYPEQm4kpEZTDYryKCniBgzyx5mfO1U8Srco38IgQG23lyT2H4ahmcXZwpaLB a59gxBRF4QmavAd9aErhRSafN2cLz3oS1P5JFlEoibmP/muy+TCx+rV6rfWUHKdcot8z jgA2TiO6dpZu0WWiycqUHdKQKJk1OoTHdpbCGARMe7Wc+B3YkrhnaRLG9oWgoTexK4uW /zUKd6Wc7xMmNmRJAx17ksXQrTL2hfSl4fKz647kiSQzgaJbkJlvSxtrzddULpUt441E gQaw== 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:in-reply-to :references; bh=7fcz895GUsu55hC5nTmUgHw6xA+IJt+1id8NXirwNlM=; b=rTyomfdMbfYFSoEF4ZiO/jC/mHlMZsjXpyoekZsXP8Ekg3btpAq4w9JHrZpDBalvM7 6jFrcTIusvpRHWTWmiRtDf1NEZ3/e08evv/2kdGsxzfZlwDvCRE/DpxKGLOksrd++JL6 C8uvXqdX5RDGucv4Z3ZdQ7I3jB9Sbp4vcP/3tUiDewmqiKdXJYo3FyIiEwB8DmXzWmV1 0C8K8+VPuj+kkbW0BPH6scIr3rneyTaFRk7WgGsePaG30Q6ERx8I/sdnietZGM6GkTG8 cRZfH+fXgVwSs6BiiP1Kb80I0iqtZGKA0uSNOAea0u7gx3N/JaguNHeG22Qkaelmhkde tGZQ== X-Gm-Message-State: APzg51CCtpCjpoEBjlzVcJadxyCzD0eTyAScULPnKC0WNTRzeWpbk6KI dNMrRDwqV19iAD6jCLy11G4= X-Google-Smtp-Source: ANB0VdYY8IRyJyHvIIx2ksl+ThEEVOKF+FOMBA3dpXx+QuDAFvRk7+O2kpuCoTl06PlR48Or1XA4GQ== X-Received: by 2002:adf:cc91:: with SMTP id p17-v6mr8042454wrj.226.1535643947922; Thu, 30 Aug 2018 08:45:47 -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.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Aug 2018 08:45:47 -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 26/30] ARM: dts: sun8i: h3: enable H3 sid controller Date: Thu, 30 Aug 2018 17:45:14 +0200 Message-Id: <20180830154518.29507-27-embed3d@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180830154518.29507-1-embed3d@gmail.com> References: <20180830154518.29507-1-embed3d@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180830_084558_980032_1734B453 X-CRM114-Status: GOOD ( 12.88 ) 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 This patch enables the the sid controller in the H3. It can be used for thermal calibration data. Signed-off-by: Philipp Rossak --- arch/arm/boot/dts/sun8i-h3.dtsi | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/arm/boot/dts/sun8i-h3.dtsi b/arch/arm/boot/dts/sun8i-h3.dtsi index 954848d5df50..1866aec69ec1 100644 --- a/arch/arm/boot/dts/sun8i-h3.dtsi +++ b/arch/arm/boot/dts/sun8i-h3.dtsi @@ -104,6 +104,13 @@ }; }; + soc { + sid: eeprom@1c14000 { + compatible = "allwinner,sun8i-h3-sid"; + reg = <0x01c14000 0x400>; + }; + }; + thermal-zones { cpu-thermal { /* milliseconds */ From patchwork Thu Aug 30 15:45:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Rossak X-Patchwork-Id: 10582209 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 E9F74920 for ; Thu, 30 Aug 2018 16:02:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D81262C0FF for ; Thu, 30 Aug 2018 16:02:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CBA482C102; Thu, 30 Aug 2018 16:02:44 +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=ham 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 412D62C0FF for ; Thu, 30 Aug 2018 16:02:44 +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:References: In-Reply-To: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:List-Owner; bh=zO0tmN/ZBNxpUCIcawgs5VzgVKeA8/IlkM4RdfufI0I=; b=sZXPme3AJyIL9jSD6BKPuJZnwD Md7Pm53C77Q2yKeuaexL23N+DPbF/1aISV9ZibSOpNwthxaqI5hUd7Aa17m8rWZf/S1yznBGT3xrY AP6m132DAY1sMfQ6mIO8hoTHBXfW5F0CNW6mgkuZF6zp022MTjFdYaAGQz1qNIsQkUzq+ewQcnG2J Z9Yq0jywM12lC7fb41mYBUylfjxzmj9VNXQ9o2nvT+ezk9eGUCH83T5bLl6ViriaG3xf/xpXpvBT1 CGcQqoB/oRThLSl1ob4VdxoQgBhyvmpSQSj2NGs09NGtXRKRlRHnbJ9431OKt/dQ13biMgur5Zrvx Hk598azQ==; 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 1fvPP3-0003gT-6H; Thu, 30 Aug 2018 16:02:37 +0000 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fvP8r-0001lf-EL for linux-arm-kernel@lists.infradead.org; Thu, 30 Aug 2018 15:45:55 +0000 Received: by mail-wm0-x242.google.com with SMTP id y2-v6so2487127wma.1 for ; Thu, 30 Aug 2018 08:45:50 -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:in-reply-to:references; bh=uL+RlF1B8X/odxljz0MZSNmhjxVAqq2N7EvHMawx/vQ=; b=sTH3nV6t6alJ644hRiZ1vJjRhtz7c2syDksMfEE0JxXa+Woh1JxBWUovFdbpuw8uzV Xo4/UrH5Li9xXOkir35nIx0HeDLVJKSXIrI0U3KbXNBlIz4731zitPTit7jObJu+hTEd HTtHbzNT0rDImceTuciYxQIKotQbzw/DEK59yGvvp6wb/MDsJiejbJ0Djd9Eg8g05g7w eokB9Cq3ZUzoIEP4cq2UIS1EhQ5ALtYbQ6HUWfcAGvWIDZAaf2axj7LSm5puMhRvutHU rhPI5yleS7mM7Svzn3NR5dK5X4TGHGC7qCdetgr2HpUrP4Q0874BabnexHcftqaT6CDa PMrw== 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:in-reply-to :references; bh=uL+RlF1B8X/odxljz0MZSNmhjxVAqq2N7EvHMawx/vQ=; b=BCiA1NsA9qLcqSut3KulC+bgEoD2maIN+glNcnOkLTShTGP284c5rUeP9xOcKiytja ZvZ2t1rrqfhJ8SIkl2xrczGcTwzZJg8TwtxSr1mo4Sy8oxwqYpOPeZpVHAo9/nyyeSxp 5IAIJ8ImpcXW4bXIoGt1eD6bz9n619oz7AWiSSOYLEZRQ6Mgv/At/nfMc/QSESlM+1MU Bi2NZ97UkKJk9wF4a94IhHkjnxbvD2Gavzbh7N17LEgejPAQJ+c34nLZTwsCJ8HrBcZa PNJEShtK6bSh1s4cr+cGwiQJPBifpxfNVC3De5/dqvnqTd2STUqpAxScIWIZE2MGnbG+ ok8w== X-Gm-Message-State: APzg51B0HbcSFZTvtqTV8PKkxGb68rvYp7LbagpmItZW+WfZaHwObwdw +VJ/BNQZj+pgN5BV4Dw84Eg= X-Google-Smtp-Source: ANB0VdbcppwMi0pbfqC1/1hcsx8Wa1g8hjNqGUhDOM+NvoVaj4+RzzJnlnPWk8L6qomTrkarfHUCig== X-Received: by 2002:a1c:1f48:: with SMTP id f69-v6mr2114357wmf.152.1535643948953; Thu, 30 Aug 2018 08:45:48 -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.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Aug 2018 08:45:48 -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 27/30] ARM: dts: sun8i: h3: use calibration for ths Date: Thu, 30 Aug 2018 17:45:15 +0200 Message-Id: <20180830154518.29507-28-embed3d@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180830154518.29507-1-embed3d@gmail.com> References: <20180830154518.29507-1-embed3d@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180830_084553_584466_78B8062B X-CRM114-Status: GOOD ( 14.38 ) 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 The H3 SID is supported by the kernel so we can add a NVMEM Data cell, that contains the calibration data. On the H3 the eFuses are located at the offset 0x200. The thermal data itself has an offset of 0x34 from the eFuse base. So we end on an offset of 0x234. Signed-off-by: Philipp Rossak --- arch/arm/boot/dts/sun8i-h3.dtsi | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/arch/arm/boot/dts/sun8i-h3.dtsi b/arch/arm/boot/dts/sun8i-h3.dtsi index 1866aec69ec1..0fc447f0c02a 100644 --- a/arch/arm/boot/dts/sun8i-h3.dtsi +++ b/arch/arm/boot/dts/sun8i-h3.dtsi @@ -106,8 +106,15 @@ soc { sid: eeprom@1c14000 { + #address-cells = <1>; + #size-cells = <1>; compatible = "allwinner,sun8i-h3-sid"; reg = <0x01c14000 0x400>; + + /* Data cells */ + thermal_calibration: calib@234 { + reg = <0x234 0x8>; + }; }; }; @@ -227,4 +234,6 @@ &ths { compatible = "allwinner,sun8i-h3-ths"; #thermal-sensor-cells = <0>; + nvmem-cells = <&thermal_calibration>; + nvmem-cell-names = "calibration"; }; From patchwork Thu Aug 30 15:45:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Rossak X-Patchwork-Id: 10582225 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 000BE920 for ; Thu, 30 Aug 2018 16:07:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E29412C0D9 for ; Thu, 30 Aug 2018 16:07:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D5AF32C117; Thu, 30 Aug 2018 16:07:42 +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=ham 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 423E32C0D9 for ; Thu, 30 Aug 2018 16:07:42 +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:References: In-Reply-To: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:List-Owner; bh=kvHgbu1RWerTihLN/JE8XbPvxBz06xpyPTh/psi65Dg=; b=oI5F0csrR170k/+T/5OpV+jz5c lo6JD54RYq/r795YGYwV/3jFulHN5waHXgCVqgit8jQF60JXTl5v/ltbTQDjFwCbhJ6l35cspj+AK 08cw23TeKb8g2aQ/T9YdBOJjry45mkgN/mnuvHgyW6JrQh7W69p44jYQadpN5MXR51b/rCRpTKlC8 Uz5NuxfKjriPRWhyGBUMjZTEmtsQ6oA+VRInF7dKfft1Mkr5dCLSmk09SxyKN728Yeif2cQqQIexN ioqO0ZeIwVvel4rJKGhb8CVYcm3I7YKxj1g3kv+KMVImBmavPovrQ0e0X8zXnldItdtPLSkDhtj/m 1YfP3MEw==; 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 1fvPTr-0007oW-MA; Thu, 30 Aug 2018 16:07:35 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fvP90-0001mF-DQ for linux-arm-kernel@lists.infradead.org; Thu, 30 Aug 2018 15:46:04 +0000 Received: by mail-wr1-x444.google.com with SMTP id k5-v6so8501442wre.10 for ; Thu, 30 Aug 2018 08:45:51 -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:in-reply-to:references; bh=y/Fj6KILOvy4Hub0AlnmhTfrUDXUWebrPBRvX31vXgc=; b=TIsgTYwpO0JSXsFCAR1gBgU4yOWMOe7YlHBfRlrGLorlzSjKvfBEMgg5cZt11Oud2j i2DU+7SYH/UXgrqjScKBzQwBtQrpdWU9JP2Er/9rOkXzlqkKrNJIVsoHQ7opKHMlso6/ dhslqj6NMOMt8pkEIkvJzkiP0tE0ni3IK/VhmYJrpx7OMb+BjvCTrUzpRn4Itwl5bbxg mlDVB9w1rF4pLCa85smzJZMdbdzlbGMzhvN32mie0bhHoH7vnoqFqxRyfD3pwr3aai2S MITLssiZJ2Od90VcPFzI4BijdPDVhDd1S9F0cnRKThVTQunMt6pd+QGNwfyOX/WZyqhz HKWA== 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:in-reply-to :references; bh=y/Fj6KILOvy4Hub0AlnmhTfrUDXUWebrPBRvX31vXgc=; b=nX2jdvL0i5ldLkL+RpPNuINMnwIMKU+vsbUURRo8xLDSHvCrs2sGTNZkPKAFkDf2+/ jaW9RQ2Z7vofaXF6QpbYqSMmRUbdAyvGyIj02MflzFthYtSKYsF4Lwvn2+aYT3WSudVW auwiwoZ12iw8ifMI3FdqhTn/oE3502yfUXylVQ6UYOZKYoymmV1lYLFqTBzKTsH7uq3s Gp2Gty7zZ6l8wUm3JRETdchps6k1da/fl7f43iNaYgNGAnLN/y8SVts4bZsAOAS7okkH NpATAuMxTnQ1l2fO/F5cgcRFgjtAMCk9THH7g/FD25tN9gZsDmivuyLq0wMSvLwSzHXQ PDpw== X-Gm-Message-State: APzg51AA48l3ALzWRc9AZazN0xMnCrF6PN1TxnUE+QYOCdJTVuphxB4J PQzG00Pf7wd/yufMnK4xb/Q= X-Google-Smtp-Source: ANB0Vdbc61xQJObw7vzUpdLQCS/u4BaJGuaWXTUg2M+HtFLPJancYx3rVv+/+CbFv0zcDYP+W/DtZw== X-Received: by 2002:adf:ffc7:: with SMTP id x7-v6mr3502999wrs.137.1535643950090; Thu, 30 Aug 2018 08:45:50 -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.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Aug 2018 08:45:49 -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 28/30] ARM: dts: sun8i: a83t: add support for the thermal sensor in A83T Date: Thu, 30 Aug 2018 17:45:16 +0200 Message-Id: <20180830154518.29507-29-embed3d@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180830154518.29507-1-embed3d@gmail.com> References: <20180830154518.29507-1-embed3d@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180830_084602_527575_3D8009DA X-CRM114-Status: GOOD ( 14.25 ) 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 As we have gained the support for the thermal sensor in A83T, we can now add its device nodes to the device tree. The A83T seems to have a broken IRQ 31, thus we use here IRQ 41. Signed-off-by: Philipp Rossak --- arch/arm/boot/dts/sun8i-a83t.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/arm/boot/dts/sun8i-a83t.dtsi b/arch/arm/boot/dts/sun8i-a83t.dtsi index 2be23d600957..f2f745930b08 100644 --- a/arch/arm/boot/dts/sun8i-a83t.dtsi +++ b/arch/arm/boot/dts/sun8i-a83t.dtsi @@ -757,6 +757,14 @@ clocks = <&osc24M>; }; + ths: thermal-sensor@1f04000 { + compatible = "allwinner,sun8i-a83t-ths"; + reg = <0x01f04000 0x100>; + interrupts = ; + #thermal-sensor-cells = <1>; + #io-channel-cells = <0>; + }; + watchdog@1c20ca0 { compatible = "allwinner,sun6i-a31-wdt"; reg = <0x01c20ca0 0x20>; From patchwork Thu Aug 30 15:45:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Rossak X-Patchwork-Id: 10582227 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 46524174A for ; Thu, 30 Aug 2018 16:08:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 314D22C01F for ; Thu, 30 Aug 2018 16:08:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 21B6C2C029; Thu, 30 Aug 2018 16:08:29 +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 7C6082C01F for ; Thu, 30 Aug 2018 16:08:28 +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:References: In-Reply-To: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:List-Owner; bh=SGkeoxcoggzL3rK4xKzHfmumYu2N030OsYvBTAEJvkc=; b=rciBHmd47Ol4j5FcHXKIDdR7Xk /icn2nMXl9RUtYyj5xY+lexFLkj7564Qr488PHxHzjv79sRxAjSjpUlvCqJKFfx843e0LvmwxSEi1 WLPnXHGCKjeCE8S6Hz65GObLJrKpR36bJKdK6Lb89/JruPShcd5hl5Jrhj4L7lsqeofQc0JPs+At0 ZKPf8PdgleapqV6HGSn/VVBK8yBpRpeiB+n0Xz2apcx78I5q3uhD9nQlRrXATAXSOqGGD7SMGQ0dX NFYo1zmDglpcS8keOTJudIPiLzVGA0NI6d6c6MlHrJbWd3136cahlYYzX6UGqTq7Cj9969VSO8nAj uFPPpRag==; 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 1fvPUZ-00087w-Kh; Thu, 30 Aug 2018 16:08:19 +0000 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fvP91-0001mq-GV for linux-arm-kernel@lists.infradead.org; Thu, 30 Aug 2018 15:46:05 +0000 Received: by mail-wr1-x441.google.com with SMTP id 20-v6so8495117wrb.12 for ; Thu, 30 Aug 2018 08:45:52 -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:in-reply-to:references; bh=sICcaZN9SuHUxjIoI4iQcsXgJZYewubrScoChP39YpI=; b=Aw9v103kYcLLYZnLacNAi2w5W6W18WUc1/2IS7u1/9HUeYKyu4eVfDzJpD1PybEatM MrznRHu0Dyec+WLTggEvXmp5Kv0AyCMgzolRBcFSo0gyBteDJBPi4A3FbFhuf+bVVJSr c1plByogpJ61B/oG/PH35mpesTFkcO7qUY76jxP8pTCn7XnBOtLXxgNT2WGs4rSCcFrx 1CpIT5w6d56m/eCqh2mYJ9XgYLwEf0A5sLm4P28K/L8XHYSP8UyvztV8hXy6EtYlXBAA dPIIgci9jS3fMMvNK2OTj7tLhbedaZocdsbA8R+/5Bkh1jiKxN4AiDz31Uttg+7SNhPU Ry6Q== 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:in-reply-to :references; bh=sICcaZN9SuHUxjIoI4iQcsXgJZYewubrScoChP39YpI=; b=ROSMO4rvoq8oHJduTdUV+1crN9khfN6VaVH8G6T7jA80ZRvYxF5uFOCG7/JGX476nz XGEBMuirC4Ri6OpS0sOqPK+kXpsRuHAUtAavKvD7XaBOy06hSQ/ZL+QUZHqF3qx6Qc+o 6JR+cyjvFa8Dd0aKj6lzgtXbJG5aUw++kbulQOry7CT/FFTTjwBcnhmaHHVyY+P7QUT+ p9Y4kvFTBSiQ5xi7kkXsNCTiKB3HEHNGYnWWA8dh0cs/4896F/9gWfUxnSrbodYU9bPM 8A3AQu85Gw2Cgtt3HJed184m+vBOMwnNtYOggQd8G5cOtaxn/PxcV1u+OZWVfQSrt8w/ Tivg== X-Gm-Message-State: APzg51DoVpycgDBYbCRAO0NfbYXh/1EUQLU6CA9xpkS+RtW65mqpbzaU Dxl4hSwH2MgBc67ZByfnCyc= X-Google-Smtp-Source: ANB0VdZ0MikSKsrAa87d0u3AUJ+5RqMu1iRmXtZH7fLGRlp1wDHMuNiCDvEZEfF05cd4AM5E4NiNTA== X-Received: by 2002:adf:8504:: with SMTP id 4-v6mr7769616wrh.72.1535643951102; Thu, 30 Aug 2018 08:45:51 -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.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Aug 2018 08:45:50 -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 29/30] ARM: dts: sun8i: a83t: add thermal zone to A83T Date: Thu, 30 Aug 2018 17:45:17 +0200 Message-Id: <20180830154518.29507-30-embed3d@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180830154518.29507-1-embed3d@gmail.com> References: <20180830154518.29507-1-embed3d@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180830_084603_614880_BF1C4580 X-CRM114-Status: GOOD ( 13.90 ) 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 This patch adds the thermal zones to the A83T. Sensor 0 is located besides the cpu cluster 0. Sensor 1 is located besides cluster 1 and sensor 2 is located besides in the gpu. Signed-off-by: Philipp Rossak --- arch/arm/boot/dts/sun8i-a83t.dtsi | 103 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) diff --git a/arch/arm/boot/dts/sun8i-a83t.dtsi b/arch/arm/boot/dts/sun8i-a83t.dtsi index f2f745930b08..78aa448e869f 100644 --- a/arch/arm/boot/dts/sun8i-a83t.dtsi +++ b/arch/arm/boot/dts/sun8i-a83t.dtsi @@ -50,6 +50,7 @@ #include #include #include +#include / { interrupt-parent = <&gic>; @@ -69,6 +70,9 @@ cci-control-port = <&cci_control0>; enable-method = "allwinner,sun8i-a83t-smp"; reg = <0>; + #cooling-cells = <2>; + cooling-min-level = <0>; + cooling-max-level = <7>; }; cpu@1 { @@ -107,6 +111,9 @@ cci-control-port = <&cci_control1>; enable-method = "allwinner,sun8i-a83t-smp"; reg = <0x100>; + #cooling-cells = <2>; + cooling-min-level = <0>; + cooling-max-level = <7>; }; cpu@101 { @@ -1035,4 +1042,100 @@ #size-cells = <0>; }; }; + + thermal-zones { + cpu0_thermal: cpu0-thermal { + polling-delay-passive = <1000>; + polling-delay = <5000>; + thermal-sensors = <&ths 0>; + + trips { + cpu0_warm: cpu_warm { + temperature = <70000>; + hysteresis = <2000>; + type = "passive"; + }; + cpu0_hot: cpu_hot { + temperature = <80000>; + hysteresis = <2000>; + type = "passive"; + }; + cpu0_very_hot: cpu_very_hot { + temperature = <90000>; + hysteresis = <2000>; + type = "passive"; + }; + cpu0_crit: cpu_crit { + temperature = <105000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + + cooling-maps { + cpu_warm_limit_cpu { + trip = <&cpu0_warm>; + cooling-device = <&cpu0 THERMAL_NO_LIMIT 4>; + }; + cpu_hot_limit_cpu { + trip = <&cpu0_hot>; + cooling-device = <&cpu0 5 5>; + }; + cpu_very_hot_limit_cpu { + trip = <&cpu0_very_hot>; + cooling-device = <&cpu0 7 THERMAL_NO_LIMIT>; + }; + }; + }; + + cpu1_thermal: cpu1-thermal { + polling-delay-passive = <1000>; + polling-delay = <5000>; + thermal-sensors = <&ths 1>; + + trips { + cpu1_warm: cpu_warm { + temperature = <70000>; + hysteresis = <2000>; + type = "passive"; + }; + cpu1_hot: cpu_hot { + temperature = <80000>; + hysteresis = <2000>; + type = "passive"; + }; + cpu1_very_hot: cpu_very_hot { + temperature = <90000>; + hysteresis = <2000>; + type = "passive"; + }; + cpu1_crit: cpu_crit { + temperature = <105000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + + cooling-maps { + cpu_warm_limit_cpu { + trip = <&cpu1_warm>; + cooling-device = <&cpu100 THERMAL_NO_LIMIT 4>; + }; + cpu_hot_limit_cpu { + trip = <&cpu1_hot>; + cooling-device = <&cpu100 5 5>; + }; + cpu_very_hot_limit_cpu { + trip = <&cpu1_very_hot>; + cooling-device = <&cpu100 7 THERMAL_NO_LIMIT>; + }; + }; + }; + + gpu_thermal: gpu-thermal { + polling-delay-passive = <1000>; + polling-delay = <5000>; + thermal-sensors = <&ths 2>; + }; + }; }; From patchwork Thu Aug 30 15:45:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Rossak X-Patchwork-Id: 10582215 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 452A3920 for ; Thu, 30 Aug 2018 16:05:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2B9372C0D5 for ; Thu, 30 Aug 2018 16:05:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1BBCC2C115; Thu, 30 Aug 2018 16:05:36 +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=ham 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 9897C2C0D5 for ; Thu, 30 Aug 2018 16:05:35 +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:References: In-Reply-To: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:List-Owner; bh=JfhWapaZ14Pfik2jqOGEJsbMKBlSn1+cvLfeH1G10NM=; b=ZvwCQ+WzOPoNJN4HCcebGWkn7C EKcb+xXobr6eELhYSRhhXA2ZG0nhiN/2S9iDxZRYxEMh24QWzI7JxFmtKKKST70g0Tp4h/+Lj5eRm rbKGRtNWPwJ64NkYfqw7ELn/jmDdrxMQ6xCmTnLZ3f0J+1gFSvmdVnK8o7QJjDlc1sk+gZdBbUwYF DexqDLAD0uvv4kNmSyCweB+FC6a9cXoO1/613xBEgNRTWa8qgLoXDY+CWBn2gHNH7OqZysdOALO5i 90R4tQK4dUbGHigTE2PWdjS9vMrCyRaQIXMl5202t2GAmTv5T+mAOztwG5i7ptXIDbFUeVVIstEbQ t0NuHaCw==; 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 1fvPRk-0005rM-6o; Thu, 30 Aug 2018 16:05:24 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fvP8w-0001nJ-Io for linux-arm-kernel@lists.infradead.org; Thu, 30 Aug 2018 15:46:00 +0000 Received: by mail-wr1-x442.google.com with SMTP id u12-v6so8500294wrr.4 for ; Thu, 30 Aug 2018 08:45:53 -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:in-reply-to:references; bh=3W91bGBF1HpXiJKP9B53w9fhR17jbGJS1HMpVllHUDg=; b=gbvr/F2HG8fxSR5G3qpM1w/HDHaOhquocX4t4s4Iriv1Oag0KkMCt9kVdUenhdLo7z Vg0c1ulZlgLpzC/nCYix1MfpC4qwbWUaTHI0/Poj2KgrmM3d4dDxW4hilvyjeASrCKEV SK6WKzwU4wLyE/w8Qd4m+b2+YXhn6i8oQhnfhjIX6cdMk4P+HQrE4rE/q2NqHWFzbM9l bZryZTbOSAMUpVzoRSDO/xe5wN1yuZDogc4vD2TBED7YswaCWPgwbH/RBT1HI8MkDKdw FexGMW99YGWdbO8Sm5ayMzwuG3q+3GGuyAtHuLgyJo9DNth2OPHQrPGo6od3HbOj/DWM 4Qtg== 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:in-reply-to :references; bh=3W91bGBF1HpXiJKP9B53w9fhR17jbGJS1HMpVllHUDg=; b=ihhXfAXIjezTJ5Xr3pwqky4/1rhmRXqbjTKj4fHnhrmEKh9m+de1venK2J+KGwmps5 XgogeEr0odpMMuhHMjF1kZnTYMisSDoF1i0Zy/RcLDpSqJPt1bJLeOXR2MGECIQOgwwn AtEXPBMFMokZCoR2aohi92wmFJPISlhV/PWSC/md5hdr1KAtYwPwV+O40Q8c7dGzESgA Ol0JvY5dSK7R/Ibo8XXtdcjEX7S7C1AubXVJGQ1wbY2IKpGHbtNRiOkqrSePFzC/nUiX vlAO2MFLHkL06x5MYwJbPJzWHimgfuUBL/UV9dAT+Rt8qD1sYfSBkq78zFo0TEzxVwVJ kE3Q== X-Gm-Message-State: APzg51C2l/xeoi2eeKX0S1bUkLkKqDCnDZ9qj9bAAe6l8ncNij/xAoUm tGTMfETtntHqgSxE6nFSNWw= X-Google-Smtp-Source: ANB0VdYplH+KyHB34+f5e/lpoUakLxXB/+ITZhkOm7a8OcAvHUtBBgtm0J1cFOmXZ/SchLPMerKIkw== X-Received: by 2002:adf:824f:: with SMTP id 73-v6mr8055934wrb.130.1535643952128; Thu, 30 Aug 2018 08:45:52 -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.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Aug 2018 08:45:51 -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 30/30] ARM: sun8i: a83t: full range OPP tables and CPUfreq Date: Thu, 30 Aug 2018 17:45:18 +0200 Message-Id: <20180830154518.29507-31-embed3d@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180830154518.29507-1-embed3d@gmail.com> References: <20180830154518.29507-1-embed3d@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180830_084558_722553_115209D8 X-CRM114-Status: GOOD ( 12.42 ) 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 Since we have now thermal trotteling enabeled we can now add the full range of the OPP table. The operating points were found in Allwinner BSP and fex files. Signed-off-by: Philipp Rossak --- arch/arm/boot/dts/sun8i-a83t.dtsi | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/arch/arm/boot/dts/sun8i-a83t.dtsi b/arch/arm/boot/dts/sun8i-a83t.dtsi index 78aa448e869f..ddcf404f9c80 100644 --- a/arch/arm/boot/dts/sun8i-a83t.dtsi +++ b/arch/arm/boot/dts/sun8i-a83t.dtsi @@ -250,6 +250,22 @@ opp-microvolt = <840000>; clock-latency-ns = <244144>; /* 8 32k periods */ }; + + opp-1608000000 { + opp-hz = /bits/ 64 <1608000000>; + opp-microvolt = <920000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; + opp-1800000000 { /* BOOT FREQ */ + opp-hz = /bits/ 64 <1800000000>; + opp-microvolt = <1000000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; + opp-2016000000 { + opp-hz = /bits/ 64 <2016000000>; + opp-microvolt = <1080000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; }; cpu1_opp_table: opp_table1 { @@ -303,6 +319,22 @@ opp-microvolt = <840000>; clock-latency-ns = <244144>; /* 8 32k periods */ }; + + opp-1608000000 { + opp-hz = /bits/ 64 <1608000000>; + opp-microvolt = <920000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; + opp-1800000000 { /* BOOT FREQ */ + opp-hz = /bits/ 64 <1800000000>; + opp-microvolt = <1000000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; + opp-2016000000 { + opp-hz = /bits/ 64 <2016000000>; + opp-microvolt = <1080000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; }; soc {