Lines Matching +full:gpio +full:- +full:f
1 // SPDX-License-Identifier: GPL-2.0
3 * GPIO driver for TI TPS65912x PMICs
5 * Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com/
6 * Andrew F. Davis <afd@ti.com>
8 * Based on the Arizona GPIO driver and the previous TPS65912 driver by
12 #include <linux/gpio/driver.h>
26 struct tps65912_gpio *gpio = gpiochip_get_data(gc); in tps65912_gpio_get_direction() local
30 ret = regmap_read(gpio->tps->regmap, TPS65912_GPIO1 + offset, &val); in tps65912_gpio_get_direction()
42 struct tps65912_gpio *gpio = gpiochip_get_data(gc); in tps65912_gpio_direction_input() local
44 return regmap_update_bits(gpio->tps->regmap, TPS65912_GPIO1 + offset, in tps65912_gpio_direction_input()
51 struct tps65912_gpio *gpio = gpiochip_get_data(gc); in tps65912_gpio_direction_output() local
55 ret = regmap_update_bits(gpio->tps->regmap, TPS65912_GPIO1 + offset, in tps65912_gpio_direction_output()
60 return regmap_update_bits(gpio->tps->regmap, TPS65912_GPIO1 + offset, in tps65912_gpio_direction_output()
66 struct tps65912_gpio *gpio = gpiochip_get_data(gc); in tps65912_gpio_get() local
69 ret = regmap_read(gpio->tps->regmap, TPS65912_GPIO1 + offset, &val); in tps65912_gpio_get()
82 struct tps65912_gpio *gpio = gpiochip_get_data(gc); in tps65912_gpio_set() local
84 return regmap_update_bits(gpio->tps->regmap, TPS65912_GPIO1 + offset, in tps65912_gpio_set()
89 .label = "tps65912-gpio",
96 .base = -1,
103 struct tps65912 *tps = dev_get_drvdata(pdev->dev.parent); in tps65912_gpio_probe()
104 struct tps65912_gpio *gpio; in tps65912_gpio_probe() local
106 gpio = devm_kzalloc(&pdev->dev, sizeof(*gpio), GFP_KERNEL); in tps65912_gpio_probe()
107 if (!gpio) in tps65912_gpio_probe()
108 return -ENOMEM; in tps65912_gpio_probe()
110 gpio->tps = dev_get_drvdata(pdev->dev.parent); in tps65912_gpio_probe()
111 gpio->gpio_chip = template_chip; in tps65912_gpio_probe()
112 gpio->gpio_chip.parent = tps->dev; in tps65912_gpio_probe()
114 return devm_gpiochip_add_data(&pdev->dev, &gpio->gpio_chip, gpio); in tps65912_gpio_probe()
118 { "tps65912-gpio", },
125 .name = "tps65912-gpio",
132 MODULE_AUTHOR("Andrew F. Davis <afd@ti.com>");
133 MODULE_DESCRIPTION("TPS65912 GPIO driver");