Lines Matching refs:offset
75 static int msic_gpio_to_ireg(unsigned offset) in msic_gpio_to_ireg() argument
77 if (offset >= MSIC_NUM_GPIO) in msic_gpio_to_ireg()
80 if (offset < 8) in msic_gpio_to_ireg()
81 return INTEL_MSIC_GPIO0LV0CTLI - offset; in msic_gpio_to_ireg()
82 if (offset < 16) in msic_gpio_to_ireg()
83 return INTEL_MSIC_GPIO1LV0CTLI - offset + 8; in msic_gpio_to_ireg()
84 if (offset < 20) in msic_gpio_to_ireg()
85 return INTEL_MSIC_GPIO0HV0CTLI - offset + 16; in msic_gpio_to_ireg()
87 return INTEL_MSIC_GPIO1HV0CTLI - offset + 20; in msic_gpio_to_ireg()
90 static int msic_gpio_to_oreg(unsigned offset) in msic_gpio_to_oreg() argument
92 if (offset >= MSIC_NUM_GPIO) in msic_gpio_to_oreg()
95 if (offset < 8) in msic_gpio_to_oreg()
96 return INTEL_MSIC_GPIO0LV0CTLO - offset; in msic_gpio_to_oreg()
97 if (offset < 16) in msic_gpio_to_oreg()
98 return INTEL_MSIC_GPIO1LV0CTLO - offset + 8; in msic_gpio_to_oreg()
99 if (offset < 20) in msic_gpio_to_oreg()
100 return INTEL_MSIC_GPIO0HV0CTLO - offset + 16; in msic_gpio_to_oreg()
102 return INTEL_MSIC_GPIO1HV0CTLO - offset + 20; in msic_gpio_to_oreg()
105 static int msic_gpio_direction_input(struct gpio_chip *chip, unsigned offset) in msic_gpio_direction_input() argument
109 reg = msic_gpio_to_oreg(offset); in msic_gpio_direction_input()
117 unsigned offset, int value) in msic_gpio_direction_output() argument
125 reg = msic_gpio_to_oreg(offset); in msic_gpio_direction_output()
132 static int msic_gpio_get(struct gpio_chip *chip, unsigned offset) in msic_gpio_get() argument
138 reg = msic_gpio_to_ireg(offset); in msic_gpio_get()
149 static void msic_gpio_set(struct gpio_chip *chip, unsigned offset, int value) in msic_gpio_set() argument
153 reg = msic_gpio_to_oreg(offset); in msic_gpio_set()
180 static int msic_gpio_to_irq(struct gpio_chip *chip, unsigned offset) in msic_gpio_to_irq() argument
183 return mg->irq_base + offset; in msic_gpio_to_irq()
195 int offset; in msic_bus_sync_unlock() local
203 offset = __ffs(mg->trig_change_mask); in msic_bus_sync_unlock()
205 reg = msic_gpio_to_ireg(offset); in msic_bus_sync_unlock()