On 8/13/24 17:40, Inochi Amaoto wrote:
On Tue, Aug 13, 2024 at 11:27:11AM GMT, Guenter Roeck wrote:
On Sat, Aug 10, 2024 at 04:03:51PM +0800, Inochi Amaoto wrote:
SG2042 use an external MCU to provide basic hardware information
and thermal sensors.
Add driver support for the onboard MCU of SG2042.
Signed-off-by: Inochi Amaoto <inochiama@xxxxxxxxxxx>
Tested-by: Chen Wang <unicorn_wang@xxxxxxxxxxx>
Reviewed-by: Chen Wang <unicorn_wang@xxxxxxxxxxx>
---
Documentation/hwmon/index.rst | 1 +
Documentation/hwmon/sg2042-mcu.rst | 77 ++++++
drivers/hwmon/Kconfig | 11 +
drivers/hwmon/Makefile | 1 +
drivers/hwmon/sg2042-mcu.c | 388 +++++++++++++++++++++++++++++
5 files changed, 478 insertions(+)
create mode 100644 Documentation/hwmon/sg2042-mcu.rst
create mode 100644 drivers/hwmon/sg2042-mcu.c
diff --git a/Documentation/hwmon/index.rst b/Documentation/hwmon/index.rst
index 913c11390a45..ea3b5be8fe4f 100644
--- a/Documentation/hwmon/index.rst
+++ b/Documentation/hwmon/index.rst
@@ -206,6 +206,7 @@ Hardware Monitoring Kernel Drivers
sch5636
scpi-hwmon
sfctemp
+ sg2042-mcu
sht15
sht21
sht3x
diff --git a/Documentation/hwmon/sg2042-mcu.rst b/Documentation/hwmon/sg2042-mcu.rst
new file mode 100644
index 000000000000..18a3578ac213
--- /dev/null
+++ b/Documentation/hwmon/sg2042-mcu.rst
@@ -0,0 +1,77 @@
+.. SPDX-License-Identifier: GPL-2.0
+
+Kernel driver sg2042-mcu
+========================
+
+Supported chips:
+
+ * Onboard MCU for sg2042
+
+ Addresses scanned: -
+
+ Prefix: 'sg2042-mcu'
+
+Authors:
+
+ - Inochi Amaoto <inochiama@xxxxxxxxxxx>
+
+Description
+-----------
+
+This driver supprts hardware monitoring for onboard MCU with
+i2c interface.
+
+Usage Notes
+-----------
+
+This driver does not auto-detect devices. You will have to instantiate
+the devices explicitly.
+Please see Documentation/i2c/instantiating-devices.rst for details.
+
+Sysfs Attributes
+----------------
+
+The following table shows the standard entries support by the driver:
+
+================= =====================================================
+Name Description
+================= =====================================================
+temp1_input Measured temperature of SoC
+temp1_crit Critical high temperature
+temp1_crit_hyst hysteresis temperature restore from Critical
+temp2_input Measured temperature of the base board
+================= =====================================================
+
+The following table shows the extra entries support by the platform:
+
Those are attached to the i2c device, which should be mentioned.
I have mentioned this in the Description. Does this need to be
mentioned here again?
Here is where it is needed.
Guenter