linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org>
To: "fixed-term.Oleksij.Rempel"
	<fixed-term.Oleksij.Rempel-V5te9oGctAVWk0Htik3J/w@public.gmane.org>
Cc: Oleksij Rempel <linux-YEK0n+YFykbzxQdaRaTXBw@public.gmane.org>,
	Dirk Behme <dirk.behme-V5te9oGctAVWk0Htik3J/w@public.gmane.org>,
	Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	linux-spi <linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH RFC] spi: add flow controll support
Date: Mon, 29 Feb 2016 14:46:44 +0100	[thread overview]
Message-ID: <CAMuHMdUYAOqA_dYsQmA18jrijGC3ShGEaT9MJoC9r_buqv_-Ew@mail.gmail.com> (raw)
In-Reply-To: <56D448E1.6090006-V5te9oGctAVWk0Htik3J/w@public.gmane.org>

Hi Oleksij,

On Mon, Feb 29, 2016 at 2:34 PM, fixed-term.Oleksij.Rempel
<fixed-term.Oleksij.Rempel-V5te9oGctAVWk0Htik3J/w@public.gmane.org> wrote:
> On 29.02.2016 13:14, Geert Uytterhoeven wrote:
>> On Mon, Feb 29, 2016 at 1:04 PM, Oleksij Rempel <linux-YEK0n+YFykbzxQdaRaTXBw@public.gmane.org> wrote:
>>> --- a/drivers/spi/spi.c
>>> +++ b/drivers/spi/spi.c
>>
>>> +/* spi_fc_probe should be called by spi_device driver. */
>>> +int spi_fc_probe(struct spi_device *spi)
>>> +{
>>> +       struct device_node *np = spi->dev.of_node;
>>> +       int ret;
>>> +
>>> +       if (!np)
>>> +               return 0;
>>> +
>>> +       if (!(spi->mode & SPI_FC_MASK) || spi->mode & SPI_FC_HW_ONLY)
>>> +               return 0;
>>> +
>>> +       spi->fc_gpio = devm_gpiod_get(&spi->dev, "fc", GPIOD_IN);
>>> +       if (IS_ERR(spi->fc_gpio)) {
>>> +               ret = PTR_ERR(spi->fc_gpio);
>>> +               dev_err(&spi->dev, "Failed to request FC GPIO: %d\n", ret);
>>> +               return ret;
>>> +       }
>>> +
>>> +       init_completion(&spi->fc_complete);
>>> +       snprintf(spi->fc_irq_name, sizeof(spi->fc_irq_name), "spi-fc-%s",
>>> +                dev_name(&spi->dev));
>>> +       ret = devm_request_irq(&spi->dev, gpiod_to_irq(spi->fc_gpio),
>>
>> gpiod_to_irq() will return -ENXIO if the GPIO doesn't support interrupts.
>> Granted, devm_request_irq() will fail in that case, but you may want to support
>> polling.
>
> Do you mean IRQF_IRQPOLL or row gpio polling?

I don't mean IRQF_IRQPOLL.
I don't know what you mean by "row gpio polling".

I mean a GPIO without interrupt capability, where you have to read the GPIO
state from time to time to detect changes.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2016-02-29 13:46 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-29 12:04 [PATCH RFC] spi: add flow controll support Oleksij Rempel
     [not found] ` <1456747459-8559-1-git-send-email-linux-YEK0n+YFykbzxQdaRaTXBw@public.gmane.org>
2016-02-29 12:14   ` Geert Uytterhoeven
     [not found]     ` <56D448E1.6090006@de.bosch.com>
     [not found]       ` <56D448E1.6090006-V5te9oGctAVWk0Htik3J/w@public.gmane.org>
2016-02-29 13:46         ` Geert Uytterhoeven [this message]
2016-03-01 14:43         ` [PATCH 1/6] " Oleksij Rempel
     [not found]           ` <1456843400-20696-1-git-send-email-linux-YEK0n+YFykbzxQdaRaTXBw@public.gmane.org>
2016-03-01 14:43             ` [PATCH 2/6] spi: add add flow control test driver Oleksij Rempel
2016-03-01 14:43             ` [PATCH 3/6] DT: add documentation for spi-fc-test driver Oleksij Rempel
     [not found]               ` <1456843400-20696-3-git-send-email-linux-YEK0n+YFykbzxQdaRaTXBw@public.gmane.org>
2016-03-02  2:17                 ` Mark Brown
2016-03-01 14:43             ` [PATCH 4/6] spi: davinci: set new SPI_FC_* flags Oleksij Rempel
     [not found]               ` <1456843400-20696-4-git-send-email-linux-YEK0n+YFykbzxQdaRaTXBw@public.gmane.org>
2016-03-02  2:16                 ` Mark Brown
     [not found]                   ` <56D68754.3090405@de.bosch.com>
     [not found]                     ` <56D68754.3090405-V5te9oGctAVWk0Htik3J/w@public.gmane.org>
2016-03-02 10:48                       ` Mark Brown
2016-03-01 14:43             ` [PATCH 5/6] spi: sun4i: " Oleksij Rempel
2016-03-01 14:43             ` [PATCH 6/6] spi: bitbang: " Oleksij Rempel
2016-03-02  1:32             ` [PATCH 1/6] spi: add flow controll support Mark Brown
2016-03-02  2:46             ` Mark Brown
     [not found]               ` <56D68CD7.8000203@de.bosch.com>
     [not found]                 ` <56D68CD7.8000203-V5te9oGctAVWk0Htik3J/w@public.gmane.org>
2016-03-02 10:55                   ` Mark Brown
2016-03-02 12:26             ` Martin Sperl
2016-02-29 13:11   ` [PATCH RFC] " Martin Sperl

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=CAMuHMdUYAOqA_dYsQmA18jrijGC3ShGEaT9MJoC9r_buqv_-Ew@mail.gmail.com \
    --to=geert-td1emuhucqxl1znqvxdv9g@public.gmane.org \
    --cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=dirk.behme-V5te9oGctAVWk0Htik3J/w@public.gmane.org \
    --cc=fixed-term.Oleksij.Rempel-V5te9oGctAVWk0Htik3J/w@public.gmane.org \
    --cc=linux-YEK0n+YFykbzxQdaRaTXBw@public.gmane.org \
    --cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /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).