Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1457088 > unrolled thread
| Started by | Fabien Lahoudere <fabien.lahoudere@collabora.co.uk> |
|---|---|
| First post | 2016-08-05 15:20 +0200 |
| Last post | 2016-08-05 16:30 +0200 |
| Articles | 3 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH 1/1] generic spidev devices must be registered Fabien Lahoudere <fabien.lahoudere@collabora.co.uk> - 2016-08-05 15:20 +0200
Re: [PATCH 1/1] generic spidev devices must be registered Mark Rutland <mark.rutland@arm.com> - 2016-08-05 15:50 +0200
Re: [PATCH 1/1] generic spidev devices must be registered Mark Brown <broonie@kernel.org> - 2016-08-05 16:30 +0200
| From | Fabien Lahoudere <fabien.lahoudere@collabora.co.uk> |
|---|---|
| Date | 2016-08-05 15:20 +0200 |
| Subject | [PATCH 1/1] generic spidev devices must be registered |
| Message-ID | <s2NcB-80H-5@gated-at.bofh.it> |
Adding spidev in the compatible list, let configure spidev from device tree
instead of C source code.
Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.co.uk>
---
Documentation/devicetree/bindings/spi/spidev.txt | 16 ++++++++++++++++
drivers/spi/spidev.c | 1 +
2 files changed, 17 insertions(+)
create mode 100644 Documentation/devicetree/bindings/spi/spidev.txt
diff --git a/Documentation/devicetree/bindings/spi/spidev.txt b/Documentation/devicetree/bindings/spi/spidev.txt
new file mode 100644
index 0000000..23200f2
--- /dev/null
+++ b/Documentation/devicetree/bindings/spi/spidev.txt
@@ -0,0 +1,16 @@
+* SPIDEV
+
+spidev is a device driver to access to SPI devices using normal userspace I/O calls.
+To make an SPI device compatible with this drivers add:
+
+Required properties:
+- compatible : should be "spidev".
+
+Example:
+
+spidev0: spi@0 {
+ compatible = "spidev";
+ reg = <0>;
+ spi-max-frequency = <1000000>;
+ status = "okay";
+};
diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c
index 2e05046..d780491 100644
--- a/drivers/spi/spidev.c
+++ b/drivers/spi/spidev.c
@@ -696,6 +696,7 @@ static struct class *spidev_class;
static const struct of_device_id spidev_dt_ids[] = {
{ .compatible = "rohm,dh2228fv" },
{ .compatible = "lineartechnology,ltc2488" },
+ { .compatible = "spidev" },
{},
};
MODULE_DEVICE_TABLE(of, spidev_dt_ids);
--
2.7.4
[toc] | [next] | [standalone]
| From | Mark Rutland <mark.rutland@arm.com> |
|---|---|
| Date | 2016-08-05 15:50 +0200 |
| Message-ID | <s2NFE-8dj-29@gated-at.bofh.it> |
| In reply to | #1457088 |
On Fri, Aug 05, 2016 at 03:11:53PM +0200, Fabien Lahoudere wrote:
> Adding spidev in the compatible list, let configure spidev from device tree
> instead of C source code.
I'm not keen on this.
It ties the hardware description to today's use-case, and leaves the DT
without information regarding the particuarl device. The binding is also
written in terms of the userspace interface, which is backwards.
So NAK to this as-is.
Thanks,
Mark.
>
> Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.co.uk>
> ---
> Documentation/devicetree/bindings/spi/spidev.txt | 16 ++++++++++++++++
> drivers/spi/spidev.c | 1 +
> 2 files changed, 17 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/spi/spidev.txt
>
> diff --git a/Documentation/devicetree/bindings/spi/spidev.txt b/Documentation/devicetree/bindings/spi/spidev.txt
> new file mode 100644
> index 0000000..23200f2
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/spi/spidev.txt
> @@ -0,0 +1,16 @@
> +* SPIDEV
> +
> +spidev is a device driver to access to SPI devices using normal userspace I/O calls.
> +To make an SPI device compatible with this drivers add:
> +
> +Required properties:
> +- compatible : should be "spidev".
> +
> +Example:
> +
> +spidev0: spi@0 {
> + compatible = "spidev";
> + reg = <0>;
> + spi-max-frequency = <1000000>;
> + status = "okay";
> +};
> diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c
> index 2e05046..d780491 100644
> --- a/drivers/spi/spidev.c
> +++ b/drivers/spi/spidev.c
> @@ -696,6 +696,7 @@ static struct class *spidev_class;
> static const struct of_device_id spidev_dt_ids[] = {
> { .compatible = "rohm,dh2228fv" },
> { .compatible = "lineartechnology,ltc2488" },
> + { .compatible = "spidev" },
> {},
> };
> MODULE_DEVICE_TABLE(of, spidev_dt_ids);
> --
> 2.7.4
>
[toc] | [prev] | [next] | [standalone]
| From | Mark Brown <broonie@kernel.org> |
|---|---|
| Date | 2016-08-05 16:30 +0200 |
| Message-ID | <s2Oil-eE-1@gated-at.bofh.it> |
| In reply to | #1457110 |
[Multipart message — attachments visible in raw view] — view raw
On Fri, Aug 05, 2016 at 02:43:43PM +0100, Mark Rutland wrote: > On Fri, Aug 05, 2016 at 03:11:53PM +0200, Fabien Lahoudere wrote: > > Adding spidev in the compatible list, let configure spidev from device tree > > instead of C source code. > I'm not keen on this. > It ties the hardware description to today's use-case, and leaves the DT > without information regarding the particuarl device. The binding is also > written in terms of the userspace interface, which is backwards. > So NAK to this as-is. Indeed. Fabien, please see the *extensive* and repeated previous discussions of this topic. Device tree is there to describe the hardware, not the software you currently happen to be using on your system. Please also see the comments in the driver which explain why we require a compatible string which is descriptive of the hardware.
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web