mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
pinctrl/amd: Set the level based on ACPI tables
In the function amd_gpio_irq_set_type, read the values from the ACPI table to set the level and drop the settings passed by the client. Cc: <[email protected]> # 4.8.x+ Reviewed-by: Pankaj Sen <[email protected]> Reviewed-by: Nitesh Kumar Agrawal <[email protected]> Reviewed-by: Shah, Nehal-bakulchandra <[email protected]> Signed-off-by: Shyam-sundar S-k <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
This commit is contained in:
parent
7ce7d89f48
commit
2983f296f2
1 changed files with 7 additions and 12 deletions
|
|
@ -382,26 +382,21 @@ static int amd_gpio_irq_set_type(struct irq_data *d, unsigned int type)
|
|||
{
|
||||
int ret = 0;
|
||||
u32 pin_reg;
|
||||
unsigned long flags;
|
||||
bool level_trig;
|
||||
u32 active_level;
|
||||
unsigned long flags, irq_flags;
|
||||
struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
|
||||
struct amd_gpio *gpio_dev = gpiochip_get_data(gc);
|
||||
|
||||
spin_lock_irqsave(&gpio_dev->lock, flags);
|
||||
pin_reg = readl(gpio_dev->base + (d->hwirq)*4);
|
||||
|
||||
/*
|
||||
* When level_trig is set EDGE and active_level is set HIGH in BIOS
|
||||
* default settings, ignore incoming settings from client and use
|
||||
* BIOS settings to configure GPIO register.
|
||||
/* Ignore the settings coming from the client and
|
||||
* read the values from the ACPI tables
|
||||
* while setting the trigger type
|
||||
*/
|
||||
level_trig = !(pin_reg & (LEVEL_TRIGGER << LEVEL_TRIG_OFF));
|
||||
active_level = pin_reg & (ACTIVE_LEVEL_MASK << ACTIVE_LEVEL_OFF);
|
||||
|
||||
if(level_trig &&
|
||||
((active_level >> ACTIVE_LEVEL_OFF) == ACTIVE_HIGH))
|
||||
type = IRQ_TYPE_EDGE_FALLING;
|
||||
irq_flags = irq_get_trigger_type(d->irq);
|
||||
if (irq_flags != IRQ_TYPE_NONE)
|
||||
type = irq_flags;
|
||||
|
||||
switch (type & IRQ_TYPE_SENSE_MASK) {
|
||||
case IRQ_TYPE_EDGE_RISING:
|
||||
|
|
|
|||
Loading…
Reference in a new issue