• Home
  • Raw
  • Download

Lines Matching refs:offset

30 #define DA9062_TYPE(offset)		(4 * (offset % 2))  argument
31 #define DA9062_PIN_SHIFT(offset) (4 * (offset % 2)) argument
45 unsigned int offset) in da9062_pctl_get_pin_mode() argument
50 ret = regmap_read(regmap, DA9062AA_GPIO_0_1 + (offset >> 1), &val); in da9062_pctl_get_pin_mode()
54 val >>= DA9062_PIN_SHIFT(offset); in da9062_pctl_get_pin_mode()
61 unsigned int offset, unsigned int mode_req) in da9062_pctl_set_pin_mode() argument
69 mode <<= DA9062_PIN_SHIFT(offset); in da9062_pctl_set_pin_mode()
70 mask = DA9062AA_GPIO0_PIN_MASK << DA9062_PIN_SHIFT(offset); in da9062_pctl_set_pin_mode()
72 ret = regmap_update_bits(regmap, DA9062AA_GPIO_0_1 + (offset >> 1), in da9062_pctl_set_pin_mode()
75 pctl->pin_config[offset] = mode_req; in da9062_pctl_set_pin_mode()
80 static int da9062_gpio_get(struct gpio_chip *gc, unsigned int offset) in da9062_gpio_get() argument
87 gpio_mode = da9062_pctl_get_pin_mode(pctl, offset); in da9062_gpio_get()
106 return !!(val & BIT(offset)); in da9062_gpio_get()
109 static void da9062_gpio_set(struct gpio_chip *gc, unsigned int offset, in da9062_gpio_set() argument
115 regmap_update_bits(regmap, DA9062AA_GPIO_MODE0_4, BIT(offset), in da9062_gpio_set()
116 value << offset); in da9062_gpio_set()
119 static int da9062_gpio_get_direction(struct gpio_chip *gc, unsigned int offset) in da9062_gpio_get_direction() argument
124 gpio_mode = da9062_pctl_get_pin_mode(pctl, offset); in da9062_gpio_get_direction()
142 unsigned int offset) in da9062_gpio_direction_input() argument
146 struct gpio_desc *desc = gpiochip_get_desc(gc, offset); in da9062_gpio_direction_input()
150 ret = da9062_pctl_set_pin_mode(pctl, offset, DA9062_PIN_GPI); in da9062_gpio_direction_input()
163 return regmap_update_bits(regmap, DA9062AA_GPIO_0_1 + (offset >> 1), in da9062_gpio_direction_input()
164 DA9062AA_GPIO0_TYPE_MASK << DA9062_TYPE(offset), in da9062_gpio_direction_input()
165 gpi_type << DA9062_TYPE(offset)); in da9062_gpio_direction_input()
169 unsigned int offset, int value) in da9062_gpio_direction_output() argument
172 unsigned int pin_config = pctl->pin_config[offset]; in da9062_gpio_direction_output()
175 ret = da9062_pctl_set_pin_mode(pctl, offset, pin_config); in da9062_gpio_direction_output()
179 da9062_gpio_set(gc, offset, value); in da9062_gpio_direction_output()
184 static int da9062_gpio_set_config(struct gpio_chip *gc, unsigned int offset, in da9062_gpio_set_config() argument
202 BIT(offset), 0); in da9062_gpio_set_config()
204 gpio_mode = da9062_pctl_get_pin_mode(pctl, offset); in da9062_gpio_set_config()
210 BIT(offset), BIT(offset)); in da9062_gpio_set_config()
212 gpio_mode = da9062_pctl_get_pin_mode(pctl, offset); in da9062_gpio_set_config()
218 BIT(offset), BIT(offset)); in da9062_gpio_set_config()
220 return da9062_pctl_set_pin_mode(pctl, offset, in da9062_gpio_set_config()
223 return da9062_pctl_set_pin_mode(pctl, offset, in da9062_gpio_set_config()
230 static int da9062_gpio_to_irq(struct gpio_chip *gc, unsigned int offset) in da9062_gpio_to_irq() argument
236 DA9062_IRQ_GPI0 + offset); in da9062_gpio_to_irq()