recipes-kernel: Add PWM Rate-of-Change configuration
During driver initialization of fan dynamics registers, add support to parse the max31790 node from the DTS to enable configuration of the PWM rate-of-change, ensuring proper subsequent fan control.
ref: https://drive.google.com/file/d/1yzVPOfZpmT3GCaGoqnT6Vtim71u6h8l9/view?usp=drive_link
Tested:
```
root@zoro:~# i2ctransfer -f 52 w1@0x2c 0x08 r1
0x40
root@zoro:~# i2ctransfer -f 52 w1@0x2c 0x0d r1
0x40
root@zoro:~# i2ctransfer -f 53 w1@0x2c 0x08 r1
0x40
root@zoro:~# i2ctransfer -f 53 w1@0x2c 0x0d r1
0x40
```
Google-Bug-Id: 435051059
Change-Id: Iced9a43986019c8e73fb7dbbdf3489f16afa50a1
Signed-off-by: Shao-Chieh <jieh.sc.chao@fii-na.corp-partner.google.com>
diff --git a/recipes-kernel/linux/files/0030-Add-PWM-Rate-of-Change-configuration.patch b/recipes-kernel/linux/files/0030-Add-PWM-Rate-of-Change-configuration.patch
new file mode 100644
index 0000000..10d021c
--- /dev/null
+++ b/recipes-kernel/linux/files/0030-Add-PWM-Rate-of-Change-configuration.patch
@@ -0,0 +1,64 @@
+From 6b627b0ff2a29aa6f9172d906899e691ba99e733 Mon Sep 17 00:00:00 2001
+From: Shao-Chieh <jieh.sc.chao@fii-na.corp-partner.google.com>
+Date: Mon, 4 Aug 2025 09:42:11 +0800
+Subject: [PATCH] Add PWM Rate-of-Change configuration
+
+---
+ drivers/hwmon/max31790.c | 22 +++++++++++++++++++++-
+ 1 file changed, 21 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/hwmon/max31790.c b/drivers/hwmon/max31790.c
+index 0cd44c1e9..890d1f614 100644
+--- a/drivers/hwmon/max31790.c
++++ b/drivers/hwmon/max31790.c
+@@ -483,7 +483,9 @@ static const struct hwmon_chip_info max31790_chip_info = {
+ static int max31790_init_client(struct i2c_client *client,
+ struct max31790_data *data)
+ {
+- int i, rv;
++ int i, rv, err;
++ struct device *dev = &client->dev;
++ u32 val;
+
+ for (i = 0; i < NR_CHANNEL; i++) {
+ rv = i2c_smbus_read_byte_data(client,
+@@ -492,6 +494,17 @@ static int max31790_init_client(struct i2c_client *client,
+ return rv;
+ data->fan_config[i] = rv;
+
++ if (device_property_read_u32(dev, "pwm-rate-of-change", &val) == 0) {
++ rv = i2c_smbus_read_byte_data(client, MAX31790_REG_FAN_DYNAMICS(i));
++ if (rv < 0)
++ return rv;
++ rv &= ~0x1C;
++ rv |= (val & 0x7) << 2;
++ err = i2c_smbus_write_byte_data(client, MAX31790_REG_FAN_DYNAMICS(i), rv);
++ if (err < 0)
++ return err;
++ }
++
+ rv = i2c_smbus_read_byte_data(client,
+ MAX31790_REG_FAN_DYNAMICS(i));
+ if (rv < 0)
+@@ -542,11 +555,18 @@ static const struct i2c_device_id max31790_id[] = {
+ };
+ MODULE_DEVICE_TABLE(i2c, max31790_id);
+
++static const struct of_device_id max31790_of_match[] = {
++ { .compatible = "maxim,max31790" },
++ { }
++};
++MODULE_DEVICE_TABLE(of, max31790_of_match);
++
+ static struct i2c_driver max31790_driver = {
+ .class = I2C_CLASS_HWMON,
+ .probe = max31790_probe,
+ .driver = {
+ .name = "max31790",
++ .of_match_table = max31790_of_match,
+ },
+ .id_table = max31790_id,
+ };
+--
+2.34.1
+
diff --git a/recipes-kernel/linux/linux-gbmc_aspeedg7.bb b/recipes-kernel/linux/linux-gbmc_aspeedg7.bb
index 8cd60a1..09e39aa 100644
--- a/recipes-kernel/linux/linux-gbmc_aspeedg7.bb
+++ b/recipes-kernel/linux/linux-gbmc_aspeedg7.bb
@@ -61,6 +61,7 @@
file://0027-Add-DRAM-EDAC-driver-for-ast2700.patch \
file://0028-mctp-i3c-MCTP-I3C-driver.patch \
file://0029-soc-aspeed-ast2700-epsi-Fix-eDAF-memory-mapping-in-H.patch \
+ file://0030-Add-PWM-Rate-of-Change-configuration.patch \
"
SRC_URI:append:aspeed-g7 = " \