Lines Matching full:pctl
40 static int da9062_pctl_get_pin_mode(struct da9062_pctl *pctl, in da9062_pctl_get_pin_mode() argument
43 struct regmap *regmap = pctl->da9062->regmap; in da9062_pctl_get_pin_mode()
56 static int da9062_pctl_set_pin_mode(struct da9062_pctl *pctl, in da9062_pctl_set_pin_mode() argument
59 struct regmap *regmap = pctl->da9062->regmap; in da9062_pctl_set_pin_mode()
71 pctl->pin_config[offset] = mode_req; in da9062_pctl_set_pin_mode()
78 struct da9062_pctl *pctl = gpiochip_get_data(gc); in da9062_gpio_get() local
79 struct regmap *regmap = pctl->da9062->regmap; in da9062_gpio_get()
83 gpio_mode = da9062_pctl_get_pin_mode(pctl, offset); in da9062_gpio_get()
108 struct da9062_pctl *pctl = gpiochip_get_data(gc); in da9062_gpio_set() local
109 struct regmap *regmap = pctl->da9062->regmap; in da9062_gpio_set()
117 struct da9062_pctl *pctl = gpiochip_get_data(gc); in da9062_gpio_get_direction() local
120 gpio_mode = da9062_pctl_get_pin_mode(pctl, offset); in da9062_gpio_get_direction()
140 struct da9062_pctl *pctl = gpiochip_get_data(gc); in da9062_gpio_direction_input() local
141 struct regmap *regmap = pctl->da9062->regmap; in da9062_gpio_direction_input()
146 ret = da9062_pctl_set_pin_mode(pctl, offset, DA9062_PIN_GPI); in da9062_gpio_direction_input()
167 struct da9062_pctl *pctl = gpiochip_get_data(gc); in da9062_gpio_direction_output() local
168 unsigned int pin_config = pctl->pin_config[offset]; in da9062_gpio_direction_output()
171 ret = da9062_pctl_set_pin_mode(pctl, offset, pin_config); in da9062_gpio_direction_output()
183 struct da9062_pctl *pctl = gpiochip_get_data(gc); in da9062_gpio_set_config() local
184 struct regmap *regmap = pctl->da9062->regmap; in da9062_gpio_set_config()
200 gpio_mode = da9062_pctl_get_pin_mode(pctl, offset); in da9062_gpio_set_config()
208 gpio_mode = da9062_pctl_get_pin_mode(pctl, offset); in da9062_gpio_set_config()
216 return da9062_pctl_set_pin_mode(pctl, offset, in da9062_gpio_set_config()
219 return da9062_pctl_set_pin_mode(pctl, offset, in da9062_gpio_set_config()
228 struct da9062_pctl *pctl = gpiochip_get_data(gc); in da9062_gpio_to_irq() local
229 struct da9062 *da9062 = pctl->da9062; in da9062_gpio_to_irq()
252 struct da9062_pctl *pctl; in da9062_pctl_probe() local
257 pctl = devm_kzalloc(&pdev->dev, sizeof(*pctl), GFP_KERNEL); in da9062_pctl_probe()
258 if (!pctl) in da9062_pctl_probe()
261 pctl->da9062 = dev_get_drvdata(parent); in da9062_pctl_probe()
262 if (!pctl->da9062) in da9062_pctl_probe()
268 for (i = 0; i < ARRAY_SIZE(pctl->pin_config); i++) in da9062_pctl_probe()
269 pctl->pin_config[i] = DA9062_PIN_GPO_PP; in da9062_pctl_probe()
275 pctl->gc = reference_gc; in da9062_pctl_probe()
276 pctl->gc.label = dev_name(&pdev->dev); in da9062_pctl_probe()
277 pctl->gc.parent = &pdev->dev; in da9062_pctl_probe()
279 platform_set_drvdata(pdev, pctl); in da9062_pctl_probe()
281 return devm_gpiochip_add_data(&pdev->dev, &pctl->gc, pctl); in da9062_pctl_probe()