[PATCH v5] mfd: cgbc: Add a hwmon cell

Thomas Richard posted 1 patch 9 months ago
drivers/mfd/cgbc-core.c | 1 +
1 file changed, 1 insertion(+)
[PATCH v5] mfd: cgbc: Add a hwmon cell
Posted by Thomas Richard 9 months ago
The Board Controller has some internal sensors. Add a hwmon cell for the
cgbc-hwmon driver which adds support for temperature, voltage, current and
fan sensors.

Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
---
Hi Lee,

As Guenter applied the hwmon patch, I resubmit the MFD part with the
subject line and commit message fixed.

Regards,

Thomas
---
Changes in v5:
- hwmon: remove patch (already applied).
- mfd: fix subject line and commit message.
- Link to v4: https://lore.kernel.org/r/20250203-congatec-board-controller-hwmon-v4-0-ff6c76a4662c@bootlin.com

Changes in v4:
- Rebased on v6.14-rc1.
- Add the documentation for this driver.
- In Kconfig, fix a typo and improve the description
- Link to v3: https://lore.kernel.org/r/20241115-congatec-board-controller-hwmon-v3-0-1c45637c8266@bootlin.com

Changes in v3:
- remove the cgbc_hwmon_compute_curr_channel() macro.
- Link to v2: https://lore.kernel.org/r/20241108-congatec-board-controller-hwmon-v2-0-16e337398527@bootlin.com

Changes in v2:
- hwmon: use unsigned int type instead of u8 in struct cgbc_hwmon_sensor
  and struct cgbc_hwmon_data.
- hwmon: in cgbc_hwmon_probe_sensors() no need to request data for the
  first sensor as the Board Controller returns data of the first sensors
  with the number of sensors.
- hwmon: fix typos in comments and improve them.
- hwmon: remove dead code in cgbc_hwmon_read() and in
  cgbc_hwmon_read_string() (deadcode was the 'return -ENODEV').
- hwmon: remove useless platform_set_drvdata().
- hwmon: channel id always refers to the same sensor.
- hwmon: add a enum cgbc_sensor_types.
- Link to v1: https://lore.kernel.org/r/20241104-congatec-board-controller-hwmon-v1-0-871e4cd59d8e@bootlin.com
---
 drivers/mfd/cgbc-core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mfd/cgbc-core.c b/drivers/mfd/cgbc-core.c
index 85283c8dde253..0460e4e3f3c59 100644
--- a/drivers/mfd/cgbc-core.c
+++ b/drivers/mfd/cgbc-core.c
@@ -236,6 +236,7 @@ static struct mfd_cell cgbc_devs[] = {
 	{ .name = "cgbc-gpio"	},
 	{ .name = "cgbc-i2c", .id = 1 },
 	{ .name = "cgbc-i2c", .id = 2 },
+	{ .name = "cgbc-hwmon"	},
 };
 
 static int cgbc_map(struct cgbc_device_data *cgbc)

---
base-commit: 379487e17ca406b47392e7ab6cf35d1c3bacb371
change-id: 20240809-congatec-board-controller-hwmon-e9e63d957d33

Best regards,
-- 
Thomas Richard <thomas.richard@bootlin.com>
Re: [PATCH v5] mfd: cgbc: Add a hwmon cell
Posted by Lee Jones 9 months ago
On Mon, 17 Mar 2025, Thomas Richard wrote:

> The Board Controller has some internal sensors. Add a hwmon cell for the
> cgbc-hwmon driver which adds support for temperature, voltage, current and
> fan sensors.
> 
> Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
> ---
> Hi Lee,
> 
> As Guenter applied the hwmon patch, I resubmit the MFD part with the
> subject line and commit message fixed.

Sorry, just seen this.

I already applied it and fixed the commit message.

-- 
Lee Jones [李琼斯]