Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756085AbbHZNya (ORCPT ); Wed, 26 Aug 2015 09:54:30 -0400 Received: from metis.ext.pengutronix.de ([92.198.50.35]:32916 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751791AbbHZNy3 (ORCPT ); Wed, 26 Aug 2015 09:54:29 -0400 Date: Wed, 26 Aug 2015 15:54:21 +0200 From: Sascha Hauer To: Daniel Lezcano Cc: linux-pm@vger.kernel.org, Zhang Rui , Eduardo Valentin , linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, Daniel Kurtz , kernel@pengutronix.de, Matthias Brugger Subject: Re: [PATCH 2/3] thermal: Add Mediatek thermal controller support Message-ID: <20150826135421.GV18700@pengutronix.de> References: <1440057962-13373-1-git-send-email-s.hauer@pengutronix.de> <1440057962-13373-3-git-send-email-s.hauer@pengutronix.de> <55D65ED7.7010102@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55D65ED7.7010102@linaro.org> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 15:49:14 up 62 days, 8:10, 107 users, load average: 0.08, 0.21, 0.19 User-Agent: Mutt/1.5.21 (2010-09-15) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2273 Lines: 65 On Fri, Aug 21, 2015 at 01:12:23AM +0200, Daniel Lezcano wrote: > On 08/20/2015 10:06 AM, Sascha Hauer wrote: > >This adds support for the Mediatek thermal controller found on MT8173 > >and likely other SoCs. > >The controller is a bit special. It does not have its own ADC, instead > >it controls the on-SoC AUXADC via AHB bus accesses. For this reason > >we need the physical address of the AUXADC. Also it controls a mux > >using AHB bus accesses, so we need the APMIXEDSYS physical address aswell. > > > >Signed-off-by: Sascha Hauer > >--- > > [ ... ] > > >diff --git a/drivers/thermal/mtk_thermal.c b/drivers/thermal/mtk_thermal.c > >new file mode 100644 > >index 0000000..06d52ef > >--- /dev/null > >+++ b/drivers/thermal/mtk_thermal.c > >@@ -0,0 +1,582 @@ > >+/* > >+ * Copyright (c) 2014 MediaTek Inc. > > 2015 ? Can change to 2015 > > >+ * Author: Hanyi.Wu > > Hanyi Wu ? It's the original author of this code. > >+#define TEMP_MONINT_COLD(sp) (BIT(0) << ((sp) * 5)) > >+#define TEMP_MONINT_HOT(sp) (BIT(1) << ((sp) * 5)) > >+#define TEMP_MONINT_LOW_OFS(sp) (BIT(2) << ((sp) * 5)) > >+#define TEMP_MONINT_HIGH_OFS(sp) (BIT(3) << ((sp) * 5)) > >+#define TEMP_MONINT_HOT_TO_NORM(sp) (BIT(4) << ((sp) * 5)) > >+#define TEMP_MONINT_TIMEOUT BIT(15) > >+#define TEMP_MONINT_IMMEDIATE_SENSE(sp) BIT(16 + (sp)) > >+#define TEMP_MONINT_FILTER_SENSE(sp) BIT(19 + (sp)) > >+#define TEMP_ADCWRITECTRL_ADC_EXTRA_WRITE BIT(2) > >+#define TEMP_ADCWRITECTRL_ADC_EXTRA1_WRITE BIT(3) > >+#define TEMP_PROTCTL_AVERAGE (0 << 16) > >+#define TEMP_PROTCTL_MAXIMUM (1 << 16) > >+#define TEMP_PROTCTL_SELECTED (2 << 16) > > <-- Not used. Will remove. Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/