Lines Matching +full:bcm6368 +full:- +full:gpio
1 // SPDX-License-Identifier: GPL-2.0+
3 * Driver for BCM6368 GPIO unit (pinctrl + GPIO)
10 #include <linux/gpio/driver.h>
17 #include "../pinctrl-utils.h"
19 #include "pinctrl-bcm63xx.h"
382 struct bcm6368_priv *priv = pc->driver_data; in bcm6368_pinctrl_set_mux()
387 if (fun->basemode) { in bcm6368_pinctrl_set_mux()
390 for (i = 0; i < pg->npins; i++) { in bcm6368_pinctrl_set_mux()
391 pin = pg->pins[i]; in bcm6368_pinctrl_set_mux()
396 regmap_update_bits(pc->regs, BCM6368_MODE_REG, mask, 0); in bcm6368_pinctrl_set_mux()
397 regmap_field_write(priv->overlays, fun->basemode); in bcm6368_pinctrl_set_mux()
399 pin = pg->pins[0]; in bcm6368_pinctrl_set_mux()
402 regmap_field_write(priv->overlays, in bcm6368_pinctrl_set_mux()
405 regmap_update_bits(pc->regs, BCM6368_MODE_REG, BIT(pin), in bcm6368_pinctrl_set_mux()
409 for (pin = 0; pin < pg->npins; pin++) { in bcm6368_pinctrl_set_mux()
415 struct gpio_chip *gc = range->gc; in bcm6368_pinctrl_set_mux()
417 if (fun->dir_out & BIT(pin)) in bcm6368_pinctrl_set_mux()
418 gc->direction_output(gc, hw_gpio, 0); in bcm6368_pinctrl_set_mux()
420 gc->direction_input(gc, hw_gpio); in bcm6368_pinctrl_set_mux()
432 struct bcm6368_priv *priv = pc->driver_data; in bcm6368_gpio_request_enable()
439 regmap_update_bits(pc->regs, BCM6368_MODE_REG, BIT(offset), 0); in bcm6368_gpio_request_enable()
442 regmap_field_write(priv->overlays, BCM6368_BASEMODE_GPIO); in bcm6368_gpio_request_enable()
475 struct device *dev = &pdev->dev; in bcm6368_pinctrl_probe()
482 return -ENOMEM; in bcm6368_pinctrl_probe()
490 priv->overlays = devm_regmap_field_alloc(dev, pc->regs, overlays); in bcm6368_pinctrl_probe()
491 if (IS_ERR(priv->overlays)) in bcm6368_pinctrl_probe()
492 return PTR_ERR(priv->overlays); in bcm6368_pinctrl_probe()
498 { .compatible = "brcm,bcm6368-pinctrl", },
505 .name = "bcm6368-pinctrl",