Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 27BC4C433F5 for ; Fri, 26 Nov 2021 13:38:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349732AbhKZNlh (ORCPT ); Fri, 26 Nov 2021 08:41:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231312AbhKZNje (ORCPT ); Fri, 26 Nov 2021 08:39:34 -0500 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82A01C061D70 for ; Fri, 26 Nov 2021 04:53:33 -0800 (PST) Received: by mail-wm1-x336.google.com with SMTP id 77-20020a1c0450000000b0033123de3425so10685805wme.0 for ; Fri, 26 Nov 2021 04:53:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=dlvnTPe3lASdFY+T2t68uKlxKrbSmUU8V1J05NQSw6U=; b=vx3JdoCTTR1Vst52bANM/Z7IW0FbzkICR7KmlAK0Oh18SEu6OAw4QJogoVfZi4orf3 umQwcTF2WSvValr0zxAMw/jP6yiRaf2jAvC9TuHopBlsZfevxuU7svcmVz+nvlvly1B7 2fbykhH51D7AukLnwsqMn4WDGAQYVkdPU2twltng4xNlNGY7mGxAS4qkDfOyKFxDmD7F SJfT0uvmQVcJPY5+TVzawK1jQ3zzb6idY+b2vmMtmvkhGLKE3pH5kPXchytLEh+e2PyK EKVdRzhKEJwipsolGkXJjc+5Vw+aFATwVzXNu20JQuPP6LDh11ZcRgZ/jYPkYTV2RTQ1 oIAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=dlvnTPe3lASdFY+T2t68uKlxKrbSmUU8V1J05NQSw6U=; b=as9cJ3KORbSCWzbqGlaLY+nLLEZLOzK1l06sQwUgfkyEX+5R/1ae9oQrNrJijJo17b KMiAxzGhILwFPgfYBm1j7zFBh411sWYADANrGflsUXwbcslFCSs0OR7dcL+7354VO0Xf Ij5q3yuHY5e2+Tj/L7OmiNEPUHf1gvDjV9JGL15NSKLu5XAvcuguhwggRN5SfxHBhfz6 ktPy5SpkpbPxRwWLCq4s5qxtgLAwEZanhZGpwRnbv0AqBMHzZo/eTRWDz5aAECN/zWyf lbIqVYRMbQCFkiSYmEMK4khruR/3Xhw83rRA9oQd912SiV3MxFQ1EW8CfiRHhRnbhoLr hO7Q== X-Gm-Message-State: AOAM530MKEi+l2hJMlHf/6ucE+V+ownP9a5N1gc25dibSmi+4YWt4RYQ aW+4hzC+eW2mI8N39sEhGFXHrA== X-Google-Smtp-Source: ABdhPJzvOAL7myFEAtrbimp/grrwHLS5GERcVMo6S8I6FeG3H8Y9RpNZEQH2gDYC1I6jeiHaHI/tvA== X-Received: by 2002:a1c:f418:: with SMTP id z24mr15612899wma.95.1637931212030; Fri, 26 Nov 2021 04:53:32 -0800 (PST) Received: from xps-9300.baylibre.local (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.gmail.com with ESMTPSA id n15sm11762083wmq.38.2021.11.26.04.53.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Nov 2021 04:53:31 -0800 (PST) From: Alexandre Bailon To: rafael@kernel.org, rui.zhang@intel.com, daniel.lezcano@linaro.org, amitk@kernel.org Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, ben.tseng@mediatek.com, khilman@baylibre.com, mka@chromium.org, Alexandre Bailon Subject: [PATCH v4 0/2] Add a generic virtual thermal sensor Date: Fri, 26 Nov 2021 13:52:42 +0100 Message-Id: <20211126125244.126300-1-abailon@baylibre.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This series add a virtual thermal sensor. It could be used to get a temperature using some thermal sensors. Currently, the supported operations are max, min and avg. The virtual sensor could be easily extended to support others operations. Changes in v2: - Fix some warnings / errors reported by kernel test robot - rename some struct and functions with a more accurate name - update the dt bindings: rename type attribute to aggregation-function - factorize a little bit the aggregation functions Changes in v3: - Aggregate thermal zone instead of thermal sensors - Use try_get_module / put_module to prevent thermal providers to be removed - Update the bindings, to be more accurate Changes in v4: - Fix two warnings reported by kernel test robot Alexandre Bailon (2): dt-bindings: Add DT bindings for the DT-based virtual sensor driver thermal: add a virtual sensor to aggregate temperatures Alexandre Bailon (2): dt-bindings: Add DT bindings for the DT-based virtual sensor driver thermal: add a virtual sensor to aggregate temperatures .../thermal/virtual,thermal-sensor.yaml | 86 +++++++ drivers/thermal/Kconfig | 8 + drivers/thermal/Makefile | 1 + drivers/thermal/virtual_thermal_sensor.c | 218 ++++++++++++++++++ include/dt-bindings/thermal/virtual-sensor.h | 15 ++ 5 files changed, 328 insertions(+) create mode 100644 Documentation/devicetree/bindings/thermal/virtual,thermal-sensor.yaml create mode 100644 drivers/thermal/virtual_thermal_sensor.c create mode 100644 include/dt-bindings/thermal/virtual-sensor.h -- 2.25.1