Lines Matching defs:offset
47 #define get_reg(offset) ((offset) / NR_GPIOS_PER_REG)
48 #define get_shift(offset) ((offset) % NR_GPIOS_PER_REG)
49 #define get_mask(offset) (BIT(get_shift(offset)))
104 static int stmfx_gpio_get(struct gpio_chip *gc, unsigned int offset)
107 u32 reg = STMFX_REG_GPIO_STATE + get_reg(offset);
108 u32 mask = get_mask(offset);
117 static void stmfx_gpio_set(struct gpio_chip *gc, unsigned int offset, int value)
121 u32 mask = get_mask(offset);
123 regmap_write_bits(pctl->stmfx->map, reg + get_reg(offset),
127 static int stmfx_gpio_get_direction(struct gpio_chip *gc, unsigned int offset)
130 u32 reg = STMFX_REG_GPIO_DIR + get_reg(offset);
131 u32 mask = get_mask(offset);
148 static int stmfx_gpio_direction_input(struct gpio_chip *gc, unsigned int offset)
151 u32 reg = STMFX_REG_GPIO_DIR + get_reg(offset);
152 u32 mask = get_mask(offset);
158 unsigned int offset, int value)
161 u32 reg = STMFX_REG_GPIO_DIR + get_reg(offset);
162 u32 mask = get_mask(offset);
164 stmfx_gpio_set(gc, offset, value);
170 unsigned int offset)
172 u32 reg = STMFX_REG_GPIO_PUPD + get_reg(offset);
173 u32 pupd, mask = get_mask(offset);
184 unsigned int offset, u32 pupd)
186 u32 reg = STMFX_REG_GPIO_PUPD + get_reg(offset);
187 u32 mask = get_mask(offset);
193 unsigned int offset)
195 u32 reg = STMFX_REG_GPIO_TYPE + get_reg(offset);
196 u32 type, mask = get_mask(offset);
207 unsigned int offset, u32 type)
209 u32 reg = STMFX_REG_GPIO_TYPE + get_reg(offset);
210 u32 mask = get_mask(offset);
348 struct seq_file *s, unsigned int offset)
354 range = pinctrl_find_gpio_range_from_pin_nolock(pctldev, offset);
358 dir = stmfx_gpio_get_direction(&pctl->gpio_chip, offset);
361 type = stmfx_pinconf_get_type(pctl, offset);
364 pupd = stmfx_pinconf_get_pupd(pctl, offset);
367 val = stmfx_gpio_get(&pctl->gpio_chip, offset);
538 unsigned int offset)
540 u32 reg = get_reg(offset);
541 u32 mask = get_mask(offset);
547 val = stmfx_gpio_get(&pctl->gpio_chip, offset);