Lines Matching defs:offset
18 /* the offset for the mapping of global gpio pin to irq */
61 static int msic_gpio_to_ireg(unsigned offset)
63 if (offset >= MSIC_NUM_GPIO)
66 if (offset < 8)
67 return INTEL_MSIC_GPIO0LV0CTLI - offset;
68 if (offset < 16)
69 return INTEL_MSIC_GPIO1LV0CTLI - offset + 8;
70 if (offset < 20)
71 return INTEL_MSIC_GPIO0HV0CTLI - offset + 16;
73 return INTEL_MSIC_GPIO1HV0CTLI - offset + 20;
76 static int msic_gpio_to_oreg(unsigned offset)
78 if (offset >= MSIC_NUM_GPIO)
81 if (offset < 8)
82 return INTEL_MSIC_GPIO0LV0CTLO - offset;
83 if (offset < 16)
84 return INTEL_MSIC_GPIO1LV0CTLO - offset + 8;
85 if (offset < 20)
86 return INTEL_MSIC_GPIO0HV0CTLO - offset + 16;
88 return INTEL_MSIC_GPIO1HV0CTLO - offset + 20;
91 static int msic_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
95 reg = msic_gpio_to_oreg(offset);
103 unsigned offset, int value)
111 reg = msic_gpio_to_oreg(offset);
118 static int msic_gpio_get(struct gpio_chip *chip, unsigned offset)
124 reg = msic_gpio_to_ireg(offset);
135 static void msic_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
139 reg = msic_gpio_to_oreg(offset);
166 static int msic_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
169 return mg->irq_base + offset;
181 int offset;
189 offset = __ffs(mg->trig_change_mask);
191 reg = msic_gpio_to_ireg(offset);