SPI_IOC_WR_MAX_SPEED_HZ was overwitten?

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

 



Hi

Is it possible that the ioctl SPI_IOC_WR_MODE call can overwrite the previous ioctl SPI_IOC_WR_MAX_SPEED_HZ speed setting?

When  we call ioctl(fd, SPI_IOC_WR_MAX_SPEED_HZ, &speed_hz) and then ioctl(fd, SPI_IOC_WR_MODE, &mode) the spi speed is taken from dts.

The spi_dev shows:
[ 4184.702224] spidev spi0.0: setup mode 0, 8 bits/w, 1000000 Hz max --> 0     SPI_IOC_WR_MAX_SPEED_HZ call, set 1MHz
[ 4184.702252] spidev spi0.0: setup mode 3, 8 bits/w, 20000000 Hz max --> 0    SPI_IOC_WR_MODE call set mode 3 but use the default speed from devicetree

And now the spi speed is wrong and cannot be used.

When we change the order to:
ioctl(fd, SPI_IOC_WR_MODE, &mode) and then
ioctl(fd, SPI_IOC_WR_MAX_SPEED_HZ, &speed_hz)

The spi_dev shows:
[10711.100375] spidev spi0.0: setup mode 3, 8 bits/w, 20000000 Hz max --> 0  SPI_IOC_WR_MODE call set mode 3
[10711.100400] spidev spi0.0: setup mode 3, 8 bits/w, 1000000 Hz max --> 0    SPI_IOC_WR_MAX_SPEED_HZ call, set 1MHz

And now the spi speed is right and can be used.

We need to program the Spansion flash chip "S25FL064A/P" with the spi interface from the QoriQ LS1021a.
The linux version is: 4.4.26.

I hope we can clarify this.

Thanks,
Alexander
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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