[BUG] vf610-zii-dev-rev-b SPI fails at boot

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



While booting 4.20 on the ZII development revision B board, I notice 
this in the kernel logs:

spi spi0.1: setup: unsupported mode bits 4
spi_gpio spi0: can't setup spi0.1, status -22
spi_master spi0: spi_device register error /spi0/at93c46d@1
spi_master spi0: Failed to create SPI device for /spi0/at93c46d@1

This is for the at93c46d@1 device attached to spi-gpio (see
arch/arm/boot/dts/vf610-zii-dev-rev-b.dts around line 330).  This
is declared with "spi-cs-high;" in DT.  It appears to be complaining
about the SPI_CS_HIGH flag.

It appears this warning comes from drivers/spi/spi.c around lines
2828-2847 due to:

	bad_bits = spi->mode & ~(spi->controller->mode_bits | SPI_CS_WORD);

and it looks like spi-gpio sets:

	master->mode_bits = SPI_3WIRE | SPI_CPHA | SPI_CPOL;

but then goes on to set:

	spi_gpio->bitbang.flags = SPI_CS_HIGH;

However, this is ignored by bitbang if master->mode_bits has already
been set:

	if (!master->mode_bits)
		master->mode_bits = SPI_CPOL | SPI_CPHA | bitbang->flags;

It looks like this commit introduced for v4.19 broke the driver:

commit 4b859db2c60692560afbfef1b030d0ddef57b7ee
Author: Lorenzo Bianconi <lorenzo.bianconi@xxxxxxxxxx>
Date:   Sat Jul 28 10:19:14 2018 +0200

by setting master->mode_bits - prior to this, bitbang would have set
the mode bits itself.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up
According to speedtest.net: 11.9Mbps down 500kbps up



[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux