config.sonic: Build driver for sensor INA238#585
Conversation
|
|
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
paulmenzel
left a comment
There was a problem hiding this comment.
Please make the commit subject/title more specific. Maybe:
config.sonic: Build driver for sensor INA238
Then amend the commit message, and document on what system you need this, and paste the Linux log lines of the driver, that it is actually used and working.
Do the same for the merge/pull request description.
|
And of course welcome to SONiC, and thank you for your contribution. It’s much appreciated. |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Validation: - Platform: Micas M2-6951-64HC-CP - Kernel: 6.12.41+deb13-sonic-amd64 Driver probe log: root@sonic:/home/admin# dmesg | grep ina238 [ 23.824230] ina238 57-0040: power monitor ina238 (Rshunt = 10000 uOhm, gain = 4) [ 23.824238] i2c i2c-57: new_device: Instantiated device ina238 at 0x40 [ 23.837771] ina238 58-0041: power monitor ina238 (Rshunt = 10000 uOhm, gain = 4) [ 23.837779] i2c i2c-58: new_device: Instantiated device ina238 at 0x41 Hwmon interface: root@sonic:/sys/bus/i2c/devices/57-0040/hwmon/hwmon30# ls curr1_input in0_input in0_max_alarm in0_min_alarm in1_max in1_min name power1_input power1_max_alarm temp1_input temp1_max_alarm device in0_max in0_min in1_input in1_max_alarm in1_min_alarm power power1_max subsystem temp1_max uevent root@sonic:/sys/bus/i2c/devices/57-0040/hwmon/hwmon30# cat name ina238 root@sonic:/sys/bus/i2c/devices/57-0040/hwmon/hwmon30# cat in0_input 3 root@sonic:/sys/bus/i2c/devices/57-0040/hwmon/hwmon30# cat in1_input 54434 root@sonic:/sys/bus/i2c/devices/57-0040/hwmon/hwmon30# cat curr1_input 360 root@sonic:/sys/bus/i2c/devices/57-0040/hwmon/hwmon30# cat power1_input 19555200 root@sonic:/sys/bus/i2c/devices/57-0040/hwmon/hwmon30# cat temp1_input 37750 Signed-off-by: RayWang-micas <ray@micasnetworks.com>
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Thanks for the review and tips. |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
## Why I did it
The target platform uses INA238 power monitoring devices. The current kernel configuration does not build the INA238 driver, which prevents the sensors from being exposed through the Linux hwmon framework.
This change enables CONFIG_SENSORS_INA238 in SONiC.
## How I verified it
Platform: Micas M2-6951-64HC-CP
Kernel log:
dmesg | grep ina238
[ 23.824230] ina238 57-0040: power monitor ina238 (Rshunt = 10000 uOhm, gain = 4)
[ 23.824238] i2c i2c-57: new_device: Instantiated device ina238 at 0x40
[ 23.837771] ina238 58-0041: power monitor ina238 (Rshunt = 10000 uOhm, gain = 4)
[ 23.837779] i2c i2c-58: new_device: Instantiated device ina238 at 0x41
Hwmon interface created successfully:
/sys/bus/i2c/devices/57-0040/hwmon/hwmon30/
Example readings:
root@sonic:/sys/bus/i2c/devices/57-0040/hwmon/hwmon30# cat name
ina238
root@sonic:/sys/bus/i2c/devices/57-0040/hwmon/hwmon30# cat in0_input
3
root@sonic:/sys/bus/i2c/devices/57-0040/hwmon/hwmon30# cat in1_input
54434
root@sonic:/sys/bus/i2c/devices/57-0040/hwmon/hwmon30# cat curr1_input
360
root@sonic:/sys/bus/i2c/devices/57-0040/hwmon/hwmon30# cat power1_input
19555200
root@sonic:/sys/bus/i2c/devices/57-0040/hwmon/hwmon30# cat temp1_input
37750