Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-only
0002 /*
0003  * arch/arm/mach-tegra/board-paz00.c
0004  *
0005  * Copyright (C) 2011 Marc Dietrich <marvin24@gmx.de>
0006  *
0007  * Based on board-harmony.c
0008  * Copyright (C) 2010 Google, Inc.
0009  */
0010 
0011 #include <linux/property.h>
0012 #include <linux/gpio/machine.h>
0013 #include <linux/platform_device.h>
0014 
0015 #include "board.h"
0016 
0017 static struct property_entry wifi_rfkill_prop[] __initdata = {
0018     PROPERTY_ENTRY_STRING("name", "wifi_rfkill"),
0019     PROPERTY_ENTRY_STRING("type", "wlan"),
0020     { },
0021 };
0022 
0023 static struct platform_device wifi_rfkill_device = {
0024     .name   = "rfkill_gpio",
0025     .id = -1,
0026 };
0027 
0028 static struct gpiod_lookup_table wifi_gpio_lookup = {
0029     .dev_id = "rfkill_gpio",
0030     .table = {
0031         GPIO_LOOKUP("tegra-gpio", 25, "reset", 0),
0032         GPIO_LOOKUP("tegra-gpio", 85, "shutdown", 0),
0033         { },
0034     },
0035 };
0036 
0037 void __init tegra_paz00_wifikill_init(void)
0038 {
0039     device_create_managed_software_node(&wifi_rfkill_device.dev, wifi_rfkill_prop, NULL);
0040     gpiod_add_lookup_table(&wifi_gpio_lookup);
0041     platform_device_register(&wifi_rfkill_device);
0042 }