summaryrefslogtreecommitdiff
path: root/sys/dev/acpi
diff options
context:
space:
mode:
authorJoshua Stein <jcs@cvs.openbsd.org>2021-08-10 12:19:07 +0000
committerJoshua Stein <jcs@cvs.openbsd.org>2021-08-10 12:19:07 +0000
commit79522ddfa6904f02aed1fab6943ad7715ea9ed81 (patch)
tree301f449c706af8c9abdd99be10290abf0c678a23 /sys/dev/acpi
parent355d6a8a55621af15f1ced8d22230b5906ecfae3 (diff)
Add Tiger Lake LP (INT34C5) support
with James Hastings
Diffstat (limited to 'sys/dev/acpi')
-rw-r--r--sys/dev/acpi/pchgpio.c40
1 files changed, 37 insertions, 3 deletions
diff --git a/sys/dev/acpi/pchgpio.c b/sys/dev/acpi/pchgpio.c
index 1dff43d1679..fb0fd32ce52 100644
--- a/sys/dev/acpi/pchgpio.c
+++ b/sys/dev/acpi/pchgpio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pchgpio.c,v 1.2 2021/05/16 08:50:59 jsg Exp $ */
+/* $OpenBSD: pchgpio.c,v 1.3 2021/08/10 12:19:06 jcs Exp $ */
/*
* Copyright (c) 2020 Mark Kettenis
* Copyright (c) 2020 James Hastings
@@ -98,6 +98,7 @@ struct cfdriver pchgpio_cd = {
const char *pchgpio_hids[] = {
"INT34BB",
+ "INT34C5",
NULL
};
@@ -128,8 +129,41 @@ struct pchgpio_device cnl_lp_device =
.npins = 320,
};
+struct pchgpio_group tgl_lp_groups[] =
+{
+ /* Community 0 */
+ { 0, 0, 0, 25, 0, 0 }, /* GPP_B */
+ { 0, 1, 26, 41, 26, 32 }, /* GPP_T */
+ { 0, 2, 42, 66, 42, 64 }, /* GPP_A */
+
+ /* Community 1 */
+ { 1, 0, 67, 74, 0, 96 }, /* GPP_S */
+ { 1, 1, 75, 98, 24, 128 }, /* GPP_H */
+ { 1, 2, 99, 119, 45, 160 }, /* GPP_D */
+ { 1, 3, 120, 143, 69, 192 }, /* GPP_U */
+
+ /* Community 4 */
+ { 2, 0, 171, 194, 0, 256 }, /* GPP_C */
+ { 2, 1, 195, 219, 25, 288 }, /* GPP_F */
+ { 2, 3, 226, 250, 51, 320 }, /* GPP_E */
+
+ /* Community 5 */
+ { 3, 0, 260, 267, 0, 352 }, /* GPP_R */
+};
+
+struct pchgpio_device tgl_lp_device =
+{
+ .pad_size = 16,
+ .gpi_is = 0x100,
+ .gpi_ie = 0x120,
+ .groups = tgl_lp_groups,
+ .ngroups = nitems(tgl_lp_groups),
+ .npins = 360,
+};
+
struct pchgpio_match pchgpio_devices[] = {
{ "INT34BB", &cnl_lp_device },
+ { "INT34C5", &tgl_lp_device },
};
int pchgpio_read_pin(void *, int);
@@ -291,8 +325,8 @@ pchgpio_intr_establish(void *cookie, int pin, int flags,
uint32_t reg;
uint16_t offset;
uint8_t bank, bar;
-
- KASSERT(pin >= 0 && pin < sc->sc_npins);
+
+ KASSERT(pin >= 0);
if ((group = pchgpio_find_group(sc, pin)) == NULL)
return;