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
28 * we are dealing with - then we are done in bd71828_gpio_set()
33 ret = regmap_update_bits(bdgpio->regmap, GPIO_OUT_REG(offset), in bd71828_gpio_set()
36 dev_err(bdgpio->dev, "Could not set gpio to %d\n", value); in bd71828_gpio_set()
46 ret = regmap_read(bdgpio->regmap, BD71828_REG_IO_STAT, in bd71828_gpio_get()
49 ret = regmap_read(bdgpio->regmap, GPIO_OUT_REG(offset), in bd71828_gpio_get()
63 return -ENOTSUPP; in bd71828_gpio_set_config()
67 return regmap_update_bits(bdgpio->regmap, in bd71828_gpio_set_config()
72 return regmap_update_bits(bdgpio->regmap, in bd71828_gpio_set_config()
79 return -ENOTSUPP; in bd71828_gpio_set_config()
86 * we trust that if the pin is not excluded by "gpio-reserved-ranges" in bd71828_get_direction()
88 * on BD71828 can't really be used for general purpose input - input in bd71828_get_direction()
100 struct device *dev = &pdev->dev; in bd71828_probe()
105 return -ENOMEM; in bd71828_probe()
107 bdgpio->dev = dev; in bd71828_probe()
108 bdgpio->gpio.parent = dev->parent; in bd71828_probe()
109 bdgpio->gpio.label = "bd71828-gpio"; in bd71828_probe()
110 bdgpio->gpio.owner = THIS_MODULE; in bd71828_probe()
111 bdgpio->gpio.get_direction = bd71828_get_direction; in bd71828_probe()
112 bdgpio->gpio.set_config = bd71828_gpio_set_config; in bd71828_probe()
113 bdgpio->gpio.can_sleep = true; in bd71828_probe()
114 bdgpio->gpio.get = bd71828_gpio_get; in bd71828_probe()
115 bdgpio->gpio.set = bd71828_gpio_set; in bd71828_probe()
116 bdgpio->gpio.base = -1; in bd71828_probe()
121 * "gpio-reserved-ranges" and exclude them from control in bd71828_probe()
123 bdgpio->gpio.ngpio = 4; in bd71828_probe()
124 bdgpio->regmap = dev_get_regmap(dev->parent, NULL); in bd71828_probe()
125 if (!bdgpio->regmap) in bd71828_probe()
126 return -ENODEV; in bd71828_probe()
128 return devm_gpiochip_add_data(dev, &bdgpio->gpio, bdgpio); in bd71828_probe()
133 .name = "bd71828-gpio"
143 MODULE_ALIAS("platform:bd71828-gpio");