sunxi: 6.6: set testing kernel
[openwrt/openwrt.git] / target / linux / generic / hack-5.4 / 991-platform-x86-pcengines-apuv2-revert-simswitch.patch
1 From 8c9254d41881c81bea610193c6ac59c8cb8b79fe Mon Sep 17 00:00:00 2001
2 From: Florian Eckert <fe@dev.tdt.de>
3 Date: Fri, 27 Mar 2020 16:11:55 +0100
4 Subject: [PATCH] Revert "platform/x86: pcengines-apuv2: wire up simswitch gpio
5 as led"
6
7 This reverts commit 5037d4ddda31c2dbbb018109655f61054b1756dc.
8
9 Commit message from linux:
10 The APU3+ boards have two SIM sockets, while only one of them
11 can be routed to the mpcie slots at a time. Selection is done
12 via simswap gpio.
13
14 We currently don't have a fitting subsystem for those cases yet,
15 so just wire it up to a LED for the time being. While this isn't
16 really semantically correct, it's a good compromise.
17
18 Explanation why this does not work:
19 This change connects the simswap to the LED subsystem of the kernel.
20 From my point of view, it's nonsense. If we do it this way, then this
21 can be switched relatively easily via the LED subsystem (trigger:
22 none/default-on) and that is dangerous! If this is used, it would be
23 unfavorable, since there is also another trigger (trigger: heartbeat/netdev).
24 This LED also appears in the LuCI and can therefore be switched by the user.
25
26 Therefore, this simswap GPIO should remain in the GPIO
27 subsystem and be switched via it and not be connected to the LED
28 subsystem. To avoid the problems mentioned above. The LED subsystem is
29 not made for this and it is not a good compromise, but rather dangerous.
30
31 Signed-off-by: Florian Eckert <fe@dev.tdt.de>
32 ---
33 drivers/platform/x86/pcengines-apuv2.c | 5 +----
34 1 file changed, 1 insertion(+), 4 deletions(-)
35
36 --- a/drivers/platform/x86/pcengines-apuv2.c
37 +++ b/drivers/platform/x86/pcengines-apuv2.c
38 @@ -77,8 +77,7 @@ static const struct amd_fch_gpio_pdata b
39 static const struct gpio_led apu2_leds[] = {
40 { .name = "apu:green:1" },
41 { .name = "apu:green:2" },
42 - { .name = "apu:green:3" },
43 - { .name = "apu:simswap" },
44 + { .name = "apu:green:3" }
45 };
46
47 static const struct gpio_led_platform_data apu2_leds_pdata = {
48 @@ -95,8 +94,6 @@ static struct gpiod_lookup_table gpios_l
49 NULL, 1, GPIO_ACTIVE_LOW),
50 GPIO_LOOKUP_IDX(AMD_FCH_GPIO_DRIVER_NAME, APU2_GPIO_LINE_LED3,
51 NULL, 2, GPIO_ACTIVE_LOW),
52 - GPIO_LOOKUP_IDX(AMD_FCH_GPIO_DRIVER_NAME, APU2_GPIO_LINE_SIMSWAP,
53 - NULL, 3, GPIO_ACTIVE_LOW),
54 }
55 };
56