From patchwork Tue Apr 10 12:42:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartlomiej Zolnierkiewicz X-Patchwork-Id: 10332995 X-Patchwork-Delegate: eduardo.valentin@ti.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 70EF26053B for ; Tue, 10 Apr 2018 12:45:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 620A327FAE for ; Tue, 10 Apr 2018 12:45:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5289E28826; Tue, 10 Apr 2018 12:45:53 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D20D327FAE for ; Tue, 10 Apr 2018 12:45:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753308AbeDJMoQ (ORCPT ); Tue, 10 Apr 2018 08:44:16 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:32957 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753680AbeDJMoM (ORCPT ); Tue, 10 Apr 2018 08:44:12 -0400 Received: from epcas2p4.samsung.com (unknown [182.195.41.56]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20180410124410epoutp01b03bedb0d91f1e0baa381f6ad5235d02~kE7b_ttpP2510025100epoutp013; Tue, 10 Apr 2018 12:44:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20180410124410epoutp01b03bedb0d91f1e0baa381f6ad5235d02~kE7b_ttpP2510025100epoutp013 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1523364250; bh=S8kffDXAINou6drCo5hL9oAyBYQcFTcfFohamhKvpwY=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=ZuYDDYu2Yu3AJmw5QEBMLWnHxBiGGogfyXY6iTkpEtY7Rfj/h+26hgfr6bv2RUFT5 oJDIMbpNTu0wYnWGppwM3mlDIo//UVHgpBOX5n8Z1k2og0DnlFBAnmGs2yMfl468mh UVD0Ti4VGiJfhXVLY7DHR2qQcmo+hO0AfJs4P6No= Received: from epsmges2p4.samsung.com (unknown [182.195.42.72]) by epcas2p3.samsung.com (KnoxPortal) with ESMTP id 20180410124409epcas2p3a767d55ee95ee364a262841b5cbfe584~kE7bBWTro1455814558epcas2p3O; Tue, 10 Apr 2018 12:44:09 +0000 (GMT) Received: from epcas2p4.samsung.com ( [182.195.41.56]) by epsmges2p4.samsung.com (Symantec Messaging Gateway) with SMTP id C4.46.04082.991BCCA5; Tue, 10 Apr 2018 21:44:09 +0900 (KST) Received: from epsmgms2p2new.samsung.com (unknown [182.195.42.143]) by epcas2p4.samsung.com (KnoxPortal) with ESMTP id 20180410124407epcas2p4c537eb52653af45b85af6b69969c4e52~kE7Zf1k6p2644226442epcas2p4l; Tue, 10 Apr 2018 12:44:07 +0000 (GMT) X-AuditID: b6c32a48-8d9ff70000000ff2-a0-5accb199bb62 Received: from epmmp1.local.host ( [203.254.227.16]) by epsmgms2p2new.samsung.com (Symantec Messaging Gateway) with SMTP id 20.3E.03827.791BCCA5; Tue, 10 Apr 2018 21:44:07 +0900 (KST) Received: from AMDC3058.DIGITAL.local ([106.120.53.102]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0P6Y00EUVZATQUB0@mmp1.samsung.com>; Tue, 10 Apr 2018 21:44:07 +0900 (KST) From: Bartlomiej Zolnierkiewicz To: Zhang Rui , Eduardo Valentin Cc: Eric Anholt , Stefan Wahren , Markus Mayer , bcm-kernel-feedback-list@broadcom.com, Heiko Stuebner , Thierry Reding , Jonathan Hunter , Keerthy , Masahiro Yamada , Jun Nie , Baoyou Xie , Shawn Guo , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, b.zolnierkie@samsung.com Subject: [PATCH 11/17] thermal: rockchip_thermal: enable/check sensor after its setup is finished Date: Tue, 10 Apr 2018 14:42:05 +0200 Message-id: <1523364131-31059-12-git-send-email-b.zolnierkie@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1523364131-31059-1-git-send-email-b.zolnierkie@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAAzWSbUhTURyHPfdt19XiNkUPan6Y9UGrqal0shIjP9xK0a9JkEMvU5ovbCop RJuWb6FZYuWQKSlU8y115ppa4tKlTUXUZb5FJjIVpmQoKlrOi9+e8/s95/zPgUPj4mLSi05J y+SUaTKFhBISH8z+6HxVqzU+aKzYD7W+aiHR0oYFoKbSfgLVTNhI1KsZB+jfwiqJhjrzMPRI +5pA9Yu/BGjcVE2hjdIvAFU7ZgRo8VcZhewGT9T2dopC2yYdgXrmN0DkSTZvbYBitT+HKfaj dk7AdkyHsXXdyxjbpi+m2FlbN8WW5jsotsygB2ynTYezX19uEaxlqhNjN9p840TxwitJnCIl m1MGRiQIk584cjI6RPd1L8yUGtQeKwGuNGRCYc/MtMDJYsYIYEHD7RIgPOAtAPt3TOBIsk9U EnzRBeC2vhfjFzsAzle+w5wWxYTDZ4X6gx007c7cgoZG2ungTBUB12f7cafjxiRCXbOecDLB nIEV2sLDXMTcgO12G8ZP84WDAxWkk10P8t2eNZLPnwqguj6I5yhotOwTPLvBFYtBwLM3XNK3 AudgyOQDuGnsxvmiHMDuFjH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OOGq6dCt13185LFyh9GxfwpVWa50z0ki8azqXlRRezpnbU NG08fdXj9aRVtxuOarp4/X31yEae6zNnoaPIgWDXQwGv/sh58/zo/c73qzOpkdG5JklZ47bw xq/rHJb/Z3x9LzTeg3fTUu97060fuU7dHXNaX4mlOCPRUIu5qDgRAATFObB1AgAA X-CMS-MailID: 20180410124407epcas2p4c537eb52653af45b85af6b69969c4e52 X-Msg-Generator: CA CMS-TYPE: 102P X-CMS-RootMailID: 20180410124407epcas2p4c537eb52653af45b85af6b69969c4e52 X-RootMTR: 20180410124407epcas2p4c537eb52653af45b85af6b69969c4e52 References: <1523364131-31059-1-git-send-email-b.zolnierkie@samsung.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP * Enable/check sensor explicitly in rockchip_thermal_probe() (also check sensor after doing chipset specific control operation). * Remove superfluous second sensor enable/check attempt. Cc: Heiko Stuebner Signed-off-by: Bartlomiej Zolnierkiewicz --- This driver may require some more fixing (probably IRQ should be requested after ->control call). drivers/thermal/rockchip_thermal.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/thermal/rockchip_thermal.c b/drivers/thermal/rockchip_thermal.c index 500cfc3..0b3509b 100644 --- a/drivers/thermal/rockchip_thermal.c +++ b/drivers/thermal/rockchip_thermal.c @@ -1161,9 +1161,6 @@ static int rockchip_configure_from_dt(struct device *dev, return error; } - thermal_zone_device_toggle(sensor->tzd, true); - thermal_zone_device_check(sensor->tzd); - return 0; } @@ -1272,6 +1269,9 @@ static int rockchip_thermal_probe(struct platform_device *pdev) } } + for (i = 0; i < thermal->chip->chn_num; i++) + thermal_zone_device_toggle((&thermal->sensors[i])->tzd, true); + error = devm_request_threaded_irq(&pdev->dev, irq, NULL, &rockchip_thermal_alarm_irq_thread, IRQF_ONESHOT, @@ -1284,10 +1284,8 @@ static int rockchip_thermal_probe(struct platform_device *pdev) thermal->chip->control(thermal->regs, true); - for (i = 0; i < thermal->chip->chn_num; i++) { - thermal_zone_device_toggle((&thermal->sensors[i])->tzd, true); + for (i = 0; i < thermal->chip->chn_num; i++) thermal_zone_device_check((&thermal->sensors[i])->tzd); - } platform_set_drvdata(pdev, thermal);