irq: Tidy up of-platdata irq support

This function is available but not exported. More generally it does not
really work as intended.

Reimplement it and add a sandbox test too.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2021-08-07 07:24:11 -06:00
parent f521be6083
commit 3e57ad907c
9 changed files with 119 additions and 19 deletions

View File

@@ -124,6 +124,19 @@
#sound-dai-cells = <1>;
};
irq_sandbox: irq-sbox {
u-boot,dm-spl;
compatible = "sandbox,irq";
interrupt-controller;
#interrupt-cells = <2>;
};
irq-test {
u-boot,dm-spl;
compatible = "sandbox,irq-test";
interrupts-extended = <&irq_sandbox 3 0>;
};
lcd {
u-boot,dm-pre-proper;
compatible = "sandbox,lcd-sdl";

View File

@@ -0,0 +1,20 @@
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright 2021 Google LLC
*/
#ifndef __SANDBOX_IRQ_H
#define __SANDBOX_IRQ_H
/**
* struct sandbox_irq_priv - private data for this driver
*
* @count: Counts the number calls to the read_and_clear() method
* @pending: true if an interrupt is pending, else false
*/
struct sandbox_irq_priv {
int count;
bool pending;
};
#endif /* __SANDBOX_IRQ_H */