/* * mt65xx pinctrl driver based on Allwinner A1X pinctrl driver. * Copyright (c) 2014 MediaTek Inc. * Author: Hongzhou.Yang <hongzhou.yang@mediatek.com> * * This program is free software; you can redistribute 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 that 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. */#include<linux/io.h>#include<linux/gpio/driver.h>#include<linux/module.h>#include<linux/of.h>#include<linux/of_address.h>#include<linux/of_device.h>#include<linux/of_irq.h>#include<linux/pinctrl/consumer.h>#include<linux/pinctrl/machine.h>#include<linux/pinctrl/pinconf.h>#include<linux/pinctrl/pinconf-generic.h>#include<linux/pinctrl/pinctrl.h>#include<linux/pinctrl/pinmux.h>#include<linux/platform_device.h>#include<linux/slab.h>#include<linux/bitops.h>#include<linux/regmap.h>#include<linux/mfd/syscon.h>#include<linux/delay.h>#include<linux/interrupt.h>#include<linux/pm.h>#include<dt-bindings/pinctrl/mt65xx.h>#include"../core.h"#include"../pinconf.h"#include"../pinctrl-utils.h"#include"pinctrl-mtk-common.h"#define MAX_GPIO_MODE_PER_REG 5#define GPIO_MODE_BITS 3#define GPIO_MODE_PREFIX "GPIO"staticconstchar*constmtk_gpio_functions[]