David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame^] | 1 | // SPDX-License-Identifier: GPL-2.0-only |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 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. |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 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 | platform_device_add_properties(&wifi_rfkill_device, wifi_rfkill_prop); |
| 40 | gpiod_add_lookup_table(&wifi_gpio_lookup); |
| 41 | platform_device_register(&wifi_rfkill_device); |
| 42 | } |