I'm not an SPI expert, but if using GPIO chipselects then it appears the core SPI code handles
all the GPIO operations, not the individual SPI block driver. Hence it is correct that spi-bcm2835.c does no checking of SPI_NO_CS when using gpio chipselects.
It does appear that spi.c doesn't check SPI_NO_CS, so perhaps it is worth a quick hack in there to make it
Code: Select all
if (gpio_is_valid(spi->cs_gpio)) {
if (!(spi->mode & SPI_NO_CS))
gpio_set_value(spi->cs_gpio, !enable);
} else if (spi->master->set_cs) {
spi->master->set_cs(spi, !enable);
}
piras77 wrote:Since you encountered problems with the kernel driver, and there wasn't any answer, my suggestion was to try it the direct way. Honestly, I can't find a proper documentation on the kernel drivers (and not only for SPI).
Most of the kernel documentation is in the kernel tree -
https://github.com/raspberrypi/linux/tr ... tation/spi is a good place to start for SPI (other kernel versions are available as branches).
piras77 wrote:I neither know whether these drivers are developed by the RPF or by Broadcom (so where would we direct a question regarding these?). Most responses here in this forum come from users, not kernel developers AFAIK.
First port of call if you really think you have found a bug -
https://github.com/raspberrypi/linux/issues. That's the repo that the Pi specific Linux kernel comes from.
Secondly the copyright message at the
top of the source file tells you
Code: Select all
/*
* Driver for Broadcom BCM2835 SPI Controllers
*
* Copyright (C) 2012 Chris Boot
* Copyright (C) 2013 Stephen Warren
* Copyright (C) 2015 Martin Sperl
*
* This driver is inspired by:
* spi-ath79.c, Copyright (C) 2009-2011 Gabor Juhos <juhosg@openwrt.org>
* spi-atmel.c, Copyright (C) 2006 Atmel Corporation
*
No company attribution should tell you not supplied by Broadcom or RPF.
And thirdly with ANY Linux kernel driver, there will be a maintainer and mailing list listed for it in
MAINTAINERS. There is a useful little script in the kernel tree called get_maintainers.pl (in the scripts folder) that will do just that:
Code: Select all
me@my-PC:~/linux$ ./scripts/get_maintainer.pl drivers/spi/spi-bcm2835.c
Mark Brown <broonie@kernel.org> (maintainer:SPI SUBSYSTEM)
Eric Anholt <eric@anholt.net> (maintainer:BROADCOM BCM2835 ARM ARCHITECTURE)
Stefan Wahren <stefan.wahren@i2se.com> (maintainer:BROADCOM BCM2835 ARM ARCHITECTURE)
Florian Fainelli <f.fainelli@gmail.com> (maintainer:BROADCOM BCM281XX/BCM11XXX/BCM216XX ARM ARCHITE...)
Ray Jui <rjui@broadcom.com> (maintainer:BROADCOM BCM281XX/BCM11XXX/BCM216XX ARM ARCHITE...)
Scott Branden <sbranden@broadcom.com> (maintainer:BROADCOM BCM281XX/BCM11XXX/BCM216XX ARM ARCHITE...)
bcm-kernel-feedback-list@broadcom.com (maintainer:BROADCOM BCM281XX/BCM11XXX/BCM216XX ARM ARCHITE...)
linux-spi@vger.kernel.org (open list:SPI SUBSYSTEM)
linux-rpi-kernel@lists.infradead.org (moderated list:BROADCOM BCM2835 ARM ARCHITECTURE)
linux-arm-kernel@lists.infradead.org (moderated list:BROADCOM BCM2835 ARM ARCHITECTURE)
linux-kernel@vger.kernel.org (open list)
Look at the most specific lists first, so
linux-rpi-kernel@lists.infradead.org would be your next port of call if you think it is spi-bcm2835.c related, and
linux-spi@vger.kernel.org if you thought it was spi.c (the core framework). A search of the list archives first would be sensible.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.