Lines Matching defs:offset
287 unsigned offset, int gpio_mode)
291 afunc = readl(nmk_chip->addr + NMK_GPIO_AFSLA) & ~BIT(offset);
292 bfunc = readl(nmk_chip->addr + NMK_GPIO_AFSLB) & ~BIT(offset);
294 afunc |= BIT(offset);
296 bfunc |= BIT(offset);
302 unsigned offset, enum nmk_gpio_slpm mode)
308 slpm |= BIT(offset);
310 slpm &= ~BIT(offset);
315 unsigned offset, enum nmk_gpio_pull pull)
321 pdis |= BIT(offset);
322 nmk_chip->pull_up &= ~BIT(offset);
324 pdis &= ~BIT(offset);
330 nmk_chip->pull_up |= BIT(offset);
331 writel(BIT(offset), nmk_chip->addr + NMK_GPIO_DATS);
333 nmk_chip->pull_up &= ~BIT(offset);
334 writel(BIT(offset), nmk_chip->addr + NMK_GPIO_DATC);
339 unsigned offset, bool lowemi)
341 bool enabled = nmk_chip->lowemi & BIT(offset);
347 nmk_chip->lowemi |= BIT(offset);
349 nmk_chip->lowemi &= ~BIT(offset);
356 unsigned offset)
358 writel(BIT(offset), nmk_chip->addr + NMK_GPIO_DIRC);
362 unsigned offset, int val)
365 writel(BIT(offset), nmk_chip->addr + NMK_GPIO_DATS);
367 writel(BIT(offset), nmk_chip->addr + NMK_GPIO_DATC);
371 unsigned offset, int val)
373 writel(BIT(offset), nmk_chip->addr + NMK_GPIO_DIRS);
374 __nmk_gpio_set_output(nmk_chip, offset, val);
378 unsigned offset, int gpio_mode,
385 u32 bit = BIT(offset);
394 __nmk_gpio_set_mode(nmk_chip, offset, gpio_mode);
405 nmk_gpio_disable_lazy_irq(struct nmk_gpio_chip *nmk_chip, unsigned offset)
407 u32 falling = nmk_chip->fimsc & BIT(offset);
408 u32 rising = nmk_chip->rimsc & BIT(offset);
409 int gpio = nmk_chip->chip.base + offset;
410 int irq = irq_find_mapping(nmk_chip->chip.irq.domain, offset);
420 nmk_chip->rimsc &= ~BIT(offset);
426 nmk_chip->fimsc &= ~BIT(offset);
444 unsigned offset, unsigned alt_num)
463 if (npct->soc->altcx_pins[i].pin == offset)
468 offset);
488 offset, i+1);
499 offset, alt_num);
517 offset, i+1);
525 offset, alt_index+1);
625 int offset, enum nmk_gpio_irq_type which,
646 if (nmk_chip->edge_rising & BIT(offset)) {
648 *rimscval |= BIT(offset);
650 *rimscval &= ~BIT(offset);
653 if (nmk_chip->edge_falling & BIT(offset)) {
655 *fimscval |= BIT(offset);
657 *fimscval &= ~BIT(offset);
663 int offset, bool on)
671 __nmk_gpio_set_slpm(nmk_chip, offset,
675 __nmk_gpio_irq_modify(nmk_chip, offset, WAKE, on);
827 static int nmk_gpio_get_dir(struct gpio_chip *chip, unsigned offset)
834 dir = readl(nmk_chip->addr + NMK_GPIO_DIR) & BIT(offset);
844 static int nmk_gpio_make_input(struct gpio_chip *chip, unsigned offset)
850 writel(BIT(offset), nmk_chip->addr + NMK_GPIO_DIRC);
857 static int nmk_gpio_get_input(struct gpio_chip *chip, unsigned offset)
864 value = !!(readl(nmk_chip->addr + NMK_GPIO_DAT) & BIT(offset));
871 static void nmk_gpio_set_output(struct gpio_chip *chip, unsigned offset,
878 __nmk_gpio_set_output(nmk_chip, offset, val);
883 static int nmk_gpio_make_output(struct gpio_chip *chip, unsigned offset,
890 __nmk_gpio_make_output(nmk_chip, offset, val);
898 static int nmk_gpio_get_mode(struct nmk_gpio_chip *nmk_chip, int offset)
904 afunc = readl(nmk_chip->addr + NMK_GPIO_AFSLA) & BIT(offset);
905 bfunc = readl(nmk_chip->addr + NMK_GPIO_AFSLB) & BIT(offset);
916 unsigned offset, unsigned gpio)
918 const char *label = gpiochip_is_requested(chip, offset);
936 is_out = !!(readl(nmk_chip->addr + NMK_GPIO_DIR) & BIT(offset));
937 pull = !(readl(nmk_chip->addr + NMK_GPIO_PDIS) & BIT(offset));
938 data_out = !!(readl(nmk_chip->addr + NMK_GPIO_DAT) & BIT(offset));
939 mode = nmk_gpio_get_mode(nmk_chip, offset);
950 int irq = chip->to_irq(chip, offset);
965 val = nmk_gpio_get_input(chip, offset);
975 if (nmk_chip->edge_rising & BIT(offset))
977 else if (nmk_chip->edge_falling & BIT(offset))
1006 unsigned offset, unsigned gpio)
1222 unsigned offset)
1224 struct gpio_chip *chip = find_gc_from_pin(offset);
1227 seq_printf(s, "invalid pin offset");
1230 nmk_gpio_dbg_show_one(s, pctldev, chip, offset - chip->base, offset);
1581 "invalid pin offset %d in group %s at index %d\n",
1629 unsigned offset)
1647 dev_dbg(npct->dev, "enable pin %u as GPIO\n", offset);
1650 bit = offset % NMK_GPIO_PER_CHIP;
1660 unsigned offset)
1664 dev_dbg(npct->dev, "disable pin %u as GPIO\n", offset);
1708 "invalid pin offset %d\n", pin);