Lines Matching defs:pin

53  * sama5d2_piobu_setup_pin() - prepares a pin for set_direction call
55 * Do not consider pin for tamper detection (normal and backup modes)
56 * Do not consider pin as tamper wakeup interrupt source
58 static int sama5d2_piobu_setup_pin(struct gpio_chip *chip, unsigned int pin)
63 unsigned int mask = BIT(PIOBU_DET_OFFSET + pin);
77 * sama5d2_piobu_write_value() - writes value & mask at the pin's PIOBU register
79 static int sama5d2_piobu_write_value(struct gpio_chip *chip, unsigned int pin,
86 reg = PIOBU_BASE + pin * PIOBU_REG_SIZE;
92 * sama5d2_piobu_read_value() - read the value with masking from the pin's PIOBU
95 static int sama5d2_piobu_read_value(struct gpio_chip *chip, unsigned int pin,
103 reg = PIOBU_BASE + pin * PIOBU_REG_SIZE;
115 unsigned int pin)
117 int ret = sama5d2_piobu_read_value(chip, pin, PIOBU_DIRECTION);
130 unsigned int pin)
132 return sama5d2_piobu_write_value(chip, pin, PIOBU_DIRECTION, PIOBU_IN);
139 unsigned int pin, int value)
146 return sama5d2_piobu_write_value(chip, pin, PIOBU_DIRECTION | PIOBU_SOD,
153 static int sama5d2_piobu_get(struct gpio_chip *chip, unsigned int pin)
155 /* if pin is input, read value from PDS else read from SOD */
156 int ret = sama5d2_piobu_get_direction(chip, pin);
159 ret = sama5d2_piobu_read_value(chip, pin, PIOBU_PDS);
161 ret = sama5d2_piobu_read_value(chip, pin, PIOBU_SOD);
172 static int sama5d2_piobu_set(struct gpio_chip *chip, unsigned int pin,
180 return sama5d2_piobu_write_value(chip, pin, PIOBU_SOD, value);
220 dev_err(&pdev->dev, "Failed to setup pin: %d %d\n",