summaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.h
diff options
context:
space:
mode:
authorSean Wang <sean.wang@mediatek.com>2018-09-08 19:07:20 +0800
committerLinus Walleij <linus.walleij@linaro.org>2018-09-18 14:52:42 -0700
commitfb5fa8dc151b2364c975a9070eedb28a354a995a (patch)
treee30c6247a6ca5d58f915e735ce6cb6f4100b0917 /drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.h
parentb906faf7b61db890733003d5dc513bee9cd52294 (diff)
downloadlinux-fb5fa8dc151b2364c975a9070eedb28a354a995a.tar.bz2
pinctrl: mediatek: extend struct mtk_pin_desc to pinctrl-mtk-common-v2.c
This patch introduces a data structure mtk_pin_desc, which is used to provide information per pin characteristic such as driving current, eint number and a driving index, that is used to lookup table describing the details about the groups of driving current by which the pin is able to adjust the driving strength so that the driver could get the appropriate driving group when calls .pin_config_get()/set(). Signed-off-by: Ryder.Lee <ryder.lee@mediatek.com> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.h')
-rw-r--r--drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.h b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.h
index f05c8020ca1c..a8e12ac90f0b 100644
--- a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.h
+++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.h
@@ -15,6 +15,8 @@
#define MTK_DISABLE 0
#define MTK_ENABLE 1
+#define EINT_NA -1
+
#define PIN_FIELD_CALC(_s_pin, _e_pin, _s_addr, _x_addrs, _s_bit, \
_x_bits, _sz_reg, _fixed) { \
.s_pin = _s_pin, \
@@ -52,6 +54,17 @@ enum {
PINCTRL_PIN_REG_MAX,
};
+/* Group the pins by the driving current */
+enum {
+ DRV_FIXED,
+ DRV_GRP0,
+ DRV_GRP1,
+ DRV_GRP2,
+ DRV_GRP3,
+ DRV_GRP4,
+ DRV_GRP_MAX,
+};
+
/* struct mtk_pin_field - the structure that holds the information of the field
* used to describe the attribute for the pin
* @offset: the register offset relative to the base address
@@ -103,6 +116,21 @@ struct mtk_pin_reg_calc {
unsigned int nranges;
};
+/**
+ * struct mtk_pin_desc - the structure that providing information
+ * for each pin of chips
+ * @number: unique pin number from the global pin number space
+ * @name: name for this pin
+ * @eint_n: the eint number for this pin
+ * @drv_n: the index with the driving group
+ */
+struct mtk_pin_desc {
+ unsigned int number;
+ const char *name;
+ u16 eint_n;
+ u8 drv_n;
+};
+
/* struct mtk_pin_soc - the structure that holds SoC-specific data */
struct mtk_pin_soc {
const struct mtk_pin_reg_calc *reg_cal;