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 
207bb3ed21SHeikki Krogerus #include <linux/gpio/driver.h>
21a0524accSThierry Reding #include <linux/platform_device.h>
229aaa15a7SMarc Dietrich #include <linux/rfkill-gpio.h>
23a0524accSThierry Reding 
2465b935aaSMarc Dietrich #include "board.h"
2565b935aaSMarc Dietrich 
269aaa15a7SMarc Dietrich static struct rfkill_gpio_platform_data wifi_rfkill_platform_data = {
279aaa15a7SMarc Dietrich 	.name	= "wifi_rfkill",
289aaa15a7SMarc Dietrich 	.type	= RFKILL_TYPE_WLAN,
299aaa15a7SMarc Dietrich };
309aaa15a7SMarc Dietrich 
319aaa15a7SMarc Dietrich static struct platform_device wifi_rfkill_device = {
329aaa15a7SMarc Dietrich 	.name	= "rfkill_gpio",
339aaa15a7SMarc Dietrich 	.id	= -1,
349aaa15a7SMarc Dietrich 	.dev	= {
359aaa15a7SMarc Dietrich 		.platform_data = &wifi_rfkill_platform_data,
369aaa15a7SMarc Dietrich 	},
379aaa15a7SMarc Dietrich };
389aaa15a7SMarc Dietrich 
397bb3ed21SHeikki Krogerus static struct gpiod_lookup_table wifi_gpio_lookup = {
407bb3ed21SHeikki Krogerus 	.dev_id = "rfkill_gpio",
417bb3ed21SHeikki Krogerus 	.table = {
427bb3ed21SHeikki Krogerus 		GPIO_LOOKUP_IDX("tegra-gpio", 25, NULL, 0, 0),
437bb3ed21SHeikki Krogerus 		GPIO_LOOKUP_IDX("tegra-gpio", 85, NULL, 1, 0),
447bb3ed21SHeikki Krogerus 		{ },
457bb3ed21SHeikki Krogerus 	},
467bb3ed21SHeikki Krogerus };
477bb3ed21SHeikki Krogerus 
48b64a02c6SStephen Warren void __init tegra_paz00_wifikill_init(void)
49b64a02c6SStephen Warren {
507bb3ed21SHeikki Krogerus 	gpiod_add_lookup_table(&wifi_gpio_lookup);
51b64a02c6SStephen Warren 	platform_device_register(&wifi_rfkill_device);
52b64a02c6SStephen Warren }
53