Lines Matching refs:cmr

45 	u32 cmr;  member
88 unsigned cmr; in atmel_tcb_pwm_request() local
107 regmap_read(tcbpwmc->regmap, ATMEL_TC_REG(tcbpwmc->channel, CMR), &cmr); in atmel_tcb_pwm_request()
112 if (cmr & ATMEL_TC_WAVE) { in atmel_tcb_pwm_request()
122 tcbpwm->div = cmr & ATMEL_TC_TCCLKS; in atmel_tcb_pwm_request()
125 cmr &= (ATMEL_TC_TCCLKS | ATMEL_TC_ACMR_MASK | in atmel_tcb_pwm_request()
128 cmr = 0; in atmel_tcb_pwm_request()
130 cmr |= ATMEL_TC_WAVE | ATMEL_TC_WAVESEL_UP_AUTO | ATMEL_TC_EEVT_XC0; in atmel_tcb_pwm_request()
131 regmap_write(tcbpwmc->regmap, ATMEL_TC_REG(tcbpwmc->channel, CMR), cmr); in atmel_tcb_pwm_request()
153 unsigned cmr; in atmel_tcb_pwm_disable() local
168 regmap_read(tcbpwmc->regmap, ATMEL_TC_REG(tcbpwmc->channel, CMR), &cmr); in atmel_tcb_pwm_disable()
172 cmr &= ~ATMEL_TC_ACMR_MASK; in atmel_tcb_pwm_disable()
174 cmr |= ATMEL_TC_ASWTRG_CLEAR; in atmel_tcb_pwm_disable()
176 cmr |= ATMEL_TC_ASWTRG_SET; in atmel_tcb_pwm_disable()
178 cmr &= ~ATMEL_TC_BCMR_MASK; in atmel_tcb_pwm_disable()
180 cmr |= ATMEL_TC_BSWTRG_CLEAR; in atmel_tcb_pwm_disable()
182 cmr |= ATMEL_TC_BSWTRG_SET; in atmel_tcb_pwm_disable()
185 regmap_write(tcbpwmc->regmap, ATMEL_TC_REG(tcbpwmc->channel, CMR), cmr); in atmel_tcb_pwm_disable()
191 if (!(cmr & (ATMEL_TC_ACPC | ATMEL_TC_BCPC))) { in atmel_tcb_pwm_disable()
210 u32 cmr; in atmel_tcb_pwm_enable() local
225 regmap_read(tcbpwmc->regmap, ATMEL_TC_REG(tcbpwmc->channel, CMR), &cmr); in atmel_tcb_pwm_enable()
228 cmr &= ~ATMEL_TC_TCCLKS; in atmel_tcb_pwm_enable()
231 cmr &= ~ATMEL_TC_ACMR_MASK; in atmel_tcb_pwm_enable()
235 cmr |= ATMEL_TC_ASWTRG_CLEAR; in atmel_tcb_pwm_enable()
237 cmr |= ATMEL_TC_ASWTRG_SET; in atmel_tcb_pwm_enable()
239 cmr &= ~ATMEL_TC_BCMR_MASK; in atmel_tcb_pwm_enable()
241 cmr |= ATMEL_TC_BSWTRG_CLEAR; in atmel_tcb_pwm_enable()
243 cmr |= ATMEL_TC_BSWTRG_SET; in atmel_tcb_pwm_enable()
255 cmr |= ATMEL_TC_ACPA_SET | ATMEL_TC_ACPC_CLEAR; in atmel_tcb_pwm_enable()
257 cmr |= ATMEL_TC_ACPA_CLEAR | ATMEL_TC_ACPC_SET; in atmel_tcb_pwm_enable()
260 cmr |= ATMEL_TC_BCPB_SET | ATMEL_TC_BCPC_CLEAR; in atmel_tcb_pwm_enable()
262 cmr |= ATMEL_TC_BCPB_CLEAR | ATMEL_TC_BCPC_SET; in atmel_tcb_pwm_enable()
266 cmr |= (tcbpwm->div & ATMEL_TC_TCCLKS); in atmel_tcb_pwm_enable()
268 regmap_write(tcbpwmc->regmap, ATMEL_TC_REG(tcbpwmc->channel, CMR), cmr); in atmel_tcb_pwm_enable()
529 regmap_read(tcbpwm->regmap, ATMEL_TC_REG(channel, CMR), &chan->cmr); in atmel_tcb_pwm_suspend()
543 regmap_write(tcbpwm->regmap, ATMEL_TC_REG(channel, CMR), chan->cmr); in atmel_tcb_pwm_resume()