From: Kyle Roeschley <kyle.roeschley-acOepvfBmUk@public.gmane.org>
To: Geert Uytterhoeven <geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org>
Cc: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
linux-spi <linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: spidev: Instantiating from DT as "spidev"
Date: Wed, 29 Nov 2017 13:24:08 -0600 [thread overview]
Message-ID: <20171129192407.vrkphuhttmzl2ii4@senary> (raw)
In-Reply-To: <CAMuHMdUps9Ti=CRZM7UxrHLD8GA+FKD+_RFLW3H9wUpSRTYs8w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On Wed, Nov 29, 2017 at 05:32:55PM +0100, Geert Uytterhoeven wrote:
>
> Implement something in sysfs like "new_device" for i2c, or "slave" for SPI.
> Then people can add a new device (e.g. "spidev") by writing to that
> virtual file.
That makes sense to me. However, the i2c "new_device" and SPI "slave" nodes are
simpler in that they only require the device name (and address for i2c). A SPI
device can have many properties specified in the device tree that we would
somehow need to get and parse. Two options I see would be:
1. Set device status to disabled in the DT and add the device when the name is
written to the new_device sysfs node. But then, this is basically the same
as just specifying "spidev" in the DT (minus the printks). I suppose we
could also drop the compatible entry and require the user to specify a
driver when writing to new_device.
2. Pass all parameters into the "new_device" node, e.g. by passing in and
applying a DT overlay or snippet.
In my specific case [1], the device tree entires are simple, but I wouldn't
expect that for everyone. I've hacked up the first option and it works, but it
doesn't seem terribly useful. I noticed that you've been working with DT
overlays recently; what do you think of the second option?
[1] https://github.com/ni/linux/blob/nilrt/17.0/4.6/arch/arm/boot/dts/ni-76F2.dts#L108
--
Kyle Roeschley
Software Engineer
National Instruments
--
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
next prev parent reply other threads:[~2017-11-29 19:24 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-29 15:04 spidev: Instantiating from DT as "spidev" Kyle Roeschley
2017-11-29 16:32 ` Geert Uytterhoeven
[not found] ` <CAMuHMdUps9Ti=CRZM7UxrHLD8GA+FKD+_RFLW3H9wUpSRTYs8w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-11-29 19:24 ` Kyle Roeschley [this message]
2017-11-29 22:18 ` Geert Uytterhoeven
[not found] ` <CAMuHMdX62=vC6=P-v=SPe_hq0F12tOZCgePaS7=MZZg_4PkvUw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-11-30 2:07 ` Trent Piepho
[not found] ` <1512007657.9792.45.camel-cgc2CodaaHDQT0dZR+AlfA@public.gmane.org>
2017-11-30 8:03 ` Geert Uytterhoeven
[not found] ` <CAMuHMdXv2WsGCUBD4Td9K1zOfZ9DOfeW5rYtCyq27Ucp21xGRA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-11-30 22:24 ` Kyle Roeschley
2017-12-12 18:44 ` Kyle Roeschley
2017-11-29 20:22 ` Trent Piepho
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=20171129192407.vrkphuhttmzl2ii4@senary \
--to=kyle.roeschley-acoepvfbmuk@public.gmane.org \
--cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=geert-Td1EMuHUCqxL1ZNQvxDV9g@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).