Lines Matching refs:nr
61 static inline struct gsta_regs __iomem *__regs(struct gsta_gpio *chip, int nr) in __regs() argument
63 return chip->regs[nr / GSTA_GPIO_PER_BLOCK]; in __regs()
66 static inline u32 __bit(int nr) in __bit() argument
68 return 1U << (nr % GSTA_GPIO_PER_BLOCK); in __bit()
75 static void gsta_gpio_set(struct gpio_chip *gpio, unsigned nr, int val) in gsta_gpio_set() argument
78 struct gsta_regs __iomem *regs = __regs(chip, nr); in gsta_gpio_set()
79 u32 bit = __bit(nr); in gsta_gpio_set()
87 static int gsta_gpio_get(struct gpio_chip *gpio, unsigned nr) in gsta_gpio_get() argument
90 struct gsta_regs __iomem *regs = __regs(chip, nr); in gsta_gpio_get()
91 u32 bit = __bit(nr); in gsta_gpio_get()
96 static int gsta_gpio_direction_output(struct gpio_chip *gpio, unsigned nr, in gsta_gpio_direction_output() argument
100 struct gsta_regs __iomem *regs = __regs(chip, nr); in gsta_gpio_direction_output()
101 u32 bit = __bit(nr); in gsta_gpio_direction_output()
112 static int gsta_gpio_direction_input(struct gpio_chip *gpio, unsigned nr) in gsta_gpio_direction_input() argument
115 struct gsta_regs __iomem *regs = __regs(chip, nr); in gsta_gpio_direction_input()
116 u32 bit = __bit(nr); in gsta_gpio_direction_input()
166 static void gsta_set_config(struct gsta_gpio *chip, int nr, unsigned cfg) in gsta_set_config() argument
168 struct gsta_regs __iomem *regs = __regs(chip, nr); in gsta_set_config()
170 u32 bit = __bit(nr); in gsta_set_config()
174 pr_info("%s: %p %i %i\n", __func__, chip, nr, cfg); in gsta_set_config()
225 __func__, chip, nr, cfg); in gsta_set_config()
236 int nr = data->irq - chip->irq_base; in gsta_irq_disable() local
237 struct gsta_regs __iomem *regs = __regs(chip, nr); in gsta_irq_disable()
238 u32 bit = __bit(nr); in gsta_irq_disable()
243 if (chip->irq_type[nr] & IRQ_TYPE_EDGE_RISING) { in gsta_irq_disable()
247 if (chip->irq_type[nr] & IRQ_TYPE_EDGE_FALLING) { in gsta_irq_disable()
259 int nr = data->irq - chip->irq_base; in gsta_irq_enable() local
260 struct gsta_regs __iomem *regs = __regs(chip, nr); in gsta_irq_enable()
261 u32 bit = __bit(nr); in gsta_irq_enable()
266 type = chip->irq_type[nr]; in gsta_irq_enable()
287 int nr = d->irq - chip->irq_base; in gsta_irq_type() local
295 chip->irq_type[nr] = type; /* used for enable/disable */ in gsta_irq_type()
306 int i, nr, base; in gsta_gpio_handler() local
313 nr = __ffs(is); in gsta_gpio_handler()
314 irq = base + nr; in gsta_gpio_handler()
316 writel(1 << nr, ®s->ic); in gsta_gpio_handler()