Lines Matching refs:pin
72 * @mux_A_periph: assign the corresponding pin to the peripheral A function.
73 * @mux_B_periph: assign the corresponding pin to the peripheral B function.
74 * @mux_C_periph: assign the corresponding pin to the peripheral C function.
75 * @mux_D_periph: assign the corresponding pin to the peripheral D function.
91 void (*set_drivestrength)(struct at91_port *pio, u32 pin,
95 static u32 two_bit_pin_value_shift_amount(u32 pin)
97 /* return the shift value for a pin for "two bit" per pin registers,
99 return 2 * ((pin >= MAX_NB_GPIO_PER_BANK/2)
100 ? pin - MAX_NB_GPIO_PER_BANK/2 : pin);
202 static void set_drive_strength(void *reg, u32 pin, u32 strength)
204 u32 shift = two_bit_pin_value_shift_amount(pin);
210 u32 pin, u32 setting)
215 if (pin >= MAX_NB_GPIO_PER_BANK / 2)
223 set_drive_strength(reg, pin, setting);
227 u32 pin, u32 setting)
232 if (pin >= MAX_NB_GPIO_PER_BANK / 2)
243 set_drive_strength(reg, pin, setting);
319 struct at91_port *pio, u32 pin, u32 config)
321 u32 mask = BIT(pin);
340 ops->set_drivestrength(pio, pin,
346 static int at91_pin_check_config(struct udevice *dev, u32 bank, u32 pin)
351 debug("pin conf bank %d >= nbanks %d\n", bank, priv->nbanks);
355 if (pin >= MAX_NB_GPIO_PER_BANK) {
356 debug("pin conf pin %d >= %d\n", pin, MAX_NB_GPIO_PER_BANK);
370 u32 bank, pin;
380 * the binding format is atmel,pins = <bank pin mux CONFIG ...>,
393 pin = *list++;
397 ret = at91_pin_check_config(dev, bank, pin);
402 mask = BIT(pin);
408 ret = at91_pinconf_set(ops, pio, pin, conf);