From: Alexandre Courbot <gnurou@gmail.com>
To: Muthu Mani <muth@cypress.com>
Cc: Samuel Ortiz <sameo@linux.intel.com>,
Lee Jones <lee.jones@linaro.org>,
Wolfram Sang <wsa@the-dreams.de>,
Linus Walleij <linus.walleij@linaro.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>,
"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
linux-usb@vger.kernel.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Rajaram Regupathy <rera@cypress.com>,
Johan Hovold <johan@kernel.org>
Subject: Re: [PATCH v3 3/3] gpio: add support for Cypress CYUSBS234 USB-GPIO adapter
Date: Tue, 7 Oct 2014 19:03:56 +0900 [thread overview]
Message-ID: <CAAVeFu+vBZ49ciZT+-dnKXks201_psy_NtYsTjw0ptOkx2es7Q@mail.gmail.com> (raw)
In-Reply-To: <1412606822-3406-1-git-send-email-muth@cypress.com>
On Mon, Oct 6, 2014 at 11:47 PM, Muthu Mani <muth@cypress.com> wrote:
> +
> +static int cy_gpio_direction_input(struct gpio_chip *chip,
> + unsigned offset)
> +{
> + return 0;
> +}
> +
> +static int cy_gpio_direction_output(struct gpio_chip *chip,
> + unsigned offset, int value)
> +{
> + return 0;
> +}
If that chip is capable of both output and input, shouldn't these
functions be implemented? I think this has already been pointed out in
a previous version but you did not reply.
> +
> +static int cyusbs23x_gpio_probe(struct platform_device *pdev)
> +{
> + struct cyusbs23x *cyusbs;
> + struct cyusbs_gpio *cy_gpio;
> + int ret = 0;
> +
> + dev_dbg(&pdev->dev, "%s\n", __func__);
> +
> + cyusbs = dev_get_drvdata(pdev->dev.parent);
> +
> + cy_gpio = devm_kzalloc(&pdev->dev, sizeof(*cy_gpio), GFP_KERNEL);
> + if (cy_gpio == NULL)
> + return -ENOMEM;
> +
> + cy_gpio->cyusbs = cyusbs;
> + /* registering gpio */
> + cy_gpio->gpio.label = dev_name(&pdev->dev);
> + cy_gpio->gpio.dev = &pdev->dev;
> + cy_gpio->gpio.owner = THIS_MODULE;
> + cy_gpio->gpio.base = -1;
> + cy_gpio->gpio.ngpio = 12; /* total GPIOs */
Isn't there a way to get the number of GPIOs from a reliable source?
If not, please at least use a macro here.
next prev parent reply other threads:[~2014-10-07 10:04 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-06 14:47 [PATCH v3 3/3] gpio: add support for Cypress CYUSBS234 USB-GPIO adapter Muthu Mani
2014-10-07 10:03 ` Alexandre Courbot [this message]
[not found] ` <CAAVeFu+vBZ49ciZT+-dnKXks201_psy_NtYsTjw0ptOkx2es7Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-10-08 7:09 ` Muthu Mani
[not found] ` <405b439b16ea40078718da326343f673-W5EIp8XyyIo12s5EQIJpXb9PrO6axcR4XA4E9RH9d+qIuWR1G4zioA@public.gmane.org>
2014-10-08 7:18 ` Alexandre Courbot
2014-10-08 23:46 ` RR
2014-10-09 7:59 ` Alexandre Courbot
2014-10-27 15:30 ` Linus Walleij
2014-10-29 2:21 ` RR
-- strict thread matches above, loose matches on Subject: below --
2014-10-06 12:53 Muthu Mani
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAAVeFu+vBZ49ciZT+-dnKXks201_psy_NtYsTjw0ptOkx2es7Q@mail.gmail.com \
--to=gnurou@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=johan@kernel.org \
--cc=lee.jones@linaro.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=muth@cypress.com \
--cc=rera@cypress.com \
--cc=sameo@linux.intel.com \
--cc=wsa@the-dreams.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).