mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-11-07 04:36:52 -10:00
gpio: add Intel Alder Lake-N GPIO driver
Add a GPIO driver for the Intel Alder Lake-N platform based on the generic intelgpio framework. The driver provides pad group definitions for four GPIO communities covering groups GPP_A through GPP_T, vGPIO and HVCMOS, and matches ACPI hardware IDs INTC1056, INTC1057 and INTC1085. The kernel module build infrastructure and the wiring into files.x86 are included. Reviewed by: vexeduxr MFC after: 1 week Sponsored by: Beckhoff Automation GmbH & Co. KG Pull Request: https://github.com/freebsd/freebsd-src/pull/2205
This commit is contained in:
1 parent
5349a46bab
commit
8c7a3ccf54
4 files changed
+104
No files matched your search
@@ -99,6 +99,8 @@ dev/fdc/fdc_acpi.c optional fdc
|
||||
dev/fdc/fdc_isa.c optional fdc isa
|
||||
dev/gpio/bytgpio.c optional bytgpio
|
||||
dev/gpio/chvgpio.c optional chvgpio
|
||||
dev/gpio/intel/adlngpio.c optional adlngpio
|
||||
dev/gpio/intel/intelgpio.c optional adlngpio
|
||||
dev/hpt27xx/hpt27xx_os_bsd.c optional hpt27xx
|
||||
dev/hpt27xx/hpt27xx_osm_bsd.c optional hpt27xx
|
||||
dev/hpt27xx/hpt27xx_config.c optional hpt27xx
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
* Copyright (c) 2026 Beckhoff Automation GmbH & Co. KG
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/bus.h>
|
||||
#include <sys/gpio.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/module.h>
|
||||
|
||||
#include <contrib/dev/acpica/include/acpi.h>
|
||||
|
||||
#include <dev/acpica/acpivar.h>
|
||||
#include <dev/gpio/gpiobusvar.h>
|
||||
|
||||
#include "intelgpio.h"
|
||||
|
||||
#include "gpio_if.h"
|
||||
#include "opt_acpi.h"
|
||||
|
||||
static const struct intelgpio_padgroup adln_com0_groups[] = {
|
||||
{ .first_pad = 0, .npads = 26, .gpio_base = 0, .name = "GPP_B" },
|
||||
{ .first_pad = 26, .npads = 16, .gpio_base = 32, .name = "GPP_T" },
|
||||
{ .first_pad = 42, .npads = 25, .gpio_base = 64, .name = "GPP_A" },
|
||||
};
|
||||
|
||||
static const struct intelgpio_padgroup adln_com1_groups[] = {
|
||||
{ .first_pad = 67, .npads = 8, .gpio_base = 96, .name = "GPP_S" },
|
||||
{ .first_pad = 75, .npads = 20, .gpio_base = 128, .name = "GPP_I" },
|
||||
{ .first_pad = 95, .npads = 24, .gpio_base = 160, .name = "GPP_H" },
|
||||
{ .first_pad = 119, .npads = 21, .gpio_base = 192, .name = "GPP_D" },
|
||||
{ .first_pad = 140, .npads = 29, .gpio_base = 224, .name = "vGPIO" },
|
||||
};
|
||||
|
||||
static const struct intelgpio_padgroup adln_com4_groups[] = {
|
||||
{ .first_pad = 169, .npads = 24, .gpio_base = 256, .name = "GPP_C" },
|
||||
{ .first_pad = 193, .npads = 25, .gpio_base = 288, .name = "GPP_F" },
|
||||
{ .first_pad = 218,
|
||||
.npads = 6,
|
||||
.gpio_base = INTELGPIO_GPIO_NOMAP,
|
||||
.name = "HVCMOS" },
|
||||
{ .first_pad = 224, .npads = 25, .gpio_base = 320, .name = "GPP_E" },
|
||||
};
|
||||
|
||||
static const struct intelgpio_padgroup adln_com5_groups[] = {
|
||||
{ .first_pad = 249, .npads = 8, .gpio_base = 352, .name = "GPP_R" },
|
||||
};
|
||||
|
||||
static const struct intelgpio_community adln_communities[] = {
|
||||
{ .ngroups = nitems(adln_com0_groups), .groups = adln_com0_groups },
|
||||
{ .ngroups = nitems(adln_com1_groups), .groups = adln_com1_groups },
|
||||
{ .ngroups = nitems(adln_com4_groups), .groups = adln_com4_groups },
|
||||
{ .ngroups = nitems(adln_com5_groups), .groups = adln_com5_groups },
|
||||
};
|
||||
|
||||
static char *adln_hids[] = { "INTC1056", "INTC1057", "INTC1085", NULL };
|
||||
|
||||
static const struct intelgpio_platform adln_platform = {
|
||||
.communities = adln_communities,
|
||||
.ncommunities = nitems(adln_communities),
|
||||
.hids = adln_hids,
|
||||
.desc = "Intel Alder Lake-N GPIO",
|
||||
};
|
||||
|
||||
static int
|
||||
adln_probe(device_t dev)
|
||||
{
|
||||
return (intelgpio_probe(dev, &adln_platform));
|
||||
}
|
||||
|
||||
static int
|
||||
adln_attach(device_t dev)
|
||||
{
|
||||
return (intelgpio_attach(dev, &adln_platform));
|
||||
}
|
||||
|
||||
static device_method_t adln_methods[] = {
|
||||
DEVMETHOD(device_probe, adln_probe),
|
||||
DEVMETHOD(device_attach, adln_attach),
|
||||
|
||||
DEVMETHOD_END
|
||||
};
|
||||
|
||||
DEFINE_CLASS_1(gpio, adln_driver, adln_methods,
|
||||
sizeof(struct intelgpio_softc), intelgpio_driver);
|
||||
|
||||
DRIVER_MODULE(adlngpio, acpi, adln_driver, NULL, NULL);
|
||||
MODULE_DEPEND(adlngpio, acpi, 1, 1, 1);
|
||||
MODULE_DEPEND(adlngpio, gpiobus, 1, 1, 1);
|
||||
MODULE_VERSION(adlngpio, 1);
|
||||
ACPI_PNP_INFO(adln_hids);
|
||||
@@ -73,6 +73,7 @@ SUBDIR= \
|
||||
bridgestp \
|
||||
bwi \
|
||||
bwn \
|
||||
${_adlngpio} \
|
||||
${_bytgpio} \
|
||||
${_chvgpio} \
|
||||
cam \
|
||||
@@ -797,6 +798,7 @@ _wdatwd= wdatwd
|
||||
|
||||
_aac= aac
|
||||
_aacraid= aacraid
|
||||
_adlngpio= adlngpio
|
||||
.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
|
||||
_aesni= aesni
|
||||
.endif
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
.PATH: ${SRCTOP}/sys/dev/gpio/intel
|
||||
KMOD= adlngpio
|
||||
SRCS= intelgpio.c adlngpio.c
|
||||
SRCS+= acpi_if.h device_if.h bus_if.h gpio_if.h opt_acpi.h opt_platform.h
|
||||
|
||||
.include <bsd.kmod.mk>
|
||||
Reference in new issue
Block a user