linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Peter Hung <hpeter@gmail.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Alexandre Courbot <gnurou@gmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jslaby@suse.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	"linux-serial@vger.kernel.org" <linux-serial@vger.kernel.org>,
	One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>,
	Rob Groner <rgroner@rtd.com>
Subject: Re: [PATCH v5] serial: 8250: add gpio support to exar
Date: Tue, 19 Jan 2016 16:44:23 +0530	[thread overview]
Message-ID: <20160119111344.GA23168@sudip-pc> (raw)
In-Reply-To: <CAHp75VdopyRUcwSFY=qowoiq6Twkg686oQHed8WU5Ep8QQtL+A@mail.gmail.com>

On Tue, Jan 19, 2016 at 12:09:08PM +0200, Andy Shevchenko wrote:
> On Tue, Jan 19, 2016 at 8:06 AM, Sudip Mukherjee
> <sudipm.mukherjee@gmail.com> wrote:
> > Exar XR17V352/354/358 chips have 16 multi-purpose inputs/outputs which
> > can be controlled using gpio interface.
> > Add support to use these pins.
> 
> + Peter Hung.
> 
> Seems Fintek HW is going similar way you, guys, have to decide how to
> proceed in general. I like this way Sudip made here, though I still
> few comments below.

Just had a look at the Fintek patch. Interestingly high baudrate was our
next plan. :)

> 
> First of all, can we split it to two patches like cooking GPIO driver
> first, then extend Exar piece of serial driver?
> 
> I also would like to vote for splitting out first Exar parts from
> 8250_pci like Peter did for Fintek.

Then maybe instead of splitting out if we have the provision of high
baudrate in 8250_pci? And the way I have done, it is just a matter of few
function calls from 8250_pci in case the hardware is present. So then,
what may be the advantage of splitting out?

>
<snip>
 
> > +static void exar_set(struct gpio_chip *chip, unsigned int reg, int val,
> > +                    unsigned int offset)
> 
> This one by implementation looks like exar_update()

well, I made it exar_set() as it is setting the gpio pins.

> 
<snip>
> > +
> > +static int gpio_exar_probe(struct platform_device *pdev)
> > +{
> > +       struct pci_dev *dev = platform_get_drvdata(pdev);
> > +       struct exar_gpio_chip *exar_gpio, *exar_temp;
> > +       void __iomem *p;
> > +       int index = 1;
> > +       int ret;
> > +
> > +       if (dev->vendor != PCI_VENDOR_ID_EXAR)
> > +               return -ENODEV;
> > +
> > +       p = pci_ioremap_bar(dev, 0);
> 
> So, if it would be separate driver for 8250_exar.c (by the way what is
> 8250_exar_st16c554.c?) you will use managed functions here…

8250_exar_st16c554.c -> Its probe and all other functions are in 8250_core.c

> 
<snip>
> > +       sprintf(exar_gpio->name, "exar_gpio%d", index);
> > +       exar_gpio->gpio_chip.label = exar_gpio->name;
> > +       exar_gpio->gpio_chip.parent = &dev->dev;
> > +       exar_gpio->gpio_chip.direction_output = exar_direction_output;
> > +       exar_gpio->gpio_chip.direction_input = exar_direction_input;
> > +       exar_gpio->gpio_chip.get_direction = exar_get_direction;
> > +       exar_gpio->gpio_chip.get = exar_get_value;
> > +       exar_gpio->gpio_chip.set = exar_set_value;
> > +       exar_gpio->gpio_chip.base = -1;
> > +       exar_gpio->gpio_chip.ngpio = 16;
> 
> > +       exar_gpio->gpio_chip.owner = THIS_MODULE;
> 
> Does core set it for you?

No, all the gpio drivers are setting it by itself. Maybe we can see if
that feature can be added to gpio core or not..

> 
<snip>
> 
> > +static const struct platform_device_id gpio_exar_id[] = {
> 
> > +       { "gpio_exar", 0},
> 
> This is default fallback. I don't think you need this at all (example
> in my mind is dw_dmac driver, where you can't find such line). But
> please recheck.

somehow in my testing the module was not loading without this. Maybe
module_alias is the key. I will check again while making these
modifications. But now the question is should I split out? What advantage
will be there in splitting out?

regards
sudip
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2016-01-19 11:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-19  6:06 [PATCH v5] serial: 8250: add gpio support to exar Sudip Mukherjee
2016-01-19 10:09 ` Andy Shevchenko
2016-01-19 11:14   ` Sudip Mukherjee [this message]
2016-01-19 11:39     ` Andy Shevchenko
2016-02-07  6:44 ` Greg Kroah-Hartman
2016-02-07 13:54   ` Sudip Mukherjee
2016-02-07 21:35     ` Greg Kroah-Hartman

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=20160119111344.GA23168@sudip-pc \
    --to=sudipm.mukherjee@gmail.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=gnomes@lxorguk.ukuu.org.uk \
    --cc=gnurou@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hpeter@gmail.com \
    --cc=jslaby@suse.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=rgroner@rtd.com \
    /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).