Lines Matching full:offset
10 static int rk628_calc_mux_offset(struct rk628 *rk628, int mux, int reg, int offset) in rk628_calc_mux_offset() argument
18 val = BIT(offset) | orig; in rk628_calc_mux_offset()
20 val = ~BIT(offset) & orig; in rk628_calc_mux_offset()
23 if (offset >= 4 && offset < 8) { in rk628_calc_mux_offset()
24 offset += offset - 4; in rk628_calc_mux_offset()
25 val = 0x3 << (offset + 16) | (mux << offset); in rk628_calc_mux_offset()
26 } else if (offset > 7) { in rk628_calc_mux_offset()
27 offset += 4; in rk628_calc_mux_offset()
28 val = BIT(offset + 16) | (mux << offset); in rk628_calc_mux_offset()
30 val = BIT(offset + 16) | (mux << offset); in rk628_calc_mux_offset()
34 if (offset == 13) in rk628_calc_mux_offset()
35 offset++; in rk628_calc_mux_offset()
36 if (offset > 11) in rk628_calc_mux_offset()
37 val = 0x3 << (offset + 16) | (mux << offset); in rk628_calc_mux_offset()
39 val = BIT(offset + 16) | (mux << offset); in rk628_calc_mux_offset()
42 val = BIT(offset + 16) | (mux << offset); in rk628_calc_mux_offset()
45 offset -= 16; in rk628_calc_mux_offset()
46 val = 0x3 << ((offset*2) + 16) | (mux << (offset*2)); in rk628_calc_mux_offset()
49 if (offset > 11) in rk628_calc_mux_offset()
50 val = 0x3 << (offset + 16) | (mux << offset); in rk628_calc_mux_offset()
52 val = BIT(offset + 16) | (mux << offset); in rk628_calc_mux_offset()
63 int i, iomux_base, offset, val; in rk628_misc_pinctrl_set_mux() local
70 offset = rk628_pin_iomux_groups[i].pins % BANK_OFFSET; in rk628_misc_pinctrl_set_mux()
80 val = rk628_calc_mux_offset(rk628, mux, iomux_base, offset); in rk628_misc_pinctrl_set_mux()
92 int i, data_reg, offset, val; in rk628_misc_gpio_get_value() local
97 offset = rk628_pin_iomux_groups[i].pins % BANK_OFFSET; in rk628_misc_gpio_get_value()
109 val >>= offset; in rk628_misc_gpio_get_value()
117 int i, data_reg, offset, val; in rk628_misc_gpio_set_value() local
121 offset = rk628_pin_iomux_groups[i].pins % BANK_OFFSET; in rk628_misc_gpio_set_value()
122 if (offset >= 16) { in rk628_misc_gpio_set_value()
124 offset -= 16; in rk628_misc_gpio_set_value()
138 val = BIT(offset + 16) | BIT(offset); in rk628_misc_gpio_set_value()
140 val = BIT(offset + 16) | (0xffff & ~BIT(offset)); in rk628_misc_gpio_set_value()
151 int i, dir_reg, offset, val; in rk628_misc_gpio_set_direction() local
155 offset = rk628_pin_iomux_groups[i].pins % BANK_OFFSET; in rk628_misc_gpio_set_direction()
156 if (offset >= 16) { in rk628_misc_gpio_set_direction()
158 offset -= 16; in rk628_misc_gpio_set_direction()
172 val = BIT(offset + 16) | (0xffff & ~BIT(offset)); in rk628_misc_gpio_set_direction()
174 val = BIT(offset + 16) | BIT(offset); in rk628_misc_gpio_set_direction()
184 int i, iomux_base, offset, val, mux; in rk628_misc_iomux_init() local
189 offset = rk628_pin_iomux_groups[i].pins % BANK_OFFSET; in rk628_misc_iomux_init()
191 val = rk628_calc_mux_offset(rk628, mux, iomux_base, offset); in rk628_misc_iomux_init()
222 int i, bank, pull_reg = 0, offset, val = 0; in rk628_misc_gpio_set_pull_highz_up_down() local
229 offset = rk628_pin_iomux_groups[i].pins % BANK_OFFSET; in rk628_misc_gpio_set_pull_highz_up_down()
244 if (offset == 2) in rk628_misc_gpio_set_pull_highz_up_down()
247 if (offset < valid_pinnum[bank]) in rk628_misc_gpio_set_pull_highz_up_down()
248 val = 0x3 << (2 * offset + 16) | pull << (2 * offset); in rk628_misc_gpio_set_pull_highz_up_down()
254 if (offset == 2) in rk628_misc_gpio_set_pull_highz_up_down()
257 if (offset < valid_pinnum[bank]) in rk628_misc_gpio_set_pull_highz_up_down()
258 val = 0x3 << (2 * offset + 16) | pull << (2 * offset); in rk628_misc_gpio_set_pull_highz_up_down()
266 if (offset < valid_pinnum[bank]) { in rk628_misc_gpio_set_pull_highz_up_down()
267 offset = offset % 8; in rk628_misc_gpio_set_pull_highz_up_down()
268 val = 0x3 << (2 * offset + 16) | pull << (2 * offset); in rk628_misc_gpio_set_pull_highz_up_down()
272 if (pull == GPIO_PULL_UP && (offset == 2 || offset == 11 || offset == 12)) in rk628_misc_gpio_set_pull_highz_up_down()
274 else if (pull == GPIO_PULL_DOWN && (offset == 9 || offset == 10)) in rk628_misc_gpio_set_pull_highz_up_down()
277 if (offset == 0 || offset == 1 || offset == 3 || offset == 8) { in rk628_misc_gpio_set_pull_highz_up_down()
284 if ((offset > 7 && offset < valid_pinnum[bank]) || offset < 4) { in rk628_misc_gpio_set_pull_highz_up_down()
285 offset = offset % 8; in rk628_misc_gpio_set_pull_highz_up_down()
286 val = 0x3 << (2 * offset + 16) | pull << (2 * offset); in rk628_misc_gpio_set_pull_highz_up_down()