#include <linux/gpio/driver.h>
#include <linux/module.h>
#include <linux/of_irq.h>
#include <linux/pinctrl/pinconf-generic.h>
#include <linux/pinctrl/pinconf.h>
#include <linux/pinctrl/pinmux.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <dt-bindings/pinctrl/qcom,pmic-mpp.h>
#include "../pinctrl-utils.h"
#define PMIC_MPP_ADDRESS_RANGE 0x100
#define PMIC_MPP_PULL_UP_0P6KOHM 0
#define PMIC_MPP_PULL_UP_10KOHM 1
#define PMIC_MPP_PULL_UP_30KOHM 2
#define PMIC_MPP_PULL_UP_OPEN 3
#define PMIC_MPP_REG_TYPE 0x4
#define PMIC_MPP_REG_SUBTYPE 0x5
#define PMIC_MPP_TYPE 0x11
#define PMIC_MPP_SUBTYPE_4CH_NO_ANA_OUT 0x3
#define PMIC_MPP_SUBTYPE_ULT_4CH_NO_ANA_OUT 0x4
#define PMIC_MPP_SUBTYPE_4CH_NO_SINK 0x5
#define PMIC_MPP_SUBTYPE_ULT_4CH_NO_SINK 0x6
#define PMIC_MPP_SUBTYPE_4CH_FULL_FUNC 0x7
#define PMIC_MPP_SUBTYPE_8CH_FULL_FUNC 0xf
#define PMIC_MPP_REG_RT_STS 0x10
#define PMIC_MPP_REG_RT_STS_VAL_MASK 0x1
#define PMIC_MPP_REG_MODE_CTL 0x40
#define PMIC_MPP_REG_DIG_VIN_CTL 0x41
#define PMIC_MPP_REG_DIG_PULL_CTL 0x42
#define PMIC_MPP_REG_DIG_IN_CTL 0x43
#define PMIC_MPP_REG_EN_CTL 0x46
#define PMIC_MPP_REG_AOUT_CTL 0x48
#define PMIC_MPP_REG_AIN_CTL 0x4a
#define PMIC_MPP_REG_SINK_CTL 0x4c
#define PMIC_MPP_REG_MODE_VALUE_MASK 0x1
#define PMIC_MPP_REG_MODE_FUNCTION_SHIFT 1
#define PMIC_MPP_REG_MODE_FUNCTION_MASK 0x7
#define PMIC_MPP_REG_MODE_DIR_SHIFT 4
#define PMIC_MPP_REG_MODE_DIR_MASK 0x7
#define PMIC_MPP_REG_VIN_SHIFT 0
#define PMIC_MPP_REG_VIN_MASK 0x7
#define PMIC_MPP_REG_PULL_SHIFT 0
#define PMIC_MPP_REG_PULL_MASK 0x7
#define PMIC_MPP_REG_MASTER_EN_SHIFT 7
#define PMIC_MPP_REG_AIN_ROUTE_SHIFT 0
#define PMIC_MPP_REG_AIN_ROUTE_MASK 0x7
#define PMIC_MPP_MODE_DIGITAL_INPUT 0
#define PMIC_MPP_MODE_DIGITAL_OUTPUT 1