lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 7 Jan 2020 00:19:23 +0100
From:   Linus Walleij <linus.walleij@...aro.org>
To:     Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
Cc:     Rob Herring <robh@...nel.org>, Mark Brown <broonie@...nel.org>,
        Lee Jones <lee.jones@...aro.org>,
        Vinod Koul <vinod.koul@...aro.org>,
        "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." 
        <alsa-devel@...a-project.org>,
        "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" 
        <devicetree@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        spapothi@...eaurora.org, bgoswami@...eaurora.org,
        "open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>
Subject: Re: [PATCH v5 09/11] gpio: wcd934x: Add support to wcd934x gpio controller

On Tue, Dec 17, 2019 at 1:17 PM Srinivas Kandagatla
<srinivas.kandagatla@...aro.org> wrote:

> This patch adds support to wcd934x gpio block found in
> WCD9340/WC9341 Audio codecs.
>
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@...aro.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ