linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* spidev instantiated from DT
@ 2016-12-11 12:03 Giuseppe Lippolis
  2016-12-12  9:14 ` Geert Uytterhoeven
  0 siblings, 1 reply; 4+ messages in thread
From: Giuseppe Lippolis @ 2016-12-11 12:03 UTC (permalink / raw)
  To: linux-spi-u79uwXL29TY76Z2rM5mHXA

Dear All,
in the spidev.c driver there is a check preventing to export the SPI
subsystem to the userspace.
The commit message state:

	spi: spidev: Warn loudly if instantiated from DT as "spidev"

    Since spidev is a detail of how Linux controls a device rather than a
    description of the hardware in the system we should never have a node
    described as "spidev" in DT, any SPI device could be a spidev so this
    is just not a useful description.

    In order to help prevent users from writing such device trees generate a
    warning if spidev is instantiated as a DT node without an ID in the
match
    table.

    Signed-off-by: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>

Currently in the spidec.c are registered two devices to use "legally" this
driver:
    { .compatible = "rohm,dh2228fv" },
    { .compatible = "lineartechnology,ltc2488" },

I cannot fully understand the rationale.
I have a board mounting an spi device. Currently no dedicated driver for
this devices exists.
So in my opinion, now, make sense to describe a device-tree with a "generic"
driver, allowing the userspace to control the device. When at the end a
dedicated driver will be available an update of the device tree will be
possible.

In alternative, make sense to add a dedicated .compatible = "xxx,yyy"
statements to attach the spidev driver to the specific device and allowing
the DT description as soon as a dedicated driver will be not available?

Can someone clarify me these points?

--
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] 4+ messages in thread

* Re: spidev instantiated from DT
  2016-12-11 12:03 spidev instantiated from DT Giuseppe Lippolis
@ 2016-12-12  9:14 ` Geert Uytterhoeven
  0 siblings, 0 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2016-12-12  9:14 UTC (permalink / raw)
  To: Giuseppe Lippolis; +Cc: linux-spi

Hi Giuseppe,

On Sun, Dec 11, 2016 at 1:03 PM, Giuseppe Lippolis
<giu.lippolis-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> in the spidev.c driver there is a check preventing to export the SPI
> subsystem to the userspace.
> The commit message state:
>
>         spi: spidev: Warn loudly if instantiated from DT as "spidev"
>
>     Since spidev is a detail of how Linux controls a device rather than a
>     description of the hardware in the system we should never have a node
>     described as "spidev" in DT, any SPI device could be a spidev so this
>     is just not a useful description.
>
>     In order to help prevent users from writing such device trees generate a
>     warning if spidev is instantiated as a DT node without an ID in the
> match
>     table.
>
>     Signed-off-by: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
>
> Currently in the spidec.c are registered two devices to use "legally" this
> driver:
>     { .compatible = "rohm,dh2228fv" },
>     { .compatible = "lineartechnology,ltc2488" },
>
> I cannot fully understand the rationale.
> I have a board mounting an spi device. Currently no dedicated driver for
> this devices exists.

But you can still describe the SPI device in DT, right?
Then you can add its compatible value to spidev.c now, until a dedicated
driver becomes available.

> So in my opinion, now, make sense to describe a device-tree with a "generic"
> driver, allowing the userspace to control the device. When at the end a
> dedicated driver will be available an update of the device tree will be
> possible.

Hmm... So you would change DT, which describes the hardware, while the actual
hardware hasn't changed?

Does that help to understand the rationale?

> In alternative, make sense to add a dedicated .compatible = "xxx,yyy"
> statements to attach the spidev driver to the specific device and allowing
> the DT description as soon as a dedicated driver will be not available?

Please add the dedicated compatible statement to spidev.c.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
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] 4+ messages in thread

* Re: spidev instantiated from DT
  2016-12-12 19:45 Giuseppe Lippolis
@ 2016-12-13  8:27 ` Geert Uytterhoeven
  0 siblings, 0 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2016-12-13  8:27 UTC (permalink / raw)
  To: Giuseppe Lippolis; +Cc: linux-spi

Hi Guiseppe,

On Mon, Dec 12, 2016 at 8:45 PM, Giuseppe Lippolis
<giu.lippolis-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> So the rationale is to keep fixed the HW description (that make sense).
> If a "generic" driver is required, the specific device compatible statement
> shall be added in spidev like:
>         { .compatible = "lineartechnology,ltc2488" },
>
> And if later a more specific driver will be available, the previous line
> shall be removed.
>
> Can you please confirm my understanding?

That's correct.

Of course we prefer having a specific driver ;-)

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
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] 4+ messages in thread

* Re: spidev instantiated from DT
@ 2016-12-12 19:45 Giuseppe Lippolis
  2016-12-13  8:27 ` Geert Uytterhoeven
  0 siblings, 1 reply; 4+ messages in thread
From: Giuseppe Lippolis @ 2016-12-12 19:45 UTC (permalink / raw)
  To: linux-spi-u79uwXL29TY76Z2rM5mHXA; +Cc: geert-Td1EMuHUCqxL1ZNQvxDV9g

Hi Geert,

Thanks for your clarification.

So the rationale is to keep fixed the HW description (that make sense).
If a "generic" driver is required, the specific device compatible statement
shall be added in spidev like:
	{ .compatible = "lineartechnology,ltc2488" },

And if later a more specific driver will be available, the previous line
shall be removed. 

Can you please confirm my understanding?

Bye.

--
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] 4+ messages in thread

end of thread, other threads:[~2016-12-13  8:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-11 12:03 spidev instantiated from DT Giuseppe Lippolis
2016-12-12  9:14 ` Geert Uytterhoeven
2016-12-12 19:45 Giuseppe Lippolis
2016-12-13  8:27 ` Geert Uytterhoeven

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).