* [PATCH 1/1] apu6: add apu6 variation to apu2 driver family
@ 2022-12-30 18:07 Philip Prindeville
2022-12-30 18:07 ` Philip Prindeville
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Philip Prindeville @ 2022-12-30 18:07 UTC (permalink / raw)
To: platform-driver-x86, linux-x86_64, platform-driver-x86
Cc: Ed Wildgoose, Andres Salomon, Andreas Eberlein,
Philip Prindeville
From: Philip Prindeville <philipp@redfish-solutions.com>
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@redfish-solutions.com>
---
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@metux.net>
*/
@@ -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@metux.net>");
-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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 1/1] apu6: add apu6 variation to apu2 driver family
2022-12-30 18:07 [PATCH 1/1] apu6: add apu6 variation to apu2 driver family Philip Prindeville
@ 2022-12-30 18:07 ` Philip Prindeville
2022-12-31 11:06 ` Ed Wildgoose
2022-12-31 14:16 ` foodeas
2 siblings, 0 replies; 5+ messages in thread
From: Philip Prindeville @ 2022-12-30 18:07 UTC (permalink / raw)
To: platform-driver-x86, linux-x86_64, platform-driver-x86
Cc: Ed Wildgoose, Andres Salomon, Andreas Eberlein,
Philip Prindeville
From: Philip Prindeville <philipp@redfish-solutions.com>
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@redfish-solutions.com>
---
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@metux.net>
*/
@@ -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@metux.net>");
-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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] apu6: add apu6 variation to apu2 driver family
2022-12-30 18:07 [PATCH 1/1] apu6: add apu6 variation to apu2 driver family Philip Prindeville
2022-12-30 18:07 ` Philip Prindeville
@ 2022-12-31 11:06 ` Ed Wildgoose
2023-01-01 22:39 ` Philip Prindeville
2022-12-31 14:16 ` foodeas
2 siblings, 1 reply; 5+ messages in thread
From: Ed Wildgoose @ 2022-12-31 11:06 UTC (permalink / raw)
To: Philip Prindeville, platform-driver-x86, linux-x86_64
Cc: Ed Wildgoose, Andres Salomon, Andreas Eberlein
On 30/12/2022 18:07, Philip Prindeville wrote:
> From: Philip Prindeville <philipp@redfish-solutions.com>
>
> Add detection of PC Engines "apu6" platform via DMI.
>
> Also, revise leds-apu.c to call out additional platforms
> which aren't supported.
Any chance of also adding the APU5? Details in my previous patches
Ed W
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/1] apu6: add apu6 variation to apu2 driver family
2022-12-30 18:07 [PATCH 1/1] apu6: add apu6 variation to apu2 driver family Philip Prindeville
2022-12-30 18:07 ` Philip Prindeville
2022-12-31 11:06 ` Ed Wildgoose
@ 2022-12-31 14:16 ` foodeas
2 siblings, 0 replies; 5+ messages in thread
From: foodeas @ 2022-12-31 14:16 UTC (permalink / raw)
To: 'Philip Prindeville', platform-driver-x86, linux-x86_64,
platform-driver-x86
Cc: 'Ed Wildgoose', 'Andres Salomon',
'Andreas Eberlein'
Looks good for me!
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] apu6: add apu6 variation to apu2 driver family
2022-12-31 11:06 ` Ed Wildgoose
@ 2023-01-01 22:39 ` Philip Prindeville
0 siblings, 0 replies; 5+ messages in thread
From: Philip Prindeville @ 2023-01-01 22:39 UTC (permalink / raw)
To: Ed Wildgoose
Cc: platform-driver-x86, linux-x86_64, Ed Wildgoose, Andres Salomon,
Andreas Eberlein
> On Dec 31, 2022, at 4:06 AM, Ed Wildgoose <ed@wildgooses.com> wrote:
>
>
> On 30/12/2022 18:07, Philip Prindeville wrote:
>> From: Philip Prindeville <philipp@redfish-solutions.com>
>>
>> Add detection of PC Engines "apu6" platform via DMI.
>>
>> Also, revise leds-apu.c to call out additional platforms
>> which aren't supported.
>
>
> Any chance of also adding the APU5? Details in my previous patches
>
> Ed W
>
Sure, but I have questions about this:
+ /* APU5 w/ mainline BIOS */
+ {
+ .ident = "apu5",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "PC Engines"),
+ DMI_MATCH(DMI_BOARD_NAME, "apu5")
+ },
+ .driver_data = (void *)&apu5_driver_data,
+ },
All the other entries have their .driver_data pointing to a struct amd_fch_gpio_pdata... but not this one. It points to a struct apu_driver_data and I don't even see the definition of that type. Should it point to "board_apu5" instead and we can drop:
+static const struct amd_fch_gpio_pdata board_apu5 = {
+ .gpio_num = ARRAY_SIZE(apu5_gpio_regs),
+ .gpio_reg = apu5_gpio_regs,
+ .gpio_names = apu5_gpio_names,
+};
+
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-01-01 22:39 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-30 18:07 [PATCH 1/1] apu6: add apu6 variation to apu2 driver family Philip Prindeville
2022-12-30 18:07 ` Philip Prindeville
2022-12-31 11:06 ` Ed Wildgoose
2023-01-01 22:39 ` Philip Prindeville
2022-12-31 14:16 ` foodeas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox