• Home
  • Raw
  • Download

Lines Matching refs:mgpio

128 	struct max77620_gpio *mgpio = gpiochip_get_data(gc);  in max77620_gpio_dir_input()  local
131 ret = regmap_update_bits(mgpio->rmap, GPIO_REG_ADDR(offset), in max77620_gpio_dir_input()
135 dev_err(mgpio->dev, "CNFG_GPIOx dir update failed: %d\n", ret); in max77620_gpio_dir_input()
142 struct max77620_gpio *mgpio = gpiochip_get_data(gc); in max77620_gpio_get() local
146 ret = regmap_read(mgpio->rmap, GPIO_REG_ADDR(offset), &val); in max77620_gpio_get()
148 dev_err(mgpio->dev, "CNFG_GPIOx read failed: %d\n", ret); in max77620_gpio_get()
161 struct max77620_gpio *mgpio = gpiochip_get_data(gc); in max77620_gpio_dir_output() local
168 ret = regmap_update_bits(mgpio->rmap, GPIO_REG_ADDR(offset), in max77620_gpio_dir_output()
171 dev_err(mgpio->dev, "CNFG_GPIOx val update failed: %d\n", ret); in max77620_gpio_dir_output()
175 ret = regmap_update_bits(mgpio->rmap, GPIO_REG_ADDR(offset), in max77620_gpio_dir_output()
179 dev_err(mgpio->dev, "CNFG_GPIOx dir update failed: %d\n", ret); in max77620_gpio_dir_output()
184 static int max77620_gpio_set_debounce(struct max77620_gpio *mgpio, in max77620_gpio_set_debounce() argument
205 dev_err(mgpio->dev, "Illegal value %u\n", debounce); in max77620_gpio_set_debounce()
209 ret = regmap_update_bits(mgpio->rmap, GPIO_REG_ADDR(offset), in max77620_gpio_set_debounce()
212 dev_err(mgpio->dev, "CNFG_GPIOx_DBNC update failed: %d\n", ret); in max77620_gpio_set_debounce()
220 struct max77620_gpio *mgpio = gpiochip_get_data(gc); in max77620_gpio_set() local
227 ret = regmap_update_bits(mgpio->rmap, GPIO_REG_ADDR(offset), in max77620_gpio_set()
230 dev_err(mgpio->dev, "CNFG_GPIO_OUT update failed: %d\n", ret); in max77620_gpio_set()
236 struct max77620_gpio *mgpio = gpiochip_get_data(gc); in max77620_gpio_set_config() local
240 return regmap_update_bits(mgpio->rmap, GPIO_REG_ADDR(offset), in max77620_gpio_set_config()
244 return regmap_update_bits(mgpio->rmap, GPIO_REG_ADDR(offset), in max77620_gpio_set_config()
248 return max77620_gpio_set_debounce(mgpio, offset, in max77620_gpio_set_config()
259 struct max77620_gpio *mgpio = gpiochip_get_data(gc); in max77620_gpio_to_irq() local
260 struct max77620_chip *chip = dev_get_drvdata(mgpio->dev->parent); in max77620_gpio_to_irq()
268 struct max77620_gpio *mgpio; in max77620_gpio_probe() local
276 mgpio = devm_kzalloc(&pdev->dev, sizeof(*mgpio), GFP_KERNEL); in max77620_gpio_probe()
277 if (!mgpio) in max77620_gpio_probe()
280 mgpio->rmap = chip->rmap; in max77620_gpio_probe()
281 mgpio->dev = &pdev->dev; in max77620_gpio_probe()
283 mgpio->gpio_chip.label = pdev->name; in max77620_gpio_probe()
284 mgpio->gpio_chip.parent = &pdev->dev; in max77620_gpio_probe()
285 mgpio->gpio_chip.direction_input = max77620_gpio_dir_input; in max77620_gpio_probe()
286 mgpio->gpio_chip.get = max77620_gpio_get; in max77620_gpio_probe()
287 mgpio->gpio_chip.direction_output = max77620_gpio_dir_output; in max77620_gpio_probe()
288 mgpio->gpio_chip.set = max77620_gpio_set; in max77620_gpio_probe()
289 mgpio->gpio_chip.set_config = max77620_gpio_set_config; in max77620_gpio_probe()
290 mgpio->gpio_chip.to_irq = max77620_gpio_to_irq; in max77620_gpio_probe()
291 mgpio->gpio_chip.ngpio = MAX77620_GPIO_NR; in max77620_gpio_probe()
292 mgpio->gpio_chip.can_sleep = 1; in max77620_gpio_probe()
293 mgpio->gpio_chip.base = -1; in max77620_gpio_probe()
295 mgpio->gpio_chip.of_node = pdev->dev.parent->of_node; in max77620_gpio_probe()
298 platform_set_drvdata(pdev, mgpio); in max77620_gpio_probe()
300 ret = devm_gpiochip_add_data(&pdev->dev, &mgpio->gpio_chip, mgpio); in max77620_gpio_probe()