* [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; 8+ 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] 8+ 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
2017-10-03 21:37 ` Rob Herring
2017-09-21 15:48 ` [PATCH v2 2/2] uio: add default compatible string to uio_pdrv_genirq Chris Packham
1 sibling, 1 reply; 8+ 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] 8+ 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; 8+ 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] 8+ messages in thread
* Re: [PATCH v2 1/2] uio: dt-bindings: document binding for uio-pdrv-genirq
@ 2017-10-03 21:37 ` Rob Herring
0 siblings, 0 replies; 8+ messages in thread
From: Rob Herring @ 2017-10-03 21:37 UTC (permalink / raw)
To: Chris Packham; +Cc: mark.rutland, gregkh, devicetree, linux-kernel
On Fri, Sep 22, 2017 at 03:48:13AM +1200, Chris Packham wrote:
> 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
NAK.
I'm sure this has come up before but if you want to map a device to a
uio driver, then add its compatible string to the driver. Bindings
describe h/w devices.
Rob
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 1/2] uio: dt-bindings: document binding for uio-pdrv-genirq
@ 2017-10-03 21:37 ` Rob Herring
0 siblings, 0 replies; 8+ messages in thread
From: Rob Herring @ 2017-10-03 21:37 UTC (permalink / raw)
To: Chris Packham
Cc: mark.rutland-5wv7dgnIgG8,
gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
On Fri, Sep 22, 2017 at 03:48:13AM +1200, Chris Packham wrote:
> 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-6g8wRflRTwXFdCa3tKVlE6U/zSkkHjvu@public.gmane.org>
> ---
> .../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
NAK.
I'm sure this has come up before but if you want to map a device to a
uio driver, then add its compatible string to the driver. Bindings
describe h/w devices.
Rob
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 1/2] uio: dt-bindings: document binding for uio-pdrv-genirq
2017-10-03 21:37 ` Rob Herring
@ 2017-10-08 21:03 ` Chris Packham
-1 siblings, 0 replies; 8+ messages in thread
From: Chris Packham @ 2017-10-08 21:03 UTC (permalink / raw)
To: Rob Herring; +Cc: mark.rutland, gregkh, devicetree, linux-kernel
Hi Rob, Greg,
On 04/10/17 10:38, Rob Herring wrote:
> On Fri, Sep 22, 2017 at 03:48:13AM +1200, Chris Packham wrote:
>> 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
>
> NAK.
>
> I'm sure this has come up before but if you want to map a device to a
> uio driver, then add its compatible string to the driver. Bindings
> describe h/w devices.
Fair enough.
The problem for me is that the uio-pdrv-genirq is so generic it could
apply to pretty much any hardware device. The driver has dt-awareness
but it currently doesn't have any built-in compatible string (it is set
via a module param).
My use-case is a microcontoller with a userspace driver all I need out
of the kernel is i2c access and interrupts. Any suggestions as to how to
move forward with this.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 1/2] uio: dt-bindings: document binding for uio-pdrv-genirq
@ 2017-10-08 21:03 ` Chris Packham
0 siblings, 0 replies; 8+ messages in thread
From: Chris Packham @ 2017-10-08 21:03 UTC (permalink / raw)
To: Rob Herring
Cc: mark.rutland-5wv7dgnIgG8,
gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
Hi Rob, Greg,
On 04/10/17 10:38, Rob Herring wrote:
> On Fri, Sep 22, 2017 at 03:48:13AM +1200, Chris Packham wrote:
>> 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-6g8wRflRTwXFdCa3tKVlE6U/zSkkHjvu@public.gmane.org>
>> ---
>> .../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
>
> NAK.
>
> I'm sure this has come up before but if you want to map a device to a
> uio driver, then add its compatible string to the driver. Bindings
> describe h/w devices.
Fair enough.
The problem for me is that the uio-pdrv-genirq is so generic it could
apply to pretty much any hardware device. The driver has dt-awareness
but it currently doesn't have any built-in compatible string (it is set
via a module param).
My use-case is a microcontoller with a userspace driver all I need out
of the kernel is i2c access and interrupts. Any suggestions as to how to
move forward with this.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 1/2] uio: dt-bindings: document binding for uio-pdrv-genirq
2017-10-08 21:03 ` Chris Packham
(?)
@ 2017-10-09 1:32 ` Rob Herring
-1 siblings, 0 replies; 8+ messages in thread
From: Rob Herring @ 2017-10-09 1:32 UTC (permalink / raw)
To: Chris Packham; +Cc: mark.rutland, gregkh, devicetree, linux-kernel
On Sun, Oct 8, 2017 at 4:03 PM, Chris Packham
<Chris.Packham@alliedtelesis.co.nz> wrote:
> Hi Rob, Greg,
>
> On 04/10/17 10:38, Rob Herring wrote:
>> On Fri, Sep 22, 2017 at 03:48:13AM +1200, Chris Packham wrote:
>>> 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
>>
>> NAK.
>>
>> I'm sure this has come up before but if you want to map a device to a
>> uio driver, then add its compatible string to the driver. Bindings
>> describe h/w devices.
>
> Fair enough.
>
> The problem for me is that the uio-pdrv-genirq is so generic it could
> apply to pretty much any hardware device. The driver has dt-awareness
> but it currently doesn't have any built-in compatible string (it is set
> via a module param).
>
> My use-case is a microcontoller with a userspace driver all I need out
> of the kernel is i2c access and interrupts. Any suggestions as to how to
> move forward with this.
Define the binding for the uC regardless of how the driver is
implemented. Then add its compatible to the uio-pdev driver. That's
how we've dealt with spi-dev for example.
Rob
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2017-10-09 1:33 UTC | newest]
Thread overview: 8+ 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
2017-10-03 21:37 ` Rob Herring
2017-10-03 21:37 ` Rob Herring
2017-10-08 21:03 ` Chris Packham
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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.