linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org>
To: Martin Sperl <kernel-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
Cc: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	linux-spi <linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH] spi: spidev: Warn loudly if instantiated from DT as "spidev"
Date: Thu, 23 Apr 2015 09:42:02 +0200	[thread overview]
Message-ID: <CAMuHMdUv0z=VOec+JbbRBeM9fg2TvQgRX4GefVbOZDoQoOECQQ@mail.gmail.com> (raw)
In-Reply-To: <7C2BEBF5-5169-4804-A7B8-DBCE2E9E8C70-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>

On Thu, Apr 23, 2015 at 9:21 AM, Martin Sperl <kernel-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org> wrote:
>> On 28.03.2015, at 00:42, Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> wrote:
>>
>> 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>
>
> So what is now the “correct way” to create a spidev device via the
> device-tree?

Add the compatible value for your device to the spidev_dt_ids[] array in
drivers/spi/spidev.c.

> Note that on a raspberry pi the 2 SPI devices are by default configured
> as spidev and only overlays would change the settings to a different
> alias. So this change will impact that default immediately.
>
> Thus I wonder if it is wise to produce potential “support issues" for
> distributions triggered by this patch.

So what you need is a way to handover from generic spidev to a device-specific
driver, cfr. what graphics drivers do when the device has been bound to by
vesafb or simplefb.

Could this be implemented in a generic way in the spi or DT code?

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.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

  parent reply	other threads:[~2015-04-23  7:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-27 23:42 [PATCH] spi: spidev: Warn loudly if instantiated from DT as "spidev" Mark Brown
     [not found] ` <1427499742-26916-1-git-send-email-broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2015-04-23  7:21   ` Martin Sperl
     [not found]     ` <7C2BEBF5-5169-4804-A7B8-DBCE2E9E8C70-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2015-04-23  7:42       ` Geert Uytterhoeven [this message]
     [not found]         ` <CAMuHMdUv0z=VOec+JbbRBeM9fg2TvQgRX4GefVbOZDoQoOECQQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-04-23  7:45           ` Geert Uytterhoeven
     [not found]             ` <CAMuHMdW5hgB7vFmMc6TRqJ2wwWZ0=S+OKdQQoucXakoSnVixtw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-04-23 10:36               ` Mark Brown
     [not found]                 ` <20150423103652.GT22845-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2015-04-23 13:21                   ` Martin Sperl
     [not found]                     ` <5538F1D6.7020503-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2015-04-23 13:36                       ` Mark Brown
     [not found]                         ` <5538F95A.20203@martin.sperl.org>
     [not found]                           ` <20150423181317.GZ22845@sirena.org.uk>
     [not found]                             ` <20150423181317.GZ22845-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2015-04-23 19:23                               ` Martin Sperl
     [not found]                             ` <81BCB930-E90B-4978-9593-7997B64F65CE@martin.sperl.org>
     [not found]                               ` <81BCB930-E90B-4978-9593-7997B64F65CE-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2015-04-23 19:32                                 ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMuHMdUv0z=VOec+JbbRBeM9fg2TvQgRX4GefVbOZDoQoOECQQ@mail.gmail.com' \
    --to=geert-td1emuhucqxl1znqvxdv9g@public.gmane.org \
    --cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=kernel-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org \
    --cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).