From nobody Sun Nov 24 15:42:01 2024 Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 99DEA13D246; Mon, 4 Nov 2024 15:48:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730735310; cv=none; b=FaAW4j37beF8D7taHoudLTDUXj+cd3m0J2FgpSpC/GqqRuLqe7LmvG3bZVf4WkaGPO4jCRVIpl1DgTfTGLNxuM38RGzTpGP2Jyq28kgF5Oj9JR8hGY2H0kFJ+ALDU/B3DPyd4hBnMTGDfwFvwQgWuq6/togyX1ETkX5oxI9fYbM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730735310; c=relaxed/simple; bh=gFerD5ldOKvsFK+mw5dFheZKzWQUE9Sh2wiPh0XTxSM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Eg8Ym+7V3OKyudsqWmuuLbByeY8rWVg0rqKSxLFRcaRarGXseLYYkDV5hw0YrQrZnBN70wm38QLBEHKk906/Xmal1qhC+MW/b1c5rL+2QmIReR9aYW5VAQ3Nfl1I/LGIBgy7F7673MW7s9cFgFIqOAL03nXDmr03+CbC/inuqsA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=Ve7f9sY8; arc=none smtp.client-ip=217.70.183.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="Ve7f9sY8" Received: by mail.gandi.net (Postfix) with ESMTPSA id BEE206000A; Mon, 4 Nov 2024 15:48:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1730735300; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0sKR0gYnXlZ93kQz9P5jrXOjDSLStg/V94QAs8PFErM=; b=Ve7f9sY8n1/xQXgaGrrdcZtpWhmcXbTcLXJwmF/oxBnEcx5cbNxTHcrXwXuEA4TVoJYDR+ i5RMuDrmONCwYSjVCB729RMIBLI983wBmhYOPT7GlriZV7PVdPMw9rs1GxudihJgk/GqJq dqw42t6A6fC5NFIerteKKkTaEK/z1f2m4JS/8JbzwiJPKRHw23m8I9MAOP73YQ4kR7zHK8 X1FoYbhCLLzNXFSMtbcXBgm4tEkjjMZVUOpWbDEHQ3vFKaA1HPkzho3S0aD9JcpQmNZjl3 htSLCgdoqiPEnnbvGWGRYF3m9Udpn5oiF3sFibr71bjGlyzw6rzyl4HLRSjXTA== From: Thomas Richard Date: Mon, 04 Nov 2024 16:48:07 +0100 Subject: [PATCH 1/2] hwmon: Add Congatec Board Controller monitoring driver Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241104-congatec-board-controller-hwmon-v1-1-871e4cd59d8e@bootlin.com> References: <20241104-congatec-board-controller-hwmon-v1-0-871e4cd59d8e@bootlin.com> In-Reply-To: <20241104-congatec-board-controller-hwmon-v1-0-871e4cd59d8e@bootlin.com> To: Jean Delvare , Guenter Roeck , Lee Jones Cc: linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, thomas.petazzoni@bootlin.com, blake.vermeer@keysight.com, Thomas Richard X-Mailer: b4 0.14.1 X-GND-Sasl: thomas.richard@bootlin.com Add support for the Congatec Board Controller. This controller exposes temperature, voltage, current and fan sensors. The available sensors list cannot be predicted. Some sensors can be present or not, depending the system. The driver has an internal list of all possible sensors, for all Congatec boards. The Board Controller gives to the driver its sensors list, and their status (active or not). Signed-off-by: Thomas Richard --- MAINTAINERS | 1 + drivers/hwmon/Kconfig | 9 ++ drivers/hwmon/Makefile | 1 + drivers/hwmon/cgbc-hwmon.c | 287 +++++++++++++++++++++++++++++++++++++++++= ++++ 4 files changed, 298 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 3507df3381b1..5e96646593b1 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -5784,6 +5784,7 @@ CONGATEC BOARD CONTROLLER MFD DRIVER M: Thomas Richard S: Maintained F: drivers/gpio/gpio-cgbc.c +F: drivers/hwmon/cgbc-hwmon.c F: drivers/i2c/busses/i2c-cgbc.c F: drivers/mfd/cgbc-core.c F: drivers/watchdog/cgbc_wdt.c diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig index cfb4e9314c62..c7b6e93aeb9b 100644 --- a/drivers/hwmon/Kconfig +++ b/drivers/hwmon/Kconfig @@ -463,6 +463,15 @@ config SENSORS_BT1_PVT_ALARMS the data conversion will be periodically performed and the data will be saved in the internal driver cache. =20 +config SENSORS_CGBC + tristate "Congatec Board Controller Sensors" + depends on MFD_CGBC + help + Enables sensors support for the Congatec Board Controller. + + This driver can also be built as a module. If so, the module will be + called cgbc-hwmon. + config SENSORS_CHIPCAP2 tristate "Amphenol ChipCap 2 relative humidity and temperature sensor" depends on I2C diff --git a/drivers/hwmon/Makefile b/drivers/hwmon/Makefile index b827b92f2a78..318da6d8f752 100644 --- a/drivers/hwmon/Makefile +++ b/drivers/hwmon/Makefile @@ -59,6 +59,7 @@ obj-$(CONFIG_SENSORS_ASUS_ROG_RYUJIN) +=3D asus_rog_ryuji= n.o obj-$(CONFIG_SENSORS_ATXP1) +=3D atxp1.o obj-$(CONFIG_SENSORS_AXI_FAN_CONTROL) +=3D axi-fan-control.o obj-$(CONFIG_SENSORS_BT1_PVT) +=3D bt1-pvt.o +obj-$(CONFIG_SENSORS_CGBC) +=3D cgbc-hwmon.o obj-$(CONFIG_SENSORS_CHIPCAP2) +=3D chipcap2.o obj-$(CONFIG_SENSORS_CORETEMP) +=3D coretemp.o obj-$(CONFIG_SENSORS_CORSAIR_CPRO) +=3D corsair-cpro.o diff --git a/drivers/hwmon/cgbc-hwmon.c b/drivers/hwmon/cgbc-hwmon.c new file mode 100644 index 000000000000..3234c7590acb --- /dev/null +++ b/drivers/hwmon/cgbc-hwmon.c @@ -0,0 +1,287 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * cgbc-hwmon - Congatec Board Controller hardware monitoring driver + * + * Copyright (C) 2024 Thomas Richard + */ + +#include +#include +#include +#include +#include +#include + +#define CGBC_HWMON_TYPE_TEMP 1 +#define CGBC_HWMON_TYPE_IN 2 +#define CGBC_HWMON_TYPE_FAN 3 + +#define CGBC_HWMON_CMD_SENSOR 0x77 +#define CGBC_HWMON_CMD_SENSOR_DATA_SIZE 0x05 + +#define CGBC_HWMON_TYPE_MASK GENMASK(6, 5) +#define CGBC_HWMON_ID_MASK GENMASK(4, 0) +#define CGBC_HWMON_ACTIVE_BIT BIT(7) +#define CGBC_HWMON_DATA_HIGH GENMASK(15, 8) +#define CGBC_HWMON_DATA_LOW GENMASK(7, 0) + +struct cgbc_hwmon_sensor { + enum hwmon_sensor_types type; + bool active; + u8 index; + const char *label; +}; + +struct cgbc_hwmon_data { + struct cgbc_device_data *cgbc; + u8 nb_sensors; + struct cgbc_hwmon_sensor *sensors; +}; + +static const char * const cgbc_hwmon_labels_temp[] =3D { + "CPU Temperature", + "Box Temperature", + "Ambient Temperature", + "Board Temperature", + "Carrier Temperature", + "Chipset Temperature", + "Video Temperature", + "Other Temperature", + "TOPDIM Temperature", + "BOTTOMDIM Temperature", +}; + +static const struct { + enum hwmon_sensor_types type; + const char *label; +} cgbc_hwmon_labels_in[] =3D { + { hwmon_in, "CPU Voltage" }, + { hwmon_in, "DC Runtime Voltage" }, + { hwmon_in, "DC Standby Voltage" }, + { hwmon_in, "CMOS Battery Voltage" }, + { hwmon_in, "Battery Voltage" }, + { hwmon_in, "AC Voltage" }, + { hwmon_in, "Other Voltage" }, + { hwmon_in, "5V Voltage" }, + { hwmon_in, "5V Standby Voltage" }, + { hwmon_in, "3V3 Voltage" }, + { hwmon_in, "3V3 Standby Voltage" }, + { hwmon_in, "VCore A Voltage" }, + { hwmon_in, "VCore B Voltage" }, + { hwmon_in, "12V Voltage" }, + { hwmon_curr, "DC Current" }, + { hwmon_curr, "5V Current" }, + { hwmon_curr, "12V Current" }, +}; + +static const char * const cgbc_hwmon_labels_fan[] =3D { + "CPU Fan", + "Box Fan", + "Ambient Fan", + "Chipset Fan", + "Video Fan", + "Other Fan", +}; + +static int cgbc_hwmon_cmd(struct cgbc_device_data *cgbc, u8 id, u8 *data) +{ + u8 cmd[2] =3D {CGBC_HWMON_CMD_SENSOR, id}; + + return cgbc_command(cgbc, cmd, sizeof(cmd), data, CGBC_HWMON_CMD_SENSOR_D= ATA_SIZE, NULL); +} + +static int cgbc_hwmon_probe_sensors(struct device *dev, struct cgbc_hwmon_= data *hwmon) +{ + struct cgbc_device_data *cgbc =3D hwmon->cgbc; + struct cgbc_hwmon_sensor *sensor =3D hwmon->sensors; + u8 data[CGBC_HWMON_CMD_SENSOR_DATA_SIZE], nb_sensors, i; + int ret; + + ret =3D cgbc_hwmon_cmd(cgbc, 0, &data[0]); + if (ret) + return ret; + + nb_sensors =3D data[0]; + + hwmon->sensors =3D devm_kzalloc(dev, sizeof(*hwmon->sensors) * nb_sensors= , GFP_KERNEL); + sensor =3D hwmon->sensors; + + for (i =3D 0; i < nb_sensors; i++) { + u8 type, id; + + ret =3D cgbc_hwmon_cmd(cgbc, i, &data[0]); + if (ret) + return ret; + + type =3D FIELD_GET(CGBC_HWMON_TYPE_MASK, data[1]); + id =3D FIELD_GET(CGBC_HWMON_ID_MASK, data[1]) - 1; + + if (type =3D=3D CGBC_HWMON_TYPE_TEMP && id < ARRAY_SIZE(cgbc_hwmon_label= s_temp)) { + sensor->type =3D hwmon_temp; + sensor->label =3D cgbc_hwmon_labels_temp[id]; + } else if (type =3D=3D CGBC_HWMON_TYPE_IN && id < ARRAY_SIZE(cgbc_hwmon_= labels_in)) { + /* + * The Board Controller doesn't do differences between current and volt= age + * sensors + */ + sensor->type =3D cgbc_hwmon_labels_in[id].type; + sensor->label =3D cgbc_hwmon_labels_in[id].label; + } else if (type =3D=3D CGBC_HWMON_TYPE_FAN && id < ARRAY_SIZE(cgbc_hwmon= _labels_fan)) { + sensor->type =3D hwmon_fan; + sensor->label =3D cgbc_hwmon_labels_fan[id]; + } else { + dev_warn(dev, "Board Controller returned an unknown sensor (type=3D%d, = id=3D%d), ignore it", + type, id); + continue; + } + + sensor->active =3D FIELD_GET(CGBC_HWMON_ACTIVE_BIT, data[1]); + sensor->index =3D i; + sensor++; + hwmon->nb_sensors++; + } + + return 0; +} + +static struct cgbc_hwmon_sensor *cgbc_hwmon_find_sensor(struct cgbc_hwmon_= data *hwmon, + enum hwmon_sensor_types type, int channel) +{ + struct cgbc_hwmon_sensor *sensor =3D NULL; + int i, cnt =3D 0; + + for (i =3D 0; i < hwmon->nb_sensors; i++) { + if (hwmon->sensors[i].type =3D=3D type && cnt++ =3D=3D channel) { + sensor =3D &hwmon->sensors[i]; + break; + } + } + + return sensor; +} + +static int cgbc_hwmon_read(struct device *dev, enum hwmon_sensor_types typ= e, u32 attr, int channel, + long *val) +{ + struct cgbc_hwmon_data *hwmon =3D dev_get_drvdata(dev); + struct cgbc_hwmon_sensor *sensor =3D cgbc_hwmon_find_sensor(hwmon, type, = channel); + struct cgbc_device_data *cgbc =3D hwmon->cgbc; + u8 data[CGBC_HWMON_CMD_SENSOR_DATA_SIZE]; + int ret; + + if (!sensor) + return -ENODEV; + + ret =3D cgbc_hwmon_cmd(cgbc, sensor->index, &data[0]); + if (ret) + return ret; + + *val =3D FIELD_PREP(CGBC_HWMON_DATA_HIGH, data[3]) | FIELD_PREP(CGBC_HWMO= N_DATA_LOW, data[2]); + + /* For the Board Controller 1lsb =3D 0.1 degree centigrade */ + if (sensor->type =3D=3D hwmon_temp) + *val *=3D 100; + + return 0; +} + +static umode_t cgbc_hwmon_is_visible(const void *_data, enum hwmon_sensor_= types type, u32 attr, + int channel) +{ + struct cgbc_hwmon_data *data =3D (struct cgbc_hwmon_data *)_data; + struct cgbc_hwmon_sensor *sensor; + + sensor =3D cgbc_hwmon_find_sensor(data, type, channel); + if (!sensor) + return 0; + + return sensor->active ? 0444 : 0; +} + +static int cgbc_hwmon_read_string(struct device *dev, enum hwmon_sensor_ty= pes type, u32 attr, + int channel, const char **str) +{ + struct cgbc_hwmon_data *hwmon =3D dev_get_drvdata(dev); + struct cgbc_hwmon_sensor *sensor =3D cgbc_hwmon_find_sensor(hwmon, type, = channel); + + if (!sensor) + return -ENODEV; + + *str =3D sensor->label; + + return 0; +} + +static const struct hwmon_channel_info * const cgbc_hwmon_info[] =3D { + HWMON_CHANNEL_INFO(temp, + HWMON_T_INPUT | HWMON_T_LABEL, HWMON_T_INPUT | HWMON_T_LABEL, + HWMON_T_INPUT | HWMON_T_LABEL, HWMON_T_INPUT | HWMON_T_LABEL, + HWMON_T_INPUT | HWMON_T_LABEL, HWMON_T_INPUT | HWMON_T_LABEL, + HWMON_T_INPUT | HWMON_T_LABEL, HWMON_T_INPUT | HWMON_T_LABEL, + HWMON_T_INPUT | HWMON_T_LABEL, HWMON_T_INPUT | HWMON_T_LABEL), + HWMON_CHANNEL_INFO(in, + HWMON_I_INPUT | HWMON_I_LABEL, HWMON_I_INPUT | HWMON_I_LABEL, + HWMON_I_INPUT | HWMON_I_LABEL, HWMON_I_INPUT | HWMON_I_LABEL, + HWMON_I_INPUT | HWMON_I_LABEL, HWMON_I_INPUT | HWMON_I_LABEL, + HWMON_I_INPUT | HWMON_I_LABEL, HWMON_I_INPUT | HWMON_I_LABEL, + HWMON_I_INPUT | HWMON_I_LABEL, HWMON_I_INPUT | HWMON_I_LABEL, + HWMON_I_INPUT | HWMON_I_LABEL, HWMON_I_INPUT | HWMON_I_LABEL, + HWMON_I_INPUT | HWMON_I_LABEL, HWMON_I_INPUT | HWMON_I_LABEL), + HWMON_CHANNEL_INFO(curr, + HWMON_C_INPUT | HWMON_C_LABEL, HWMON_C_INPUT | HWMON_C_LABEL, + HWMON_C_INPUT | HWMON_C_LABEL), + HWMON_CHANNEL_INFO(fan, + HWMON_F_INPUT | HWMON_F_LABEL, HWMON_F_INPUT | HWMON_F_LABEL, + HWMON_F_INPUT | HWMON_F_LABEL, HWMON_F_INPUT | HWMON_F_LABEL, + HWMON_F_INPUT | HWMON_F_LABEL, HWMON_F_INPUT | HWMON_F_LABEL), + NULL +}; + +static const struct hwmon_ops cgbc_hwmon_ops =3D { + .is_visible =3D cgbc_hwmon_is_visible, + .read =3D cgbc_hwmon_read, + .read_string =3D cgbc_hwmon_read_string, +}; + +static const struct hwmon_chip_info cgbc_chip_info =3D { + .ops =3D &cgbc_hwmon_ops, + .info =3D cgbc_hwmon_info, +}; + +static int cgbc_hwmon_probe(struct platform_device *pdev) +{ + struct cgbc_device_data *cgbc =3D dev_get_drvdata(pdev->dev.parent); + struct device *dev =3D &pdev->dev; + struct cgbc_hwmon_data *data; + struct device *hwmon_dev; + int ret; + + data =3D devm_kzalloc(dev, sizeof(*data), GFP_KERNEL); + if (!data) + return -ENOMEM; + + data->cgbc =3D cgbc; + + platform_set_drvdata(pdev, data); + + ret =3D cgbc_hwmon_probe_sensors(dev, data); + if (ret) + return dev_err_probe(dev, ret, "failed to probe sensors"); + + hwmon_dev =3D devm_hwmon_device_register_with_info(dev, "cgbc_hwmon", dat= a, &cgbc_chip_info, + NULL); + return PTR_ERR_OR_ZERO(hwmon_dev); +} + +static struct platform_driver cgbc_hwmon_driver =3D { + .driver =3D { + .name =3D "cgbc-hwmon", + }, + .probe =3D cgbc_hwmon_probe, +}; + +module_platform_driver(cgbc_hwmon_driver); + +MODULE_AUTHOR("Thomas Richard "); +MODULE_DESCRIPTION("Congatec Board Controller Hardware Monitoring Driver"); +MODULE_LICENSE("GPL"); --=20 2.39.5 From nobody Sun Nov 24 15:42:01 2024 Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 99D9C70816; Mon, 4 Nov 2024 15:48:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730735309; cv=none; b=ucjX/36LvDUUwU7bGM7ZfXVtCREYsPNBDOfUzmn2LRD+cteOYCk9e8Zy+b0IuvmoFiWcFnStsZ1mAXFhJ2ZUC8sXDiqA3juSJfY+IR8FCCNaN5uFCIFgAZgExZigg7j22T4xislsr9kAmQtaM17AQtcbISpC4Nlvkr9O2EEp8XQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730735309; c=relaxed/simple; bh=bggjSsff92I5nfqkHZKLXAtnYfyMCNcWpoDAFa1s/UY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=vEJ9YdXp1mOaxNGJ7pyC0PlGvNJSJag5RZABomuq1KfH4SUpa6g4HJD3TyllF7njFw7vxejJz4R9lI0PQcM7pqJ7/cjaRGPEOJSWeCEYtDVS2dDaKMh+HgrlV376bVYR8civyCZNRuRFRaL8thMnsRYVfYTE0SGWMENA0oaNUoI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=lsLqCTsY; arc=none smtp.client-ip=217.70.183.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="lsLqCTsY" Received: by mail.gandi.net (Postfix) with ESMTPSA id 3FC3C6000C; Mon, 4 Nov 2024 15:48:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1730735300; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PWKzQLDi1P0e2NgDvgc4yHfOyzr35Ho5+wgbJLaL+w0=; b=lsLqCTsYOXiqpGyaY0s8b0IrYsMHGrgefc5xY3Zp8Gu+0j6Vqa5EQxYSTBUZN3Y7Ruw58a ZfCqd3fqTkEsv6EJf0kH0F7MGpzbm6cybdT4hmMr5X44csOQYGKg0mig1G8C3A1BtBS3fr jyXAYkrY6ONkKfi/r7EVXVxIc+G2+DNHI6q1fBP/cpNUBehwiy0E7GCfsqm2a52COAM7lH l7J5DbKpS/P3d/38dnGUgai2Mw+Fm6yphsxQsBxf0JlNPON3NiFDbrErsPAxvGDAXrRZvd bCmxWJUUfNycGGq9MSws1egP0OUB9CtbFnYKFrlAd1+IPULLjDENoZeuvKRcaQ== From: Thomas Richard Date: Mon, 04 Nov 2024 16:48:08 +0100 Subject: [PATCH 2/2] mfd: cgbc: add a hwmon cell Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241104-congatec-board-controller-hwmon-v1-2-871e4cd59d8e@bootlin.com> References: <20241104-congatec-board-controller-hwmon-v1-0-871e4cd59d8e@bootlin.com> In-Reply-To: <20241104-congatec-board-controller-hwmon-v1-0-871e4cd59d8e@bootlin.com> To: Jean Delvare , Guenter Roeck , Lee Jones Cc: linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, thomas.petazzoni@bootlin.com, blake.vermeer@keysight.com, Thomas Richard X-Mailer: b4 0.14.1 X-GND-Sasl: thomas.richard@bootlin.com 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 --- 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 93004a6b29c1..7cc2872235ac 100644 --- a/drivers/mfd/cgbc-core.c +++ b/drivers/mfd/cgbc-core.c @@ -236,6 +236,7 @@ static struct mfd_cell cgbc_devs[] =3D { { .name =3D "cgbc-gpio" }, { .name =3D "cgbc-i2c", .id =3D 1 }, { .name =3D "cgbc-i2c", .id =3D 2 }, + { .name =3D "cgbc-hwmon" }, }; =20 static int cgbc_map(struct cgbc_device_data *cgbc) --=20 2.39.5