I’m attempting to interface an ADIS16448 IMU with a TX2. The maximum SPI rate of the IMU is 2MHz. However, the default SPI clock rate of the TX2 is 50 MHz. Therefore, I need to decrease the TX2 SPI clock rate to <2MHz.
SPI is fully operational on my TX2- the spidev loopback test completes successfully. Setting the clock rate via…
ret = ioctl(fd, SPI_IOC_WR_MAX_SPEED_HZ, &speed);
…returns successfully but the clock rate is unchanged. An oscilloscope attached to the SPI_CLK pin (pin 23) on the J21 header was used to verify this clock rate.
I added kernel print statements to both the spi-tegra114 driver and the clk_set_rate() function located in kernel/drivers/clk/clk.c. All of these functions involved in setting spi clock rate seem to be called correctly and return without error.
I would greatly appreciate if someone could shed some light on what I’m doing wrong here. Has anyone successfully changed the SPI clock rate?