aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl/pinctrl-samsung.h
diff options
context:
space:
mode:
authorTomasz Figa <tomasz.figa@gmail.com>2013-03-18 17:31:52 -0400
committerLinus Walleij <linus.walleij@linaro.org>2013-04-09 03:41:09 -0400
commit499147c9dbceee27c63bf8e6b604aca1737e9e0c (patch)
tree54305db6aac8a73a8e495f98b1f0f82886e3af53 /drivers/pinctrl/pinctrl-samsung.h
parentd5517bec272ce4732f7e86a72a1bb815834c912c (diff)
pinctrl: samsung: Split pin bank description into two structures
This patch splits pin bank description into two structures, one describing bank type (currently only bitfield widths), which can be shared across multiple banks and second containing bank-specific parameters including a pointer to a bank type struct. It is a prerequisite for further patch removing the statically hardcoded register offsets, making it impossible to support SoCs with different set and order of pin control registers. Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/pinctrl-samsung.h')
-rw-r--r--drivers/pinctrl/pinctrl-samsung.h26
1 files changed, 16 insertions, 10 deletions
diff --git a/drivers/pinctrl/pinctrl-samsung.h b/drivers/pinctrl/pinctrl-samsung.h
index b9dbe7949fab..1c590f7e95dd 100644
--- a/drivers/pinctrl/pinctrl-samsung.h
+++ b/drivers/pinctrl/pinctrl-samsung.h
@@ -37,16 +37,22 @@
37 37
38/** 38/**
39 * enum pincfg_type - possible pin configuration types supported. 39 * enum pincfg_type - possible pin configuration types supported.
40 * @PINCFG_TYPE_FUNC: Function configuration.
41 * @PINCFG_TYPE_DAT: Pin value configuration.
40 * @PINCFG_TYPE_PUD: Pull up/down configuration. 42 * @PINCFG_TYPE_PUD: Pull up/down configuration.
41 * @PINCFG_TYPE_DRV: Drive strength configuration. 43 * @PINCFG_TYPE_DRV: Drive strength configuration.
42 * @PINCFG_TYPE_CON_PDN: Pin function in power down mode. 44 * @PINCFG_TYPE_CON_PDN: Pin function in power down mode.
43 * @PINCFG_TYPE_PUD_PDN: Pull up/down configuration in power down mode. 45 * @PINCFG_TYPE_PUD_PDN: Pull up/down configuration in power down mode.
44 */ 46 */
45enum pincfg_type { 47enum pincfg_type {
48 PINCFG_TYPE_FUNC,
49 PINCFG_TYPE_DAT,
46 PINCFG_TYPE_PUD, 50 PINCFG_TYPE_PUD,
47 PINCFG_TYPE_DRV, 51 PINCFG_TYPE_DRV,
48 PINCFG_TYPE_CON_PDN, 52 PINCFG_TYPE_CON_PDN,
49 PINCFG_TYPE_PUD_PDN, 53 PINCFG_TYPE_PUD_PDN,
54
55 PINCFG_TYPE_NUM
50}; 56};
51 57
52/* 58/*
@@ -103,15 +109,19 @@ enum eint_type {
103struct samsung_pinctrl_drv_data; 109struct samsung_pinctrl_drv_data;
104 110
105/** 111/**
112 * struct samsung_pin_bank_type: pin bank type description
113 * @fld_width: widths of configuration bitfields (0 if unavailable)
114 */
115struct samsung_pin_bank_type {
116 u8 fld_width[PINCFG_TYPE_NUM];
117};
118
119/**
106 * struct samsung_pin_bank: represent a controller pin-bank. 120 * struct samsung_pin_bank: represent a controller pin-bank.
121 * @type: type of the bank (register offsets and bitfield widths)
107 * @pctl_offset: starting offset of the pin-bank registers. 122 * @pctl_offset: starting offset of the pin-bank registers.
108 * @pin_base: starting pin number of the bank. 123 * @pin_base: starting pin number of the bank.
109 * @nr_pins: number of pins included in this bank. 124 * @nr_pins: number of pins included in this bank.
110 * @func_width: width of the function selector bit field.
111 * @pud_width: width of the pin pull up/down selector bit field.
112 * @drv_width: width of the pin driver strength selector bit field.
113 * @conpdn_width: width of the sleep mode function selector bin field.
114 * @pudpdn_width: width of the sleep mode pull up/down selector bit field.
115 * @eint_type: type of the external interrupt supported by the bank. 125 * @eint_type: type of the external interrupt supported by the bank.
116 * @name: name to be prefixed for each pin in this pin bank. 126 * @name: name to be prefixed for each pin in this pin bank.
117 * @of_node: OF node of the bank. 127 * @of_node: OF node of the bank.
@@ -122,14 +132,10 @@ struct samsung_pinctrl_drv_data;
122 * @slock: spinlock protecting bank registers 132 * @slock: spinlock protecting bank registers
123 */ 133 */
124struct samsung_pin_bank { 134struct samsung_pin_bank {
135 struct samsung_pin_bank_type *type;
125 u32 pctl_offset; 136 u32 pctl_offset;
126 u32 pin_base; 137 u32 pin_base;
127 u8 nr_pins; 138 u8 nr_pins;
128 u8 func_width;
129 u8 pud_width;
130 u8 drv_width;
131 u8 conpdn_width;
132 u8 pudpdn_width;
133 enum eint_type eint_type; 139 enum eint_type eint_type;
134 u32 eint_offset; 140 u32 eint_offset;
135 char *name; 141 char *name;