12 #include <linux/errno.h>
18 #include <linux/kernel.h>
19 #include <linux/module.h>
20 #include <linux/pci.h>
25 #define DRV_NAME "sdv_gpio"
26 #define SDV_NUM_PUB_GPIOS 12
27 #define PCI_DEVICE_ID_SDV_GPIO 0x2e67
45 struct irq_chip_generic *
gc;
49 static int sdv_gpio_pub_set_type(
struct irq_data *
d,
unsigned int type)
51 struct irq_chip_generic *
gc = irq_data_get_irq_chip_data(d);
61 reg =
readl(type_reg);
92 irq_stat &= ~
BIT(irq_bit);
135 struct irq_chip_type *
ct;
163 sd->
gc->private = sd;
164 ct = sd->
gc->chip_types;
166 ct->regs.eoi =
GPSTR;
171 ct->chip.irq_set_type = sdv_gpio_pub_set_type;
178 sd->
irq_base, 0, &irq_domain_sdv_ops, sd);
204 dev_err(&pdev->
dev,
"can't enable device.\n");
220 if (prop && len == 4) {
221 mux_val = of_read_number(prop, 1);
234 dev_err(&pdev->
dev,
"gpiochip_add() failed.\n");
238 ret = sdv_register_irqsupport(sd, pdev);
242 pci_set_drvdata(pdev, sd);
243 dev_info(&pdev->
dev,
"Sodaville GPIO driver registered.\n");
257 static void sdv_gpio_remove(
struct pci_dev *pdev)
265 dev_err(&pdev->
dev,
"gpiochip_remove() failed.\n");
280 .id_table = sdv_gpio_pci_ids,
281 .probe = sdv_gpio_probe,
282 .remove = sdv_gpio_remove,