Nicolò has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/37994 )
Change subject: mb/google/peppy: Add ALS as ACPI device Some of models of the C720 can have an ISL29018 ambient light sensor on the mainboard, probably all the C720P have it. ......................................................................
mb/google/peppy: Add ALS as ACPI device Some of models of the C720 can have an ISL29018 ambient light sensor on the mainboard, probably all the C720P have it.
This patch will provide a way for the kernel to access the ALS sensor even after the chromeos_laptop driver broke.
Please note that this patch advertise the ALS as an ISL29023, this is due to the fact that the proximity function of the ISL2018 is available only if a properly IR LED is present with the sensor. The C720 doesn't have the IR LED circuit.
More work will be required to properly set the _STA to help the kernel driver on probing of the device itself.
Tested on 4.15+
Change-Id: I8ed5583afb2f866c1b21eb44f5188526cfb7ebd9 Signed-off-by: Nicolò Veronese nicveronese@gmail.com --- M src/mainboard/google/slippy/variants/peppy/include/variant/acpi/mainboard.asl 1 file changed, 33 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/94/37994/1
diff --git a/src/mainboard/google/slippy/variants/peppy/include/variant/acpi/mainboard.asl b/src/mainboard/google/slippy/variants/peppy/include/variant/acpi/mainboard.asl index cc3e063..c3dfe5f 100644 --- a/src/mainboard/google/slippy/variants/peppy/include/variant/acpi/mainboard.asl +++ b/src/mainboard/google/slippy/variants/peppy/include/variant/acpi/mainboard.asl @@ -149,4 +149,37 @@ } } } + + Device (ALSD) + { + Name (_HID, "ISL29023") + Name (_DDN, "Renesas ALS") + Name (_UID, 6) + Name (_CRS, ResourceTemplate() + { + I2cSerialBus ( + 0x44, // SlaveAddress + ControllerInitiated, // SlaveMode + 400000, // ConnectionSpeed + AddressingMode7Bit, // AddressingMode + "\_SB.PCI0.I2C1" // ResourceSource + ) + + // GPIO51 (ball R5) is PIRQT: PIRQL_GSI + PIRQL - PIRQT = PIRQW_GSI + // 27 + 3 - 11 = 35 + Interrupt (ResourceConsumer, Edge, ActiveLow) + { + BOARD_LIGHTSENSOR_IRQ + } + }) + + Method (_STA) + { + If (LEqual (\S2EN, 1)) { + Return (0xF) + } Else { + Return (0x0) + } + } + } }
Nicolò has uploaded a new patch set (#2). ( https://review.coreboot.org/c/coreboot/+/37994 )
Change subject: mb/google/peppy: Add ALS as ACPI device ......................................................................
mb/google/peppy: Add ALS as ACPI device
Some of models of the C720 can have an ISL29018 ambient light sensor on the mainboard, probably all the C720P have it.
This patch will provide a way for the kernel to access the ALS sensor even after the chromeos_laptop driver broke.
Please note that this patch advertise the ALS as an ISL29023, this is due to the fact that the proximity function of the ISL2018 is available only if a properly IR LED is present with the sensor. The C720 doesn't have the IR LED circuit.
More work will be required to properly set the _STA to help the kernel driver on probing of the device itself.
Tested on 4.15+
Change-Id: I8ed5583afb2f866c1b21eb44f5188526cfb7ebd9 Signed-off-by: Nicolò Veronese nicveronese@gmail.com --- M src/mainboard/google/slippy/variants/peppy/include/variant/acpi/mainboard.asl 1 file changed, 33 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/94/37994/2
Matt DeVillier has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/37994 )
Change subject: mb/google/peppy: Add ALS as ACPI device ......................................................................
Patch Set 2:
(2 comments)
https://review.coreboot.org/c/coreboot/+/37994/2/src/mainboard/google/slippy... File src/mainboard/google/slippy/variants/peppy/include/variant/acpi/mainboard.asl:
https://review.coreboot.org/c/coreboot/+/37994/2/src/mainboard/google/slippy... PS2, Line 168: // GPIO51 (ball R5) is PIRQT: PIRQL_GSI + PIRQL - PIRQT = PIRQW_GSI : // 27 + 3 - 11 = 35 this comment doesn't make a ton of sense here without the resulting value used below and not hidden away in another file. I'd argue it belongs either in the onboard.h with the definition, or in that commit's message.
https://review.coreboot.org/c/coreboot/+/37994/2/src/mainboard/google/slippy... PS2, Line 179: Return (0xF) how does the OS (linux, windows) handle this in the case where no ALS is present?
Nicolò has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/37994 )
Change subject: mb/google/peppy: Add ALS as ACPI device ......................................................................
Patch Set 2:
(1 comment)
Was busy with university exams. I'll push a fix for the IRQ comment.
We mignt need a proper Mainboard level backend for probing HW and pass HW states to ACPI.
https://review.coreboot.org/c/coreboot/+/37994/2/src/mainboard/google/slippy... File src/mainboard/google/slippy/variants/peppy/include/variant/acpi/mainboard.asl:
https://review.coreboot.org/c/coreboot/+/37994/2/src/mainboard/google/slippy... PS2, Line 179: Return (0xF)
how does the OS (linux, windows) handle this in the case where no ALS is present?
It's the same behavior for the touchscreen, not all models have it. (Only the P variant)
Stefan Reinauer has abandoned this change. ( https://review.coreboot.org/c/coreboot/+/37994?usp=email )
Change subject: mb/google/peppy: Add ALS as ACPI device ......................................................................
Abandoned