With the new device tree on my Raspberry Pi 3B+, the i2c baudrate gets set in the /boot/config.txt. Is it possible to set this on the fly instead? I have a device (DAC8574) that needs some initial setup communication at 400 K baudrate first before it can switch to the 3.4 M baudrate.
This is what I have in /boot/config.txt
As a test, I tried to rmmod the i2c_bcm2835 and then reload with the following.
sudo rmmod i2c_bcm2835 sudo modprobe i2c_bcm2835 i2c_arm_baudrate=100000
But no luck, the speed remains at 400 K. I'm using the i2c-dev (SMBUS) tools with a C executable. Ideally, I'd like to be able to change the speed within the C program/executable. I could not find anything in the smbus docs about changing speeds. But maybe there is another way.