1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright 2019 Google, LLC
4 * Written by Simon Glass <sjg@chromium.org>
10 #include <dm/device-internal.h>
12 int irq_route_pmc_gpio_gpe(struct udevice *dev, uint pmc_gpe_num)
14 const struct irq_ops *ops = irq_get_ops(dev);
16 if (!ops->route_pmc_gpio_gpe)
19 return ops->route_pmc_gpio_gpe(dev, pmc_gpe_num);
22 int irq_set_polarity(struct udevice *dev, uint irq, bool active_low)
24 const struct irq_ops *ops = irq_get_ops(dev);
26 if (!ops->set_polarity)
29 return ops->set_polarity(dev, irq, active_low);
32 int irq_snapshot_polarities(struct udevice *dev)
34 const struct irq_ops *ops = irq_get_ops(dev);
36 if (!ops->snapshot_polarities)
39 return ops->snapshot_polarities(dev);
42 int irq_restore_polarities(struct udevice *dev)
44 const struct irq_ops *ops = irq_get_ops(dev);
46 if (!ops->restore_polarities)
49 return ops->restore_polarities(dev);
52 int irq_first_device_type(enum irq_dev_t type, struct udevice **devp)
56 ret = uclass_first_device_drvdata(UCLASS_IRQ, type, devp);
58 return log_msg_ret("find", ret);
63 UCLASS_DRIVER(irq) = {