Linux wireless drivers development
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Cc: "John W. Linville" <linville@tuxdriver.com>,
	Johannes Berg <johannes@sipsolutions.net>,
	Rhyland Klein <rklein@nvidia.com>,
	linux-acpi@vger.kernel.org, linux-wireless@vger.kernel.org,
	netdev@vger.kernel.org,
	Mika Westerberg <mika.westerberg@linux.intel.com>
Subject: Re: [PATCH 5/5] net: rfkill: gpio: add ACPI support
Date: Wed, 16 Oct 2013 22:55:01 +0200	[thread overview]
Message-ID: <2878506.7lf24R85t6@vostro.rjw.lan> (raw)
In-Reply-To: <1381920823-15403-6-git-send-email-heikki.krogerus@linux.intel.com>

On Wednesday, October 16, 2013 01:53:43 PM Heikki Krogerus wrote:
> Including ACPI ID for Broadcom GPS receiver BCM4752.
> 
> Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> ---
>  net/rfkill/rfkill-gpio.c | 31 ++++++++++++++++++++++++++++++-
>  1 file changed, 30 insertions(+), 1 deletion(-)
> 
> diff --git a/net/rfkill/rfkill-gpio.c b/net/rfkill/rfkill-gpio.c
> index 2dd78c6..5620d3c 100644
> --- a/net/rfkill/rfkill-gpio.c
> +++ b/net/rfkill/rfkill-gpio.c
> @@ -24,6 +24,8 @@
>  #include <linux/platform_device.h>
>  #include <linux/clk.h>
>  #include <linux/slab.h>
> +#include <linux/acpi.h>
> +#include <linux/acpi_gpio.h>
>  
>  #include <linux/rfkill-gpio.h>
>  
> @@ -70,6 +72,23 @@ static const struct rfkill_ops rfkill_gpio_ops = {
>  	.set_block = rfkill_gpio_set_power,
>  };
>  
> +static int rfkill_gpio_acpi_probe(struct device *dev,
> +				  struct rfkill_gpio_data *rfkill)
> +{
> +	const struct acpi_device_id *id;
> +
> +	id = acpi_match_device(dev->driver->acpi_match_table, dev);
> +	if (!id)
> +		return -ENODEV;
> +
> +	rfkill->name = dev_name(dev);
> +	rfkill->type = (unsigned)id->driver_data;
> +	rfkill->reset_gpio = acpi_get_gpio_by_index(dev, 0, NULL);
> +	rfkill->shutdown_gpio = acpi_get_gpio_by_index(dev, 1, NULL);
> +
> +	return 0;
> +}
> +
>  static int rfkill_gpio_probe(struct platform_device *pdev)
>  {
>  	struct rfkill_gpio_platform_data *pdata = pdev->dev.platform_data;
> @@ -82,7 +101,11 @@ static int rfkill_gpio_probe(struct platform_device *pdev)
>  	if (!rfkill)
>  		return -ENOMEM;
>  
> -	if (pdata) {
> +	if (ACPI_HANDLE(&pdev->dev)) {
> +		ret = rfkill_gpio_acpi_probe(&pdev->dev, rfkill);
> +		if (ret)
> +			return ret;
> +	} else if (pdata) {
>  		clk_name = pdata->power_clk_name;
>  		rfkill->name = pdata->name;
>  		rfkill->type = pdata->type;
> @@ -170,12 +193,18 @@ static int rfkill_gpio_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> +static const struct acpi_device_id rfkill_acpi_match[] = {
> +	{ "BCM4752", RFKILL_TYPE_GPS },
> +	{ },
> +};
> +
>  static struct platform_driver rfkill_gpio_driver = {
>  	.probe = rfkill_gpio_probe,
>  	.remove = rfkill_gpio_remove,
>  	.driver = {
>  		.name = "rfkill_gpio",
>  		.owner = THIS_MODULE,
> +		.acpi_match_table = ACPI_PTR(rfkill_acpi_match),
>  	},
>  };

Looks good to me.

Has Mika seen this?

-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

  reply	other threads:[~2013-10-16 20:43 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-16 10:53 [PATCH 0/5] rfkill-gpio: ACPI support Heikki Krogerus
2013-10-16 10:53 ` [PATCH 1/5] net: rfkill: gpio: convert to resource managed allocation Heikki Krogerus
2013-10-16 10:53 ` [PATCH 2/5] net: rfkill: gpio: clean up clock handling Heikki Krogerus
2013-10-16 10:53 ` [PATCH 3/5] net: rfkill: gpio: spinlock-safe GPIO access Heikki Krogerus
2013-10-16 10:53 ` [PATCH 4/5] net: rfkill: gpio: prepare for DT and ACPI support Heikki Krogerus
2013-10-16 10:53 ` [PATCH 5/5] net: rfkill: gpio: add " Heikki Krogerus
2013-10-16 20:55   ` Rafael J. Wysocki [this message]
2013-10-17  7:44     ` Mika Westerberg
2013-10-17 11:48       ` Rafael J. Wysocki
2013-10-16 16:13 ` [PATCH 0/5] rfkill-gpio: " Rhyland Klein
2013-10-17 14:26 ` Johannes Berg

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=2878506.7lf24R85t6@vostro.rjw.lan \
    --to=rjw@rjwysocki.net \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=mika.westerberg@linux.intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=rklein@nvidia.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