arm: configs: aspeed: Enable IR35221 driver config
Subsystems (4)
PATCH 1/1 arm: configs: aspeed: Enable IR35221 driver config
Enable config options for the IR35221 driver.
--- arch/arm/configs/aspeed_g5_defconfig | 1 + 1 file changed, 1 insertion(+)
arch/arm/configs/aspeed_g5_defconfig +1 -0
@@ -141,6 +141,7 @@ CONFIG_SENSORS_ADM1275=y CONFIG_SENSORS_LM25066=y CONFIG_SENSORS_UCD9000=y CONFIG_SENSORS_TMP421=y +CONFIG_SENSORS_IR35221=y CONFIG_USB=y CONFIG_USB_ANNOUNCE_NEW_DEVICES=y CONFIG_USB_DYNAMIC_MINORS=y
Signature · 1 line
1.8.2.2
PATCH v2 1/1 arm: dts: aspeed: Add IR35221 instances to dev tree
Add IR35221 to i2c4 and i2c5 buses.
---
V2 - Convert I2C bus addresses to 7 bit right aligned.
- Add IR35221 to device tree documentation.
--- .../devicetree/bindings/i2c/trivial-devices.txt | 1 + arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+)
Documentation/devicetree/bindings/i2c/trivial-devices.txt +1 -0
@@ -53,6 +53,7 @@ fsl,sgtl5000 SGTL5000: Ultra Low-Power Audio Codec gmt,g751 G751: Digital Temperature Sensor and Thermal Watchdog with Two-Wire Interface infineon,slb9635tt Infineon SLB9635 (Soft-) I2C TPM (old protocol, max 100khz) infineon,slb9645tt Infineon SLB9645 I2C TPM (new protocol, max 400khz) +infineon,ir35221 Infineon IR35221 Digital DC-DC Multiphase Converter isil,isl29028 Intersil ISL29028 Ambient Light and Proximity Sensor maxim,ds1050 5 Bit Programmable, Pulse-Width Modulator maxim,max1237 Low-Power, 4-/12-Channel, 2-Wire Serial, 12-Bit ADCs
arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts +20 -0
@@ -394,6 +394,16 @@ compatible = "ti,tmp423"; reg = <0x4c>; }; + + ir35221@70 { + compatible = "infineon,ir35221"; + reg = <0x70>; + }; + + ir35221@71 { + compatible = "infineon,ir35221"; + reg = <0x71>; + }; };
@@ -408,6 +418,16 @@ compatible = "ti,tmp423"; reg = <0x4c>; }; + + ir35221@70 { + compatible = "infineon,ir35221"; + reg = <0x70>; + }; + + ir35221@71 { + compatible = "infineon,ir35221"; + reg = <0x71>; + }; }; &i2c6 {
Signature · 1 line
1.8.2.2
Joel Stanley
maintainerRe: [PATCH linux dev-4.10 v2] arm: dts: aspeed: Add IR35221 instances to dev tree
Quoted 1 line · Christopher Bostic
Add IR35221 to i2c4 and i2c5 buses.
This is similar to the patch that I sent on the 2nd.
I took your patch as it adds the device at 0x71 which I did not know about.
Cheers,
Joel
Quoted 63 lines
Signed-off-by Christopher Bostic <[email protected]>---
V2 - Convert I2C bus addresses to 7 bit right aligned.
- Add IR35221 to device tree documentation.--- .../devicetree/bindings/i2c/trivial-devices.txt | 1 + arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+)Documentation/devicetree/bindings/i2c/trivial-devices.txt +1
-0@@ -53,6 +53,7 @@ fsl,sgtl5000 SGTL5000: Ultra Low-Power Audio Codec gmt,g751 G751: Digital Temperature Sensor and Thermal Watchdog with Two-Wire Interface infineon,slb9635tt Infineon SLB9635 (Soft-) I2C TPM (old protocol, max 100khz) infineon,slb9645tt Infineon SLB9645 I2C TPM (new protocol, max 400khz) +infineon,ir35221 Infineon IR35221 Digital DC-DC Multiphase Converter isil,isl29028 Intersil ISL29028 Ambient Light and Proximity Sensor maxim,ds1050 5 Bit Programmable, Pulse-Width Modulator maxim,max1237 Low-Power, 4-/12-Channel, 2-Wire Serial, 12-Bit ADCsarch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts +20
-1@@ -394,6 +394,16 @@ compatible = "ti,tmp423"; reg = <0x4c>; }; + + ir35221@70 { + compatible = "infineon,ir35221"; + reg = <0x70>; + }; + + ir35221@71 { + compatible = "infineon,ir35221"; + reg = <0x71>; + }; };@@ -408,6 +418,16 @@ compatible = "ti,tmp423"; reg = <0x4c>; }; + + ir35221@70 { + compatible = "infineon,ir35221"; + reg = <0x70>; + }; + + ir35221@71 { + compatible = "infineon,ir35221"; + reg = <0x71>; + }; }; &i2c6 { --1.8.2.2
Joel Stanley
maintainerRe: [PATCH linux dev-4.10 v2] arm: dts: aspeed: Add IR35221 instances to dev tree
Quoted 8 lines · Joel Stanley
Quoted 1 line · Christopher Bostic
Add IR35221 to i2c4 and i2c5 buses.
This is similar to the patch that I sent on the 2nd.
I took your patch as it adds the device at
0x71which I did not know about.
This breaks userspace, as userspace assumes it can access the i2c devices through /dev/i2c-x.
Do you have a ticket opened for fixing userspace?
Cheers,
Joel
Re: [PATCH linux dev-4.10 v2] arm: dts: aspeed: Add IR35221 instances to dev tree
Quoted 8 lines · Joel Stanley
Quoted 4 lines · Joel Stanley
Quoted 1 line · Christopher Bostic
Add IR35221 to i2c4 and i2c5 buses.
Quoted 8 lines
Quoted 4 lines
This is similar to the patch that I sent on the 2nd.
I took your patch as it adds the device at
0x71which I did not know about.This breaks userspace, as userspace assumes it can access the i2c devices through
/dev/i2c-x.
Joel, or anyone able to answer…
Do you know which application? I wasn’t aware of any applications using i2c-dev...
Can we simply remove i2c-dev from the config?
thx - brad
Quoted 5 lines
Do you have a ticket opened for fixing userspace?
Cheers,
Joel
Joel Stanley
maintainerRe: [PATCH linux dev-4.10 v2] arm: dts: aspeed: Add IR35221 instances to dev tree
Quoted 13 lines · Brad Bishop
Quoted 13 lines · Joel Stanley
Quoted 8 lines · Joel Stanley
Quoted 1 line · Christopher Bostic
Add IR35221 to i2c4 and i2c5 buses.
This is similar to the patch that I sent on the 2nd.
I took your patch as it adds the device at
0x71which I did not know about.
Quoted 7 lines
Quoted 3 lines
This breaks userspace, as userspace assumes it can access the i2c devices through
/dev/i2c-x.Joel, or anyone able to answer…
Do you know which application? I wasn’t aware of any applications using i2c-dev...
The one I noticed was vrm-control.sh.
Quoted 1 line
Can we simply remove i2c-dev from the config?
We could, but that would break other bits of the p9 userspace.
Taking a look a the root filesystem, we have the following applications that use the /dev/i2c interfaces:
$ grep -rl i2cset * usr/sbin/i2cset usr/bin/avsbus-disable.sh usr/bin/avsbus-workaround.sh usr/bin/avsbus-enable.sh usr/bin/vrm-control.sh usr/bin/vcs_on.sh usr/bin/ucd_disable_vcs.sh usr/bin/vcs_off.sh
grep -rl i2cget *usr/sbin/i2cgetusr/bin/vrm-control.sh
Cheers,
Joel
Re: [PATCH linux dev-4.10 v2] arm: dts: aspeed: Add IR35221 instances to dev tree
Quoted 35 lines · Joel Stanley
Quoted 13 lines · Brad Bishop
Quoted 13 lines · Joel Stanley
Quoted 8 lines · Joel Stanley
Quoted 1 line · Christopher Bostic
Add IR35221 to i2c4 and i2c5 buses.
This is similar to the patch that I sent on the 2nd.
I took your patch as it adds the device at
0x71which I did not know about.Quoted 7 lines
Quoted 3 lines
This breaks userspace, as userspace assumes it can access the i2c devices through
/dev/i2c-x.Joel, or anyone able to answer…
Do you know which application? I wasn’t aware of any applications using i2c-dev...
The one I noticed was
vrm-control.sh.Quoted 1 line
Can we simply remove i2c-dev from the config?
We could, but that would break other bits of the p9 userspace.
Taking a look a the root filesystem, we have the following applications that use the
/dev/i2cinterfaces:
Quoted 10 lines
$ grep -rl i2cset * usr/sbin/i2cset usr/bin/avsbus-disable.sh usr/bin/avsbus-workaround.sh usr/bin/avsbus-enable.sh usr/bin/vrm-control.sh usr/bin/vcs_on.sh usr/bin/ucd_disable_vcs.sh usr/bin/vcs_off.sh
Thanks Joel. I had forgotten about these.
I’m not sure how to handle this. We obviously still need to run these workarounds, but we also need the regulator temperatures.
The only thing I can think of is exposing what these scripts need via sysfs attributes.
Is there any alternative?
Quoted 7 lines
grep -rl i2cget *
usr/sbin/i2cgetusr/bin/vrm-control.shCheers,
Joel
Joel Stanley
maintainerRe: [PATCH linux dev-4.10 v2] arm: dts: aspeed: Add IR35221 instances to dev tree
Quoted 8 lines · Brad Bishop
Quoted 8 lines
Quoted 7 lines
Quoted 3 lines
This breaks userspace, as userspace assumes it can access the i2c devices through
/dev/i2c-x.Joel, or anyone able to answer…
Do you know which application? I wasn’t aware of any applications using i2c-dev...
Quoted 8 lines
Quoted 1 line
The one I noticed was
vrm-control.sh.I’m not sure how to handle this. We obviously still need to run these workarounds, but we also need the regulator temperatures.
The only thing I can think of is exposing what these scripts need via sysfs attributes.
Is there any alternative?
There are two options:
Write from userspace
We could unbind the driver, make the relevant configuration changes in userspace, and then re-bind the driver. This has the benefit of being sure that the driver will still work, and does not require any kernel work.
A sub-option of this is to do the same without unbinding the driver. Userspace can specify a "force" flag in the ioctl, which allows it to write to the i2c device even when a kernel driver is bound. The upside here is less messing around with unbinding, but the drawback is userspace may change the hardware state that the driver depends on, leading to instability. We could audit the drivers to make sure the state we're changing from userspace does not affect the driver, and/or fix the driver so it still behaves.
Add functionality to the driver
Look at adding the required configuration to the driver. Either through device tree properties, or sysfs files. This is would require looking at the writes we need to do, and working out how they can be integrated.
As discussed today, we will go with writing from userspace after unbinding the driver.
As I've already merged the ir35221 patch into the kernel, completing the unbinding work is blocking an update of the kernel. Do we have a ticket opened for this work?
Cheers,
Joel