Lines Matching +full:com +full:- +full:offset
1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com/
4 * Andrew F. Davis <afd@ti.com>
21 unsigned offset) in tps65086_gpio_get_direction() argument
28 unsigned offset) in tps65086_gpio_direction_input() argument
31 return -EINVAL; in tps65086_gpio_direction_input()
35 unsigned offset, int value) in tps65086_gpio_direction_output() argument
40 regmap_update_bits(gpio->tps->regmap, TPS65086_GPOCTRL, in tps65086_gpio_direction_output()
41 BIT(4 + offset), value ? BIT(4 + offset) : 0); in tps65086_gpio_direction_output()
46 static int tps65086_gpio_get(struct gpio_chip *chip, unsigned offset) in tps65086_gpio_get() argument
51 ret = regmap_read(gpio->tps->regmap, TPS65086_GPOCTRL, &val); in tps65086_gpio_get()
55 return val & BIT(4 + offset); in tps65086_gpio_get()
58 static void tps65086_gpio_set(struct gpio_chip *chip, unsigned offset, in tps65086_gpio_set() argument
63 regmap_update_bits(gpio->tps->regmap, TPS65086_GPOCTRL, in tps65086_gpio_set()
64 BIT(4 + offset), value ? BIT(4 + offset) : 0); in tps65086_gpio_set()
68 .label = "tps65086-gpio",
75 .base = -1,
85 gpio = devm_kzalloc(&pdev->dev, sizeof(*gpio), GFP_KERNEL); in tps65086_gpio_probe()
87 return -ENOMEM; in tps65086_gpio_probe()
91 gpio->tps = dev_get_drvdata(pdev->dev.parent); in tps65086_gpio_probe()
92 gpio->chip = template_chip; in tps65086_gpio_probe()
93 gpio->chip.parent = gpio->tps->dev; in tps65086_gpio_probe()
95 ret = gpiochip_add_data(&gpio->chip, gpio); in tps65086_gpio_probe()
97 dev_err(&pdev->dev, "Could not register gpiochip, %d\n", ret); in tps65086_gpio_probe()
108 gpiochip_remove(&gpio->chip); in tps65086_gpio_remove()
114 { "tps65086-gpio", },
121 .name = "tps65086-gpio",
129 MODULE_AUTHOR("Andrew F. Davis <afd@ti.com>");