[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VcRxPVs0KHwaY8QZima489D2_hntuW0eUqdfK8HJ-gnKA@mail.gmail.com>
Date: Thu, 28 Jan 2021 16:44:02 +0200
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Carlis <zhangxuezhi3@...il.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Colin King <colin.king@...onical.com>,
oliver.graute@...oconnector.com, zhangxuezhi1@...ong.com,
Deepak R Varma <mh12gx2825@...il.com>,
Stefano Brivio <sbrivio@...hat.com>,
dri-devel <dri-devel@...ts.freedesktop.org>,
"open list:FRAMEBUFFER LAYER" <linux-fbdev@...r.kernel.org>,
"open list:STAGING SUBSYSTEM" <devel@...verdev.osuosl.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v12] staging: fbtft: add tearing signal detect
On Thu, Jan 28, 2021 at 4:33 PM Andy Shevchenko
<andy.shevchenko@...il.com> wrote:
> On Thu, Jan 28, 2021 at 2:58 PM Carlis <zhangxuezhi3@...il.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
Powered by blists - more mailing lists