Source
x
static inline struct pic32_gpio_bank *pctl_to_bank(struct pic32_pinctrl *pctl,
/*
* PIC32 pinctrl driver
*
* Joshua Henderson, <joshua.henderson@microchip.com>
* Copyright (C) 2015 Microchip Technology Inc. All rights reserved.
*
* This program is free software; you can distribute it and/or modify it
* under the terms of the GNU General Public License (Version 2) as
* published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*/
static const struct pinconf_generic_params pic32_mpp_bindings[] = {
{"microchip,digital", PIN_CONFIG_MICROCHIP_DIGITAL, 0},
{"microchip,analog", PIN_CONFIG_MICROCHIP_ANALOG, 0},
};
struct pic32_function {
const char *name;
const char * const *groups;
unsigned int ngroups;
};
struct pic32_pin_group {
const char *name;
unsigned int pin;
struct pic32_desc_function *functions;
};
struct pic32_desc_function {
const char *name;
u32 muxreg;
u32 muxval;
};
struct pic32_gpio_bank {
void __iomem *reg_base;
struct gpio_chip gpio_chip;
struct irq_chip irq_chip;
struct clk *clk;
};
struct pic32_pinctrl {
void __iomem *reg_base;
struct device *dev;
struct pinctrl_dev *pctldev;
const struct pinctrl_pin_desc *pins;
unsigned int npins;
const struct pic32_function *functions;
unsigned int nfunctions;
const struct pic32_pin_group *groups;
unsigned int ngroups;
struct pic32_gpio_bank *gpio_banks;
unsigned int nbanks;
struct clk *clk;
};
static const struct pinctrl_pin_desc pic32_pins[] = {
PINCTRL_PIN(0, "A0"),