Lines Matching refs:offset

206 static int twl_request(struct gpio_chip *chip, unsigned offset)  in twl_request()  argument
214 if (offset >= TWL4030_GPIO_MAX) { in twl_request()
219 offset -= TWL4030_GPIO_MAX; in twl_request()
220 if (offset) { in twl_request()
268 priv->usage_count |= BIT(offset); in twl_request()
274 static void twl_free(struct gpio_chip *chip, unsigned offset) in twl_free() argument
279 if (offset >= TWL4030_GPIO_MAX) { in twl_free()
280 twl4030_led_set_value(offset - TWL4030_GPIO_MAX, 1); in twl_free()
284 priv->usage_count &= ~BIT(offset); in twl_free()
294 static int twl_direction_in(struct gpio_chip *chip, unsigned offset) in twl_direction_in() argument
300 if (offset < TWL4030_GPIO_MAX) in twl_direction_in()
301 ret = twl4030_set_gpio_direction(offset, 1); in twl_direction_in()
306 priv->direction &= ~BIT(offset); in twl_direction_in()
313 static int twl_get(struct gpio_chip *chip, unsigned offset) in twl_get() argument
320 if (!(priv->usage_count & BIT(offset))) { in twl_get()
325 if (priv->direction & BIT(offset)) in twl_get()
326 status = priv->out_state & BIT(offset); in twl_get()
328 status = twl4030_get_gpio_datain(offset); in twl_get()
336 static void twl_set(struct gpio_chip *chip, unsigned offset, int value) in twl_set() argument
341 if (offset < TWL4030_GPIO_MAX) in twl_set()
342 twl4030_set_gpio_dataout(offset, value); in twl_set()
344 twl4030_led_set_value(offset - TWL4030_GPIO_MAX, value); in twl_set()
347 priv->out_state |= BIT(offset); in twl_set()
349 priv->out_state &= ~BIT(offset); in twl_set()
354 static int twl_direction_out(struct gpio_chip *chip, unsigned offset, int value) in twl_direction_out() argument
360 if (offset < TWL4030_GPIO_MAX) { in twl_direction_out()
361 ret = twl4030_set_gpio_direction(offset, 0); in twl_direction_out()
372 priv->direction |= BIT(offset); in twl_direction_out()
375 twl_set(chip, offset, value); in twl_direction_out()
380 static int twl_to_irq(struct gpio_chip *chip, unsigned offset) in twl_to_irq() argument
384 return (priv->irq_base && (offset < TWL4030_GPIO_MAX)) in twl_to_irq()
385 ? (priv->irq_base + offset) in twl_to_irq()