platform/x86: Add Intel Cherry Trail ACPI INT33FE device driver
Subsystems (2)
PATCH v6 1/1 platform/x86: Add Intel Cherry Trail ACPI INT33FE device driver
The INT33FE ACPI device has a CRS table with I2cSerialBusV2 resources for 3 devices: Maxim MAX17047 Fuel Gauge Controller, FUSB302 USB Type-C Controller and PI3USB30532 USB switch.
This commit adds a driver for this ACPI device which instantiates i2c-clients for these, so that the standard i2c drivers for these chips can bind to the them.
---
Changes in v4:
-This is a new patch in v4 of this patch-set replacing the
cht_wc_fuel_gauge driver which was binding to the INT33FE device before I figured out this is some sort of meta device describing 3 devices and that the fuel-guage really is just a Maxim MAX17047. The cht_wc_fuel_gauge driver will be replaced by a max17047 driver which I will submit seperately
Changes in v5:
-Remove not needed (and not upstream) #include <linux/power/acpi.h> -Sort variable declarations in upside-down Chistmas tree order Changes in v6:
-The i2c device at address 0x22 pointed to by the INT33FE acpi node is
actually a FUSB302 not a FUSB300C do s/300c/302/
-Added Reviewed-by-s from v5 review
--- drivers/platform/x86/Kconfig | 13 +++ drivers/platform/x86/Makefile | 1 + drivers/platform/x86/intel_cht_int33fe.c | 143 +++++++++++++++++++++++++++++++ 3 files changed, 157 insertions(+) create mode 100644 drivers/platform/x86/intel_cht_int33fe.c
drivers/platform/x86/Kconfig +13 -0
@@ -772,6 +772,19 @@ config ACPI_CMPC keys as input device, backlight device, tablet and accelerometer devices. +config INTEL_CHT_INT33FE + tristate "Intel Cherry Trail ACPI INT33FE Driver" + depends on X86 && ACPI + ---help--- + This driver add support for the INT33FE ACPI device found on + some Intel Cherry Trail devices. + + The INT33FE ACPI device has a CRS table with I2cSerialBusV2 + resources for 3 devices: Maxim MAX17047 Fuel Gauge Controller, + FUSB302 USB Type-C Controller and PI3USB30532 USB switch. + This driver instantiates i2c-clients for these, so that standard + i2c drivers for these chips can bind to the them. + config INTEL_HID_EVENT tristate "INTEL HID Event" depends on ACPI
drivers/platform/x86/Makefile +1 -0
@@ -44,6 +44,7 @@ obj-$(CONFIG_ACPI_TOSHIBA) += toshiba_acpi.o obj-$(CONFIG_TOSHIBA_BT_RFKILL) += toshiba_bluetooth.o obj-$(CONFIG_TOSHIBA_HAPS) += toshiba_haps.o obj-$(CONFIG_TOSHIBA_WMI) += toshiba-wmi.o +obj-$(CONFIG_INTEL_CHT_INT33FE) += intel_cht_int33fe.o obj-$(CONFIG_INTEL_HID_EVENT) += intel-hid.o obj-$(CONFIG_INTEL_VBTN) += intel-vbtn.o obj-$(CONFIG_INTEL_SCU_IPC) += intel_scu_ipc.o
drivers/platform/x86/intel_cht_int33fe.c new file +143 -0
143 lines not on this page · raw message
Signature · 1 line
2.9.3
Quoted 9 lines · Hans de Goede
The INT33FE ACPI device has a CRS table with I2cSerialBusV2 resources for
3 devices: Maxim MAX17047 Fuel Gauge Controller, FUSB302 USB Type-C Controller and PI3USB30532 USB switch.This commit adds a driver for this ACPI device which instantiates i2c-clients for these, so that the standard i2c drivers for these chips
can bind to the them.
Given one more thought, if the devices should be present all to make it work, than you perhaps may use component framework.
In this case this so called "pseudo" device is not so pseudo, but "master".
Signature · 2 lines
Andy Shevchenko <[email protected]> Intel Finland Oy
Hi,
Quoted 6 lines · Andy Shevchenko
Quoted 5 lines · Hans de Goede
The INT33FE ACPI device has a CRS table with I2cSerialBusV2 resources for
3 devices: Maxim MAX17047 Fuel Gauge Controller, FUSB302 USB Type-C Controller and PI3USB30532 USB switch.
Quoted 7 lines
Quoted 4 lines
This commit adds a driver for this ACPI device which instantiates i2c-clients for these, so that the standard i2c drivers for these chips
can bind to the them.Given one more thought, if the devices should be present all to make it work, than you perhaps may use component framework.
Actually the fuel-guage is completely independent, the PI3USB30532 USB switch will get set based on extcon cable events from the FUSB302 USB Type-C controller, but otherwise both drivers are independent and the FUSB302 USB Type-C controller pretty much operates stand-alone.
Quoted 2 lines
In this case this so called "pseudo" device is not so pseudo, but "master".
I think this is really some Windows weirdness, if I configure the BIOS to boot "Android" the ACPI INT33FE device goes away and instead I get 3 separate ACPI devices for the 3 chips.
Regards,
Hans
Quoted 22 lines · Hans de Goede
Hi,
Quoted 6 lines · Andy Shevchenko
Quoted 5 lines · Hans de Goede
The INT33FE ACPI device has a CRS table with I2cSerialBusV2 resources for
3 devices: Maxim MAX17047 Fuel Gauge Controller, FUSB302 USB Type-C Controller and PI3USB30532 USB switch.Quoted 7 lines
Quoted 4 lines
This commit adds a driver for this ACPI device which instantiates i2c-clients for these, so that the standard i2c drivers for these chips
can bind to the them.Given one more thought, if the devices should be present all to make it work, than you perhaps may use component framework.
Actually the fuel-guage is completely independent, the PI3USB30532 USB switch will get set based on extcon cable events from the FUSB302 USB Type-C controller, but otherwise both drivers are independent and the FUSB302 USB Type-C controller pretty much operates stand-alone.
Quoted 6 lines
Quoted 2 lines
In this case this so called "pseudo" device is not so pseudo, but "master".
I think this is really some Windows weirdness, if I configure the BIOS to boot "Android" the ACPI INT33FE device goes away and instead I get 3 separate ACPI devices for the 3 chips.
So if this is this case, what is the value in supporting "windows weirdness" if the end user can select "Android" and be presented with 3 separate devices?
Signature · 2 lines
Darren Hart VMware Open Source Technology Center
Hi,
Quoted 26 lines · Darren Hart
Quoted 25 lines · Hans de Goede
Hi,
Quoted 6 lines · Andy Shevchenko
Quoted 5 lines · Hans de Goede
The INT33FE ACPI device has a CRS table with I2cSerialBusV2 resources for
3 devices: Maxim MAX17047 Fuel Gauge Controller, FUSB302 USB Type-C Controller and PI3USB30532 USB switch.Quoted 7 lines
Quoted 4 lines
This commit adds a driver for this ACPI device which instantiates i2c-clients for these, so that the standard i2c drivers for these chips
can bind to the them.Given one more thought, if the devices should be present all to make it work, than you perhaps may use component framework.
Actually the fuel-guage is completely independent, the PI3USB30532 USB switch will get set based on extcon cable events from the FUSB302 USB Type-C controller, but otherwise both drivers are independent and the FUSB302 USB Type-C controller pretty much operates stand-alone.
Quoted 2 lines
In this case this so called "pseudo" device is not so pseudo, but "master".
Quoted 6 lines
Quoted 3 lines
I think this is really some Windows weirdness, if I configure the BIOS to boot "Android" the ACPI INT33FE device goes away and instead I get 3 separate ACPI devices for the 3 chips.
So if this is this case, what is the value in supporting "windows weirdness" if the end user can select "Android" and be presented with 3 separate devices?
Multiple reasons:
1) Multi-boot with windows without needing to toggle a BIOS option all the time
2) Many of these devices only ship with windows, the Android option is there from the BIOS template code they used, but is untested, so this may give us the 3 separate devices but at the same time break other stuff
3) On some devices the BIOS tries to autodetect the OS, overriding the BIOS option
4) On some devices, including the one I'm developing on, but I can "fix" this with a BIOS downgrade, this option has been locked to avoid 2.
5) Users really should not need to touch BIOS settings ever
My main goal for Linux on Bay Trail / Cherrytrail devices is for everything to just work independent of the OSID setting and I'm afraid that this is also necessary to properly support al variants of hw out there. E.g. My cube iwork8 air does 3. from the above list, so if I do:
touch /boot/efi/EFI/BOOT/BOOTX64.EFI
reboot
OSID = 1 (BIOS thinks it is running Windows 8.1 / 10)
And if I then do:
rm /boot/efi/EFI/BOOT/BOOTX64.EFI
reboot
OSID = 4 (BIOS thinks it is running Android)
Independent of the option I select in the BIOS.
Also I would like to point out that the entire pseudo-driver including copyright header is only 144 lines, so it is not like we need a crazy amount of code to deal with this.
Regards,
Hans
Quoted 7 lines · Hans de Goede
Hi,
Quoted 4 lines · Darren Hart
Quoted 3 lines · Hans de Goede
Hi,
On 06-04-17 13:03, Andy Shevchenko wrote:
...
Quoted 12 lines
Quoted 9 lines
Quoted 6 lines
Quoted 2 lines
In this case this so called "pseudo" device is not so pseudo, but "master".
I think this is really some Windows weirdness, if I configure the BIOS to boot "Android" the ACPI INT33FE device goes away and instead I get 3 separate ACPI devices for the 3 chips.
So if this is this case, what is the value in supporting "windows weirdness" if the end user can select "Android" and be presented with 3 separate devices?
Multiple reasons:
Quoted 8 lines
1) Multi-boot with windows without needing to toggle a BIOS option all the time
2) Many of these devices only ship with windows, the Android option is there from the BIOS template code they used, but is untested, so this may give us the 3 separate devices but at the same time break other stuff
3) On some devices the BIOS tries to autodetect the OS, overriding the BIOS option
4) On some devices, including the one I'm developing on, but I can "fix" this with a BIOS downgrade, this option has been locked to avoid 2.
5) Users really should not need to touch BIOS settings ever
Agreed on all points.
I'm happy to pull this in. I need an immutable i2c branch with the dependencies to do so.
Signature · 2 lines
Darren Hart VMware Open Source Technology Center