Lines Matching defs:offset
33 * structure, to get a bit offset for a pin (use GPDR as an example):
36 * reg = offset / 32;
37 * bit = offset % 32;
40 * so the bit of reg_addr is to control pin offset's GPDR feature
67 static void __iomem *gpio_reg(struct gpio_chip *chip, unsigned offset,
72 u8 reg = offset / 32;
77 static void __iomem *gpio_reg_2bit(struct gpio_chip *chip, unsigned offset,
82 u8 reg = offset / 16;
87 static int intel_gpio_request(struct gpio_chip *chip, unsigned offset)
89 void __iomem *gafr = gpio_reg_2bit(chip, offset, GAFR);
91 int shift = (offset % 16) << 1, af = (value >> shift) & 3;
100 static int intel_gpio_get(struct gpio_chip *chip, unsigned offset)
102 void __iomem *gplr = gpio_reg(chip, offset, GPLR);
104 return !!(readl(gplr) & BIT(offset % 32));
107 static void intel_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
112 gpsr = gpio_reg(chip, offset, GPSR);
113 writel(BIT(offset % 32), gpsr);
115 gpcr = gpio_reg(chip, offset, GPCR);
116 writel(BIT(offset % 32), gpcr);
120 static int intel_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
123 void __iomem *gpdr = gpio_reg(chip, offset, GPDR);
132 value &= ~BIT(offset % 32);
143 unsigned offset, int value)
146 void __iomem *gpdr = gpio_reg(chip, offset, GPDR);
149 intel_gpio_set(chip, offset, value);
156 value |= BIT(offset % 32);