Lines Matching refs:pin
68 .pin = a, \
450 unsigned pin, in xway_pinconf_get() argument
455 int port = PORT(pin); in xway_pinconf_get()
463 reg = GPIO_OD(pin); in xway_pinconf_get()
465 !gpio_getbit(info->membase[0], reg, PORT_PIN(pin))); in xway_pinconf_get()
472 reg = GPIO_PUDEN(pin); in xway_pinconf_get()
473 if (!gpio_getbit(info->membase[0], reg, PORT_PIN(pin))) { in xway_pinconf_get()
481 reg = GPIO_PUDSEL(pin); in xway_pinconf_get()
482 if (!gpio_getbit(info->membase[0], reg, PORT_PIN(pin))) in xway_pinconf_get()
489 reg = GPIO_DIR(pin); in xway_pinconf_get()
491 gpio_getbit(info->membase[0], reg, PORT_PIN(pin))); in xway_pinconf_get()
501 unsigned pin, in xway_pinconf_set() argument
508 int port = PORT(pin); in xway_pinconf_set()
521 reg = GPIO_OD(pin); in xway_pinconf_set()
525 PORT_PIN(pin)); in xway_pinconf_set()
529 PORT_PIN(pin)); in xway_pinconf_set()
536 reg = GPIO_PUDEN(pin); in xway_pinconf_set()
540 PORT_PIN(pin)); in xway_pinconf_set()
543 gpio_setbit(info->membase[0], reg, PORT_PIN(pin)); in xway_pinconf_set()
548 reg = GPIO_PUDSEL(pin); in xway_pinconf_set()
552 PORT_PIN(pin)); in xway_pinconf_set()
556 PORT_PIN(pin)); in xway_pinconf_set()
563 reg = GPIO_DIR(pin); in xway_pinconf_set()
567 PORT_PIN(pin)); in xway_pinconf_set()
571 PORT_PIN(pin)); in xway_pinconf_set()
613 int pin, int mux) in xway_mux_apply() argument
616 int port = PORT(pin); in xway_mux_apply()
617 u32 alt1_reg = GPIO_ALT1(pin); in xway_mux_apply()
623 gpio_setbit(info->membase[0], GPIO_ALT0(pin), PORT_PIN(pin)); in xway_mux_apply()
625 gpio_clearbit(info->membase[0], GPIO_ALT0(pin), PORT_PIN(pin)); in xway_mux_apply()
628 gpio_setbit(info->membase[0], alt1_reg, PORT_PIN(pin)); in xway_mux_apply()
630 gpio_clearbit(info->membase[0], alt1_reg, PORT_PIN(pin)); in xway_mux_apply()
649 static void xway_gpio_set(struct gpio_chip *chip, unsigned int pin, int val) in xway_gpio_set() argument
654 gpio_setbit(info->membase[0], GPIO_OUT(pin), PORT_PIN(pin)); in xway_gpio_set()
656 gpio_clearbit(info->membase[0], GPIO_OUT(pin), PORT_PIN(pin)); in xway_gpio_set()
659 static int xway_gpio_get(struct gpio_chip *chip, unsigned int pin) in xway_gpio_get() argument
663 return gpio_getbit(info->membase[0], GPIO_IN(pin), PORT_PIN(pin)); in xway_gpio_get()
666 static int xway_gpio_dir_in(struct gpio_chip *chip, unsigned int pin) in xway_gpio_dir_in() argument
670 gpio_clearbit(info->membase[0], GPIO_DIR(pin), PORT_PIN(pin)); in xway_gpio_dir_in()
675 static int xway_gpio_dir_out(struct gpio_chip *chip, unsigned int pin, int val) in xway_gpio_dir_out() argument
679 gpio_setbit(info->membase[0], GPIO_DIR(pin), PORT_PIN(pin)); in xway_gpio_dir_out()
680 xway_gpio_set(chip, pin, val); in xway_gpio_dir_out()