Lines Matching +full:gpio +full:- +full:reserved +full:- +full:ranges
1 // SPDX-License-Identifier: GPL-2.0-only
4 #include <linux/gpio/driver.h>
5 #include <linux/mfd/rohm-bd71828.h>
16 struct gpio_chip gpio; member
27 * we are dealing with - then we are done in bd71828_gpio_set()
32 return regmap_update_bits(bdgpio->regmap, GPIO_OUT_REG(offset), in bd71828_gpio_set()
43 ret = regmap_read(bdgpio->regmap, BD71828_REG_IO_STAT, in bd71828_gpio_get()
46 ret = regmap_read(bdgpio->regmap, GPIO_OUT_REG(offset), in bd71828_gpio_get()
60 return -ENOTSUPP; in bd71828_gpio_set_config()
64 return regmap_update_bits(bdgpio->regmap, in bd71828_gpio_set_config()
69 return regmap_update_bits(bdgpio->regmap, in bd71828_gpio_set_config()
76 return -ENOTSUPP; in bd71828_gpio_set_config()
83 * we trust that if the pin is not excluded by "gpio-reserved-ranges" in bd71828_get_direction()
85 * on BD71828 can't really be used for general purpose input - input in bd71828_get_direction()
97 struct device *dev = &pdev->dev; in bd71828_probe()
102 return -ENOMEM; in bd71828_probe()
104 bdgpio->dev = dev; in bd71828_probe()
105 bdgpio->gpio.parent = dev->parent; in bd71828_probe()
106 bdgpio->gpio.label = "bd71828-gpio"; in bd71828_probe()
107 bdgpio->gpio.owner = THIS_MODULE; in bd71828_probe()
108 bdgpio->gpio.get_direction = bd71828_get_direction; in bd71828_probe()
109 bdgpio->gpio.set_config = bd71828_gpio_set_config; in bd71828_probe()
110 bdgpio->gpio.can_sleep = true; in bd71828_probe()
111 bdgpio->gpio.get = bd71828_gpio_get; in bd71828_probe()
112 bdgpio->gpio.set = bd71828_gpio_set; in bd71828_probe()
113 bdgpio->gpio.base = -1; in bd71828_probe()
118 * "gpio-reserved-ranges" and exclude them from control in bd71828_probe()
120 bdgpio->gpio.ngpio = 4; in bd71828_probe()
121 bdgpio->regmap = dev_get_regmap(dev->parent, NULL); in bd71828_probe()
122 if (!bdgpio->regmap) in bd71828_probe()
123 return -ENODEV; in bd71828_probe()
125 return devm_gpiochip_add_data(dev, &bdgpio->gpio, bdgpio); in bd71828_probe()
130 .name = "bd71828-gpio"
140 MODULE_ALIAS("platform:bd71828-gpio");