i2c spi buses: enforce drivers to set default SPI/I2C bus frequency

Not a lot of drivers use the global default, which is somewhat arbitrary.
This commit is contained in:
Beat Küng
2020-03-17 23:31:17 -04:00
committed by Daniel Agar
parent 8ebde51648
commit d6bb5b3b9e
13 changed files with 60 additions and 2 deletions
@@ -117,10 +117,12 @@ public:
void *custom_data{nullptr}; ///< driver-specific custom argument
// driver defaults, if not specified via CLI
int default_spi_frequency{20 * 1000 * 1000}; ///< default spi bus frequency [Hz]
int default_i2c_frequency{400 * 1000}; ///< default i2c bus frequency [Hz]
int default_spi_frequency{-1}; ///< default spi bus frequency (driver needs to set this) [Hz]
int default_i2c_frequency{-1}; ///< default i2c bus frequency (driver needs to set this) [Hz]
private:
bool validateConfiguration();
char _options[32] {};
int _optind{1};
const char *_optarg{nullptr};