blob: ea6bff404161b50df2352cc627f62f4f8e8b3111 [file] [log] [blame]
Marc Dietrich65b935a2011-03-07 21:01:31 +01001/*
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 Krogerusd54bbaf2016-01-25 12:03:48 +030020#include <linux/property.h>
Linus Walleij0a6d3152014-07-24 20:08:55 +020021#include <linux/gpio/machine.h>
Thierry Redinga0524ac2014-07-11 09:44:49 +020022#include <linux/platform_device.h>
Thierry Redinga0524ac2014-07-11 09:44:49 +020023
Marc Dietrich65b935a2011-03-07 21:01:31 +010024#include "board.h"
Marc Dietrich65b935a2011-03-07 21:01:31 +010025
Dmitry Torokhoved0a27ef2017-01-22 23:43:47 -080026static struct property_entry wifi_rfkill_prop[] __initdata = {
Heikki Krogerusd54bbaf2016-01-25 12:03:48 +030027 PROPERTY_ENTRY_STRING("name", "wifi_rfkill"),
28 PROPERTY_ENTRY_STRING("type", "wlan"),
29 { },
30};
31
Marc Dietrich9aaa15a2011-08-07 21:00:52 +020032static struct platform_device wifi_rfkill_device = {
33 .name = "rfkill_gpio",
34 .id = -1,
Marc Dietrich9aaa15a2011-08-07 21:00:52 +020035};
36
Heikki Krogerus7bb3ed22013-12-03 14:49:58 +020037static struct gpiod_lookup_table wifi_gpio_lookup = {
38 .dev_id = "rfkill_gpio",
39 .table = {
Dmitry Osipenkoe77b6752015-06-30 17:15:50 +030040 GPIO_LOOKUP("tegra-gpio", 25, "reset", 0),
41 GPIO_LOOKUP("tegra-gpio", 85, "shutdown", 0),
Heikki Krogerus7bb3ed22013-12-03 14:49:58 +020042 { },
43 },
44};
45
Stephen Warrenb64a02c2012-05-02 16:05:44 -060046void __init tegra_paz00_wifikill_init(void)
47{
Heikki Krogerusf4d05262016-03-29 14:52:23 +030048 platform_device_add_properties(&wifi_rfkill_device, wifi_rfkill_prop);
Heikki Krogerus7bb3ed22013-12-03 14:49:58 +020049 gpiod_add_lookup_table(&wifi_gpio_lookup);
Stephen Warrenb64a02c2012-05-02 16:05:44 -060050 platform_device_register(&wifi_rfkill_device);
51}