public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: James Seo <james@equiv.tech>
To: Jean Delvare <jdelvare@suse.com>,
	Guenter Roeck <linux@roeck-us.net>,
	Jonathan Corbet <corbet@lwn.net>
Cc: James Seo <james@equiv.tech>,
	linux-hwmon@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [RFC 10/11] hwmon: (core) Add missing beep-related standard attributes
Date: Thu,  4 May 2023 00:57:51 -0700	[thread overview]
Message-ID: <20230504075752.1320967-11-james@equiv.tech> (raw)
In-Reply-To: <20230504075752.1320967-1-james@equiv.tech>

beep_enable, inY_beep, currY_beep, fanY_beep, and tempY_beep
are standard attributes mentioned in the sysfs interface
specification but not implemented in the hwmon core. Since
these are not deprecated, implement them.

Adding beep_mask is not necessary, as it is deprecated and
the drivers already using it are manually defining it.

Signed-off-by: James Seo <james@equiv.tech>
---
 drivers/hwmon/hwmon.c |  5 +++++
 include/linux/hwmon.h | 10 ++++++++++
 2 files changed, 15 insertions(+)

diff --git a/drivers/hwmon/hwmon.c b/drivers/hwmon/hwmon.c
index cc140cf99290..7b611a073be4 100644
--- a/drivers/hwmon/hwmon.c
+++ b/drivers/hwmon/hwmon.c
@@ -456,6 +456,7 @@ static const char * const hwmon_chip_attrs[] = {
 	[hwmon_chip_in_samples] = "in_samples",
 	[hwmon_chip_power_samples] = "power_samples",
 	[hwmon_chip_temp_samples] = "temp_samples",
+	[hwmon_chip_beep_enable] = "beep_enable",
 };
 
 static const char * const hwmon_temp_attr_templates[] = {
@@ -486,6 +487,7 @@ static const char * const hwmon_temp_attr_templates[] = {
 	[hwmon_temp_reset_history] = "temp%d_reset_history",
 	[hwmon_temp_rated_min] = "temp%d_rated_min",
 	[hwmon_temp_rated_max] = "temp%d_rated_max",
+	[hwmon_temp_beep] = "temp%d_beep",
 };
 
 static const char * const hwmon_in_attr_templates[] = {
@@ -507,6 +509,7 @@ static const char * const hwmon_in_attr_templates[] = {
 	[hwmon_in_crit_alarm] = "in%d_crit_alarm",
 	[hwmon_in_rated_min] = "in%d_rated_min",
 	[hwmon_in_rated_max] = "in%d_rated_max",
+	[hwmon_in_beep] = "in%d_beep",
 };
 
 static const char * const hwmon_curr_attr_templates[] = {
@@ -528,6 +531,7 @@ static const char * const hwmon_curr_attr_templates[] = {
 	[hwmon_curr_crit_alarm] = "curr%d_crit_alarm",
 	[hwmon_curr_rated_min] = "curr%d_rated_min",
 	[hwmon_curr_rated_max] = "curr%d_rated_max",
+	[hwmon_curr_beep] = "curr%d_beep",
 };
 
 static const char * const hwmon_power_attr_templates[] = {
@@ -562,6 +566,7 @@ static const char * const hwmon_power_attr_templates[] = {
 	[hwmon_power_crit_alarm] = "power%d_crit_alarm",
 	[hwmon_power_rated_min] = "power%d_rated_min",
 	[hwmon_power_rated_max] = "power%d_rated_max",
+	[hwmon_curr_beep] = "power%d_beep",
 };
 
 static const char * const hwmon_energy_attr_templates[] = {
diff --git a/include/linux/hwmon.h b/include/linux/hwmon.h
index fe80e8e24b5a..496448a5f331 100644
--- a/include/linux/hwmon.h
+++ b/include/linux/hwmon.h
@@ -60,6 +60,7 @@ enum hwmon_chip_attributes {
 	hwmon_chip_in_samples,
 	hwmon_chip_power_samples,
 	hwmon_chip_temp_samples,
+	hwmon_chip_beep_enable,
 };
 
 #define HWMON_C_TEMP_RESET_HISTORY	BIT(hwmon_chip_temp_reset_history)
@@ -74,6 +75,7 @@ enum hwmon_chip_attributes {
 #define HWMON_C_IN_SAMPLES		BIT(hwmon_chip_in_samples)
 #define HWMON_C_POWER_SAMPLES		BIT(hwmon_chip_power_samples)
 #define HWMON_C_TEMP_SAMPLES		BIT(hwmon_chip_temp_samples)
+#define HWMON_C_BEEP_ENABLE		BIT(hwmon_chip_beep_enable)
 
 enum hwmon_temp_attributes {
 	hwmon_temp_enable,
@@ -103,6 +105,7 @@ enum hwmon_temp_attributes {
 	hwmon_temp_reset_history,
 	hwmon_temp_rated_min,
 	hwmon_temp_rated_max,
+	hwmon_temp_beep,
 };
 
 #define HWMON_T_ENABLE		BIT(hwmon_temp_enable)
@@ -132,6 +135,7 @@ enum hwmon_temp_attributes {
 #define HWMON_T_RESET_HISTORY	BIT(hwmon_temp_reset_history)
 #define HWMON_T_RATED_MIN	BIT(hwmon_temp_rated_min)
 #define HWMON_T_RATED_MAX	BIT(hwmon_temp_rated_max)
+#define HWMON_T_BEEP		BIT(hwmon_temp_beep)
 
 enum hwmon_in_attributes {
 	hwmon_in_enable,
@@ -152,6 +156,7 @@ enum hwmon_in_attributes {
 	hwmon_in_crit_alarm,
 	hwmon_in_rated_min,
 	hwmon_in_rated_max,
+	hwmon_in_beep,
 };
 
 #define HWMON_I_ENABLE		BIT(hwmon_in_enable)
@@ -172,6 +177,7 @@ enum hwmon_in_attributes {
 #define HWMON_I_CRIT_ALARM	BIT(hwmon_in_crit_alarm)
 #define HWMON_I_RATED_MIN	BIT(hwmon_in_rated_min)
 #define HWMON_I_RATED_MAX	BIT(hwmon_in_rated_max)
+#define HWMON_I_BEEP		BIT(hwmon_in_beep)
 
 enum hwmon_curr_attributes {
 	hwmon_curr_enable,
@@ -192,6 +198,7 @@ enum hwmon_curr_attributes {
 	hwmon_curr_crit_alarm,
 	hwmon_curr_rated_min,
 	hwmon_curr_rated_max,
+	hwmon_curr_beep,
 };
 
 #define HWMON_C_ENABLE		BIT(hwmon_curr_enable)
@@ -212,6 +219,7 @@ enum hwmon_curr_attributes {
 #define HWMON_C_CRIT_ALARM	BIT(hwmon_curr_crit_alarm)
 #define HWMON_C_RATED_MIN	BIT(hwmon_curr_rated_min)
 #define HWMON_C_RATED_MAX	BIT(hwmon_curr_rated_max)
+#define HWMON_C_BEEP		BIT(hwmon_curr_beep)
 
 enum hwmon_power_attributes {
 	hwmon_power_enable,
@@ -328,6 +336,7 @@ enum hwmon_fan_attributes {
 	hwmon_fan_min_alarm,
 	hwmon_fan_max_alarm,
 	hwmon_fan_fault,
+	hwmon_fan_beep,
 };
 
 #define HWMON_F_ENABLE			BIT(hwmon_fan_enable)
@@ -342,6 +351,7 @@ enum hwmon_fan_attributes {
 #define HWMON_F_MIN_ALARM		BIT(hwmon_fan_min_alarm)
 #define HWMON_F_MAX_ALARM		BIT(hwmon_fan_max_alarm)
 #define HWMON_F_FAULT			BIT(hwmon_fan_fault)
+#define HWMON_F_BEEP			BIT(hwmon_fan_beep)
 
 enum hwmon_pwm_attributes {
 	hwmon_pwm_input,
-- 
2.34.1


  parent reply	other threads:[~2023-05-04  8:14 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-04  7:57 [RFC 00/11] hwmon: Modernize documentation James Seo
2023-05-04  7:57 ` [RFC 01/11] Documentation/hwmon: Move misplaced entry in hwmon docs index James Seo
2023-05-05  4:58   ` Bagas Sanjaya
2023-05-06 13:43   ` Guenter Roeck
2023-05-04  7:57 ` [RFC 02/11] hwmon: (core) Rename last parameter of devm_hwmon_register_with_info() James Seo
2023-05-04 15:29   ` Guenter Roeck
2023-05-05 13:15     ` James Seo
2023-05-05 13:30       ` Guenter Roeck
2023-05-05 14:39         ` James Seo
2023-05-04  7:57 ` [RFC 03/11] hwmon: (core) Revise kerneldoc comments James Seo
2023-07-25 23:51   ` Russell Haley
2023-05-04  7:57 ` [RFC 04/11] Documentation/hwmon: Revise hwmon kernel API reference James Seo
2023-05-05  4:12   ` Bagas Sanjaya
2023-05-05  4:20   ` Bagas Sanjaya
2023-05-05 13:29     ` James Seo
2023-05-06 13:52   ` Guenter Roeck
2023-05-07 14:40     ` James Seo
2023-05-04  7:57 ` [RFC 05/11] Documentation/hwmon: Revise PMBus core documentation James Seo
2023-05-05  4:27   ` Bagas Sanjaya
2023-05-05  4:32     ` Guenter Roeck
2023-05-05 13:35     ` James Seo
2023-05-04  7:57 ` [RFC 06/11] Documentation/hwmon: Revise patch submission checklist James Seo
2023-05-05  4:34   ` Bagas Sanjaya
2023-05-05 14:50     ` James Seo
2023-05-04  7:57 ` [RFC 07/11] Documentation/hwmon: Revise sysfs interface specification James Seo
2023-05-05  4:51   ` Bagas Sanjaya
2023-05-05 15:01     ` James Seo
2023-05-05 15:10       ` Jonathan Corbet
2023-05-04  7:57 ` [RFC 08/11] Documentation/hwmon: Revise userspace tools documentation James Seo
2023-05-05  5:03   ` Bagas Sanjaya
2023-05-05 15:12     ` James Seo
2023-05-05 21:10       ` Guenter Roeck
2023-05-04  7:57 ` [RFC 09/11] ABI: sysfs-class-hwmon: Revise hwmon ABI documentation James Seo
2023-05-04  7:57 ` James Seo [this message]
2023-05-04  7:57 ` [RFC 11/11] ABI: sysfs-class-hwmon: Add missing hwmon standard attributes James Seo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230504075752.1320967-11-james@equiv.tech \
    --to=james@equiv.tech \
    --cc=corbet@lwn.net \
    --cc=jdelvare@suse.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox