Lines Matching refs:mask
100 void (*mux_A_periph)(struct at91_port *pio, u32 mask);
101 void (*mux_B_periph)(struct at91_port *pio, u32 mask);
102 void (*mux_C_periph)(struct at91_port *pio, u32 mask);
103 void (*mux_D_periph)(struct at91_port *pio, u32 mask);
104 void (*set_deglitch)(struct at91_port *pio, u32 mask, bool is_on);
105 void (*set_debounce)(struct at91_port *pio, u32 mask, bool is_on,
107 void (*set_pulldown)(struct at91_port *pio, u32 mask, bool is_on);
108 void (*disable_schmitt_trig)(struct at91_port *pio, u32 mask);
122 static void at91_mux_disable_interrupt(struct at91_port *pio, u32 mask) in at91_mux_disable_interrupt() argument
124 writel(mask, &pio->idr); in at91_mux_disable_interrupt()
127 static void at91_mux_set_pullup(struct at91_port *pio, u32 mask, bool on) in at91_mux_set_pullup() argument
130 writel(mask, &pio->mux.pio3.ppddr); in at91_mux_set_pullup()
132 writel(mask, (on ? &pio->puer : &pio->pudr)); in at91_mux_set_pullup()
135 static void at91_mux_set_output(struct at91_port *pio, unsigned mask, in at91_mux_set_output() argument
138 writel(mask, (val ? &pio->sodr : &pio->codr)); in at91_mux_set_output()
139 writel(mask, (is_on ? &pio->oer : &pio->odr)); in at91_mux_set_output()
142 static void at91_mux_set_multidrive(struct at91_port *pio, u32 mask, bool on) in at91_mux_set_multidrive() argument
144 writel(mask, (on ? &pio->mder : &pio->mddr)); in at91_mux_set_multidrive()
147 static void at91_mux_set_A_periph(struct at91_port *pio, u32 mask) in at91_mux_set_A_periph() argument
149 writel(mask, &pio->mux.pio2.asr); in at91_mux_set_A_periph()
152 static void at91_mux_set_B_periph(struct at91_port *pio, u32 mask) in at91_mux_set_B_periph() argument
154 writel(mask, &pio->mux.pio2.bsr); in at91_mux_set_B_periph()
157 static void at91_mux_pio3_set_A_periph(struct at91_port *pio, u32 mask) in at91_mux_pio3_set_A_periph() argument
159 writel(readl(&pio->mux.pio3.abcdsr1) & ~mask, &pio->mux.pio3.abcdsr1); in at91_mux_pio3_set_A_periph()
160 writel(readl(&pio->mux.pio3.abcdsr2) & ~mask, &pio->mux.pio3.abcdsr2); in at91_mux_pio3_set_A_periph()
163 static void at91_mux_pio3_set_B_periph(struct at91_port *pio, u32 mask) in at91_mux_pio3_set_B_periph() argument
165 writel(readl(&pio->mux.pio3.abcdsr1) | mask, &pio->mux.pio3.abcdsr1); in at91_mux_pio3_set_B_periph()
166 writel(readl(&pio->mux.pio3.abcdsr2) & ~mask, &pio->mux.pio3.abcdsr2); in at91_mux_pio3_set_B_periph()
169 static void at91_mux_pio3_set_C_periph(struct at91_port *pio, u32 mask) in at91_mux_pio3_set_C_periph() argument
171 writel(readl(&pio->mux.pio3.abcdsr1) & ~mask, &pio->mux.pio3.abcdsr1); in at91_mux_pio3_set_C_periph()
172 writel(readl(&pio->mux.pio3.abcdsr2) | mask, &pio->mux.pio3.abcdsr2); in at91_mux_pio3_set_C_periph()
175 static void at91_mux_pio3_set_D_periph(struct at91_port *pio, u32 mask) in at91_mux_pio3_set_D_periph() argument
177 writel(readl(&pio->mux.pio3.abcdsr1) | mask, &pio->mux.pio3.abcdsr1); in at91_mux_pio3_set_D_periph()
178 writel(readl(&pio->mux.pio3.abcdsr2) | mask, &pio->mux.pio3.abcdsr2); in at91_mux_pio3_set_D_periph()
181 static void at91_mux_set_deglitch(struct at91_port *pio, u32 mask, bool is_on) in at91_mux_set_deglitch() argument
183 writel(mask, (is_on ? &pio->ifer : &pio->ifdr)); in at91_mux_set_deglitch()
187 u32 mask, bool is_on) in at91_mux_pio3_set_deglitch() argument
190 writel(mask, &pio->mux.pio3.ifscdr); in at91_mux_pio3_set_deglitch()
191 at91_mux_set_deglitch(pio, mask, is_on); in at91_mux_pio3_set_deglitch()
194 static void at91_mux_pio3_set_debounce(struct at91_port *pio, u32 mask, in at91_mux_pio3_set_debounce() argument
198 writel(mask, &pio->mux.pio3.ifscer); in at91_mux_pio3_set_debounce()
200 writel(mask, &pio->ifer); in at91_mux_pio3_set_debounce()
202 writel(mask, &pio->mux.pio3.ifscdr); in at91_mux_pio3_set_debounce()
207 u32 mask, bool is_on) in at91_mux_pio3_set_pulldown() argument
210 writel(mask, &pio->pudr); in at91_mux_pio3_set_pulldown()
212 writel(mask, (is_on ? &pio->mux.pio3.ppder : &pio->mux.pio3.ppddr)); in at91_mux_pio3_set_pulldown()
216 u32 mask) in at91_mux_pio3_disable_schmitt_trig() argument
218 writel(readl(&pio->schmitt) | mask, &pio->schmitt); in at91_mux_pio3_disable_schmitt_trig()
349 static void at91_mux_gpio_disable(struct at91_port *pio, u32 mask) in at91_mux_gpio_disable() argument
351 writel(mask, &pio->pdr); in at91_mux_gpio_disable()
354 static void at91_mux_gpio_enable(struct at91_port *pio, u32 mask, bool input) in at91_mux_gpio_enable() argument
356 writel(mask, &pio->per); in at91_mux_gpio_enable()
357 writel(mask, (input ? &pio->odr : &pio->oer)); in at91_mux_gpio_enable()
361 struct at91_port *pio, u32 mask, enum at91_mux mux) in at91_pmx_set() argument
363 at91_mux_disable_interrupt(pio, mask); in at91_pmx_set()
366 at91_mux_gpio_enable(pio, mask, 1); in at91_pmx_set()
369 ops->mux_A_periph(pio, mask); in at91_pmx_set()
372 ops->mux_B_periph(pio, mask); in at91_pmx_set()
377 ops->mux_C_periph(pio, mask); in at91_pmx_set()
382 ops->mux_D_periph(pio, mask); in at91_pmx_set()
386 at91_mux_gpio_disable(pio, mask); in at91_pmx_set()
394 u32 mask = BIT(pin); in at91_pinconf_set() local
399 at91_mux_set_output(pio, mask, config & OUTPUT, in at91_pinconf_set()
401 at91_mux_set_pullup(pio, mask, config & PULL_UP); in at91_pinconf_set()
402 at91_mux_set_multidrive(pio, mask, config & MULTI_DRIVE); in at91_pinconf_set()
404 ops->set_deglitch(pio, mask, config & DEGLITCH); in at91_pinconf_set()
406 ops->set_debounce(pio, mask, config & DEBOUNCE, in at91_pinconf_set()
409 ops->set_pulldown(pio, mask, config & PULL_DOWN); in at91_pinconf_set()
411 ops->disable_schmitt_trig(pio, mask); in at91_pinconf_set()
447 u32 conf, mask, count, i; in at91_pinctrl_set_state() local
478 mask = BIT(pin); in at91_pinctrl_set_state()
480 ret = at91_pmx_set(ops, pio, mask, mux); in at91_pinctrl_set_state()