Searched refs:lp3943_gpio (Results 1 - 1 of 1) sorted by relevance

/linux-4.1.27/drivers/gpio/
H A Dgpio-lp3943.c42 struct lp3943_gpio { struct
48 static inline struct lp3943_gpio *to_lp3943_gpio(struct gpio_chip *_chip) to_lp3943_gpio()
50 return container_of(_chip, struct lp3943_gpio, chip); to_lp3943_gpio()
55 struct lp3943_gpio *lp3943_gpio = to_lp3943_gpio(chip); lp3943_gpio_request() local
56 struct lp3943 *lp3943 = lp3943_gpio->lp3943; lp3943_gpio_request()
67 struct lp3943_gpio *lp3943_gpio = to_lp3943_gpio(chip); lp3943_gpio_free() local
68 struct lp3943 *lp3943 = lp3943_gpio->lp3943; lp3943_gpio_free()
73 static int lp3943_gpio_set_mode(struct lp3943_gpio *lp3943_gpio, u8 offset, lp3943_gpio_set_mode() argument
76 struct lp3943 *lp3943 = lp3943_gpio->lp3943; lp3943_gpio_set_mode()
85 struct lp3943_gpio *lp3943_gpio = to_lp3943_gpio(chip); lp3943_gpio_direction_input() local
87 lp3943_gpio->input_mask |= BIT(offset); lp3943_gpio_direction_input()
89 return lp3943_gpio_set_mode(lp3943_gpio, offset, LP3943_GPIO_IN); lp3943_gpio_direction_input()
92 static int lp3943_get_gpio_in_status(struct lp3943_gpio *lp3943_gpio, lp3943_get_gpio_in_status() argument
110 err = lp3943_read_byte(lp3943_gpio->lp3943, addr, &read); lp3943_get_gpio_in_status()
117 static int lp3943_get_gpio_out_status(struct lp3943_gpio *lp3943_gpio, lp3943_get_gpio_out_status() argument
120 struct lp3943 *lp3943 = lp3943_gpio->lp3943; lp3943_get_gpio_out_status()
141 struct lp3943_gpio *lp3943_gpio = to_lp3943_gpio(chip); lp3943_gpio_get() local
152 if (lp3943_gpio->input_mask & BIT(offset)) lp3943_gpio_get()
153 return lp3943_get_gpio_in_status(lp3943_gpio, chip, offset); lp3943_gpio_get()
155 return lp3943_get_gpio_out_status(lp3943_gpio, chip, offset); lp3943_gpio_get()
160 struct lp3943_gpio *lp3943_gpio = to_lp3943_gpio(chip); lp3943_gpio_set() local
168 lp3943_gpio_set_mode(lp3943_gpio, offset, data); lp3943_gpio_set()
174 struct lp3943_gpio *lp3943_gpio = to_lp3943_gpio(chip); lp3943_gpio_direction_output() local
177 lp3943_gpio->input_mask &= ~BIT(offset); lp3943_gpio_direction_output()
199 struct lp3943_gpio *lp3943_gpio; lp3943_gpio_probe() local
201 lp3943_gpio = devm_kzalloc(&pdev->dev, sizeof(*lp3943_gpio), lp3943_gpio_probe()
203 if (!lp3943_gpio) lp3943_gpio_probe()
206 lp3943_gpio->lp3943 = lp3943; lp3943_gpio_probe()
207 lp3943_gpio->chip = lp3943_gpio_chip; lp3943_gpio_probe()
208 lp3943_gpio->chip.dev = &pdev->dev; lp3943_gpio_probe()
210 platform_set_drvdata(pdev, lp3943_gpio); lp3943_gpio_probe()
212 return gpiochip_add(&lp3943_gpio->chip); lp3943_gpio_probe()
217 struct lp3943_gpio *lp3943_gpio = platform_get_drvdata(pdev); lp3943_gpio_remove() local
219 gpiochip_remove(&lp3943_gpio->chip); lp3943_gpio_remove()

Completed in 73 milliseconds