1 // SPDX-License-Identifier: GPL-2.0
3 * Sandbox driver for interrupts
5 * Copyright 2019 Google LLC
12 static int sandbox_set_polarity(struct udevice *dev, uint irq, bool active_low)
20 static int sandbox_route_pmc_gpio_gpe(struct udevice *dev, uint pmc_gpe_num)
25 return pmc_gpe_num + 1;
28 static int sandbox_snapshot_polarities(struct udevice *dev)
33 static int sandbox_restore_polarities(struct udevice *dev)
38 static const struct irq_ops sandbox_irq_ops = {
39 .route_pmc_gpio_gpe = sandbox_route_pmc_gpio_gpe,
40 .set_polarity = sandbox_set_polarity,
41 .snapshot_polarities = sandbox_snapshot_polarities,
42 .restore_polarities = sandbox_restore_polarities,
45 static const struct udevice_id sandbox_irq_ids[] = {
46 { .compatible = "sandbox,irq"},
50 U_BOOT_DRIVER(sandbox_irq_drv) = {
51 .name = "sandbox_irq",
53 .of_match = sandbox_irq_ids,
54 .ops = &sandbox_irq_ops,