From: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
To: Martin Sperl <kernel-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
Cc: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Lee Jones <lee-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-rpi-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH] spi: bcm2835: transform native-cs to gpio-cs on first spi_setup
Date: Tue, 07 Apr 2015 09:43:36 -0600 [thread overview]
Message-ID: <5523FB28.5050202@wwwdotorg.org> (raw)
In-Reply-To: <A080E422-054D-401A-9302-389487FA8042-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
On 04/06/2015 11:45 PM, Martin Sperl wrote:
>
>> On 07.04.2015, at 05:01, Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org> wrote:
>> I believe the bcm283x have 2 types of SPI controller. There is 1
>> instance of the HW that this driver controls (SPI0), and that has CS0,
>> CS1. There are two instances of a different SPI HW block (SPI1, SPI2),
>> and those each have CS0, CS1, CS2. At least, that's my interpretation of
>> the table that shows the pinctrl module's per-pin alternate function values.
>
> Yes and no - SPI1 and SPI2 are a totally different beasts as these are
> "auxiliar devices" that have 2x2 word fifos, no DMA and minimal interrupt
> support and use a distinct register layout compared to SPI0.
> See BCM2835 Arm Peripherials page 20-27 for details.
>
> Essentially these are intended to get used for low speed devices or devices
> that run short transfers (<4-8 bytes)
>
> So these devices would need a totally separate SPI driver, which this driver
> does not and can not handle...
That's exactly what I said.
>> Should that be an error? Not being able to find the gpiochip implies the
>> code can't manipulate the CS lines at all, I think?
>
> Will add an dev_warn_once and contine without optimizations - the code
> still does check for the cs_gpio, so we would run without it?
> It could just be a rename of the pinctrl driver that would trigger this.
>
> You want it as an error?
If the rest of the driver is expected to always check whether
spi->cs_gpio is valid or not, and support the gpio-is-not-valid case, I
guess it's OK for that case *not* to error out.
I think we should at least warn to indicate that something unexpected
happened.
Shouldn't spi->cs_gpio be set to e.g. -1 if the pinctrl device can't be
found, so that the rest of the driver does know that the GPIO is invalid?
--
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:[~2015-04-07 15:43 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-06 17:16 [PATCH] spi: bcm2835: transform native-cs to gpio-cs on first spi_setup kernel-TqfNSX0MhmxHKSADF0wUEw
[not found] ` <1428340592-3196-2-git-send-email-kernel-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2015-04-06 17:29 ` Mark Brown
[not found] ` <20150406172913.GW6023-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2015-04-06 17:35 ` Martin Sperl
[not found] ` <12F93D4D-EDCB-4F48-B42B-049ECAD7F5E8-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2015-04-06 17:45 ` Mark Brown
[not found] ` <20150406174552.GY6023-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2015-04-06 17:58 ` Martin Sperl
[not found] ` <F4571783-619C-4664-B14F-207E2D3F60C3-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2015-04-06 18:10 ` Mark Brown
[not found] ` <20150406181033.GB6023-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2015-04-07 12:15 ` Martin Sperl
2015-04-07 3:04 ` Stephen Warren
2015-04-07 3:01 ` Stephen Warren
[not found] ` <5523487B.70501-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2015-04-07 5:45 ` Martin Sperl
[not found] ` <A080E422-054D-401A-9302-389487FA8042-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2015-04-07 15:43 ` Stephen Warren [this message]
2015-04-10 18:49 ` Mark Brown
2015-04-10 18:51 ` 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=5523FB28.5050202@wwwdotorg.org \
--to=swarren-3lzwwm7+weoh9zmkesr00q@public.gmane.org \
--cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=kernel-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org \
--cc=lee-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=linux-rpi-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.