From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 02F1DCA9EC7 for ; Wed, 30 Oct 2019 18:22:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D01A02067D for ; Wed, 30 Oct 2019 18:22:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="NS0T9NTn" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728017AbfJ3SWX (ORCPT ); Wed, 30 Oct 2019 14:22:23 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:37063 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726979AbfJ3SWX (ORCPT ); Wed, 30 Oct 2019 14:22:23 -0400 Received: by mail-pg1-f194.google.com with SMTP id p1so2025194pgi.4; Wed, 30 Oct 2019 11:22: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=RMrszFJgqQZnz4BQZjFom+3bPfD40qA/+5eRpXchJeY=; b=NS0T9NTn2sGO0rWBgW+4jVzupq39TCXDMIQTAD01DlJUEUxJasNRvYxTN7lhEcBxAO MJnXnU2YnlB5hJLWIYhhQJPobtXE07VNl3h8cPpZX3RaQK2Pqvysp1i2oTAKqoR3uMdB f74lLKWqLpqaNrN2EaQK/FTBSE2S4Qv2LdoxZObnuHBUKJCh31lwglekb9hOGGovtoVY W3N8p/9IH+gPHj8dmWQ0VB+tMf4EwMbPdE1UrNf6MUdlk3VrGn2jM11wUEeN7LnpIuAv MI2oK0TN/QUT5PpN2X0uZKU1TKX2+lL87m6iXHXsAGNam2rQmBqKAl9+YixKSr966MBy 6BUg== 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=RMrszFJgqQZnz4BQZjFom+3bPfD40qA/+5eRpXchJeY=; b=NPCYaMQfY34Vx4j63qVjirfOVw/pUqqpcXuoxMi0keLQp4pQ1Y8VDwtSL/fsd1veSv PSwNpljDVgfDe6ruv9sPJf6yAhvJBvRbyZcd2JggHwVQyfg4cfMO5VQ+71faau1H2VWx oK9ZQL+ZqD8X4yO32C1Y//tvyp64+kORw125TsQ+miQxftSmcfHKnHVhXQ6GoB93G3HS q/r5VXtwpt8VljHbF0N8bB3ANfJ+94nKkYoctwgJIxdtZoYke5o9HMnAIfDow4V6mFW0 F5IGPuFrHicQ9ifhiMGisz6dUX7in7hn5voVQ5Ft+3slDRMu8NmGiu2FWmO+V8YLBh2Y WQPg== X-Gm-Message-State: APjAAAXCbMGqaWhNb4jbdW2C7SwulJvr5F8Y2HVQCEsRt1l/Gdh0Ud0L Xci40t4oANxmw0j+0ziinrgPnFgC X-Google-Smtp-Source: APXvYqx5ES4peqb/VFYaSUgBoAeQE3RpPCPQ5SNkOCGGUcY1JED3KHtlljdhgijC8J6e++KDRJUf4A== X-Received: by 2002:a17:90a:d58f:: with SMTP id v15mr767564pju.17.1572459741909; Wed, 30 Oct 2019 11:22:21 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id z5sm521637pgi.19.2019.10.30.11.22.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Oct 2019 11:22:21 -0700 (PDT) From: Florian Fainelli To: linux-kernel@vger.kernel.org Cc: Florian Fainelli , Markus Mayer , bcm-kernel-feedback-list@broadcom.com (maintainer:BROADCOM STB AVS TMON DRIVER), Zhang Rui , Eduardo Valentin , Daniel Lezcano , Amit Kucheria , Rob Herring , Mark Rutland , linux-pm@vger.kernel.org (open list:BROADCOM STB AVS TMON DRIVER), devicetree@vger.kernel.org (open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS), linux-arm-kernel@lists.infradead.org (moderated list:BROADCOM BCM7XXX ARM ARCHITECTURE) Subject: [PATCH 6/6] thermal: brcmstb_thermal: Register different ops per process Date: Wed, 30 Oct 2019 11:21:32 -0700 Message-Id: <20191030182132.25763-7-f.fainelli@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191030182132.25763-1-f.fainelli@gmail.com> References: <20191030182132.25763-1-f.fainelli@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since we do not have interrupts on BCM7216, we cannot have trip point crossing, the thermal subsystem expects us to provide a NULL set_trips operation in that case, so make it possible to provide per-process thermal_zone_of_device_ops Signed-off-by: Florian Fainelli --- drivers/thermal/broadcom/brcmstb_thermal.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/thermal/broadcom/brcmstb_thermal.c b/drivers/thermal/broadcom/brcmstb_thermal.c index 64f715053ce9..a75a335d1bb3 100644 --- a/drivers/thermal/broadcom/brcmstb_thermal.c +++ b/drivers/thermal/broadcom/brcmstb_thermal.c @@ -96,6 +96,7 @@ static struct avs_tmon_trip avs_tmon_trips[] = { struct brcmstb_thermal_params { unsigned int offset; unsigned int mult; + const struct thermal_zone_of_device_ops *of_ops; }; struct brcmstb_thermal_priv { @@ -278,19 +279,25 @@ static int brcmstb_set_trips(void *data, int low, int high) return 0; } -static const struct thermal_zone_of_device_ops of_ops = { +static const struct thermal_zone_of_device_ops brcmstb_16nm_of_ops = { .get_temp = brcmstb_get_temp, - .set_trips = brcmstb_set_trips, }; static const struct brcmstb_thermal_params brcmstb_16nm_params = { .offset = 457829, .mult = 557, + .of_ops = &brcmstb_16nm_of_ops, +}; + +static const struct thermal_zone_of_device_ops brcmstb_28nm_of_ops = { + .get_temp = brcmstb_get_temp, + .set_trips = brcmstb_set_trips, }; static const struct brcmstb_thermal_params brcmstb_28nm_params = { .offset = 410040, .mult = 487, + .of_ops = &brcmstb_28nm_of_ops, }; static const struct of_device_id brcmstb_thermal_id_table[] = { @@ -329,7 +336,7 @@ static int brcmstb_thermal_probe(struct platform_device *pdev) platform_set_drvdata(pdev, priv); thermal = devm_thermal_zone_of_sensor_register(&pdev->dev, 0, priv, - &of_ops); + priv->temp_params.of_ops); if (IS_ERR(thermal)) { ret = PTR_ERR(thermal); dev_err(&pdev->dev, "could not register sensor: %d\n", ret); -- 2.17.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.7 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 77022CA9EC5 for ; Wed, 30 Oct 2019 18:23:16 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4C2142067D for ; Wed, 30 Oct 2019 18:23:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="qyh018Hd"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="NS0T9NTn" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4C2142067D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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=uFJufmO0+i+aMwfL4iKLVe9qp4X1dDqlKw0BnGLm0w8=; b=qyh018Hdvff5lT+R1phyENDPjr 0rSLFWk32ELeVQ81VQ8mpNaNH/DU1WhWvDWj1tHU8SCE6Fiq9d3Zzb70nAJ08r69aC/aKlGcCn7/W ycWPY5ilWcsBx6SuzmttegvzCMg/q1jtoVPU0nlgiBoSZcn01omzfH3vbGtuW44FGi3y+RKNkL6Q0 jdDvo3i7Ull3+NCn1qsQivfxx5uRiRigszAAMboH5KyRZMifHBwYmbqQXz39/y/8rpzJZVENb26cG ek59zEbYCqOx3XfwWiyfoDEXoeBucZ1gLNZ3xtg8+QuUG55WRjzG18cv8pjzem+SSlsIpoj+yb7Sh GRtiZ71A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iPsck-0005EE-Rj; Wed, 30 Oct 2019 18:23:14 +0000 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iPsbu-0004QO-SI for linux-arm-kernel@lists.infradead.org; Wed, 30 Oct 2019 18:22:24 +0000 Received: by mail-pf1-x442.google.com with SMTP id 193so855442pfc.13 for ; Wed, 30 Oct 2019 11:22: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=RMrszFJgqQZnz4BQZjFom+3bPfD40qA/+5eRpXchJeY=; b=NS0T9NTn2sGO0rWBgW+4jVzupq39TCXDMIQTAD01DlJUEUxJasNRvYxTN7lhEcBxAO MJnXnU2YnlB5hJLWIYhhQJPobtXE07VNl3h8cPpZX3RaQK2Pqvysp1i2oTAKqoR3uMdB f74lLKWqLpqaNrN2EaQK/FTBSE2S4Qv2LdoxZObnuHBUKJCh31lwglekb9hOGGovtoVY W3N8p/9IH+gPHj8dmWQ0VB+tMf4EwMbPdE1UrNf6MUdlk3VrGn2jM11wUEeN7LnpIuAv MI2oK0TN/QUT5PpN2X0uZKU1TKX2+lL87m6iXHXsAGNam2rQmBqKAl9+YixKSr966MBy 6BUg== 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=RMrszFJgqQZnz4BQZjFom+3bPfD40qA/+5eRpXchJeY=; b=HXcfi9DVBmS0uyiw0EXfVq7HeE/2KKfxFbIjKFbL06s7nsxya/CbiaZURVbvC2/Gq0 yuhckY02D+uV0G2sYQ8E3R+bBbSEb0vmEA/bF29ZfwlDQjbxItO9ub9aB+8BpMfkzlSS wSBUv0Rb0KXgu4wVJQFNxYp8cGP5mAbcPxU3lvqJJ2yCFVPqJcDMmGm7ACWhjoMqXHuZ d9+csG07zRGbyscPRx3SYMGEZk26x429Av6OypVFwOisVljOegv84DsHsEjs0UlkFuE8 OwwkbYlME0esq3Q/7tQzgiMlSgHP16xDZC9eAuC1dw0FR7Va0ecjaYCdOSaPtyv2f5fl p6aw== X-Gm-Message-State: APjAAAWkEMi7w2hjkiFseAWPje4n5B78l8hhueRAqbK4xj/KKLyMPVdk jp7/51Vrjwcm9360Np6Epak= X-Google-Smtp-Source: APXvYqx5ES4peqb/VFYaSUgBoAeQE3RpPCPQ5SNkOCGGUcY1JED3KHtlljdhgijC8J6e++KDRJUf4A== X-Received: by 2002:a17:90a:d58f:: with SMTP id v15mr767564pju.17.1572459741909; Wed, 30 Oct 2019 11:22:21 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id z5sm521637pgi.19.2019.10.30.11.22.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Oct 2019 11:22:21 -0700 (PDT) From: Florian Fainelli To: linux-kernel@vger.kernel.org Subject: [PATCH 6/6] thermal: brcmstb_thermal: Register different ops per process Date: Wed, 30 Oct 2019 11:21:32 -0700 Message-Id: <20191030182132.25763-7-f.fainelli@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191030182132.25763-1-f.fainelli@gmail.com> References: <20191030182132.25763-1-f.fainelli@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191030_112223_226096_009A973C X-CRM114-Status: GOOD ( 15.14 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Amit Kucheria , Florian Fainelli , "open list:BROADCOM STB AVS TMON DRIVER" , Daniel Lezcano , Eduardo Valentin , Rob Herring , "maintainer:BROADCOM STB AVS TMON DRIVER" , Markus Mayer , Zhang Rui , "moderated list:BROADCOM BCM7XXX ARM ARCHITECTURE" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Since we do not have interrupts on BCM7216, we cannot have trip point crossing, the thermal subsystem expects us to provide a NULL set_trips operation in that case, so make it possible to provide per-process thermal_zone_of_device_ops Signed-off-by: Florian Fainelli --- drivers/thermal/broadcom/brcmstb_thermal.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/thermal/broadcom/brcmstb_thermal.c b/drivers/thermal/broadcom/brcmstb_thermal.c index 64f715053ce9..a75a335d1bb3 100644 --- a/drivers/thermal/broadcom/brcmstb_thermal.c +++ b/drivers/thermal/broadcom/brcmstb_thermal.c @@ -96,6 +96,7 @@ static struct avs_tmon_trip avs_tmon_trips[] = { struct brcmstb_thermal_params { unsigned int offset; unsigned int mult; + const struct thermal_zone_of_device_ops *of_ops; }; struct brcmstb_thermal_priv { @@ -278,19 +279,25 @@ static int brcmstb_set_trips(void *data, int low, int high) return 0; } -static const struct thermal_zone_of_device_ops of_ops = { +static const struct thermal_zone_of_device_ops brcmstb_16nm_of_ops = { .get_temp = brcmstb_get_temp, - .set_trips = brcmstb_set_trips, }; static const struct brcmstb_thermal_params brcmstb_16nm_params = { .offset = 457829, .mult = 557, + .of_ops = &brcmstb_16nm_of_ops, +}; + +static const struct thermal_zone_of_device_ops brcmstb_28nm_of_ops = { + .get_temp = brcmstb_get_temp, + .set_trips = brcmstb_set_trips, }; static const struct brcmstb_thermal_params brcmstb_28nm_params = { .offset = 410040, .mult = 487, + .of_ops = &brcmstb_28nm_of_ops, }; static const struct of_device_id brcmstb_thermal_id_table[] = { @@ -329,7 +336,7 @@ static int brcmstb_thermal_probe(struct platform_device *pdev) platform_set_drvdata(pdev, priv); thermal = devm_thermal_zone_of_sensor_register(&pdev->dev, 0, priv, - &of_ops); + priv->temp_params.of_ops); if (IS_ERR(thermal)) { ret = PTR_ERR(thermal); dev_err(&pdev->dev, "could not register sensor: %d\n", ret); -- 2.17.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel