From patchwork Tue Jan 7 23:20:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 11322331 X-Patchwork-Delegate: rui.zhang@intel.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7C0A5138D for ; Tue, 7 Jan 2020 23:21:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5A21F206F0 for ; Tue, 7 Jan 2020 23:21:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=googlemail.com header.i=@googlemail.com header.b="nDisnmX+" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727610AbgAGXVA (ORCPT ); Tue, 7 Jan 2020 18:21:00 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:54801 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727074AbgAGXU7 (ORCPT ); Tue, 7 Jan 2020 18:20:59 -0500 Received: by mail-wm1-f68.google.com with SMTP id b19so599931wmj.4; Tue, 07 Jan 2020 15:20:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DFqhTgxbHey+swfK5cQ0/kLBEvOg3feXk6FuLBIj6rg=; b=nDisnmX+PIgFhWQVRWdesWNv9ixcj6x9PUEZ34fWlUmNl4k8eta3jASZ3azwX2INHe QxZljfKPiaAHTT6Q85B6WzdpkTBA3/ymeGOCRWoz5OFGEQeoqrv4oEl7luT115kwfzVo NcWx0AnOU61d5xFxAHhGlgVzQ7hgMWkJyY3HFRkO9mjTfBnJA3ELrMJBgFPcLqb6wHdO Q9LePQ4MDbstvjExvSoFyL6kHfLui9Wu5yQcBlkSJ+XnJBKv3cPDG5IC0S13TbspXkr4 4ow4IhTq1sI44jfXmwA1od3gLhyi698C8Gv3eTo2ZFQZJBq1c3ZU5g2XXs5TQmLPoiAJ gkNQ== 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:mime-version:content-transfer-encoding; bh=DFqhTgxbHey+swfK5cQ0/kLBEvOg3feXk6FuLBIj6rg=; b=NXGbLcp5+cGPa+mertLPYWBWGnrZHqNV0s0N3IpHY8qKBi7ztIKQJED8j0BYDkpCC2 vRRUTb/MaxYUpqypIpaV1Wa5rHW30LTLblvKeRtxNaFm4PAdOR858PN7z/p4M9BKVbQv 43VcBhflr/fxcR5WT3HjtnLb9f2GGIB0Iz+4rb+CDIRVyOiR6zmD1xcvZDVs2Luvtkh4 sEPUEA2xG8H9LOnw7bS40D0ac+l57YVTyDMssRO15wKtLbgS7JiGoXwCMr3oAkYpo+T+ 3+op9oBmKfz6G85mKGxWWPD+RzR2xCVvV48on6UerTklCVF4zyq0tyvfIJQ9UsEZSfJV 3KuQ== X-Gm-Message-State: APjAAAVm0Hf5gvkmOxh7f34oa+AEfoviO1lKISU4iWQJGpem/EDmhXyz uvpXawnlt0m5KQrONxURQYU= X-Google-Smtp-Source: APXvYqyf2pAQeQc6Y08scs8hc1IAo7Q9zP/id20wK7G8tbkv2vN+vhc6m/InBffSRAKW6T0dRy7FbA== X-Received: by 2002:a1c:4454:: with SMTP id r81mr626445wma.117.1578439257221; Tue, 07 Jan 2020 15:20:57 -0800 (PST) Received: from localhost.localdomain (p200300F1373A1900428D5CFFFEB99DB8.dip0.t-ipconnect.de. [2003:f1:373a:1900:428d:5cff:feb9:9db8]) by smtp.googlemail.com with ESMTPSA id n3sm1669577wrs.8.2020.01.07.15.20.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jan 2020 15:20:56 -0800 (PST) From: Martin Blumenstingl To: rui.zhang@intel.com, daniel.lezcano@linaro.org, amit.kucheria@verdurent.com, linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org, jeff.dagenais@gmail.com, edubezval@gmail.com, Martin Blumenstingl Subject: [PATCH 1/2] thermal: generic-adc: silence "no lookup table" on deferred probe Date: Wed, 8 Jan 2020 00:20:43 +0100 Message-Id: <20200107232044.889075-2-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200107232044.889075-1-martin.blumenstingl@googlemail.com> References: <20200107232044.889075-1-martin.blumenstingl@googlemail.com> MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org A "generic-adc-thermal" without "temperature-lookup-table" is perfectly valid since commit d36e2fa0253875 ("thermal: generic-adc: make lookup table optional"). On deferred probe the message "no lookup table, assuming DAC channel returns milliCelcius" is still logged. Prevent this message on deferred probe of the IIO channel by first looking up the IIO channel. Signed-off-by: Martin Blumenstingl --- drivers/thermal/thermal-generic-adc.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/thermal/thermal-generic-adc.c b/drivers/thermal/thermal-generic-adc.c index ae5743c9a894..226e3c2b7469 100644 --- a/drivers/thermal/thermal-generic-adc.c +++ b/drivers/thermal/thermal-generic-adc.c @@ -124,13 +124,6 @@ static int gadc_thermal_probe(struct platform_device *pdev) if (!gti) return -ENOMEM; - ret = gadc_thermal_read_linear_lookup_table(&pdev->dev, gti); - if (ret < 0) - return ret; - - gti->dev = &pdev->dev; - platform_set_drvdata(pdev, gti); - gti->channel = devm_iio_channel_get(&pdev->dev, "sensor-channel"); if (IS_ERR(gti->channel)) { ret = PTR_ERR(gti->channel); @@ -139,6 +132,13 @@ static int gadc_thermal_probe(struct platform_device *pdev) return ret; } + ret = gadc_thermal_read_linear_lookup_table(&pdev->dev, gti); + if (ret < 0) + return ret; + + gti->dev = &pdev->dev; + platform_set_drvdata(pdev, gti); + gti->tz_dev = devm_thermal_zone_of_sensor_register(&pdev->dev, 0, gti, &gadc_thermal_ops); if (IS_ERR(gti->tz_dev)) { From patchwork Tue Jan 7 23:20:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 11322323 X-Patchwork-Delegate: rui.zhang@intel.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 09C10138D for ; Tue, 7 Jan 2020 23:21:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DB4B1206F0 for ; Tue, 7 Jan 2020 23:21:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=googlemail.com header.i=@googlemail.com header.b="QWaRBgfZ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727627AbgAGXVB (ORCPT ); Tue, 7 Jan 2020 18:21:01 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:36863 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726967AbgAGXU7 (ORCPT ); Tue, 7 Jan 2020 18:20:59 -0500 Received: by mail-wr1-f68.google.com with SMTP id z3so1462859wru.3; Tue, 07 Jan 2020 15:20:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=vV3UUGvvS5e8WsB7ogZ/noPCe30PWO4cAHloQARZuMU=; b=QWaRBgfZaWwF/o5TtRmsgFA8xMd72UlNn8DRyiFN0jTom3bemOIPUhrrsKBbPAIFPJ OfNPUerjyxw6FJm3VOSYYi5Jgr+yKEMboXZfvsuYAU45QDTIYTNGFT7b4Dnd6llum1GO OYVNZfemZicnDMO/Gbi6LPR+cmcbUamwBbbKb6PmT/ZELPKX9wA3PiUldg1RwEFbpZJn FChDB9Cwd2uWGi82zr/EoW+/0IdYDj9pSitFG9zN1kP+GK+xahlLOedxl0bQf6TtlRGj mcHrgAF6imjQzl6jZDR9Rxjj8vQL2u3++H3O10BNjbxcTxdtE1Aaad7VlOpHNIRI7GDf JY3g== 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:mime-version:content-transfer-encoding; bh=vV3UUGvvS5e8WsB7ogZ/noPCe30PWO4cAHloQARZuMU=; b=GoOok3I9YdI4GEpFvm9azGU1npvOzepQubPtSiFx7SHHH639LQepTMQZWRuSjmqrkq rOPOxisUFuG7/pMW4tt94WIB2UOkxZTOpdlQnOPz+Q7Uf2Fm+2nkLEbJ3qsRzODtBnEt LO6kSQWv6E7bhKY8udwcmL1jpAfMbQKfShMhPcWE/Bnt9o3TSnipf3KS2jwSAV8m61GP 7Pu2lBPjjbIDKXc3ibWOePrMssWwXTYBwPZxiB+TUTDDQdd0sbbuw1U36M7Vhh3iwsgU aoZxUiGMZIAUtqNO7vT1wPu8aAOv7hQCGkeAmT8Q3o7asdYsu4lCS9keTzq2gALTb86+ MQBQ== X-Gm-Message-State: APjAAAUBgPSbsBig7vELt46cO+UtQjFRkLOxcf1G07/lB7Ei/1aubTdA yOquuPffsxebKIL4yZify0D+z8r3L9I= X-Google-Smtp-Source: APXvYqyKuhYihOEUdettZiq3ZmkfYHAwS5DF2R/FVnINtIyY9r4EbiuwLBRM7ACqUWiqDdfnsEIjrA== X-Received: by 2002:a5d:62d0:: with SMTP id o16mr1319611wrv.197.1578439258079; Tue, 07 Jan 2020 15:20:58 -0800 (PST) Received: from localhost.localdomain (p200300F1373A1900428D5CFFFEB99DB8.dip0.t-ipconnect.de. [2003:f1:373a:1900:428d:5cff:feb9:9db8]) by smtp.googlemail.com with ESMTPSA id n3sm1669577wrs.8.2020.01.07.15.20.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jan 2020 15:20:57 -0800 (PST) From: Martin Blumenstingl To: rui.zhang@intel.com, daniel.lezcano@linaro.org, amit.kucheria@verdurent.com, linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org, jeff.dagenais@gmail.com, edubezval@gmail.com, Martin Blumenstingl Subject: [PATCH 2/2] thermal: generic-adc: silence info message for IIO_TEMP channels Date: Wed, 8 Jan 2020 00:20:44 +0100 Message-Id: <20200107232044.889075-3-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200107232044.889075-1-martin.blumenstingl@googlemail.com> References: <20200107232044.889075-1-martin.blumenstingl@googlemail.com> MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Since commit d36e2fa0253875 ("thermal: generic-adc: make lookup table optional") "generic-adc-thermal" can be used with an IIO_TEMP channel. In this case the following message is logged at probe time: no lookup table, assuming DAC channel returns milliCelcius Silence this info message if the channel type is known to be in milli celsius. Keep this message when the channel type is unknown or not of type temperature. Signed-off-by: Martin Blumenstingl --- drivers/thermal/thermal-generic-adc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/thermal/thermal-generic-adc.c b/drivers/thermal/thermal-generic-adc.c index 226e3c2b7469..73665c3ccfe0 100644 --- a/drivers/thermal/thermal-generic-adc.c +++ b/drivers/thermal/thermal-generic-adc.c @@ -76,13 +76,17 @@ static int gadc_thermal_read_linear_lookup_table(struct device *dev, struct gadc_thermal_info *gti) { struct device_node *np = dev->of_node; + enum iio_chan_type chan_type; int ntable; int ret; ntable = of_property_count_elems_of_size(np, "temperature-lookup-table", sizeof(u32)); if (ntable <= 0) { - dev_notice(dev, "no lookup table, assuming DAC channel returns milliCelcius\n"); + ret = iio_get_channel_type(gti->channel, &chan_type); + if (ret || chan_type != IIO_TEMP) + dev_notice(dev, + "no lookup table, assuming DAC channel returns milliCelcius\n"); return 0; }