Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / drivers / pinctrl / bcm / pinctrl-bcm63xx.h
blob95243027ecd9ecc53afface8281702aebd67ec71
1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3 * Copyright (C) 2021 Álvaro Fernández Rojas <noltari@gmail.com>
4 * Copyright (C) 2016 Jonas Gorski <jonas.gorski@gmail.com>
5 */
7 #ifndef __PINCTRL_BCM63XX_H__
8 #define __PINCTRL_BCM63XX_H__
10 #include <linux/pinctrl/pinctrl.h>
12 #define BCM63XX_BANK_GPIOS 32
14 struct bcm63xx_pinctrl_soc {
15 const struct pinctrl_ops *pctl_ops;
16 const struct pinmux_ops *pmx_ops;
18 const struct pinctrl_pin_desc *pins;
19 unsigned npins;
21 unsigned int ngpios;
24 #define BCM_PIN_GROUP(n) PINCTRL_PINGROUP(#n, n##_pins, ARRAY_SIZE(n##_pins))
26 struct bcm63xx_pinctrl {
27 struct device *dev;
28 struct regmap *regs;
30 struct pinctrl_desc pctl_desc;
31 struct pinctrl_dev *pctl_dev;
33 void *driver_data;
36 static inline unsigned int bcm63xx_bank_pin(unsigned int pin)
38 return pin % BCM63XX_BANK_GPIOS;
41 int bcm63xx_pinctrl_probe(struct platform_device *pdev,
42 const struct bcm63xx_pinctrl_soc *soc,
43 void *driver_data);
45 #endif /* __PINCTRL_BCM63XX_H__ */