From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751898AbcADObk (ORCPT ); Mon, 4 Jan 2016 09:31:40 -0500 Received: from metis.ext.4.pengutronix.de ([92.198.50.35]:43478 "EHLO metis.ext.4.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751653AbcADObe (ORCPT ); Mon, 4 Jan 2016 09:31:34 -0500 Date: Mon, 4 Jan 2016 15:31:29 +0100 From: Sascha Hauer To: Daniel Kurtz Cc: linux-pm@vger.kernel.org, Zhang Rui , Eduardo Valentin , "linux-kernel@vger.kernel.org" , Sasha Hauer , linux-mediatek@lists.infradead.org, "linux-arm-kernel@lists.infradead.org" , Matthias Brugger Subject: Re: [PATCH 2/3] thermal: Add Mediatek thermal controller support Message-ID: <20160104143129.GJ13058@pengutronix.de> References: <1448883753-19068-1-git-send-email-s.hauer@pengutronix.de> <1448883753-19068-3-git-send-email-s.hauer@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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:21:44 up 78 days, 23:00, 134 users, load average: 0.86, 0.42, 0.39 User-Agent: Mutt/1.5.23 (2014-03-12) 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 On Mon, Dec 21, 2015 at 12:07:58PM +0800, Daniel Kurtz wrote: > Hi Sascha, > > One nit below that can be fixed up later, or now if you don't plan to > spin this driver to > address Eduardo's feedback... > > On Mon, Nov 30, 2015 at 7:42 PM, 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 > > [snip] > > > +static int mtk_thermal_get_calibration_data(struct device *dev, struct mtk_thermal *mt) > > +{ > > + struct nvmem_cell *cell; > > + u32 *buf; > > + size_t len; > > + int i, ret = 0; > > + > > + /* Start with default values */ > > + mt->adc_ge = 512; > > + for (i = 0; i < MT8173_NUM_SENSORS; i++) > > + mt->vts[i] = 260; > > + mt->degc_cali = 40; > > + mt->o_slope = 0; > > + > > + cell = nvmem_cell_get(dev, "calibration-data"); > > + if (IS_ERR(cell)) { > > + if (PTR_ERR(cell) == -EPROBE_DEFER) > > It is useful to know why the thermal driver is being probe defered, so > I suggest here: > dev_warn(dev, "Waiting for calibration data.\n"); The problem with that is that this message is not shown once but possibly many times and may not even show a problem because in the end the device may be probed successfully. In this case the last thing you see from the device is "Waiting for calibration data." and get annoyed by all this useless noise from the driver. Of course I agree that this information may be useful in the case you wonder why your device doesn't show up... 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 |