mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-11 21:06:44 +07:00
e77b675f87
Commit72daceb9a1
("net: rfkill: gpio: Add default GPIO driver mappings for ACPI") removed possibility to request GPIO by table index for non-ACPI platforms without changing its users. As result "shutdown" GPIO request will fail if request for "reset" GPIO succeeded or "reset" will be requested instead of "shutdown" if "reset" wasn't defined. Fix it by making gpiod_lookup_table use con_id's instead of indexes. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Fixes:72daceb
(net: rfkill: gpio: Add default GPIO driver mappings for ACPI) Cc: <stable@vger.kernel.org> # v3.19+ Acked-by: Alexandre Courbot <acourbot@nvidia.com> Reviewed-by: Marc Dietrich <marvin24@gmx.de> Tested-by: Marc Dietrich <marvin24@gmx.de> Signed-off-by: Thierry Reding <treding@nvidia.com>
53 lines
1.3 KiB
C
53 lines
1.3 KiB
C
/*
|
|
* arch/arm/mach-tegra/board-paz00.c
|
|
*
|
|
* Copyright (C) 2011 Marc Dietrich <marvin24@gmx.de>
|
|
*
|
|
* Based on board-harmony.c
|
|
* Copyright (C) 2010 Google, Inc.
|
|
*
|
|
* This software is licensed under the terms of the GNU General Public
|
|
* License version 2, as published by the Free Software Foundation, and
|
|
* may be copied, distributed, and modified under those terms.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
*/
|
|
|
|
#include <linux/gpio/machine.h>
|
|
#include <linux/platform_device.h>
|
|
#include <linux/rfkill-gpio.h>
|
|
|
|
#include "board.h"
|
|
|
|
static struct rfkill_gpio_platform_data wifi_rfkill_platform_data = {
|
|
.name = "wifi_rfkill",
|
|
.type = RFKILL_TYPE_WLAN,
|
|
};
|
|
|
|
static struct platform_device wifi_rfkill_device = {
|
|
.name = "rfkill_gpio",
|
|
.id = -1,
|
|
.dev = {
|
|
.platform_data = &wifi_rfkill_platform_data,
|
|
},
|
|
};
|
|
|
|
static struct gpiod_lookup_table wifi_gpio_lookup = {
|
|
.dev_id = "rfkill_gpio",
|
|
.table = {
|
|
GPIO_LOOKUP("tegra-gpio", 25, "reset", 0),
|
|
GPIO_LOOKUP("tegra-gpio", 85, "shutdown", 0),
|
|
{ },
|
|
},
|
|
};
|
|
|
|
void __init tegra_paz00_wifikill_init(void)
|
|
{
|
|
gpiod_add_lookup_table(&wifi_gpio_lookup);
|
|
platform_device_register(&wifi_rfkill_device);
|
|
}
|