Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0+
0002 /*
0003  * Copyright (C) 2021 Álvaro Fernández Rojas <noltari@gmail.com>
0004  * Copyright (C) 2016 Jonas Gorski <jonas.gorski@gmail.com>
0005  */
0006 
0007 #ifndef __PINCTRL_BCM63XX_H__
0008 #define __PINCTRL_BCM63XX_H__
0009 
0010 #include <linux/pinctrl/pinctrl.h>
0011 
0012 #define BCM63XX_BANK_GPIOS 32
0013 
0014 struct bcm63xx_pinctrl_soc {
0015     const struct pinctrl_ops *pctl_ops;
0016     const struct pinmux_ops *pmx_ops;
0017 
0018     const struct pinctrl_pin_desc *pins;
0019     unsigned npins;
0020 
0021     unsigned int ngpios;
0022 };
0023 
0024 struct bcm63xx_pinctrl {
0025     struct device *dev;
0026     struct regmap *regs;
0027 
0028     struct pinctrl_desc pctl_desc;
0029     struct pinctrl_dev *pctl_dev;
0030 
0031     void *driver_data;
0032 };
0033 
0034 static inline unsigned int bcm63xx_bank_pin(unsigned int pin)
0035 {
0036     return pin % BCM63XX_BANK_GPIOS;
0037 }
0038 
0039 int bcm63xx_pinctrl_probe(struct platform_device *pdev,
0040               const struct bcm63xx_pinctrl_soc *soc,
0041               void *driver_data);
0042 
0043 #endif /* __PINCTRL_BCM63XX_H__ */