Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp493051rwe; Wed, 19 Apr 2023 01:37:25 -0700 (PDT) X-Google-Smtp-Source: AKy350Y5/c4DiEBUWjK2iI7p6RyxcaKLeY2bzmY0O3qcFtP2+ToyLmxRsLmQlrr7jTdgzS0lEnBq X-Received: by 2002:a05:6a20:d709:b0:ef:c4f6:9128 with SMTP id iz9-20020a056a20d70900b000efc4f69128mr2286473pzb.42.1681893445458; Wed, 19 Apr 2023 01:37:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681893445; cv=none; d=google.com; s=arc-20160816; b=hGAllfmDuo9LLtedpGYble90w6p5lDnz56QXVPjbRVw5TQzXlsLCWNtL/+DatS8br5 R5TdyBUbh6vx5NbZTrx9nAbViRBL9+bzTD+91OShprOcHyBOCX/M46WT4vPdm6Glq6Xj B8IkR/urAqm3i7U6CbFThOhhf6dMiwUerlG5TZT/P2liYUM9uFlhwbJDu84OMNTh31Lt lTqB05WBgK4PTvSxyw84ikb8AQqVaaJRKAuDBo3WT4PTQOacvyIdJQmMpuXJV4w4Intc gM4pKjdYrOks9GxJVKp26mJUEE1DFZEPxybqM/Y56WlfXKd6cKAs2KPYosoTG68AnsjU JwIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=2iK+POleBc/byLDVWHTc7+1oZoRzGsPyfNa6vjT15MA=; b=KhkMGM6mwupCCcFdepjGTeJ6rCO2lsWVG/gZ+mPCc62UOqAy0XaDnsyY25ZcxFIK2+ 9TAryrE9QdZ4yKhEt4+J25z3aPwLKpXqrx6tvDoXZGeV5gzXjENNl0EtOwqG9dcNFJnt apF/OmYbcv2eKRcmIUrLXUG/m1GWPzVU3BPMoD26AOxBus/B2m5trW6oRkmlcQg9qR8i 2jnZHq6/XaOM+XKm4uDJZcgoQkZVnzsLzuoSN+wxshWiojkqqChUog1JbU7QUlzHFUDA a9kX8xFJdY1jvWAq4TWESkEKAeIGxSp5rEVGvvGDfb/n+gAfKk0oRqCKBFX/00/bSCa2 mDpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="hDC/3pV2"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b19-20020a621b13000000b0063d3dda6933si2722780pfb.115.2023.04.19.01.37.14; Wed, 19 Apr 2023 01:37:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="hDC/3pV2"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232706AbjDSIe2 (ORCPT + 99 others); Wed, 19 Apr 2023 04:34:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232698AbjDSIeL (ORCPT ); Wed, 19 Apr 2023 04:34:11 -0400 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1FED448A for ; Wed, 19 Apr 2023 01:33:55 -0700 (PDT) Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-3f09b9ac51dso85857155e9.0 for ; Wed, 19 Apr 2023 01:33:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681893234; x=1684485234; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2iK+POleBc/byLDVWHTc7+1oZoRzGsPyfNa6vjT15MA=; b=hDC/3pV2pCYg9oQ01G9q6YLUoP6cci4sRaJx3Sm5aYj4inrNFdmQ0mTiaMAmkpYqm9 0xkuWur4JvIUEUoV3CFBiJ+DLWUI3zMbQNrNGoPySCbgHu3PXFnRA3fJxnrD2GgIQiW9 yp93aq1KKEn3xocQvrR9R1rG0h4yZQDeJ1Bs/2V12tAVzCd6z5j9zhb8zZNGmg6i8XVe M6JQEM+p1lUwGJQPxu0Xzs9Q5gASTJUEGdNBC9QIkdOA9t8kohMjsPc0AeUEWzC4EaXq +bozF8bHPsJ/OyG9sxp0agODo83vJjFcmO0NYgxTTgda9dvsjLHYR2fcEUOcBmDXU821 /HEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681893234; x=1684485234; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2iK+POleBc/byLDVWHTc7+1oZoRzGsPyfNa6vjT15MA=; b=Y0Y8Br5OR8qsIvZ7Ok+Zojb+mezlkLdOxwAn9FoPyJz1v310QpK+hLrNZ9Stgaq02y iQXn9HeMaNvwUuoavDeGwSCm4dhfnjfcnEDoyh8jsDXEhb6W2829teFeePr6EI7s93Li TxVhCO+jbuZdG0axSjuHRu4HOQABUzqzMN85c5WRKyCvVCTY4Y+i07b1dDsfNIG65zqM +qTryN2BPgZJQR9wwSOfRbfLMbP101AGnBunU8orZ+paHZmEuZY13Ed8IQn0AYvarHiK sYjYe5msM1xLV7eO1FVAaJbV4Vta7MX66SrkVHP2w+wOHelLls9g0xCcaPoAehV2cpkk lSxg== X-Gm-Message-State: AAQBX9fpKwC/MCOFdFHL0Sxwbg+dGAxzu1SmfRxfb+7KiJ0L82EfPGNe lnDiIqAwT0d5zPkTBTZPzUaxGg== X-Received: by 2002:adf:ec86:0:b0:2d0:58f9:a6b with SMTP id z6-20020adfec86000000b002d058f90a6bmr1143426wrn.13.1681893234264; Wed, 19 Apr 2023 01:33:54 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:a794:9fb2:29fb:606d]) by smtp.gmail.com with ESMTPSA id s5-20020a1cf205000000b003ed1ff06faasm1442033wmc.19.2023.04.19.01.33.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 01:33:53 -0700 (PDT) From: Daniel Lezcano To: daniel.lezcano@linaro.org, rafael@kernel.org Cc: rui.zhang@intel.com, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Amit Kucheria , Sujith Thomas , Randy Dunlap , Srinivas Pandruvada Subject: [PATCH v4 6/6] thermal/drivers/intel_menlow: Make additionnal sysfs information optional Date: Wed, 19 Apr 2023 10:33:43 +0200 Message-Id: <20230419083343.505780-7-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230419083343.505780-1-daniel.lezcano@linaro.org> References: <20230419083343.505780-1-daniel.lezcano@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The Menlon thermal driver creates auxiliary trip points in the thermal zone sysfs directory. It is specific to Menlon. Actually these trip points could be generalized with the generic trip points in the future. Let's make the code optional and disable it by default so we have a consistency with the attributes in the thermal zone sysfs directories. If that hurts we will enable by default this option instead of disabling it. Signed-off-by: Daniel Lezcano --- drivers/thermal/intel/Kconfig | 11 +++++++++++ drivers/thermal/intel/intel_menlow.c | 9 +++++++++ 2 files changed, 20 insertions(+) diff --git a/drivers/thermal/intel/Kconfig b/drivers/thermal/intel/Kconfig index cb7e7697cf1e..ef7ffe6b56a0 100644 --- a/drivers/thermal/intel/Kconfig +++ b/drivers/thermal/intel/Kconfig @@ -112,6 +112,17 @@ config INTEL_MENLOW If unsure, say N. +config INTEL_MENLOW_SYSFS_ADDON + bool "Enable extra sysfs attributes in the thermal zone" + depends on INTEL_MENLOW + def_bool n + help + Create auxiliary trip points in the thermal zone sysfs + directory. This is specific to this driver. By default those + are disabled and are candidate for removal, if you need these + information anyway, enable the option or upgrade the + userspace program using them. + config INTEL_HFI_THERMAL bool "Intel Hardware Feedback Interface" depends on NET diff --git a/drivers/thermal/intel/intel_menlow.c b/drivers/thermal/intel/intel_menlow.c index d720add918ff..605983be516c 100644 --- a/drivers/thermal/intel/intel_menlow.c +++ b/drivers/thermal/intel/intel_menlow.c @@ -367,6 +367,7 @@ static ssize_t bios_enabled_show(struct device *dev, return sprintf(buf, "%s\n", bios_enabled ? "enabled" : "disabled"); } +#ifdef CONFIG_INTEL_MENLOW_SYSFS_ADDON static int intel_menlow_add_one_attribute(char *name, umode_t mode, void *show, void *store, struct device *dev, acpi_handle handle) @@ -398,6 +399,14 @@ static int intel_menlow_add_one_attribute(char *name, umode_t mode, void *show, return 0; } +#else +static int intel_menlow_add_one_attribute(char *name, umode_t mode, void *show, + void *store, struct device *dev, + acpi_handle handle) +{ + return 0; +} +#endif static acpi_status intel_menlow_register_sensor(acpi_handle handle, u32 lvl, void *context, void **rv) -- 2.34.1