mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Muthu Mani <muth@cypress.com>
To: Alexandre Courbot <gnurou@gmail.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-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: Wed, 8 Oct 2014 07:09:06 +0000	[thread overview]
Message-ID: <405b439b16ea40078718da326343f673@BN1PR06MB069.namprd06.prod.outlook.com> (raw)
In-Reply-To: <CAAVeFu+vBZ49ciZT+-dnKXks201_psy_NtYsTjw0ptOkx2es7Q@mail.gmail.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 2498 bytes --]

> -----Original Message-----
> From: Alexandre Courbot [mailto:gnurou@gmail.com]
> Sent: Tuesday, October 07, 2014 3:34 PM
> To: Muthu Mani
> Cc: Samuel Ortiz; Lee Jones; Wolfram Sang; Linus Walleij; Greg Kroah-
> Hartman; linux-i2c@vger.kernel.org; linux-gpio@vger.kernel.org; linux-
> usb@vger.kernel.org; Linux Kernel Mailing List; Rajaram Regupathy; Johan
> Hovold
> Subject: Re: [PATCH v3 3/3] gpio: add support for Cypress CYUSBS234 USB-
> GPIO adapter
> 
> 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.

Thanks for your inputs.

Only the GPIOs which are configured to be output GPIO can be set.
The set operation would fail trying to set the input or unconfigured GPIOs.
In this version of driver, this support is not added, it can be introduced in future versions.
I will add a TODO note in the code.

> 
> > +
> > +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.

CYUSBS234 has 12 GPIOs in total as per the datasheet. I will add a macro and use it.
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

  reply	other threads:[~2014-10-08  7:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-06 14:47 Muthu Mani
2014-10-07 10:03 ` Alexandre Courbot
2014-10-08  7:09   ` Muthu Mani [this message]
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=405b439b16ea40078718da326343f673@BN1PR06MB069.namprd06.prod.outlook.com \
    --to=muth@cypress.com \
    --cc=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=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

all inboxes | Powered by JetHome®