if (plat->pins[pin].capabilites.pwm != 1)
return NULL;
- /** quirk in rev d, this messes with pwm on that pin
- * if (plat->pins[pin].capabilites.gpio == 1) {
- * maa_gpio_context* mux_i;
- * mux_i = maa_gpio_init_raw(plat->pins[pin].gpio.pinmap);
- * if (mux_i == NULL)
- * return NULL;
- * if (maa_gpio_dir(mux_i, MAA_GPIO_OUT) != MAA_SUCCESS)
- * return NULL;
- * if (maa_gpio_write(mux_i, 0) != MAA_SUCCESS)
- * return NULL;
- * if (maa_gpio_close(mux_i) != MAA_SUCCESS)
- * return NULL;
- * }
- */
+ if (plat->pins[pin].capabilites.gpio == 1) {
+ maa_gpio_context* mux_i;
+ mux_i = maa_gpio_init_raw(plat->pins[pin].gpio.pinmap);
+ if (mux_i == NULL)
+ return NULL;
+ if (maa_gpio_dir(mux_i, MAA_GPIO_OUT) != MAA_SUCCESS)
+ return NULL;
+ // Current REV D quirk. //TODO GEN 2
+ if (maa_gpio_write(mux_i, 1) != MAA_SUCCESS)
+ return NULL;
+ if (maa_gpio_close(mux_i) != MAA_SUCCESS)
+ return NULL;
+ }
+
if (plat->pins[pin].pwm.mux_total > 0)
if (maa_setup_mux_mapped(plat->pins[pin].pwm) != MAA_SUCCESS)
return NULL;