[PATCH 1/1] apu6: add apu6 variation to apu2 driver family

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Philip Prindeville <philipp@xxxxxxxxxxxxxxxxxxxxx>

Add detection of PC Engines "apu6" platform via DMI.

Also, revise leds-apu.c to call out additional platforms
which aren't supported.

Signed-off-by: Philip Prindeville <philipp@xxxxxxxxxxxxxxxxxxxxx>
---
drivers/leds/leds-apu.c                |  2 +-
drivers/platform/x86/Kconfig           |  4 ++--
drivers/platform/x86/pcengines-apuv2.c | 19 ++++++++++++++++---
3 files changed, 19 insertions(+), 6 deletions(-)

diff --git a/drivers/leds/leds-apu.c b/drivers/leds/leds-apu.c
index c409b80c236d7182c79944225dd4b9e5d32f0a9f..5a71ced5ed3dc850d7355be90f4f7ed14ad4cc47 100644
--- a/drivers/leds/leds-apu.c
+++ b/drivers/leds/leds-apu.c
@@ -183,7 +183,7 @@ static int __init apu_led_init(void)

	if (!(dmi_match(DMI_SYS_VENDOR, "PC Engines") &&
	      (dmi_match(DMI_PRODUCT_NAME, "APU") || dmi_match(DMI_PRODUCT_NAME, "apu1")))) {
-		pr_err("No PC Engines APUv1 board detected. For APUv2,3 support, enable CONFIG_PCENGINES_APU2\n");
+		pr_err("No PC Engines APUv1 board detected. For APUv2,3,4,6 support, enable CONFIG_PCENGINES_APU2\n");
		return -ENODEV;
	}

diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
index 5692385e2d26fed92785488ce1c6e88449c54c78..86bb334a6d4d6a3a7e0319470c16d49cf6a3d9f2 100644
--- a/drivers/platform/x86/Kconfig
+++ b/drivers/platform/x86/Kconfig
@@ -698,7 +698,7 @@ config XO1_RFKILL
	  laptop.

config PCENGINES_APU2
-	tristate "PC Engines APUv2/3 front button and LEDs driver"
+	tristate "PC Engines APUv2/3/4/6 front button and LEDs driver"
	depends on INPUT && INPUT_KEYBOARD && GPIOLIB
	depends on LEDS_CLASS
	select GPIO_AMD_FCH
@@ -706,7 +706,7 @@ config PCENGINES_APU2
	select LEDS_GPIO
	help
	  This driver provides support for the front button and LEDs on
-	  PC Engines APUv2/APUv3 board.
+	  PC Engines APUv2/APUv3/APUv4/APUv6 board.

	  To compile this driver as a module, choose M here: the module
	  will be called pcengines-apuv2.
diff --git a/drivers/platform/x86/pcengines-apuv2.c b/drivers/platform/x86/pcengines-apuv2.c
index d063d91db9bcbe5ceb2ac641d3105df37651ac4d..405dea012ab80fa35775c6169b3e659d0a3fb30c 100644
--- a/drivers/platform/x86/pcengines-apuv2.c
+++ b/drivers/platform/x86/pcengines-apuv2.c
@@ -1,10 +1,11 @@
// SPDX-License-Identifier: GPL-2.0+

/*
- * PC-Engines APUv2/APUv3 board platform driver
+ * PC-Engines APUv2/APUv3/APUv4/APUv6 board platform driver
 * for GPIO buttons and LEDs
 *
 * Copyright (C) 2018 metux IT consult
+ * Copyright (C) 2022 Redfish Solutions, LLC
 * Author: Enrico Weigelt <info@xxxxxxxxx>
 */

@@ -22,7 +23,7 @@
#include <linux/platform_data/gpio/gpio-amd-fch.h>

/*
- * NOTE: this driver only supports APUv2/3 - not APUv1, as this one
+ * NOTE: this driver only supports APUv2/3/4/6 - not APUv1, as this one
 * has completely different register layouts.
 */

@@ -215,6 +216,15 @@ static const struct dmi_system_id apu_gpio_dmi_table[] __initconst = {
		},
		.driver_data = (void *)&board_apu2,
	},
+	/* APU6 w/ legacy BIOS >= 4.12 */
+	{
+		.ident       = "apu6",
+		.matches     = {
+			DMI_MATCH(DMI_SYS_VENDOR, "PC Engines"),
+			DMI_MATCH(DMI_BOARD_NAME, "apu6")
+		},
+		.driver_data = (void *)&board_apu2,
+	},
	{}
};

@@ -288,8 +298,11 @@ module_init(apu_board_init);
module_exit(apu_board_exit);

MODULE_AUTHOR("Enrico Weigelt, metux IT consult <info@xxxxxxxxx>");
-MODULE_DESCRIPTION("PC Engines APUv2/APUv3 board GPIO/LEDs/keys driver");
+MODULE_DESCRIPTION("PC Engines APUv2/APUv3/APUv4/APUv6 board GPIO/LEDs/keys driver");
MODULE_LICENSE("GPL");
MODULE_DEVICE_TABLE(dmi, apu_gpio_dmi_table);
MODULE_ALIAS("platform:pcengines-apuv2");
+MODULE_ALIAS("platform:pcengines-apuv3");
+MODULE_ALIAS("platform:pcengines-apuv4");
+MODULE_ALIAS("platform:pcengines-apuv6");
MODULE_SOFTDEP("pre: platform:" AMD_FCH_GPIO_DRIVER_NAME " platform:leds-gpio platform:gpio_keys_polled");
-- 
2.34.1




[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux