linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Frieder Schrempf <frieder.schrempf@kontron.de>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Mark Brown <broonie@kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-spi <linux-spi@vger.kernel.org>
Subject: Re: [PATCH] spi: spidev: Add compatible for external SPI ports on Kontron boards
Date: Thu, 2 Jul 2020 18:04:05 +0200	[thread overview]
Message-ID: <992ccb30-3f82-4649-acc4-442cb2568eea@kontron.de> (raw)
In-Reply-To: <CAMuHMdUkHxOqqX95R5BEET-aSF5SYw2zufnxWuqmKnSY0NENcQ@mail.gmail.com>

Hi Geert,

On 02.07.20 16:57, Geert Uytterhoeven wrote:
> Hi Frieder,
> 
> On Thu, Jul 2, 2020 at 4:46 PM Frieder Schrempf
> <frieder.schrempf@kontron.de> wrote:
>> On 02.07.20 16:25, Mark Brown wrote:
>>> On Thu, Jul 02, 2020 at 04:18:46PM +0200, Schrempf Frieder wrote:
>>>> From: Frieder Schrempf <frieder.schrempf@kontron.de>
>>>>
>>>> Allow external SPI ports on Kontron boards to use the spidev driver.
>>>
>>> I'd have expected this to require loading a DT overlay for whatever's
>>> attached?
>>
>> My intention is to use the spidev driver in the default board DT for an
>> interface that is routed to an extension connector and has no dedicated
>> slave device attached onboard. So users can attach sensors, etc. with
>> userspace drivers without touching the kernel or DT.
>>
>> See https://eur04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatchwork.kernel.org%2Fpatch%2F11639075%2F&amp;data=02%7C01%7Cfrieder.schrempf%40kontron.de%7C5ca9f0ba0ccb4ab0329f08d81e983d4e%7C8c9d3c973fd941c8a2b1646f3942daf1%7C0%7C0%7C637292987071583819&amp;sdata=M8y9HYICQLocSgRmak6uYsx9Y%2FoukaqgmK2D0F%2FTV98%3D&amp;reserved=0 for the boards DT.
> 
> You can bind "kontron,user-spi" devices to spidev from userspace:
> [PATCH v2 0/3] device tree spidev solution - driver_override for SPI
> https://eur04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fspinics.net%2Flists%2Flinux-spi%2Fmsg13951.html&amp;data=02%7C01%7Cfrieder.schrempf%40kontron.de%7C5ca9f0ba0ccb4ab0329f08d81e983d4e%7C8c9d3c973fd941c8a2b1646f3942daf1%7C0%7C0%7C637292987071583819&amp;sdata=D9pum1oTXWSt%2BY8Egb1J4DOgSa5KH3RwxsSmUl7LgUk%3D&amp;reserved=0

Thanks for pointing that out. I didn't know that this is possible.
I just tried like below it and it works like a charm:

 > echo "spidev" > 
/sys/devices/platform/soc@0/30800000.bus/30840000.spi/spi_master/spi2/spi2.0/driver_override
 > echo "spi2.0" > /sys/bus/spi/drivers/spidev/bind

Thanks,
Frieder

  reply	other threads:[~2020-07-02 16:04 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-02 14:18 [PATCH] spi: spidev: Add compatible for external SPI ports on Kontron boards Schrempf Frieder
2020-07-02 14:25 ` Mark Brown
2020-07-02 14:46   ` Frieder Schrempf
2020-07-02 14:57     ` Geert Uytterhoeven
2020-07-02 16:04       ` Frieder Schrempf [this message]
2020-07-02 15:07     ` Mark Brown
2020-07-02 16:24       ` Frieder Schrempf
2020-07-13 13:19         ` Frieder Schrempf
2020-07-13 15:11           ` Mark Brown
2020-07-14  8:54             ` Frieder Schrempf
2020-07-14 19:29               ` Mark Brown
2020-07-15  7:26                 ` Frieder Schrempf
2020-07-15 11:36                   ` Mark Brown
2020-07-15 11:45                     ` Frieder Schrempf
2020-07-15 13:10                       ` Mark Brown
2020-07-15 13:48                         ` Frieder Schrempf
2020-07-15 13:51                           ` Mark Brown
2020-07-15 19:06             ` Geert Uytterhoeven
2020-07-16  7:53               ` Frieder Schrempf

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=992ccb30-3f82-4649-acc4-442cb2568eea@kontron.de \
    --to=frieder.schrempf@kontron.de \
    --cc=broonie@kernel.org \
    --cc=geert@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.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).