All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Carlis <zhangxuezhi3@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Colin King <colin.king@canonical.com>,
	oliver.graute@kococonnector.com, zhangxuezhi1@yulong.com,
	Deepak R Varma <mh12gx2825@gmail.com>,
	Stefano Brivio <sbrivio@redhat.com>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	"open list:FRAMEBUFFER LAYER" <linux-fbdev@vger.kernel.org>,
	"open list:STAGING SUBSYSTEM" <devel@driverdev.osuosl.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v12] staging: fbtft: add tearing signal detect
Date: Thu, 28 Jan 2021 16:44:02 +0200	[thread overview]
Message-ID: <CAHp75VcRxPVs0KHwaY8QZima489D2_hntuW0eUqdfK8HJ-gnKA@mail.gmail.com> (raw)
In-Reply-To: <CAHp75Vd=ijxnamuSYuxNLeyhGMCod=HaXWrQ0W0+3QCsQAychg@mail.gmail.com>

On Thu, Jan 28, 2021 at 4:33 PM Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
> On Thu, Jan 28, 2021 at 2:58 PM Carlis <zhangxuezhi3@gmail.com> wrote:

...

> Taking all together you probably need to create a helper and use it
> inside init_display(), like
>
> static int init_tearing_effect_line(struct fbtft_par *par)
> {
>   struct device *dev = par->info->device;
>   struct gpio_desc *te;
>   int irq, rc;
>
>   te = gpiod_get_optional(dev, "te", GPIOD_IN);
>   if (IS_ERR(te))
>            return dev_err_probe(dev, PTR_ERR(te), "Failed to request
> te GPIO\n");

Sorry, here I missed the following:

  /* Absence of TE IRQ is not critical */
  if (!te)
    return 0;

>   irq = gpiod_to_irq(te); // this value you have to save in the
> driver's (per device) data structure.
>
>   /* GPIO is locked as an IRQ, we may drop the reference */
>   gpiod_put(te);

...and here:

  if (irq < 0)
    return irq;

>   init_completion(&spi_panel_te); // should be in the (per device)
> data structure
>   rc = devm_request_irq(dev, irq,  spi_panel_te_handler,
> IRQF_TRIGGER_RISING, "TE_GPIO", par);
>   if (rc)
>                 return dev_err_probe(dev, rc, "TE IRQ request failed.\n");
>   disable_irq_nosync(irq);
>   return irq;
> }

-- 
With Best Regards,
Andy Shevchenko

WARNING: multiple messages have this Message-ID (diff)
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Carlis <zhangxuezhi3@gmail.com>
Cc: "open list:STAGING SUBSYSTEM" <devel@driverdev.osuosl.org>,
	"open list:FRAMEBUFFER LAYER" <linux-fbdev@vger.kernel.org>,
	Deepak R Varma <mh12gx2825@gmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	oliver.graute@kococonnector.com,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	Stefano Brivio <sbrivio@redhat.com>,
	Colin King <colin.king@canonical.com>,
	zhangxuezhi1@yulong.com
Subject: Re: [PATCH v12] staging: fbtft: add tearing signal detect
Date: Thu, 28 Jan 2021 16:44:02 +0200	[thread overview]
Message-ID: <CAHp75VcRxPVs0KHwaY8QZima489D2_hntuW0eUqdfK8HJ-gnKA@mail.gmail.com> (raw)
In-Reply-To: <CAHp75Vd=ijxnamuSYuxNLeyhGMCod=HaXWrQ0W0+3QCsQAychg@mail.gmail.com>

On Thu, Jan 28, 2021 at 4:33 PM Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
> On Thu, Jan 28, 2021 at 2:58 PM Carlis <zhangxuezhi3@gmail.com> wrote:

...

> Taking all together you probably need to create a helper and use it
> inside init_display(), like
>
> static int init_tearing_effect_line(struct fbtft_par *par)
> {
>   struct device *dev = par->info->device;
>   struct gpio_desc *te;
>   int irq, rc;
>
>   te = gpiod_get_optional(dev, "te", GPIOD_IN);
>   if (IS_ERR(te))
>            return dev_err_probe(dev, PTR_ERR(te), "Failed to request
> te GPIO\n");

Sorry, here I missed the following:

  /* Absence of TE IRQ is not critical */
  if (!te)
    return 0;

>   irq = gpiod_to_irq(te); // this value you have to save in the
> driver's (per device) data structure.
>
>   /* GPIO is locked as an IRQ, we may drop the reference */
>   gpiod_put(te);

...and here:

  if (irq < 0)
    return irq;

>   init_completion(&spi_panel_te); // should be in the (per device)
> data structure
>   rc = devm_request_irq(dev, irq,  spi_panel_te_handler,
> IRQF_TRIGGER_RISING, "TE_GPIO", par);
>   if (rc)
>                 return dev_err_probe(dev, rc, "TE IRQ request failed.\n");
>   disable_irq_nosync(irq);
>   return irq;
> }

-- 
With Best Regards,
Andy Shevchenko
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

WARNING: multiple messages have this Message-ID (diff)
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Carlis <zhangxuezhi3@gmail.com>
Cc: "open list:STAGING SUBSYSTEM" <devel@driverdev.osuosl.org>,
	"open list:FRAMEBUFFER LAYER" <linux-fbdev@vger.kernel.org>,
	Deepak R Varma <mh12gx2825@gmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	oliver.graute@kococonnector.com,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	Stefano Brivio <sbrivio@redhat.com>,
	Colin King <colin.king@canonical.com>,
	zhangxuezhi1@yulong.com
Subject: Re: [PATCH v12] staging: fbtft: add tearing signal detect
Date: Thu, 28 Jan 2021 16:44:02 +0200	[thread overview]
Message-ID: <CAHp75VcRxPVs0KHwaY8QZima489D2_hntuW0eUqdfK8HJ-gnKA@mail.gmail.com> (raw)
In-Reply-To: <CAHp75Vd=ijxnamuSYuxNLeyhGMCod=HaXWrQ0W0+3QCsQAychg@mail.gmail.com>

On Thu, Jan 28, 2021 at 4:33 PM Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
> On Thu, Jan 28, 2021 at 2:58 PM Carlis <zhangxuezhi3@gmail.com> wrote:

...

> Taking all together you probably need to create a helper and use it
> inside init_display(), like
>
> static int init_tearing_effect_line(struct fbtft_par *par)
> {
>   struct device *dev = par->info->device;
>   struct gpio_desc *te;
>   int irq, rc;
>
>   te = gpiod_get_optional(dev, "te", GPIOD_IN);
>   if (IS_ERR(te))
>            return dev_err_probe(dev, PTR_ERR(te), "Failed to request
> te GPIO\n");

Sorry, here I missed the following:

  /* Absence of TE IRQ is not critical */
  if (!te)
    return 0;

>   irq = gpiod_to_irq(te); // this value you have to save in the
> driver's (per device) data structure.
>
>   /* GPIO is locked as an IRQ, we may drop the reference */
>   gpiod_put(te);

...and here:

  if (irq < 0)
    return irq;

>   init_completion(&spi_panel_te); // should be in the (per device)
> data structure
>   rc = devm_request_irq(dev, irq,  spi_panel_te_handler,
> IRQF_TRIGGER_RISING, "TE_GPIO", par);
>   if (rc)
>                 return dev_err_probe(dev, rc, "TE IRQ request failed.\n");
>   disable_irq_nosync(irq);
>   return irq;
> }

-- 
With Best Regards,
Andy Shevchenko
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2021-01-28 14:46 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-28 12:53 [PATCH v12] staging: fbtft: add tearing signal detect Carlis
2021-01-28 12:53 ` Carlis
2021-01-28 12:53 ` Carlis
2021-01-28 12:58 ` Greg KH
2021-01-28 12:58   ` Greg KH
2021-01-28 12:58   ` Greg KH
2021-01-28 14:33 ` Andy Shevchenko
2021-01-28 14:33   ` Andy Shevchenko
2021-01-28 14:33   ` Andy Shevchenko
2021-01-28 14:44   ` Andy Shevchenko [this message]
2021-01-28 14:44     ` Andy Shevchenko
2021-01-28 14:44     ` Andy Shevchenko
2021-01-28 15:23   ` Dan Carpenter
2021-01-28 15:23     ` Dan Carpenter
2021-01-28 15:23     ` Dan Carpenter
2021-01-29  5:01   ` carlis
2021-01-29  5:01     ` carlis
2021-01-29  5:01     ` carlis
2021-01-29 10:23     ` Andy Shevchenko
2021-01-29 10:23       ` Andy Shevchenko
2021-01-29 10:45       ` Greg Kroah-Hartman
2021-01-29 10:45         ` Greg Kroah-Hartman
2021-01-29 12:47       ` carlis
2021-01-29 12:47         ` carlis
2021-01-29 14:01         ` Andy Shevchenko
2021-01-29 14:01           ` Andy Shevchenko
2021-01-29 12:54       ` carlis
2021-01-29 12:54         ` carlis
2021-01-29 14:04         ` Andy Shevchenko
2021-01-29 14:04           ` Andy Shevchenko
2021-01-29 13:56       ` carlis
2021-01-29 13:56         ` carlis
2021-01-29 14:26         ` Andy Shevchenko
2021-01-29 14:26           ` Andy Shevchenko
2021-01-30  6:39           ` carlis
2021-01-30  6:39             ` carlis
2021-01-30  6:39             ` carlis
2021-02-01 17:40             ` Andy Shevchenko
2021-02-01 17:40               ` Andy Shevchenko
2021-02-01 17:40               ` Andy Shevchenko
2021-02-02  1:52               ` Carlis
2021-02-02  1:52                 ` Carlis
2021-02-02  1:52                 ` Carlis
2021-02-15 15:30                 ` Andy Shevchenko
2021-02-15 15:30                   ` Andy Shevchenko
2021-02-15 15:30                   ` Andy Shevchenko

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=CAHp75VcRxPVs0KHwaY8QZima489D2_hntuW0eUqdfK8HJ-gnKA@mail.gmail.com \
    --to=andy.shevchenko@gmail.com \
    --cc=colin.king@canonical.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mh12gx2825@gmail.com \
    --cc=oliver.graute@kococonnector.com \
    --cc=sbrivio@redhat.com \
    --cc=zhangxuezhi1@yulong.com \
    --cc=zhangxuezhi3@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.