Lines Matching defs:lp3943_gpio

39 struct lp3943_gpio {
47 struct lp3943_gpio *lp3943_gpio = gpiochip_get_data(chip);
48 struct lp3943 *lp3943 = lp3943_gpio->lp3943;
59 struct lp3943_gpio *lp3943_gpio = gpiochip_get_data(chip);
60 struct lp3943 *lp3943 = lp3943_gpio->lp3943;
65 static int lp3943_gpio_set_mode(struct lp3943_gpio *lp3943_gpio, u8 offset,
68 struct lp3943 *lp3943 = lp3943_gpio->lp3943;
77 struct lp3943_gpio *lp3943_gpio = gpiochip_get_data(chip);
79 lp3943_gpio->input_mask |= BIT(offset);
81 return lp3943_gpio_set_mode(lp3943_gpio, offset, LP3943_GPIO_IN);
84 static int lp3943_get_gpio_in_status(struct lp3943_gpio *lp3943_gpio,
102 err = lp3943_read_byte(lp3943_gpio->lp3943, addr, &read);
109 static int lp3943_get_gpio_out_status(struct lp3943_gpio *lp3943_gpio,
112 struct lp3943 *lp3943 = lp3943_gpio->lp3943;
133 struct lp3943_gpio *lp3943_gpio = gpiochip_get_data(chip);
144 if (lp3943_gpio->input_mask & BIT(offset))
145 return lp3943_get_gpio_in_status(lp3943_gpio, chip, offset);
147 return lp3943_get_gpio_out_status(lp3943_gpio, chip, offset);
152 struct lp3943_gpio *lp3943_gpio = gpiochip_get_data(chip);
160 lp3943_gpio_set_mode(lp3943_gpio, offset, data);
166 struct lp3943_gpio *lp3943_gpio = gpiochip_get_data(chip);
169 lp3943_gpio->input_mask &= ~BIT(offset);
191 struct lp3943_gpio *lp3943_gpio;
193 lp3943_gpio = devm_kzalloc(&pdev->dev, sizeof(*lp3943_gpio),
195 if (!lp3943_gpio)
198 lp3943_gpio->lp3943 = lp3943;
199 lp3943_gpio->chip = lp3943_gpio_chip;
200 lp3943_gpio->chip.parent = &pdev->dev;
202 platform_set_drvdata(pdev, lp3943_gpio);
204 return devm_gpiochip_add_data(&pdev->dev, &lp3943_gpio->chip,
205 lp3943_gpio);