Lines Matching refs:tps6586x_gpio
36 struct tps6586x_gpio { struct
41 static inline struct tps6586x_gpio *to_tps6586x_gpio(struct gpio_chip *chip) in to_tps6586x_gpio() argument
43 return container_of(chip, struct tps6586x_gpio, gpio_chip); in to_tps6586x_gpio()
48 struct tps6586x_gpio *tps6586x_gpio = to_tps6586x_gpio(gc); in tps6586x_gpio_get() local
52 ret = tps6586x_read(tps6586x_gpio->parent, TPS6586X_GPIOSET2, &val); in tps6586x_gpio_get()
62 struct tps6586x_gpio *tps6586x_gpio = to_tps6586x_gpio(gc); in tps6586x_gpio_set() local
64 tps6586x_update(tps6586x_gpio->parent, TPS6586X_GPIOSET2, in tps6586x_gpio_set()
71 struct tps6586x_gpio *tps6586x_gpio = to_tps6586x_gpio(gc); in tps6586x_gpio_output() local
79 return tps6586x_update(tps6586x_gpio->parent, TPS6586X_GPIOSET1, in tps6586x_gpio_output()
85 struct tps6586x_gpio *tps6586x_gpio = to_tps6586x_gpio(gc); in tps6586x_gpio_to_irq() local
87 return tps6586x_irq_get_virq(tps6586x_gpio->parent, in tps6586x_gpio_to_irq()
94 struct tps6586x_gpio *tps6586x_gpio; in tps6586x_gpio_probe() local
98 tps6586x_gpio = devm_kzalloc(&pdev->dev, in tps6586x_gpio_probe()
99 sizeof(*tps6586x_gpio), GFP_KERNEL); in tps6586x_gpio_probe()
100 if (!tps6586x_gpio) in tps6586x_gpio_probe()
103 tps6586x_gpio->parent = pdev->dev.parent; in tps6586x_gpio_probe()
105 tps6586x_gpio->gpio_chip.owner = THIS_MODULE; in tps6586x_gpio_probe()
106 tps6586x_gpio->gpio_chip.label = pdev->name; in tps6586x_gpio_probe()
107 tps6586x_gpio->gpio_chip.dev = &pdev->dev; in tps6586x_gpio_probe()
108 tps6586x_gpio->gpio_chip.ngpio = 4; in tps6586x_gpio_probe()
109 tps6586x_gpio->gpio_chip.can_sleep = true; in tps6586x_gpio_probe()
112 tps6586x_gpio->gpio_chip.direction_output = tps6586x_gpio_output; in tps6586x_gpio_probe()
113 tps6586x_gpio->gpio_chip.set = tps6586x_gpio_set; in tps6586x_gpio_probe()
114 tps6586x_gpio->gpio_chip.get = tps6586x_gpio_get; in tps6586x_gpio_probe()
115 tps6586x_gpio->gpio_chip.to_irq = tps6586x_gpio_to_irq; in tps6586x_gpio_probe()
118 tps6586x_gpio->gpio_chip.of_node = pdev->dev.parent->of_node; in tps6586x_gpio_probe()
121 tps6586x_gpio->gpio_chip.base = pdata->gpio_base; in tps6586x_gpio_probe()
123 tps6586x_gpio->gpio_chip.base = -1; in tps6586x_gpio_probe()
125 ret = gpiochip_add(&tps6586x_gpio->gpio_chip); in tps6586x_gpio_probe()
131 platform_set_drvdata(pdev, tps6586x_gpio); in tps6586x_gpio_probe()
138 struct tps6586x_gpio *tps6586x_gpio = platform_get_drvdata(pdev); in tps6586x_gpio_remove() local
140 gpiochip_remove(&tps6586x_gpio->gpio_chip); in tps6586x_gpio_remove()