* [PATCH v2 0/2] using uio_pdrv_genirq without module param
@ 2017-09-21 15:48 Chris Packham
2017-09-21 15:48 ` [PATCH v2 1/2] uio: dt-bindings: document binding for uio-pdrv-genirq Chris Packham
2017-09-21 15:48 ` [PATCH v2 2/2] uio: add default compatible string to uio_pdrv_genirq Chris Packham
0 siblings, 2 replies; 6+ messages in thread
From: Chris Packham @ 2017-09-21 15:48 UTC (permalink / raw)
To: robh+dt, mark.rutland, gregkh, devicetree, linux-kernel; +Cc: Chris Packham
I found myself about to add a driver that was a sub-optimal clone of
uio_pdrv_genirq the only difference was that I didn't want to modify the args
passed to the kernel by my bootloader. If uio_pdrv_genirq had a default
of_match entry I could simply use that. This series attempts to implement this.
Changes in v2:
- added a better commit message to 1/2
- remove bogus checkpatch fix in 2/2
Chris Packham (2):
uio: dt-bindings: document binding for uio-pdrv-genirq
uio: add default compatible string to uio_pdrv_genirq
.../bindings/uio/linux,uio-pdrv-genirq.txt | 28 ++++++++++++++++++++++
drivers/uio/uio_pdrv_genirq.c | 3 ++-
2 files changed, 30 insertions(+), 1 deletion(-)
create mode 100644 Documentation/devicetree/bindings/uio/linux,uio-pdrv-genirq.txt
--
2.14.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 1/2] uio: dt-bindings: document binding for uio-pdrv-genirq
2017-09-21 15:48 [PATCH v2 0/2] using uio_pdrv_genirq without module param Chris Packham
@ 2017-09-21 15:48 ` Chris Packham
[not found] ` <20170921154814.7510-2-chris.packham-6g8wRflRTwXFdCa3tKVlE6U/zSkkHjvu@public.gmane.org>
2017-09-21 15:48 ` [PATCH v2 2/2] uio: add default compatible string to uio_pdrv_genirq Chris Packham
1 sibling, 1 reply; 6+ messages in thread
From: Chris Packham @ 2017-09-21 15:48 UTC (permalink / raw)
To: robh+dt, mark.rutland, gregkh, devicetree, linux-kernel; +Cc: Chris Packham
Document the device tree bindings for the uio-prv-genirq driver. Provide
some examples on how it can be used.
Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
---
.../bindings/uio/linux,uio-pdrv-genirq.txt | 28 ++++++++++++++++++++++
1 file changed, 28 insertions(+)
create mode 100644 Documentation/devicetree/bindings/uio/linux,uio-pdrv-genirq.txt
diff --git a/Documentation/devicetree/bindings/uio/linux,uio-pdrv-genirq.txt b/Documentation/devicetree/bindings/uio/linux,uio-pdrv-genirq.txt
new file mode 100644
index 000000000000..90447905e886
--- /dev/null
+++ b/Documentation/devicetree/bindings/uio/linux,uio-pdrv-genirq.txt
@@ -0,0 +1,28 @@
+*Generic UIO platform driver with interrupts
+
+Required properties:
+- compatible: Should be "linux,uio-pdrv-genirq" or a value set with the of_id
+ module parameter.
+
+Optional properties:
+- interrupts: Should contain the interrupt to be associated with this device
+ (only a single interrupt is supported per device).
+- interrupt-parent: Specifies the phandle to the parent interrupt controller.
+- reg: Should specify the physical address spaces used by this device.
+
+Example:
+
+/* Device with MM IO and interrupt */
+my-device@10000 {
+ compatible = "linux,uio-pdrv-genirq";
+ reg = <0x10000 0x40>;
+ interrupts = <4 IRQ_TYPE_EDGE_BOTH>;
+ interrupt-parent = <&gic>;
+};
+
+/* Device with interrupt only */
+my-int {
+ compatible = "linux,uio-pdrv-genirq";
+ interrupts = <6 IRQ_TYPE_EDGE_BOTH>;
+ interrupt-parent = <&gic>;
+};
--
2.14.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2 2/2] uio: add default compatible string to uio_pdrv_genirq
2017-09-21 15:48 [PATCH v2 0/2] using uio_pdrv_genirq without module param Chris Packham
2017-09-21 15:48 ` [PATCH v2 1/2] uio: dt-bindings: document binding for uio-pdrv-genirq Chris Packham
@ 2017-09-21 15:48 ` Chris Packham
1 sibling, 0 replies; 6+ messages in thread
From: Chris Packham @ 2017-09-21 15:48 UTC (permalink / raw)
To: robh+dt, mark.rutland, gregkh, devicetree, linux-kernel; +Cc: Chris Packham
Add a default compatible string "linux,uio-pdrv-genirq" to
uio_pdrv_genirq to make it usable without supplying a module parameter.
The module parameter is still supported in addition to the default.
Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
---
drivers/uio/uio_pdrv_genirq.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/uio/uio_pdrv_genirq.c b/drivers/uio/uio_pdrv_genirq.c
index f598ecddc8a7..4d089240533e 100644
--- a/drivers/uio/uio_pdrv_genirq.c
+++ b/drivers/uio/uio_pdrv_genirq.c
@@ -253,11 +253,12 @@ static const struct dev_pm_ops uio_pdrv_genirq_dev_pm_ops = {
#ifdef CONFIG_OF
static struct of_device_id uio_of_genirq_match[] = {
+ { .compatible = "linux,uio-pdrv-genirq" },
{ /* This is filled with module_parm */ },
{ /* Sentinel */ },
};
MODULE_DEVICE_TABLE(of, uio_of_genirq_match);
-module_param_string(of_id, uio_of_genirq_match[0].compatible, 128, 0);
+module_param_string(of_id, uio_of_genirq_match[1].compatible, 128, 0);
MODULE_PARM_DESC(of_id, "Openfirmware id of the device to be handled by uio");
#endif
--
2.14.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2017-10-09 1:32 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-21 15:48 [PATCH v2 0/2] using uio_pdrv_genirq without module param Chris Packham
2017-09-21 15:48 ` [PATCH v2 1/2] uio: dt-bindings: document binding for uio-pdrv-genirq Chris Packham
[not found] ` <20170921154814.7510-2-chris.packham-6g8wRflRTwXFdCa3tKVlE6U/zSkkHjvu@public.gmane.org>
2017-10-03 21:37 ` Rob Herring
2017-10-08 21:03 ` Chris Packham
2017-10-09 1:32 ` Rob Herring
2017-09-21 15:48 ` [PATCH v2 2/2] uio: add default compatible string to uio_pdrv_genirq Chris Packham
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).