7 Jan
2020
7 Jan
'20
12:19 a.m.
On Tue, Dec 17, 2019 at 1:17 PM Srinivas Kandagatla srinivas.kandagatla@linaro.org wrote:
This patch adds support to wcd934x gpio block found in WCD9340/WC9341 Audio codecs.
Signed-off-by: Srinivas Kandagatla srinivas.kandagatla@linaro.org
This looks mostly finished, some minor comments.
+config GPIO_WCD934X
tristate "Qualcomm Technologies Inc WCD9340/WCD9341 gpio controller driver"
depends on MFD_WCD934X && OF_GPIO
select GPIO_GENERIC
You're not using GPIO_GENERIC so select GPIOLIB instead.
+#include <linux/module.h> +#include <linux/gpio.h>
Don't use this legacy header, use <linux/gpio/driver.h>
+static int wcd_gpio_probe(struct platform_device *pdev) +{
struct device *dev = &pdev->dev;
struct wcd_gpio_data *data;
struct gpio_chip *chip;
data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
if (!data)
return -ENOMEM;
data->map = dev_get_regmap(dev->parent, NULL);
if (!data->map) {
dev_err(dev, "%s: failed to get regmap\n", __func__);
return -EINVAL;
}
chip = &data->chip;
chip->direction_input = wcd_gpio_direction_input;
chip->direction_output = wcd_gpio_direction_output;
chip->get = wcd_gpio_get;
chip->set = wcd_gpio_set;
If you can, please implement .get_direction(), see other drivers under gpio for examples.
Yours, Linus Walleij