Lines Matching +full:on +full:- +full:chip

1 // SPDX-License-Identifier: GPL-2.0
7 * Loosely based on android x86 kernel code which is:
13 * Some peripherals on Bay Trail and Cherry Trail platforms signal a Power
16 * bit in the GPE0a_STS register to avoid an IRQ storm on IRQ 9.
26 * controller, letting gpiolib-acpi.c call the _L02 handler as it would
42 #include <asm/intel-family.h>
59 static int int0002_gpio_get(struct gpio_chip *chip, unsigned int offset) in int0002_gpio_get() argument
64 static void int0002_gpio_set(struct gpio_chip *chip, unsigned int offset, in int0002_gpio_set() argument
69 static int int0002_gpio_direction_output(struct gpio_chip *chip, in int0002_gpio_direction_output() argument
98 static int int0002_irq_set_wake(struct irq_data *data, unsigned int on) in int0002_irq_set_wake() argument
100 struct gpio_chip *chip = irq_data_get_irq_chip_data(data); in int0002_irq_set_wake() local
101 struct platform_device *pdev = to_platform_device(chip->parent); in int0002_irq_set_wake()
105 if (on) in int0002_irq_set_wake()
115 struct gpio_chip *chip = data; in int0002_irq() local
122 generic_handle_irq(irq_find_mapping(chip->irq.domain, in int0002_irq()
125 pm_wakeup_hard_event(chip->parent); in int0002_irq()
152 * No set_wake, on CHT the IRQ is typically shared with the ACPI SCI
164 static void int0002_init_irq_valid_mask(struct gpio_chip *chip, in int0002_init_irq_valid_mask() argument
173 struct device *dev = &pdev->dev; in int0002_probe()
175 struct gpio_chip *chip; in int0002_probe() local
182 return -ENODEV; in int0002_probe()
188 chip = devm_kzalloc(dev, sizeof(*chip), GFP_KERNEL); in int0002_probe()
189 if (!chip) in int0002_probe()
190 return -ENOMEM; in int0002_probe()
192 chip->label = DRV_NAME; in int0002_probe()
193 chip->parent = dev; in int0002_probe()
194 chip->owner = THIS_MODULE; in int0002_probe()
195 chip->get = int0002_gpio_get; in int0002_probe()
196 chip->set = int0002_gpio_set; in int0002_probe()
197 chip->direction_input = int0002_gpio_get; in int0002_probe()
198 chip->direction_output = int0002_gpio_direction_output; in int0002_probe()
199 chip->base = -1; in int0002_probe()
200 chip->ngpio = GPE0A_PME_B0_VIRT_GPIO_PIN + 1; in int0002_probe()
201 chip->irq.init_valid_mask = int0002_init_irq_valid_mask; in int0002_probe()
204 * We directly request the irq here instead of passing a flow-handler in int0002_probe()
210 IRQF_SHARED, "INT0002", chip); in int0002_probe()
216 girq = &chip->irq; in int0002_probe()
217 girq->chip = (struct irq_chip *)cpu_id->driver_data; in int0002_probe()
219 girq->parent_handler = NULL; in int0002_probe()
220 girq->num_parents = 0; in int0002_probe()
221 girq->parents = NULL; in int0002_probe()
222 girq->default_type = IRQ_TYPE_NONE; in int0002_probe()
223 girq->handler = handle_edge_irq; in int0002_probe()
225 ret = devm_gpiochip_add_data(dev, chip, NULL); in int0002_probe()
227 dev_err(dev, "Error adding gpio chip: %d\n", ret); in int0002_probe()
238 device_init_wakeup(&pdev->dev, false); in int0002_remove()