1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3  * arch/arm/mach-tegra/board-paz00.c
4  *
5  * Copyright (C) 2011 Marc Dietrich <marvin24@gmx.de>
6  *
7  * Based on board-harmony.c
8  * Copyright (C) 2010 Google, Inc.
9  */
10 
11 #include <linux/property.h>
12 #include <linux/gpio/machine.h>
13 #include <linux/platform_device.h>
14 
15 #include "board.h"
16 
17 static struct property_entry wifi_rfkill_prop[] __initdata = {
18 	PROPERTY_ENTRY_STRING("name", "wifi_rfkill"),
19 	PROPERTY_ENTRY_STRING("type", "wlan"),
20 	{ },
21 };
22 
23 static struct platform_device wifi_rfkill_device = {
24 	.name	= "rfkill_gpio",
25 	.id	= -1,
26 };
27 
28 static struct gpiod_lookup_table wifi_gpio_lookup = {
29 	.dev_id = "rfkill_gpio",
30 	.table = {
31 		GPIO_LOOKUP("tegra-gpio", 25, "reset", 0),
32 		GPIO_LOOKUP("tegra-gpio", 85, "shutdown", 0),
33 		{ },
34 	},
35 };
36 
37 void __init tegra_paz00_wifikill_init(void)
38 {
39 	device_create_managed_software_node(&wifi_rfkill_device.dev, wifi_rfkill_prop, NULL);
40 	gpiod_add_lookup_table(&wifi_gpio_lookup);
41 	platform_device_register(&wifi_rfkill_device);
42 }
43