Lines Matching refs:chip
46 struct gpio_chip chip; member
59 static void errata_outl(struct cs5535_gpio_chip *chip, u32 val, in errata_outl() argument
62 unsigned long addr = chip->base + 0x80 + reg; in errata_outl()
82 static void __cs5535_gpio_set(struct cs5535_gpio_chip *chip, unsigned offset, in __cs5535_gpio_set() argument
87 outl(1 << offset, chip->base + reg); in __cs5535_gpio_set()
90 errata_outl(chip, 1 << (offset - 16), reg); in __cs5535_gpio_set()
95 struct cs5535_gpio_chip *chip = &cs5535_gpio_chip; in cs5535_gpio_set() local
98 spin_lock_irqsave(&chip->lock, flags); in cs5535_gpio_set()
99 __cs5535_gpio_set(chip, offset, reg); in cs5535_gpio_set()
100 spin_unlock_irqrestore(&chip->lock, flags); in cs5535_gpio_set()
104 static void __cs5535_gpio_clear(struct cs5535_gpio_chip *chip, unsigned offset, in __cs5535_gpio_clear() argument
109 outl(1 << (offset + 16), chip->base + reg); in __cs5535_gpio_clear()
112 errata_outl(chip, 1 << offset, reg); in __cs5535_gpio_clear()
117 struct cs5535_gpio_chip *chip = &cs5535_gpio_chip; in cs5535_gpio_clear() local
120 spin_lock_irqsave(&chip->lock, flags); in cs5535_gpio_clear()
121 __cs5535_gpio_clear(chip, offset, reg); in cs5535_gpio_clear()
122 spin_unlock_irqrestore(&chip->lock, flags); in cs5535_gpio_clear()
128 struct cs5535_gpio_chip *chip = &cs5535_gpio_chip; in cs5535_gpio_isset() local
132 spin_lock_irqsave(&chip->lock, flags); in cs5535_gpio_isset()
135 val = inl(chip->base + reg); in cs5535_gpio_isset()
138 val = inl(chip->base + 0x80 + reg); in cs5535_gpio_isset()
141 spin_unlock_irqrestore(&chip->lock, flags); in cs5535_gpio_isset()
166 struct cs5535_gpio_chip *chip = &cs5535_gpio_chip; in cs5535_gpio_setup_event() local
180 spin_lock_irqsave(&chip->lock, flags); in cs5535_gpio_setup_event()
181 val = inl(chip->base + offset); in cs5535_gpio_setup_event()
193 outl(val, chip->base + offset); in cs5535_gpio_setup_event()
194 spin_unlock_irqrestore(&chip->lock, flags); in cs5535_gpio_setup_event()
204 struct cs5535_gpio_chip *chip = in chip_gpio_request() local
205 container_of(c, struct cs5535_gpio_chip, chip); in chip_gpio_request()
208 spin_lock_irqsave(&chip->lock, flags); in chip_gpio_request()
212 dev_info(&chip->pdev->dev, in chip_gpio_request()
214 spin_unlock_irqrestore(&chip->lock, flags); in chip_gpio_request()
219 __cs5535_gpio_clear(chip, offset, GPIO_OUTPUT_AUX1); in chip_gpio_request()
220 __cs5535_gpio_clear(chip, offset, GPIO_OUTPUT_AUX2); in chip_gpio_request()
223 __cs5535_gpio_clear(chip, offset, GPIO_INPUT_AUX1); in chip_gpio_request()
225 spin_unlock_irqrestore(&chip->lock, flags); in chip_gpio_request()
230 static int chip_gpio_get(struct gpio_chip *chip, unsigned offset) in chip_gpio_get() argument
235 static void chip_gpio_set(struct gpio_chip *chip, unsigned offset, int val) in chip_gpio_set() argument
245 struct cs5535_gpio_chip *chip = in chip_direction_input() local
246 container_of(c, struct cs5535_gpio_chip, chip); in chip_direction_input()
249 spin_lock_irqsave(&chip->lock, flags); in chip_direction_input()
250 __cs5535_gpio_set(chip, offset, GPIO_INPUT_ENABLE); in chip_direction_input()
251 __cs5535_gpio_clear(chip, offset, GPIO_OUTPUT_ENABLE); in chip_direction_input()
252 spin_unlock_irqrestore(&chip->lock, flags); in chip_direction_input()
259 struct cs5535_gpio_chip *chip = in chip_direction_output() local
260 container_of(c, struct cs5535_gpio_chip, chip); in chip_direction_output()
263 spin_lock_irqsave(&chip->lock, flags); in chip_direction_output()
265 __cs5535_gpio_set(chip, offset, GPIO_INPUT_ENABLE); in chip_direction_output()
266 __cs5535_gpio_set(chip, offset, GPIO_OUTPUT_ENABLE); in chip_direction_output()
268 __cs5535_gpio_set(chip, offset, GPIO_OUTPUT_VAL); in chip_direction_output()
270 __cs5535_gpio_clear(chip, offset, GPIO_OUTPUT_VAL); in chip_direction_output()
272 spin_unlock_irqrestore(&chip->lock, flags); in chip_direction_output()
289 .chip = {
350 err = gpiochip_add(&cs5535_gpio_chip.chip); in cs5535_gpio_probe()
362 gpiochip_remove(&cs5535_gpio_chip.chip); in cs5535_gpio_remove()