* [RFC PATCH 2/6] Introduce ACPI style match in platform_match
@ 2012-09-28 7:39 Zhang Rui
2012-10-01 6:47 ` Mika Westerberg
0 siblings, 1 reply; 3+ messages in thread
From: Zhang Rui @ 2012-09-28 7:39 UTC (permalink / raw)
To: LKML
Cc: linux-pm, linux-i2c,
linux-acpi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Len, Brown,
Rafael J. Wysocki, Grant Likely, Dirk Brandewie, Zhang, Rui
>From 5d7ecd12c2994b8c5905d52718c2870c3b62746e Mon Sep 17 00:00:00 2001
From: Zhang Rui <rui.zhang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Date: Fri, 28 Sep 2012 14:51:03 +0800
Subject: [RFC PATCH 2/6] Introduce ACPI style match in platform_match
Signed-off-by: Zhang Rui <rui.zhang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
drivers/base/platform.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index a1a7225..90e64c6f 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -20,6 +20,7 @@
#include <linux/err.h>
#include <linux/slab.h>
#include <linux/pm_runtime.h>
+#include <linux/acpi.h>
#include "base.h"
@@ -635,6 +636,13 @@ static const struct platform_device_id *platform_match_id(
struct platform_device *pdev)
{
while (id->name[0]) {
+#ifdef CONFIG_ACPI
+ /* attempt ACPI style match */
+ if (acpi_match_device_id(&pdev->dev, id->name) == 0) {
+ pdev->id_entry = id;
+ return id;
+ }
+#endif
if (strcmp(pdev->name, id->name) == 0) {
pdev->id_entry = id;
return id;
--
1.7.7.6
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [RFC PATCH 2/6] Introduce ACPI style match in platform_match
2012-09-28 7:39 [RFC PATCH 2/6] Introduce ACPI style match in platform_match Zhang Rui
@ 2012-10-01 6:47 ` Mika Westerberg
2012-10-01 14:00 ` Zhang, Rui
0 siblings, 1 reply; 3+ messages in thread
From: Mika Westerberg @ 2012-10-01 6:47 UTC (permalink / raw)
To: Zhang Rui
Cc: LKML, linux-pm, linux-i2c, linux-acpi@vger.kernel.org, Len, Brown,
Rafael J. Wysocki, Grant Likely, Dirk Brandewie
On Fri, Sep 28, 2012 at 03:39:15PM +0800, Zhang Rui wrote:
> >From 5d7ecd12c2994b8c5905d52718c2870c3b62746e Mon Sep 17 00:00:00 2001
> From: Zhang Rui <rui.zhang@intel.com>
> Date: Fri, 28 Sep 2012 14:51:03 +0800
> Subject: [RFC PATCH 2/6] Introduce ACPI style match in platform_match
>
> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
> ---
> drivers/base/platform.c | 8 ++++++++
> 1 files changed, 8 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/base/platform.c b/drivers/base/platform.c
> index a1a7225..90e64c6f 100644
> --- a/drivers/base/platform.c
> +++ b/drivers/base/platform.c
> @@ -20,6 +20,7 @@
> #include <linux/err.h>
> #include <linux/slab.h>
> #include <linux/pm_runtime.h>
> +#include <linux/acpi.h>
>
> #include "base.h"
>
> @@ -635,6 +636,13 @@ static const struct platform_device_id *platform_match_id(
> struct platform_device *pdev)
> {
> while (id->name[0]) {
> +#ifdef CONFIG_ACPI
I don't think the above is needed as you stub the acpi_match_device_id()
out when !CONFIG_ACPI.
How about I2C and SPI slave devices?
> + /* attempt ACPI style match */
> + if (acpi_match_device_id(&pdev->dev, id->name) == 0) {
> + pdev->id_entry = id;
> + return id;
> + }
> +#endif
> if (strcmp(pdev->name, id->name) == 0) {
> pdev->id_entry = id;
> return id;
> --
> 1.7.7.6
>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [RFC PATCH 2/6] Introduce ACPI style match in platform_match
2012-10-01 6:47 ` Mika Westerberg
@ 2012-10-01 14:00 ` Zhang, Rui
0 siblings, 0 replies; 3+ messages in thread
From: Zhang, Rui @ 2012-10-01 14:00 UTC (permalink / raw)
To: Mika Westerberg
Cc: LKML, linux-pm, linux-i2c, linux-acpi@vger.kernel.org, Len, Brown,
Rafael J. Wysocki, Grant Likely, Dirk Brandewie
> -----Original Message-----
> From: linux-acpi-owner@vger.kernel.org [mailto:linux-acpi-
> owner@vger.kernel.org] On Behalf Of Mika Westerberg
> Sent: Monday, October 01, 2012 2:47 PM
> To: Zhang, Rui
> Cc: LKML; linux-pm; linux-i2c; linux-acpi@vger.kernel.org; Len, Brown;
> Rafael J. Wysocki; Grant Likely; Dirk Brandewie
> Subject: Re: [RFC PATCH 2/6] Introduce ACPI style match in
> platform_match
> Importance: High
>
> On Fri, Sep 28, 2012 at 03:39:15PM +0800, Zhang Rui wrote:
> > >From 5d7ecd12c2994b8c5905d52718c2870c3b62746e Mon Sep 17 00:00:00
> > >2001
> > From: Zhang Rui <rui.zhang@intel.com>
> > Date: Fri, 28 Sep 2012 14:51:03 +0800
> > Subject: [RFC PATCH 2/6] Introduce ACPI style match in platform_match
> >
> > Signed-off-by: Zhang Rui <rui.zhang@intel.com>
> > ---
> > drivers/base/platform.c | 8 ++++++++
> > 1 files changed, 8 insertions(+), 0 deletions(-)
> >
> > diff --git a/drivers/base/platform.c b/drivers/base/platform.c index
> > a1a7225..90e64c6f 100644
> > --- a/drivers/base/platform.c
> > +++ b/drivers/base/platform.c
> > @@ -20,6 +20,7 @@
> > #include <linux/err.h>
> > #include <linux/slab.h>
> > #include <linux/pm_runtime.h>
> > +#include <linux/acpi.h>
> >
> > #include "base.h"
> >
> > @@ -635,6 +636,13 @@ static const struct platform_device_id
> *platform_match_id(
> > struct platform_device *pdev)
> > {
> > while (id->name[0]) {
> > +#ifdef CONFIG_ACPI
>
> I don't think the above is needed as you stub the acpi_match_device_id()
> out when !CONFIG_ACPI.
>
You're right, I'll remove this.
> How about I2C and SPI slave devices?
>
We're introduce the I2C/SPI bus ACPI binding, and the i2c/spi bus .match
method can be redirected to acpi callbacks.
Thanks,
rui
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-10-01 14:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-28 7:39 [RFC PATCH 2/6] Introduce ACPI style match in platform_match Zhang Rui
2012-10-01 6:47 ` Mika Westerberg
2012-10-01 14:00 ` Zhang, Rui
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).