165b935aaSMarc Dietrich /* 265b935aaSMarc Dietrich * arch/arm/mach-tegra/board-paz00.c 365b935aaSMarc Dietrich * 465b935aaSMarc Dietrich * Copyright (C) 2011 Marc Dietrich <marvin24@gmx.de> 565b935aaSMarc Dietrich * 665b935aaSMarc Dietrich * Based on board-harmony.c 765b935aaSMarc Dietrich * Copyright (C) 2010 Google, Inc. 865b935aaSMarc Dietrich * 965b935aaSMarc Dietrich * This software is licensed under the terms of the GNU General Public 1065b935aaSMarc Dietrich * License version 2, as published by the Free Software Foundation, and 1165b935aaSMarc Dietrich * may be copied, distributed, and modified under those terms. 1265b935aaSMarc Dietrich * 1365b935aaSMarc Dietrich * This program is distributed in the hope that it will be useful, 1465b935aaSMarc Dietrich * but WITHOUT ANY WARRANTY; without even the implied warranty of 1565b935aaSMarc Dietrich * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1665b935aaSMarc Dietrich * GNU General Public License for more details. 1765b935aaSMarc Dietrich * 1865b935aaSMarc Dietrich */ 1965b935aaSMarc Dietrich 20d54bbaf4SHeikki Krogerus #include <linux/property.h> 210a6d3158SLinus Walleij #include <linux/gpio/machine.h> 22a0524accSThierry Reding #include <linux/platform_device.h> 23a0524accSThierry Reding 2465b935aaSMarc Dietrich #include "board.h" 2565b935aaSMarc Dietrich 26d54bbaf4SHeikki Krogerus static struct property_entry __initdata wifi_rfkill_prop[] = { 27d54bbaf4SHeikki Krogerus PROPERTY_ENTRY_STRING("name", "wifi_rfkill"), 28d54bbaf4SHeikki Krogerus PROPERTY_ENTRY_STRING("type", "wlan"), 29d54bbaf4SHeikki Krogerus { }, 30d54bbaf4SHeikki Krogerus }; 31d54bbaf4SHeikki Krogerus 329aaa15a7SMarc Dietrich static struct platform_device wifi_rfkill_device = { 339aaa15a7SMarc Dietrich .name = "rfkill_gpio", 349aaa15a7SMarc Dietrich .id = -1, 359aaa15a7SMarc Dietrich }; 369aaa15a7SMarc Dietrich 377bb3ed21SHeikki Krogerus static struct gpiod_lookup_table wifi_gpio_lookup = { 387bb3ed21SHeikki Krogerus .dev_id = "rfkill_gpio", 397bb3ed21SHeikki Krogerus .table = { 40e77b675fSDmitry Osipenko GPIO_LOOKUP("tegra-gpio", 25, "reset", 0), 41e77b675fSDmitry Osipenko GPIO_LOOKUP("tegra-gpio", 85, "shutdown", 0), 427bb3ed21SHeikki Krogerus { }, 437bb3ed21SHeikki Krogerus }, 447bb3ed21SHeikki Krogerus }; 457bb3ed21SHeikki Krogerus 46b64a02c6SStephen Warren void __init tegra_paz00_wifikill_init(void) 47b64a02c6SStephen Warren { 48f4d05266SHeikki Krogerus platform_device_add_properties(&wifi_rfkill_device, wifi_rfkill_prop); 497bb3ed21SHeikki Krogerus gpiod_add_lookup_table(&wifi_gpio_lookup); 50b64a02c6SStephen Warren platform_device_register(&wifi_rfkill_device); 51b64a02c6SStephen Warren } 52