summaryrefslogtreecommitdiff
path: root/drivers/platform/x86/pcengines-apuv2.c
AgeCommit message (Collapse)AuthorFilesLines
2023-03-16platform/x86: pcengines-apuv2: Drop platform:pcengines-apuv2 module-aliasHans de Goede1-1/+0
The driver auto-loads based on the DMI modaliases and this platform modalias is not necessary and broken: 1. Not necessary since the driver itself creates the platform_device, so it is already loaded when the modalias might be used 2. From a quick scan of the code it does not create any platform-devices called "platform:pcengines-apuv2" Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20230313130241.778146-1-hdegoede@redhat.com
2021-08-06platform/x86: pcengines-apuv2: Add missing terminating entries to ↵Hans de Goede1-0/+2
gpio-lookup tables The gpiod_lookup_table.table passed to gpiod_add_lookup_table() must be terminated with an empty entry, add this. Note we have likely been getting away with this not being present because the GPIO lookup code first matches on the dev_id, causing most lookups to skip checking the table and the lookups which do check the table will find a matching entry before reaching the end. With that said, terminating these tables properly still is obviously the correct thing to do. Fixes: f8eb0235f659 ("x86: pcengines apuv2 gpio/leds/keys platform driver") Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20210806115515.12184-1-hdegoede@redhat.com
2020-09-24platform/x86: pcengines-apuv2: Fix typo on define of ↵Ed Wildgoose1-1/+1
AMD_FCH_GPIO_REG_GPIO55_DEVSLP0 Schematics show that the GPIO number is 55 (not 59). Trivial typo. Signed-off-by: Ed Wildgoose <lists@wildgooses.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-07-15platform/x86: pcengines-apuv2: revert wiring up simswitch GPIO as LEDFlorian Eckert1-3/+0
This reverts commit 5037d4ddda31c2dbbb018109655f61054b1756dc. Explanation why this does not work: This change connects the simswap to the LED subsystem of the kernel. From my point of view, it's nonsense. If we do it this way, then this can be switched relatively easily via the LED subsystem (trigger: none/default-on) and that is dangerous! If this is used, it would be unfavorable, since there is also another trigger (trigger: heartbeat/netdev). Therefore, this simswap GPIO should remain in the GPIO subsystem and be switched via it and not be connected to the LED subsystem. To avoid the problems mentioned above. The LED subsystem is not made for this and it is not a good compromise, but rather dangerous. Signed-off-by: Florian Eckert <fe@dev.tdt.de> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-12-20platform/x86: pcengines-apuv2: Spelling fixes in the driverAndy Shevchenko1-20/+20
Mainly does: - capitalize gpio and bios to GPIO and BIOS - capitalize beginning of comments - add periods in multi-line comments Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-12-20platform/x86: pcengines-apuv2: detect apuv4 boardEnrico Weigelt, metux IT consult1-0/+27
GPIO stuff on APUv4 seems to be the same as on APUv2, so we just need to match on DMI data. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-12-20platform/x86: pcengines-apuv2: fix simswap GPIO assignmentEnrico Weigelt, metux IT consult1-1/+1
The mapping entry has to hold the GPIO line index instead of controller's register number. Fixes: 5037d4ddda31 ("platform/x86: pcengines-apuv2: wire up simswitch gpio as led") Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-07-30platform/x86: pcengines-apuv2: wire up simswitch gpio as ledEnrico Weigelt1-1/+4
The APU3+ boards have two SIM sockets, while only one of them can be routed to the mpcie slots at a time. Selection is done via simswap gpio. We currently don't have a fitting subsystem for those cases yet, so just wire it up to a LED for the time being. While this isn't really semantically correct, it's a good compromise. Signed-off-by: Enrico Weigelt <info@metux.net> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-07-30platform/x86: pcengines-apuv2: add mpcie reset gpio exportFlorian Eckert1-0/+8
On APUx we have also mpcie2/mpcie3 reset pins. To make it possible to reset the ports from the userspace, add the definition to this platform device. The gpio can then be exported by the legancy gpio subsystem to toggle the mpcie reset pin. Signed-off-by: Florian Eckert <fe@dev.tdt.de> Acked-by: Enrico Weigelt <info@metux.net> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-07-29platform/x86: pcengines-apuv2: use KEY_RESTART for front buttonEnrico Weigelt1-1/+1
The keycode KEY_RESTART is more appropriate for the front button, as most people use it for things like restart or factory reset. Signed-off-by: Enrico Weigelt <info@metux.net> Fixes: f8eb0235f659 ("x86: pcengines apuv2 gpio/leds/keys platform driver") Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-07-25platform/x86: pcengines-apuv2: Fix softdep statementJean Delvare1-3/+1
Only first MODULE_SOFTDEP statement is handled per module. Multiple dependencies must be expressed in a single statement. Signed-off-by: Jean Delvare <jdelvare@suse.de> Cc: "Enrico Weigelt, metux IT consult" <info@metux.net> Cc: Darren Hart <dvhart@infradead.org> Cc: Andy Shevchenko <andy@infradead.org> [andy: massaged commit message] Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-06-12platform/x86: pcengines-apuv2: Make two symbols staticYueHaibing1-2/+2
Fix sparse warnings: drivers/platform/x86/pcengines-apuv2.c:80:27: warning: symbol 'gpios_led_table' was not declared. Should it be static? drivers/platform/x86/pcengines-apuv2.c:113:27: warning: symbol 'gpios_key_table' was not declared. Should it be static? Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: YueHaibing <yuehaibing@huawei.com> Acked-By: Enrico Weigelt, metux IT consult <info@metux.net> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-03-08x86: apuv2: remove unused variableArnd Bergmann1-1/+0
The driver was newly introduced but the version that got merged produces a harmless compiler warning: drivers/platform/x86/pcengines-apuv2.c: In function 'apu_board_init': drivers/platform/x86/pcengines-apuv2.c:211:6: error: unused variable 'rc' [-Werror=unused-variable] Remove the evidently useless variable. Fixes: f8eb0235f659 ("x86: pcengines apuv2 gpio/leds/keys platform driver") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-By: Enrico Weigelt, metux IT consult <info@metux.net> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2019-02-22x86: pcengines apuv2 gpio/leds/keys platform driverEnrico Weigelt, metux IT consult1-0/+261
Driver for PCengines APUv2 board's front LEDs and Button, which are attached to AMD PCH GPIOs. Due to lack of dedicated ACPI entry, detecting the board via DMI. Cc: linux-gpio@vger.kernel.org Cc: linus.walleij@linaro.org Cc: bgolaszewski@baylibre.com Cc: dvhart@infradead.org Cc: platform-driver-x86@vger.kernel.org Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>