mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-27 19:29:37 +00:00
![Rikard Falkeborn](/assets/img/avatar_default.png)
These are only assigned, either directly or via the bcm63xx_pinctrl_soc struct, to the pmxops field in the pinctrl_desc struct and never modified, so make them const to allow the compiler to put them in read-only memory. Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Link: https://lore.kernel.org/r/20210605185908.39982-3-rikard.falkeborn@gmail.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
43 lines
903 B
C
43 lines
903 B
C
// SPDX-License-Identifier: GPL-2.0+
|
|
/*
|
|
* Copyright (C) 2021 Álvaro Fernández Rojas <noltari@gmail.com>
|
|
* Copyright (C) 2016 Jonas Gorski <jonas.gorski@gmail.com>
|
|
*/
|
|
|
|
#ifndef __PINCTRL_BCM63XX_H__
|
|
#define __PINCTRL_BCM63XX_H__
|
|
|
|
#include <linux/pinctrl/pinctrl.h>
|
|
|
|
#define BCM63XX_BANK_GPIOS 32
|
|
|
|
struct bcm63xx_pinctrl_soc {
|
|
const struct pinctrl_ops *pctl_ops;
|
|
const struct pinmux_ops *pmx_ops;
|
|
|
|
const struct pinctrl_pin_desc *pins;
|
|
unsigned npins;
|
|
|
|
unsigned int ngpios;
|
|
};
|
|
|
|
struct bcm63xx_pinctrl {
|
|
struct device *dev;
|
|
struct regmap *regs;
|
|
|
|
struct pinctrl_desc pctl_desc;
|
|
struct pinctrl_dev *pctl_dev;
|
|
|
|
void *driver_data;
|
|
};
|
|
|
|
static inline unsigned int bcm63xx_bank_pin(unsigned int pin)
|
|
{
|
|
return pin % BCM63XX_BANK_GPIOS;
|
|
}
|
|
|
|
int bcm63xx_pinctrl_probe(struct platform_device *pdev,
|
|
const struct bcm63xx_pinctrl_soc *soc,
|
|
void *driver_data);
|
|
|
|
#endif /* __PINCTRL_BCM63XX_H__ */
|