Lines Matching defs:offset
46 static unsigned int to_reg(unsigned int reg, unsigned int offset)
48 return reg + (offset > 7);
51 static int xra1403_direction_input(struct gpio_chip *chip, unsigned int offset)
55 return regmap_update_bits(xra->regmap, to_reg(XRA_GCR, offset),
56 BIT(offset % 8), BIT(offset % 8));
59 static int xra1403_direction_output(struct gpio_chip *chip, unsigned int offset,
65 ret = regmap_update_bits(xra->regmap, to_reg(XRA_GCR, offset),
66 BIT(offset % 8), 0);
70 ret = regmap_update_bits(xra->regmap, to_reg(XRA_OCR, offset),
71 BIT(offset % 8), value ? BIT(offset % 8) : 0);
76 static int xra1403_get_direction(struct gpio_chip *chip, unsigned int offset)
82 ret = regmap_read(xra->regmap, to_reg(XRA_GCR, offset), &val);
86 if (val & BIT(offset % 8))
92 static int xra1403_get(struct gpio_chip *chip, unsigned int offset)
98 ret = regmap_read(xra->regmap, to_reg(XRA_GSR, offset), &val);
102 return !!(val & BIT(offset % 8));
105 static void xra1403_set(struct gpio_chip *chip, unsigned int offset, int value)
110 ret = regmap_update_bits(xra->regmap, to_reg(XRA_OCR, offset),
111 BIT(offset % 8), value ? BIT(offset % 8) : 0);
114 offset, ret);