Lines Matching full:off

42 	int (*bank)(unsigned int off);
43 int (*bit)(unsigned int off);
69 static int adp5585_gpio_bank(unsigned int off) in adp5585_gpio_bank() argument
71 return ADP5585_BANK(off); in adp5585_gpio_bank()
74 static int adp5585_gpio_bit(unsigned int off) in adp5585_gpio_bit() argument
76 return ADP5585_BIT(off); in adp5585_gpio_bit()
79 static int adp5589_gpio_bank(unsigned int off) in adp5589_gpio_bank() argument
81 return ADP5589_BANK(off); in adp5589_gpio_bank()
84 static int adp5589_gpio_bit(unsigned int off) in adp5589_gpio_bit() argument
86 return ADP5589_BIT(off); in adp5589_gpio_bit()
89 static int adp5585_gpio_get_direction(struct gpio_chip *chip, unsigned int off) in adp5585_gpio_get_direction() argument
95 regmap_read(adp5585_gpio->regmap, info->gpio_dir_a + info->bank(off), &val); in adp5585_gpio_get_direction()
97 return val & info->bit(off) ? GPIO_LINE_DIRECTION_OUT : GPIO_LINE_DIRECTION_IN; in adp5585_gpio_get_direction()
100 static int adp5585_gpio_direction_input(struct gpio_chip *chip, unsigned int off) in adp5585_gpio_direction_input() argument
105 return regmap_clear_bits(adp5585_gpio->regmap, info->gpio_dir_a + info->bank(off), in adp5585_gpio_direction_input()
106 info->bit(off)); in adp5585_gpio_direction_input()
109 static int adp5585_gpio_direction_output(struct gpio_chip *chip, unsigned int off, int val) in adp5585_gpio_direction_output() argument
113 unsigned int bank = info->bank(off); in adp5585_gpio_direction_output()
114 unsigned int bit = info->bit(off); in adp5585_gpio_direction_output()
126 static int adp5585_gpio_get_value(struct gpio_chip *chip, unsigned int off) in adp5585_gpio_get_value() argument
130 unsigned int bank = info->bank(off); in adp5585_gpio_get_value()
131 unsigned int bit = info->bit(off); in adp5585_gpio_get_value()
153 static int adp5585_gpio_set_value(struct gpio_chip *chip, unsigned int off, in adp5585_gpio_set_value() argument
158 unsigned int bit = adp5585_gpio->info->bit(off); in adp5585_gpio_set_value()
160 return regmap_update_bits(adp5585_gpio->regmap, info->gpo_data_a + info->bank(off), in adp5585_gpio_set_value()
165 unsigned int off, unsigned int bias) in adp5585_gpio_set_bias() argument
175 bit = off * 2; in adp5585_gpio_set_bias()
177 bit += (off > 5 ? 4 : 0); in adp5585_gpio_set_bias()
186 unsigned int off, enum pin_config_param drive) in adp5585_gpio_set_drive() argument
189 unsigned int bit = adp5585_gpio->info->bit(off); in adp5585_gpio_set_drive()
192 info->gpo_out_a + info->bank(off), bit, in adp5585_gpio_set_drive()
197 unsigned int off, unsigned int debounce) in adp5585_gpio_set_debounce() argument
200 unsigned int bit = adp5585_gpio->info->bit(off); in adp5585_gpio_set_debounce()
203 info->debounce_dis_a + info->bank(off), bit, in adp5585_gpio_set_debounce()
207 static int adp5585_gpio_set_config(struct gpio_chip *chip, unsigned int off, in adp5585_gpio_set_config() argument
216 return adp5585_gpio_set_bias(adp5585_gpio, off, in adp5585_gpio_set_config()
220 return adp5585_gpio_set_bias(adp5585_gpio, off, arg ? in adp5585_gpio_set_config()
225 return adp5585_gpio_set_bias(adp5585_gpio, off, arg ? in adp5585_gpio_set_config()
231 return adp5585_gpio_set_drive(adp5585_gpio, off, param); in adp5585_gpio_set_config()
234 return adp5585_gpio_set_debounce(adp5585_gpio, off, arg); in adp5585_gpio_set_config()
241 static int adp5585_gpio_request(struct gpio_chip *chip, unsigned int off) in adp5585_gpio_request() argument
250 ret = test_and_set_bit(off, adp5585->pin_usage); in adp5585_gpio_request()
256 regs->pin_cfg_a + info->bank(off), in adp5585_gpio_request()
257 info->bit(off)); in adp5585_gpio_request()
260 static void adp5585_gpio_free(struct gpio_chip *chip, unsigned int off) in adp5585_gpio_free() argument
265 clear_bit(off, adp5585->pin_usage); in adp5585_gpio_free()
277 unsigned int off; in adp5585_gpio_key_event() local
283 off = key - adp5585_gpio->info->gpi_ev_min; in adp5585_gpio_key_event()
284 active_high = test_bit(off, &adp5585_gpio->irq_active_high); in adp5585_gpio_key_event()
286 irq = irq_find_mapping(adp5585_gpio->gpio_chip.irq.domain, off); in adp5585_gpio_key_event()
297 off, key_press, active_high); in adp5585_gpio_key_event()