Introduce generic "outputs" DTS binding

Replaces previous "switch" and "pwm-out" bindings and allows to reference
either gpio or pwm handle and specify maximum current.

Also replacing CONFIG_HAS_LOAD and CONFIG_HAS_USB_PWR with DT_ variants.
This commit is contained in:
Martin Jäger
2020-05-06 12:53:26 +02:00
parent 90c1e7fcf5
commit ce7f63b888
29 changed files with 142 additions and 160 deletions
+4 -4
View File
@@ -185,10 +185,10 @@ static void adc_init(ADC_TypeDef *adc)
static void adc_setup()
{
#ifdef DT_SWITCH_V_SOLAR_GPIOS_CONTROLLER
struct device *dev = device_get_binding(DT_SWITCH_V_SOLAR_GPIOS_CONTROLLER);
gpio_pin_configure(dev, DT_SWITCH_V_SOLAR_GPIOS_PIN,
DT_SWITCH_V_SOLAR_GPIOS_FLAGS | GPIO_OUTPUT_ACTIVE);
#ifdef DT_OUTPUTS_V_SOLAR_PRESENT
struct device *dev = device_get_binding(DT_OUTPUTS_V_SOLAR_GPIOS_CONTROLLER);
gpio_pin_configure(dev, DT_OUTPUTS_V_SOLAR_GPIOS_PIN,
DT_OUTPUTS_V_SOLAR_GPIOS_FLAGS | GPIO_OUTPUT_ACTIVE);
#endif
adc_init(ADC1);