Lines Matching +full:jh7110 +full:- +full:sys +full:- +full:pinctrl

1 // SPDX-License-Identifier: GPL-2.0
3 * Pinctrl / GPIO driver for StarFive JH7110 SoC sys controller
20 #include <linux/pinctrl/pinctrl.h>
21 #include <linux/pinctrl/pinmux.h>
23 #include <dt-bindings/pinctrl/starfive,jh7110-pinctrl.h>
26 #include "../pinctrl-utils.h"
29 #include "pinctrl-starfive-jh7110.h"
298 if (!fs->offset) in jh7110_set_function()
301 if (func > fs->max) in jh7110_set_function()
304 reg = sfp->base + fs->offset; in jh7110_set_function()
305 func = func << fs->shift; in jh7110_set_function()
306 mask = 0x3U << fs->shift; in jh7110_set_function()
308 raw_spin_lock_irqsave(&sfp->lock, flags); in jh7110_set_function()
311 raw_spin_unlock_irqrestore(&sfp->lock, flags); in jh7110_set_function()
323 if (!gs->offset) in jh7110_set_vin_group()
326 reg = sfp->base + gs->offset; in jh7110_set_vin_group()
327 grp = gs->group << gs->shift; in jh7110_set_vin_group()
328 mask = 0x3U << gs->shift; in jh7110_set_vin_group()
330 raw_spin_lock_irqsave(&sfp->lock, flags); in jh7110_set_vin_group()
333 raw_spin_unlock_irqrestore(&sfp->lock, flags); in jh7110_set_vin_group()
341 if (pin < sfp->gc.ngpio && func == 0) in jh7110_sys_set_one_pin_mux()
346 if (pin < sfp->gc.ngpio && func == 2) in jh7110_sys_set_one_pin_mux()
360 return -1; in jh7110_sys_get_padcfg_base()
372 mis = readl_relaxed(sfp->base + JH7110_SYS_GPIOMIS0); in jh7110_sys_irq_handler()
374 generic_handle_domain_irq(sfp->gc.irq.domain, pin); in jh7110_sys_irq_handler()
376 mis = readl_relaxed(sfp->base + JH7110_SYS_GPIOMIS1); in jh7110_sys_irq_handler()
378 generic_handle_domain_irq(sfp->gc.irq.domain, pin + 32); in jh7110_sys_irq_handler()
389 writel(0U, sfp->base + JH7110_SYS_GPIOIE0); in jh7110_sys_init_hw()
390 writel(0U, sfp->base + JH7110_SYS_GPIOIE1); in jh7110_sys_init_hw()
392 writel(~0U, sfp->base + JH7110_SYS_GPIOIC0); in jh7110_sys_init_hw()
393 writel(~0U, sfp->base + JH7110_SYS_GPIOIC1); in jh7110_sys_init_hw()
395 writel(1U, sfp->base + JH7110_SYS_GPIOEN); in jh7110_sys_init_hw()
431 .compatible = "starfive,jh7110-sys-pinctrl",
441 .name = "starfive-jh7110-sys-pinctrl",
448 MODULE_DESCRIPTION("Pinctrl driver for the StarFive JH7110 SoC sys controller");