/* * Cherryview/Braswell pinctrl driver * * Copyright (C) 2014, Intel Corporation * Author: Mika Westerberg <mika.westerberg@linux.intel.com> * * This driver is based on the original Cherryview GPIO driver by * Ning Li <ning.li@intel.com> * Alan Cox <alan@linux.intel.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. */#include<linux/kernel.h>#include<linux/module.h>#include<linux/init.h>#include<linux/types.h>#include<linux/gpio.h>#include<linux/gpio/driver.h>#include<linux/acpi.h>#include<linux/pinctrl/pinctrl.h>#include<linux/pinctrl/pinmux.h>#include<linux/pinctrl/pinconf.h>#include<linux/pinctrl/pinconf-generic.h>#include<linux/platform_device.h>#define CHV_INTSTAT 0x300#define CHV_INTMASK 0x380#define FAMILY_PAD_REGS_OFF 0x4400#define FAMILY_PAD_REGS_SIZE 0x400#define MAX_FAMILY_PAD_GPIO_NO 15#define GPIO_REGS_SIZE 8#define CHV_PADCTRL0 0x000#define CHV_PADCTRL0_INTSEL_SHIFT 28#define CHV_PADCTRL0_INTSEL_MASK (0xf << CHV_PADCTRL0_INTSEL_SHIFT)#define CHV_PADCTRL0_TERM_UP BIT(23)#define CHV_PADCTRL0_TERM_SHIFT 20#define CHV_PADCTRL0_TERM_MASK (7 << CHV_PADCTRL0_TERM_SHIFT)#define CHV_PADCTRL0_TERM_20K 1#define CHV_PADCTRL0_TERM_5K 2#define CHV_PADCTRL0_TERM_1K 4#define CHV_PADCTRL0_PMODE_SHIFT 16#define CHV_PADCTRL0_PMODE_MASK (0xf << CHV_PADCTRL0_PMODE_SHIFT)#define CHV_PADCTRL0_GPIOEN BIT(15)#define CHV_PADCTRL0_GPIOCFG_SHIFT 8#define CHV_PADCTRL0_GPIOCFG_MASK (7 << CHV_PADCTRL0_GPIOCFG_SHIFT)#define CHV_PADCTRL0_GPIOCFG_GPIO 0#define CHV_PADCTRL0_G