Commit d54bbaf4 authored by Heikki Krogerus's avatar Heikki Krogerus Committed by Johannes Berg

ARM: tegra: use build-in device properties with rfkill_gpio

Pass the rfkill name and type to the device with properties
instead of driver specific platform data.
Signed-off-by: default avatarHeikki Krogerus <heikki.krogerus@linux.intel.com>
CC: Alexandre Courbot <gnurou@gmail.com>
CC: Thierry Reding <thierry.reding@gmail.com>
CC: Stephen Warren <swarren@wwwdotorg.org>
Acked-by: default avatarThierry Reding <treding@nvidia.com>
Tested-by: default avatarMarc Dietrich <marvin24@gmx.de>
Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 7d5e9737
...@@ -17,23 +17,25 @@ ...@@ -17,23 +17,25 @@
* *
*/ */
#include <linux/property.h>
#include <linux/gpio/machine.h> #include <linux/gpio/machine.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/rfkill-gpio.h>
#include "board.h" #include "board.h"
static struct rfkill_gpio_platform_data wifi_rfkill_platform_data = { static struct property_entry __initdata wifi_rfkill_prop[] = {
.name = "wifi_rfkill", PROPERTY_ENTRY_STRING("name", "wifi_rfkill"),
.type = RFKILL_TYPE_WLAN, PROPERTY_ENTRY_STRING("type", "wlan"),
{ },
};
static struct property_set __initdata wifi_rfkill_pset = {
.properties = wifi_rfkill_prop,
}; };
static struct platform_device wifi_rfkill_device = { static struct platform_device wifi_rfkill_device = {
.name = "rfkill_gpio", .name = "rfkill_gpio",
.id = -1, .id = -1,
.dev = {
.platform_data = &wifi_rfkill_platform_data,
},
}; };
static struct gpiod_lookup_table wifi_gpio_lookup = { static struct gpiod_lookup_table wifi_gpio_lookup = {
...@@ -47,6 +49,7 @@ static struct gpiod_lookup_table wifi_gpio_lookup = { ...@@ -47,6 +49,7 @@ static struct gpiod_lookup_table wifi_gpio_lookup = {
void __init tegra_paz00_wifikill_init(void) void __init tegra_paz00_wifikill_init(void)
{ {
platform_device_add_properties(&wifi_rfkill_device, &wifi_rfkill_pset);
gpiod_add_lookup_table(&wifi_gpio_lookup); gpiod_add_lookup_table(&wifi_gpio_lookup);
platform_device_register(&wifi_rfkill_device); platform_device_register(&wifi_rfkill_device);
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment