drivers: pwm: gecko: fix access to timer register

The timer registers are accessible via the device config field, driver
code was wrong in one case (pwm is the variable indicating PWM channel).

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
Gerard Marull-Paretas 2022-04-04 16:56:04 +02:00 committed by Carles Cufí
commit 6f39b08343

View file

@ -37,7 +37,7 @@ static int pwm_gecko_pin_set(const struct device *dev, uint32_t pwm,
BUS_RegMaskedWrite(&cfg->timer->ROUTE,
_TIMER_ROUTE_LOCATION_MASK,
cfg->location << _TIMER_ROUTE_LOCATION_SHIFT);
BUS_RegMaskedSet(&pwm->timer->ROUTE, 1 << pwm);
BUS_RegMaskedSet(&cfg->timer->ROUTE, 1 << pwm);
#elif defined(_TIMER_ROUTELOC0_MASK)
BUS_RegMaskedWrite(&cfg->timer->ROUTELOC0,
_TIMER_ROUTELOC0_CC0LOC_MASK << (pwm * _TIMER_ROUTELOC0_CC1LOC_SHIFT),