mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-12-11 13:56:30 +00:00
79d66a6ac1
Update this uclass to support the needs of the Apollo Lake ITSS. It supports four operations. Move the uclass into a separate directory so that sandbox can use it too. Add a new Kconfig to control it and enable this on x86. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
53 lines
1 KiB
C
53 lines
1 KiB
C
// SPDX-License-Identifier: GPL-2.0+
|
|
/*
|
|
* Copyright (C) 2015, Bin Meng <bmeng.cn@gmail.com>
|
|
*/
|
|
|
|
#include <common.h>
|
|
#include <dm.h>
|
|
#include <irq.h>
|
|
|
|
int irq_route_pmc_gpio_gpe(struct udevice *dev, uint pmc_gpe_num)
|
|
{
|
|
const struct irq_ops *ops = irq_get_ops(dev);
|
|
|
|
if (!ops->route_pmc_gpio_gpe)
|
|
return -ENOSYS;
|
|
|
|
return ops->route_pmc_gpio_gpe(dev, pmc_gpe_num);
|
|
}
|
|
|
|
int irq_set_polarity(struct udevice *dev, uint irq, bool active_low)
|
|
{
|
|
const struct irq_ops *ops = irq_get_ops(dev);
|
|
|
|
if (!ops->set_polarity)
|
|
return -ENOSYS;
|
|
|
|
return ops->set_polarity(dev, irq, active_low);
|
|
}
|
|
|
|
int irq_snapshot_polarities(struct udevice *dev)
|
|
{
|
|
const struct irq_ops *ops = irq_get_ops(dev);
|
|
|
|
if (!ops->snapshot_polarities)
|
|
return -ENOSYS;
|
|
|
|
return ops->snapshot_polarities(dev);
|
|
}
|
|
|
|
int irq_restore_polarities(struct udevice *dev)
|
|
{
|
|
const struct irq_ops *ops = irq_get_ops(dev);
|
|
|
|
if (!ops->restore_polarities)
|
|
return -ENOSYS;
|
|
|
|
return ops->restore_polarities(dev);
|
|
}
|
|
|
|
UCLASS_DRIVER(irq) = {
|
|
.id = UCLASS_IRQ,
|
|
.name = "irq",
|
|
};
|