Marc Dietrich | 65b935a | 2011-03-07 21:01:31 +0100 | [diff] [blame] | 1 | /* |
| 2 | * arch/arm/mach-tegra/board-paz00.c |
| 3 | * |
| 4 | * Copyright (C) 2011 Marc Dietrich <marvin24@gmx.de> |
| 5 | * |
| 6 | * Based on board-harmony.c |
| 7 | * Copyright (C) 2010 Google, Inc. |
| 8 | * |
| 9 | * This software is licensed under the terms of the GNU General Public |
| 10 | * License version 2, as published by the Free Software Foundation, and |
| 11 | * may be copied, distributed, and modified under those terms. |
| 12 | * |
| 13 | * This program is distributed in the hope that it will be useful, |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | * GNU General Public License for more details. |
| 17 | * |
| 18 | */ |
| 19 | |
Heikki Krogerus | d54bbaf | 2016-01-25 12:03:48 +0300 | [diff] [blame] | 20 | #include <linux/property.h> |
Linus Walleij | 0a6d315 | 2014-07-24 20:08:55 +0200 | [diff] [blame] | 21 | #include <linux/gpio/machine.h> |
Thierry Reding | a0524ac | 2014-07-11 09:44:49 +0200 | [diff] [blame] | 22 | #include <linux/platform_device.h> |
Thierry Reding | a0524ac | 2014-07-11 09:44:49 +0200 | [diff] [blame] | 23 | |
Marc Dietrich | 65b935a | 2011-03-07 21:01:31 +0100 | [diff] [blame] | 24 | #include "board.h" |
Marc Dietrich | 65b935a | 2011-03-07 21:01:31 +0100 | [diff] [blame] | 25 | |
Dmitry Torokhov | ed0a27ef | 2017-01-22 23:43:47 -0800 | [diff] [blame] | 26 | static struct property_entry wifi_rfkill_prop[] __initdata = { |
Heikki Krogerus | d54bbaf | 2016-01-25 12:03:48 +0300 | [diff] [blame] | 27 | PROPERTY_ENTRY_STRING("name", "wifi_rfkill"), |
| 28 | PROPERTY_ENTRY_STRING("type", "wlan"), |
| 29 | { }, |
| 30 | }; |
| 31 | |
Marc Dietrich | 9aaa15a | 2011-08-07 21:00:52 +0200 | [diff] [blame] | 32 | static struct platform_device wifi_rfkill_device = { |
| 33 | .name = "rfkill_gpio", |
| 34 | .id = -1, |
Marc Dietrich | 9aaa15a | 2011-08-07 21:00:52 +0200 | [diff] [blame] | 35 | }; |
| 36 | |
Heikki Krogerus | 7bb3ed2 | 2013-12-03 14:49:58 +0200 | [diff] [blame] | 37 | static struct gpiod_lookup_table wifi_gpio_lookup = { |
| 38 | .dev_id = "rfkill_gpio", |
| 39 | .table = { |
Dmitry Osipenko | e77b675 | 2015-06-30 17:15:50 +0300 | [diff] [blame] | 40 | GPIO_LOOKUP("tegra-gpio", 25, "reset", 0), |
| 41 | GPIO_LOOKUP("tegra-gpio", 85, "shutdown", 0), |
Heikki Krogerus | 7bb3ed2 | 2013-12-03 14:49:58 +0200 | [diff] [blame] | 42 | { }, |
| 43 | }, |
| 44 | }; |
| 45 | |
Stephen Warren | b64a02c | 2012-05-02 16:05:44 -0600 | [diff] [blame] | 46 | void __init tegra_paz00_wifikill_init(void) |
| 47 | { |
Heikki Krogerus | f4d0526 | 2016-03-29 14:52:23 +0300 | [diff] [blame] | 48 | platform_device_add_properties(&wifi_rfkill_device, wifi_rfkill_prop); |
Heikki Krogerus | 7bb3ed2 | 2013-12-03 14:49:58 +0200 | [diff] [blame] | 49 | gpiod_add_lookup_table(&wifi_gpio_lookup); |
Stephen Warren | b64a02c | 2012-05-02 16:05:44 -0600 | [diff] [blame] | 50 | platform_device_register(&wifi_rfkill_device); |
| 51 | } |