Lines Matching +full:bcm6358 +full:- +full:gpio
1 // SPDX-License-Identifier: GPL-2.0+
3 * Driver for BCM6358 GPIO unit (pinctrl + GPIO)
10 #include <linux/gpio/driver.h>
17 #include "../pinctrl-utils.h"
19 #include "pinctrl-bcm63xx.h"
42 /* non-GPIO function muxes require the gpio direction to be set */
257 struct bcm6358_priv *priv = pc->driver_data; in bcm6358_pinctrl_set_mux()
259 unsigned int val = pg->mode_val; in bcm6358_pinctrl_set_mux()
263 for (pin = 0; pin < pg->grp.npins; pin++) in bcm6358_pinctrl_set_mux()
266 regmap_field_update_bits(priv->overlays, mask, val); in bcm6358_pinctrl_set_mux()
268 for (pin = 0; pin < pg->grp.npins; pin++) { in bcm6358_pinctrl_set_mux()
274 struct gpio_chip *gc = range->gc; in bcm6358_pinctrl_set_mux()
276 if (pg->direction & BIT(pin)) in bcm6358_pinctrl_set_mux()
277 gc->direction_output(gc, hw_gpio, 0); in bcm6358_pinctrl_set_mux()
279 gc->direction_input(gc, hw_gpio); in bcm6358_pinctrl_set_mux()
291 struct bcm6358_priv *priv = pc->driver_data; in bcm6358_gpio_request_enable()
299 return regmap_field_update_bits(priv->overlays, mask, 0); in bcm6358_gpio_request_enable()
330 struct device *dev = &pdev->dev; in bcm6358_pinctrl_probe()
337 return -ENOMEM; in bcm6358_pinctrl_probe()
345 priv->overlays = devm_regmap_field_alloc(dev, pc->regs, overlays); in bcm6358_pinctrl_probe()
346 if (IS_ERR(priv->overlays)) in bcm6358_pinctrl_probe()
347 return PTR_ERR(priv->overlays); in bcm6358_pinctrl_probe()
353 { .compatible = "brcm,bcm6358-pinctrl", },
360 .name = "bcm6358-pinctrl",