I have a board with i2c device(accelerometer) connected to mcu. I inserted the device node to my device tree file and everything works fine - device is detected, i can read measurements etc.

However, in order to save energy i don't want to have this accelerometer active all the time and I have a switch controlled with gpio on board that cuts the power from the device when it is not needed. I want to start board with accelerometer turned off and turn it on later and then make driver to probe it somehow.

Is it possible to write something like this in dts file?

  • It should be possible to set the GPIO state on boot.The rest of it... Make a script that sets GPIO on, and mod probe the driver. Determine a trigger to run the script... – jc__ May 29 '18 at 13:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.