All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] generic spidev devices must be registered
@ 2016-08-05 13:11 ` Fabien Lahoudere
  0 siblings, 0 replies; 7+ messages in thread
From: Fabien Lahoudere @ 2016-08-05 13:11 UTC (permalink / raw)
  Cc: Fabien Lahoudere, Mark Brown, Rob Herring, Mark Rutland,
	open list:SPI SUBSYSTEM,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	open list

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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 1/1] generic spidev devices must be registered
@ 2016-08-05 13:11 ` Fabien Lahoudere
  0 siblings, 0 replies; 7+ messages in thread
From: Fabien Lahoudere @ 2016-08-05 13:11 UTC (permalink / raw)
  Cc: Fabien Lahoudere, Mark Brown, Rob Herring, Mark Rutland,
	open list:SPI SUBSYSTEM,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	open list

Adding spidev in the compatible list, let configure spidev from device tree
instead of C source code.

Signed-off-by: Fabien Lahoudere <fabien.lahoudere-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org>
---
 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

--
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 related	[flat|nested] 7+ messages in thread

* [PATCH 1/1] generic spidev devices must be registered
@ 2016-08-05 13:11 ` Fabien Lahoudere
  0 siblings, 0 replies; 7+ messages in thread
From: Fabien Lahoudere @ 2016-08-05 13:11 UTC (permalink / raw)
  Cc: Fabien Lahoudere, Mark Brown, Rob Herring, Mark Rutland,
	open list:SPI SUBSYSTEM,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	open list

Adding spidev in the compatible list, let configure spidev from device tree
instead of C source code.

Signed-off-by: Fabien Lahoudere <fabien.lahoudere-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org>
---
 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

--
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 related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/1] generic spidev devices must be registered
@ 2016-08-05 13:43   ` Mark Rutland
  0 siblings, 0 replies; 7+ messages in thread
From: Mark Rutland @ 2016-08-05 13:43 UTC (permalink / raw)
  To: Fabien Lahoudere
  Cc: Mark Brown, Rob Herring, open list:SPI SUBSYSTEM,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	open list

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
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/1] generic spidev devices must be registered
@ 2016-08-05 13:43   ` Mark Rutland
  0 siblings, 0 replies; 7+ messages in thread
From: Mark Rutland @ 2016-08-05 13:43 UTC (permalink / raw)
  To: Fabien Lahoudere
  Cc: Mark Brown, Rob Herring, open list:SPI SUBSYSTEM,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	open list

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-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org>
> ---
>  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
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" 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] 7+ messages in thread

* Re: [PATCH 1/1] generic spidev devices must be registered
  2016-08-05 13:43   ` Mark Rutland
@ 2016-08-05 14:21     ` Mark Brown
  -1 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2016-08-05 14:21 UTC (permalink / raw)
  To: Mark Rutland
  Cc: Fabien Lahoudere, Rob Herring, open list:SPI SUBSYSTEM,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	open list

[-- Attachment #1: Type: text/plain, Size: 846 bytes --]

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.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/1] generic spidev devices must be registered
@ 2016-08-05 14:21     ` Mark Brown
  0 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2016-08-05 14:21 UTC (permalink / raw)
  To: Mark Rutland
  Cc: Fabien Lahoudere, Rob Herring, open list:SPI SUBSYSTEM,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	open list

[-- Attachment #1: Type: text/plain, Size: 846 bytes --]

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.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-08-05 14:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-05 13:11 [PATCH 1/1] generic spidev devices must be registered Fabien Lahoudere
2016-08-05 13:11 ` Fabien Lahoudere
2016-08-05 13:11 ` Fabien Lahoudere
2016-08-05 13:43 ` Mark Rutland
2016-08-05 13:43   ` Mark Rutland
2016-08-05 14:21   ` Mark Brown
2016-08-05 14:21     ` Mark Brown

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.