[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20141001162802.GD23115@dtor-glaptop>
Date: Wed, 1 Oct 2014 09:28:02 -0700
From: Dmitry Torokhov <dmitry.torokhov@...il.com>
To: Mika Westerberg <mika.westerberg@...ux.intel.com>
Cc: "Rafael J. Wysocki" <rjw@...ysocki.net>,
linux-kernel@...r.kernel.org, linux-acpi@...r.kernel.org,
devicetree@...r.kernel.org,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Linus Walleij <linus.walleij@...aro.org>,
Alexandre Courbot <gnurou@...il.com>,
Bryan Wu <cooloney@...il.com>,
Lee Jones <lee.jones@...aro.org>,
Grant Likely <grant.likely@...aro.org>,
Arnd Bergmann <arnd@...db.de>, Aaron Lu <aaron.lu@...el.com>,
Darren Hart <dvhart@...ux.intel.com>
Subject: Re: [PATCH v3 13/15] input: gpio_keys_polled - Add ACPI probing
support
On Wed, Oct 01, 2014 at 12:15:35PM +0300, Mika Westerberg wrote:
> On Wed, Oct 01, 2014 at 12:48:46AM -0700, Dmitry Torokhov wrote:
> > On Wed, Oct 01, 2014 at 04:20:43AM +0200, Rafael J. Wysocki wrote:
> > > From: Mika Westerberg <mika.westerberg@...ux.intel.com>
> > >
> > > Allow the driver to probe from ACPI namespace.
> > >
> > > Signed-off-by: Aaron Lu <aaron.lu@...el.com>
> > > Signed-off-by: Mika Westerberg <mika.westerberg@...ux.intel.com>
> > > Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> > > ---
> > > drivers/input/keyboard/gpio_keys_polled.c | 7 +++++++
> > > 1 file changed, 7 insertions(+)
> > >
> > > Index: linux-pm/drivers/input/keyboard/gpio_keys_polled.c
> > > ===================================================================
> > > --- linux-pm.orig/drivers/input/keyboard/gpio_keys_polled.c
> > > +++ linux-pm/drivers/input/keyboard/gpio_keys_polled.c
> > > @@ -181,6 +181,12 @@ static const struct of_device_id gpio_ke
> > > };
> > > MODULE_DEVICE_TABLE(of, gpio_keys_polled_of_match);
> > >
> > > +static const struct acpi_device_id gpio_keys_polled_acpi_match[] = {
> > > + { "PRP0001" }, /* Device Tree shoehorned into ACPI */
> > > + { },
> > > +};
> > > +MODULE_DEVICE_TABLE(acpi, gpio_keys_polled_acpi_match);
> > > +
> > > static int gpio_keys_polled_probe(struct platform_device *pdev)
> > > {
> > > struct device *dev = &pdev->dev;
> > > @@ -309,6 +315,7 @@ static struct platform_driver gpio_keys_
> > > .name = DRV_NAME,
> > > .owner = THIS_MODULE,
> > > .of_match_table = gpio_keys_polled_of_match,
> > > + .acpi_match_table = gpio_keys_polled_acpi_match,
> > o
> > Hmm, why do we need the generic "PRP0001" in every driver? The ACPI device
> > should have PRP0001 and ACPI bus should know to look into OF matching table
> > for such devices.
>
> Arnd had a good idea for this. How about,
>
> .acpi_match_table = acpi_match_by_of_compatible,
>
> where acpi_match_by_of_compatible is provided by ACPI core? Does that
> work better for you?
I still do not see the point. ACPI core knows how to handle
drv->of_match_table, so unless we need to support ACPI_only binding in a
given driver I do not understand why we need to add boilerplate code.
Thanks.
--
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists