Lines Matching refs:offset

195 static int rk806_gpio_get(struct gpio_chip *chip, unsigned int offset)
200 if (!pci->pin_cfg[offset].val_msk) {
202 offset);
206 ret = regmap_read(pci->rk806->regmap, pci->pin_cfg[offset].reg, &val);
208 dev_err(pci->dev, "get gpio%d value failed\n", offset);
212 return !!(val & pci->pin_cfg[offset].val_msk);
216 unsigned int offset,
222 if (!pci->pin_cfg[offset].val_msk)
226 pci->pin_cfg[offset].reg,
227 pci->pin_cfg[offset].val_msk,
228 value ? pci->pin_cfg[offset].val_msk : 0);
231 offset, value);
235 unsigned int offset)
237 return pinctrl_gpio_direction_input(chip->base + offset);
241 unsigned int offset,
244 rk806_gpio_set(chip, offset, value);
245 return pinctrl_gpio_direction_output(chip->base + offset);
249 unsigned int offset)
256 if (!pci->pin_cfg[offset].dir_msk)
260 pci->pin_cfg[offset].reg,
263 dev_err(pci->dev, "get gpio%d direction failed\n", offset);
267 return !(val & pci->pin_cfg[offset].dir_msk);
350 unsigned int offset,
356 if (!pci->pin_cfg[offset].fun_msk)
359 mux <<= ffs(pci->pin_cfg[offset].fun_msk) - 1;
361 pci->pin_cfg[offset].fun_reg,
362 pci->pin_cfg[offset].fun_msk, mux);
365 dev_err(pci->dev, "set gpio%d func%d failed\n", offset, mux);
376 int offset = group;
378 return _rk806_pinctrl_set_mux(pctldev, offset, mux);
383 unsigned int offset, bool input)
389 if (!pci->pin_cfg[offset].dir_msk)
393 pci->pin_cfg[offset].reg,
394 pci->pin_cfg[offset].dir_msk,
395 input ? 0 : pci->pin_cfg[offset].dir_msk);
397 dev_err(pci->dev, "set gpio%d direction failed\n", offset);
406 unsigned int offset)
408 return _rk806_pinctrl_set_mux(pctldev, offset, RK806_PINMUX_FUN5);