From: Ralph Siemsen <ralph.siemsen@linaro.org>
To: Javier Martinez Canillas <javierm@redhat.com>
Cc: linux-kernel@vger.kernel.org, "Mark Brown" <broonie@kernel.org>,
"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
"Geert Uytterhoeven" <geert@linux-m68k.org>,
linux-spi@vger.kernel.org
Subject: Re: [PATCH] spi: docs: improve the SPI userspace API documentation
Date: Fri, 19 Nov 2021 11:03:25 -0500 [thread overview]
Message-ID: <20211119160325.GA1591448@maple.netwinder.org> (raw)
In-Reply-To: <20211118213143.2345041-1-javierm@redhat.com>
Hi Javier,
On Thu, Nov 18, 2021 at 10:31:43PM +0100, Javier Martinez Canillas
wrote:
>This doc is fairly outdated and only uses legacy device instantiation
>terminology. Let us update it and also mention the OF and ACPI device
>tables, to make easier for users to figure out how should be defined.
Thanks for putting this together! Overall it is a definite improvement.
>+NOTE: it used to be supported to define an SPI device using the "spidev"
>+ name. For example as .modalias = "spidev" or compatible = "spidev".
>+ But this is no longer supported by the Linux kernel and instead a
>+ real SPI device name as listed in one of the tables should be used.
This note is factually correct, but it might be a little too terse for
folks who are not full-time kernel developers. I'd suggest making it a
bit more prescriptive. As well, the focus can probably be on the case of
device tree, since that is the one that generates the warning (and with
your patch, causes the driver to fail to load).
I've struggled to put it into the right words, so the following is just
an idea. I've intentionally included the exact wording of the warn/err
to improve google-ability. As well, it is interesting to do a google
search for the message, and see what kinds of advice is offered. A few
that came up for me include:
https://community.nxp.com/t5/i-MX-Processors/spidev-spidev-listed-directly-in-DT/m-p/426381/highlight/true#M64609
https://yurovsky.github.io/2016/10/07/spidev-linux-devices.html
Anyhow, here is a possible addition to the NOTE in your patch.
spidev listed directly in DT is not supported
=============================================
Spidev devices are typically declared in the device tree, see
Documentation/devicetree/bindings/spi/spi-controller.yaml
spi@0 {
compatible = "vendor,device";
reg = <0>;
spi-max-frequency = <10000000>;
}
In the past, it was common to use compatible = "spidev" rather than
a more descriptive and device-specific name. For some time this has
been deprecated, and as of kernel version X.Y it is no longer allowed.
The preferred way to fix this is to use a device-specific name. This
means picking a name, usually in the format "vendor,device". This name
must then be specified in:
- the device tree for your board (instead of compatible = "spidev")
- the spidev_dt_ids[] table in drivers/spi/spidev.c
Regards,
Ralph
next prev parent reply other threads:[~2021-11-19 16:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-18 21:31 [PATCH] spi: docs: improve the SPI userspace API documentation Javier Martinez Canillas
2021-11-19 7:45 ` Uwe Kleine-König
2021-11-19 8:14 ` Javier Martinez Canillas
2021-11-19 8:10 ` Geert Uytterhoeven
2021-11-19 8:16 ` Javier Martinez Canillas
2021-11-19 16:03 ` Ralph Siemsen [this message]
2021-11-19 18:01 ` Javier Martinez Canillas
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=20211119160325.GA1591448@maple.netwinder.org \
--to=ralph.siemsen@linaro.org \
--cc=broonie@kernel.org \
--cc=geert@linux-m68k.org \
--cc=javierm@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=u.kleine-koenig@pengutronix.de \
/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).