Lines Matching +full:wcd9340 +full:- +full:gpio
1 // SPDX-License-Identifier: GPL-2.0
5 #include <linux/gpio/driver.h>
10 #define WCD_PIN_MASK(p) BIT(p - 1)
26 ret = regmap_read(data->map, WCD_REG_DIR_CTL_OFFSET, &value); in wcd_gpio_get_direction()
40 return regmap_update_bits(data->map, WCD_REG_DIR_CTL_OFFSET, in wcd_gpio_direction_input()
49 regmap_update_bits(data->map, WCD_REG_DIR_CTL_OFFSET, in wcd_gpio_direction_output()
52 return regmap_update_bits(data->map, WCD_REG_VAL_CTL_OFFSET, in wcd_gpio_direction_output()
62 regmap_read(data->map, WCD_REG_VAL_CTL_OFFSET, &value); in wcd_gpio_get()
71 regmap_update_bits(data->map, WCD_REG_VAL_CTL_OFFSET, in wcd_gpio_set()
77 struct device *dev = &pdev->dev; in wcd_gpio_probe()
83 return -ENOMEM; in wcd_gpio_probe()
85 data->map = dev_get_regmap(dev->parent, NULL); in wcd_gpio_probe()
86 if (!data->map) { in wcd_gpio_probe()
88 return -EINVAL; in wcd_gpio_probe()
91 chip = &data->chip; in wcd_gpio_probe()
92 chip->direction_input = wcd_gpio_direction_input; in wcd_gpio_probe()
93 chip->direction_output = wcd_gpio_direction_output; in wcd_gpio_probe()
94 chip->get_direction = wcd_gpio_get_direction; in wcd_gpio_probe()
95 chip->get = wcd_gpio_get; in wcd_gpio_probe()
96 chip->set = wcd_gpio_set; in wcd_gpio_probe()
97 chip->parent = dev; in wcd_gpio_probe()
98 chip->base = -1; in wcd_gpio_probe()
99 chip->ngpio = WCD934X_NPINS; in wcd_gpio_probe()
100 chip->label = dev_name(dev); in wcd_gpio_probe()
101 chip->of_gpio_n_cells = 2; in wcd_gpio_probe()
102 chip->can_sleep = false; in wcd_gpio_probe()
108 { .compatible = "qcom,wcd9340-gpio" },
109 { .compatible = "qcom,wcd9341-gpio" },
116 .name = "wcd934x-gpio",
123 MODULE_DESCRIPTION("Qualcomm Technologies, Inc WCD GPIO control driver");