| 1 |
/* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 |
|
| 3 |
#include <variant/onboard.h> |
| 4 |
|
| 5 |
Scope (\_SB.PCI0.I2C5) |
| 6 |
{ |
| 7 |
Device (ALSI) |
| 8 |
{ |
| 9 |
Name (_HID, EisaId ("LSD2918")) |
| 10 |
Name (_DDN, "Intersil 29018 Ambient Light Sensor") |
| 11 |
Name (_UID, 1) |
| 12 |
Name (_CRS, ResourceTemplate() |
| 13 |
{ |
| 14 |
I2cSerialBus ( |
| 15 |
0x44, // SlaveAddress |
| 16 |
ControllerInitiated, // SlaveMode |
| 17 |
400000, // ConnectionSpeed |
| 18 |
AddressingMode7Bit, // AddressingMode |
| 19 |
"\\_SB.I2C5", // ResourceSource |
| 20 |
) |
| 21 |
Interrupt (ResourceConsumer, Edge, ActiveLow) |
| 22 |
{ |
| 23 |
BOARD_ALS_IRQ |
| 24 |
} |
| 25 |
}) |
| 26 |
Method (_STA) |
| 27 |
{ |
| 28 |
If (\S5EN == 1) { |
| 29 |
Return (0xF) |
| 30 |
} Else { |
| 31 |
Return (0x0) |
| 32 |
} |
| 33 |
} |
| 34 |
} |
| 35 |
} |