From: Hans de Goede <hdegoede@redhat.com>
To: Linus Walleij <linus.walleij@linaro.org>, linux-gpio@vger.kernel.org
Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Kuppuswamy Sathyanarayanan
<sathyanarayanan.kuppuswamy@linux.intel.com>
Subject: Re: [PATCH] gpio: crystalcove: Use irqchip template
Date: Fri, 17 Jul 2020 16:02:35 +0200 [thread overview]
Message-ID: <fb6bb42b-b657-5cd7-7a58-236e10bfb547@redhat.com> (raw)
In-Reply-To: <d97d8c70-528e-f06b-3bf6-4faf51857a9c@redhat.com>
Hi,
On 7/17/20 3:59 PM, Hans de Goede wrote:
> Hi,
>
> On 7/17/20 1:25 PM, Linus Walleij wrote:
>> This makes the driver use the irqchip template to assign
>> properties to the gpio_irq_chip instead of using the
>> explicit calls to gpiochip_irqchip_add_nested() and
>> gpiochip_set_nested_irqchip(). The irqchip is instead
>> added while adding the gpiochip.
>>
>> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>> Cc: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
>> Cc: Hans de Goede <hdegoede@redhat.com>
>> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
>> ---
>> Intel folks and Hans: I hope someone can test this, I'm
>> a bit uncertain if IRQs could fire before registering
>> the chip and if we need a hw_init() in this driver to cope.
>
> I've added this to my personal tree for testing. I will get back
> to you when I've either hit an issue, or used it for a while without
> issues :)
>
> Hmm, testing this might be tricky, I don't think any boards
> actually use any GPIOs on the PMIC (which this driver is for)
> as interrupts...
>
> So the best I can do is boot a machine and test there are no
> regressions I guess.
Erm, it does not even compile:
drivers/gpio/gpio-crystalcove.c: In function ‘crystalcove_gpio_probe’:
drivers/gpio/gpio-crystalcove.c:357:10: error: ‘ch’ undeclared (first use in this function); did you mean ‘cg’?
357 | girq = &ch->chip.irq;
| ^~
| cg
drivers/gpio/gpio-crystalcove.c:357:10: note: each undeclared identifier is reported only once for each function it appears in
I've fixed this up locally.
Regards,
Hans
>> + girq->default_type = IRQ_TYPE_NONE;
>> + girq->handler = handle_simple_irq;
>> + girq->threaded = true;
>> retval = request_threaded_irq(irq, NULL, crystalcove_gpio_irq_handler,
>> IRQF_ONESHOT, KBUILD_MODNAME, cg);
>> @@ -370,7 +372,11 @@ static int crystalcove_gpio_probe(struct platform_device *pdev)
>> return retval;
>> }
>> - gpiochip_set_nested_irqchip(&cg->chip, &crystalcove_irqchip, irq);
>> + retval = devm_gpiochip_add_data(&pdev->dev, &cg->chip, cg);
>> + if (retval) {
>> + dev_warn(&pdev->dev, "add gpio chip error: %d\n", retval);
>> + return retval;
>> + }
>> return 0;
>> }
>>
next prev parent reply other threads:[~2020-07-17 14:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-17 11:25 [PATCH] gpio: crystalcove: Use irqchip template Linus Walleij
2020-07-17 13:59 ` Hans de Goede
2020-07-17 14:02 ` Hans de Goede [this message]
2020-07-17 14:14 ` Linus Walleij
2020-07-17 14:08 ` 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=fb6bb42b-b657-5cd7-7a58-236e10bfb547@redhat.com \
--to=hdegoede@redhat.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=bgolaszewski@baylibre.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=sathyanarayanan.kuppuswamy@linux.intel.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).