Add RGBKB-DET# GPIO

This GPIO can be used to detect if the connected keyboard is RGB.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
This commit is contained in:
Tim Crawford
2023-05-19 10:28:02 -06:00
committed by Jeremy Soller
parent e60873a82c
commit c71a58f7cf
42 changed files with 44 additions and 2 deletions

View File

@ -31,6 +31,7 @@ struct Gpio __code PM_CLKRUN_N = GPIO(H, 0); // renamed to ECCLKRUN#
struct Gpio __code PM_PWROK = GPIO(C, 6);
struct Gpio __code PWR_BTN_N = GPIO(D, 5);
struct Gpio __code PWR_SW_N = GPIO(D, 0);
struct Gpio __code RGBKB_DET_N = GPIO(E, 2);
struct Gpio __code SB_KBCRST_N = GPIO(E, 6);
struct Gpio __code SCI_N = GPIO(D, 4);
struct Gpio __code SMI_N = GPIO(D, 3);

View File

@ -37,6 +37,7 @@ extern struct Gpio __code PM_CLKRUN_N;
extern struct Gpio __code PM_PWROK;
extern struct Gpio __code PWR_BTN_N;
extern struct Gpio __code PWR_SW_N;
extern struct Gpio __code RGBKB_DET_N;
extern struct Gpio __code SB_KBCRST_N;
extern struct Gpio __code SCI_N;
#define HAVE_SLP_SUS_N 0

View File

@ -30,6 +30,7 @@ struct Gpio __code PM_CLKRUN_N = GPIO(H, 0); // renamed to ECCLKRUN#
struct Gpio __code PM_PWROK = GPIO(C, 6);
struct Gpio __code PWR_BTN_N = GPIO(D, 5);
struct Gpio __code PWR_SW_N = GPIO(B, 3);
struct Gpio __code RGBKB_DET_N = GPIO(I, 5);
struct Gpio __code SCI_N = GPIO(D, 3);
struct Gpio __code SMI_N = GPIO(D, 4);
struct Gpio __code SUSB_N_PCH = GPIO(H, 6);

View File

@ -37,6 +37,7 @@ extern struct Gpio __code PM_CLKRUN_N; // renamed to ECCLKRUN#
extern struct Gpio __code PM_PWROK;
extern struct Gpio __code PWR_BTN_N;
extern struct Gpio __code PWR_SW_N;
extern struct Gpio __code RGBKB_DET_N;
extern struct Gpio __code SCI_N;
#define HAVE_SLP_SUS_N 0
extern struct Gpio __code SMI_N;

View File

@ -26,6 +26,7 @@ struct Gpio __code PCH_DPWROK_EC = GPIO(F, 3);
struct Gpio __code PM_PWROK = GPIO(C, 6);
struct Gpio __code PWR_BTN_N = GPIO(D, 5);
struct Gpio __code PWR_SW_N = GPIO(B, 3);
struct Gpio __code RGBKB_DET_N = GPIO(E, 2);
struct Gpio __code SLP_SUS_N = GPIO(H, 7);
struct Gpio __code VA_EC_EN = GPIO(J, 4);
struct Gpio __code WLAN_EN = GPIO(G, 1);

View File

@ -32,6 +32,7 @@ extern struct Gpio __code PCH_DPWROK_EC;
extern struct Gpio __code PM_PWROK;
extern struct Gpio __code PWR_BTN_N;
extern struct Gpio __code PWR_SW_N;
extern struct Gpio __code RGBKB_DET_N;
extern struct Gpio __code SLP_SUS_N;
#define HAVE_SUS_PWR_ACK 0
extern struct Gpio __code VA_EC_EN;

View File

@ -27,6 +27,7 @@ struct Gpio __code PCH_DPWROK_EC = GPIO(F, 3);
struct Gpio __code PCH_PWROK_EC = GPIO(I, 5); // renamed to SYS_PWROK_EC
struct Gpio __code PWR_BTN_N = GPIO(D, 5);
struct Gpio __code PWR_SW_N = GPIO(B, 3);
struct Gpio __code RGBKB_DET_N = GPIO(E, 2);
struct Gpio __code SINK_CTRL = GPIO(H, 0);
struct Gpio __code SLP_SUS_N = GPIO(H, 7);
struct Gpio __code VA_EC_EN = GPIO(J, 4);

View File

@ -35,6 +35,7 @@ extern struct Gpio __code PCH_PWROK_EC;
#define HAVE_PM_PWROK 0
extern struct Gpio __code PWR_BTN_N;
extern struct Gpio __code PWR_SW_N;
extern struct Gpio __code RGBKB_DET_N;
extern struct Gpio __code SINK_CTRL;
extern struct Gpio __code SLP_SUS_N;
#define HAVE_SUS_PWR_ACK 0

View File

@ -28,6 +28,7 @@ struct Gpio __code PM_CLKRUN_N = GPIO(H, 0);
struct Gpio __code PM_PWROK = GPIO(C, 6);
struct Gpio __code PWR_BTN_N = GPIO(D, 5);
struct Gpio __code PWR_SW_N = GPIO(D, 0);
struct Gpio __code RGBKB_DET_N = GPIO(H, 3);
struct Gpio __code SB_KBCRST_N = GPIO(E, 6);
struct Gpio __code SCI_N = GPIO(D, 4);
struct Gpio __code SLP_SUS_N = GPIO(I, 2);
@ -183,8 +184,8 @@ void gpio_init() {
GPCRH1 = GPIO_IN;
// BKL_EN
GPCRH2 = GPIO_OUT;
// NC
GPCRH3 = GPIO_OUT;
// RGBKB-DET#
GPCRH3 = GPIO_IN | GPIO_UP;
// VR_ON
GPCRH4 = GPIO_IN;
// WLAN_EN

View File

@ -32,6 +32,7 @@ extern struct Gpio __code PM_CLKRUN_N;
extern struct Gpio __code PM_PWROK;
extern struct Gpio __code PWR_BTN_N;
extern struct Gpio __code PWR_SW_N;
extern struct Gpio __code RGBKB_DET_N;
extern struct Gpio __code SB_KBCRST_N;
extern struct Gpio __code SCI_N;
extern struct Gpio __code SLP_SUS_N;

View File

@ -27,6 +27,7 @@ struct Gpio __code PM_CLKRUN_N = GPIO(H, 0);
struct Gpio __code PM_PWROK = GPIO(C, 6);
struct Gpio __code PWR_BTN_N = GPIO(D, 5);
struct Gpio __code PWR_SW_N = GPIO(B, 3);
struct Gpio __code RGBKB_DET_N = GPIO(E, 2);
struct Gpio __code SB_KBCRST_N = GPIO(E, 6);
struct Gpio __code SLP_S0_N = GPIO(J, 3);
struct Gpio __code SLP_SUS_N = GPIO(J, 7);

View File

@ -33,6 +33,7 @@ extern struct Gpio __code PM_CLKRUN_N;
extern struct Gpio __code PM_PWROK;
extern struct Gpio __code PWR_BTN_N;
extern struct Gpio __code PWR_SW_N;
extern struct Gpio __code RGBKB_DET_N;
extern struct Gpio __code SB_KBCRST_N;
extern struct Gpio __code SCI_N;
extern struct Gpio __code SLP_S0_N;

View File

@ -25,6 +25,7 @@ struct Gpio __code PCH_DPWROK_EC = GPIO(B, 2);
struct Gpio __code PCH_PWROK_EC = GPIO(A, 4);
struct Gpio __code PWR_BTN_N = GPIO(D, 5);
struct Gpio __code PWR_SW_N = GPIO(B, 3);
struct Gpio __code RGBKB_DET_N = GPIO(E, 2);
struct Gpio __code SB_KBCRST_N = GPIO(E, 6);
struct Gpio __code SLP_S0_N = GPIO(J, 3);
struct Gpio __code SLP_SUS_N = GPIO(J, 7);

View File

@ -32,6 +32,7 @@ extern struct Gpio __code PCH_PWROK_EC;
#define HAVE_PM_PWROK 0
extern struct Gpio __code PWR_BTN_N;
extern struct Gpio __code PWR_SW_N;
extern struct Gpio __code RGBKB_DET_N;
extern struct Gpio __code SB_KBCRST_N;
extern struct Gpio __code SLP_S0_N;
extern struct Gpio __code SLP_SUS_N;

View File

@ -26,6 +26,7 @@ struct Gpio __code PCH_PWROK_EC = GPIO(A, 4);
struct Gpio __code PD_EN = GPIO(H, 7); // renamed to PD_POWER_EN
struct Gpio __code PWR_BTN_N = GPIO(D, 5);
struct Gpio __code PWR_SW_N = GPIO(B, 3);
struct Gpio __code RGBKB_DET_N = GPIO(I, 2);
struct Gpio __code SB_KBCRST_N = GPIO(E, 6);
struct Gpio __code SLP_S0_N = GPIO(J, 3);
struct Gpio __code SLP_SUS_N = GPIO(J, 7);

View File

@ -34,6 +34,7 @@ extern struct Gpio __code PD_EN;
#define HAVE_PM_PWROK 0
extern struct Gpio __code PWR_BTN_N;
extern struct Gpio __code PWR_SW_N;
extern struct Gpio __code RGBKB_DET_N;
extern struct Gpio __code SB_KBCRST_N;
extern struct Gpio __code SLP_S0_N;
extern struct Gpio __code SLP_SUS_N;

View File

@ -26,6 +26,7 @@ struct Gpio __code ME_WE = GPIO(I, 2);
struct Gpio __code PM_PWROK = GPIO(C, 6);
struct Gpio __code PWR_BTN_N = GPIO(D, 5);
struct Gpio __code PWR_SW_N = GPIO(B, 3);
struct Gpio __code RGBKB_DET_N = GPIO(E, 2);
struct Gpio __code SCI_N = GPIO(D, 3);
struct Gpio __code SMI_N = GPIO(D, 4);
struct Gpio __code SUSB_N_PCH = GPIO(H, 6);

View File

@ -33,6 +33,7 @@ extern struct Gpio __code ME_WE;
extern struct Gpio __code PM_PWROK;
extern struct Gpio __code PWR_BTN_N;
extern struct Gpio __code PWR_SW_N;
extern struct Gpio __code RGBKB_DET_N;
extern struct Gpio __code SCI_N;
#define HAVE_SLP_SUS_N 0
extern struct Gpio __code SMI_N;

View File

@ -28,6 +28,7 @@ struct Gpio __code PCH_DPWROK_EC = GPIO(F, 3);
struct Gpio __code PCH_PWROK_EC = GPIO(C, 6); // renamed to EC_SYS_PWROK
struct Gpio __code PWR_BTN_N = GPIO(D, 5);
struct Gpio __code PWR_SW_N = GPIO(B, 3);
struct Gpio __code RGBKB_DET_N = GPIO(E, 2);
struct Gpio __code SLP_SUS_N = GPIO(H, 3);
struct Gpio __code SUSB_N_PCH = GPIO(H, 6);
struct Gpio __code SUSC_N_PCH = GPIO(H, 1);

View File

@ -33,6 +33,7 @@ extern struct Gpio __code PCH_PWROK_EC;
#define HAVE_PM_PWROK 0
extern struct Gpio __code PWR_BTN_N;
extern struct Gpio __code PWR_SW_N;
extern struct Gpio __code RGBKB_DET_N;
extern struct Gpio __code SLP_SUS_N;
#define HAVE_SUS_PWR_ACK 0
extern struct Gpio __code SUSB_N_PCH;

View File

@ -29,6 +29,7 @@ struct Gpio __code PCH_PWROK_EC = GPIO(C, 6); // renamed to EC_SYS_PWROK
struct Gpio __code PM_PWROK = GPIO(H, 5); // actually VR_ON
struct Gpio __code PWR_BTN_N = GPIO(D, 5);
struct Gpio __code PWR_SW_N = GPIO(B, 3);
struct Gpio __code RGBKB_DET_N = GPIO(E, 2);
struct Gpio __code SLP_SUS_N = GPIO(I, 6);
struct Gpio __code SUSB_N_PCH = GPIO(H, 6);
struct Gpio __code SUSC_N_PCH = GPIO(H, 1);

View File

@ -33,6 +33,7 @@ extern struct Gpio __code PCH_PWROK_EC;
extern struct Gpio __code PM_PWROK;
extern struct Gpio __code PWR_BTN_N;
extern struct Gpio __code PWR_SW_N;
extern struct Gpio __code RGBKB_DET_N;
extern struct Gpio __code SLP_SUS_N;
#define HAVE_SUS_PWR_ACK 0
extern struct Gpio __code SUSB_N_PCH;

View File

@ -27,6 +27,7 @@ struct Gpio __code PCH_DPWROK_EC = GPIO(H, 4);
struct Gpio __code PCH_PWROK_EC = GPIO(F, 3);
struct Gpio __code PWR_BTN_N = GPIO(D, 5);
struct Gpio __code PWR_SW_N = GPIO(B, 3);
struct Gpio __code RGBKB_DET_N = GPIO(E, 2);
struct Gpio __code SLP_S0_N = GPIO(C, 6); // XXX: Really CPU_C10_GATE#
struct Gpio __code SLP_SUS_N = GPIO(J, 4);
struct Gpio __code SUSB_N_PCH = GPIO(H, 6);

View File

@ -33,6 +33,7 @@ extern struct Gpio __code PCH_PWROK_EC;
#define HAVE_PM_PWROK 0
extern struct Gpio __code PWR_BTN_N;
extern struct Gpio __code PWR_SW_N;
extern struct Gpio __code RGBKB_DET_N;
extern struct Gpio __code SLP_S0_N;
extern struct Gpio __code SLP_SUS_N;
#define HAVE_SUS_PWR_ACK 0

View File

@ -27,6 +27,7 @@ struct Gpio __code PCH_DPWROK_EC = GPIO(F, 3);
struct Gpio __code PCH_PWROK_EC = GPIO(C, 6);
struct Gpio __code PWR_BTN_N = GPIO(D, 5);
struct Gpio __code PWR_SW_N = GPIO(B, 3);
struct Gpio __code RGBKB_DET_N = GPIO(E, 2);
struct Gpio __code SLP_S0_N = GPIO(J, 2); // XXX: Really CPU_C10_GATE#
struct Gpio __code SLP_SUS_N = GPIO(J, 7);
struct Gpio __code SUSB_N_PCH = GPIO(H, 6);

View File

@ -33,6 +33,7 @@ extern struct Gpio __code PCH_PWROK_EC;
#define HAVE_PM_PWROK 0
extern struct Gpio __code PWR_BTN_N;
extern struct Gpio __code PWR_SW_N;
extern struct Gpio __code RGBKB_DET_N;
extern struct Gpio __code SLP_S0_N;
extern struct Gpio __code SLP_SUS_N;
#define HAVE_SUS_PWR_ACK 0

View File

@ -27,6 +27,7 @@ struct Gpio __code PCH_DPWROK_EC = GPIO(H, 4);
struct Gpio __code PCH_PWROK_EC = GPIO(F, 3);
struct Gpio __code PWR_BTN_N = GPIO(D, 5);
struct Gpio __code PWR_SW_N = GPIO(B, 3);
struct Gpio __code RGBKB_DET_N = GPIO(E, 2);
struct Gpio __code SLP_SUS_N = GPIO(J, 4);
struct Gpio __code VA_EC_EN = GPIO(H, 7);
struct Gpio __code WLAN_EN = GPIO(G, 1);

View File

@ -33,6 +33,7 @@ extern struct Gpio __code PCH_PWROK_EC;
#define HAVE_PM_PWROK 0
extern struct Gpio __code PWR_BTN_N;
extern struct Gpio __code PWR_SW_N;
extern struct Gpio __code RGBKB_DET_N;
extern struct Gpio __code SLP_SUS_N;
#define HAVE_SUS_PWR_ACK 0
extern struct Gpio __code VA_EC_EN;

View File

@ -28,6 +28,7 @@ struct Gpio __code PCH_PWROK_EC = GPIO(C, 6); // renamed to SYS_PWROK_EC
struct Gpio __code PD_EN = GPIO(F, 6); // renamed to PD_POWER_EN
struct Gpio __code PWR_BTN_N = GPIO(D, 5);
struct Gpio __code PWR_SW_N = GPIO(B, 3);
struct Gpio __code RGBKB_DET_N = GPIO(E, 2);
struct Gpio __code SINK_CTRL = GPIO(H, 1);
struct Gpio __code SLP_SUS_N = GPIO(H, 7);
struct Gpio __code VA_EC_EN = GPIO(J, 4);

View File

@ -36,6 +36,7 @@ extern struct Gpio __code PD_EN;
#define HAVE_PM_PWROK 0
extern struct Gpio __code PWR_BTN_N;
extern struct Gpio __code PWR_SW_N;
extern struct Gpio __code RGBKB_DET_N;
extern struct Gpio __code SINK_CTRL;
extern struct Gpio __code SLP_SUS_N;
#define HAVE_SUS_PWR_ACK 0

View File

@ -27,6 +27,7 @@ struct Gpio __code ME_WE = GPIO(I, 2);
struct Gpio __code PM_PWROK = GPIO(C, 6);
struct Gpio __code PWR_BTN_N = GPIO(D, 5);
struct Gpio __code PWR_SW_N = GPIO(D, 0);
struct Gpio __code RGBKB_DET_N = GPIO(J, 3);
struct Gpio __code SB_KBCRST_N = GPIO(E, 6);
struct Gpio __code SCI_N = GPIO(D, 4);
struct Gpio __code SMI_N = GPIO(D, 3);

View File

@ -33,6 +33,7 @@ extern struct Gpio __code ME_WE;
extern struct Gpio __code PM_PWROK;
extern struct Gpio __code PWR_BTN_N;
extern struct Gpio __code PWR_SW_N;
extern struct Gpio __code RGBKB_DET_N;
extern struct Gpio __code SB_KBCRST_N;
extern struct Gpio __code SCI_N;
#define HAVE_SLP_SUS_N 0

View File

@ -26,6 +26,7 @@ struct Gpio __code ME_WE = GPIO(I, 2);
struct Gpio __code PM_PWROK = GPIO(C, 6);
struct Gpio __code PWR_BTN_N = GPIO(D, 5);
struct Gpio __code PWR_SW_N = GPIO(B, 3);
struct Gpio __code RGBKB_DET_N = GPIO(J, 3);
struct Gpio __code SB_KBCRST_N = GPIO(E, 6);
struct Gpio __code SCI_N = GPIO(D, 3);
struct Gpio __code SMI_N = GPIO(D, 4);

View File

@ -33,6 +33,7 @@ extern struct Gpio __code ME_WE;
extern struct Gpio __code PM_PWROK;
extern struct Gpio __code PWR_BTN_N;
extern struct Gpio __code PWR_SW_N;
extern struct Gpio __code RGBKB_DET_N;
extern struct Gpio __code SB_KBCRST_N;
extern struct Gpio __code SCI_N;
#define HAVE_SLP_SUS_N 0

View File

@ -25,6 +25,7 @@ struct Gpio __code ME_WE = GPIO(I, 2);
struct Gpio __code PM_PWROK = GPIO(C, 6);
struct Gpio __code PWR_BTN_N = GPIO(D, 5);
struct Gpio __code PWR_SW_N = GPIO(B, 3);
struct Gpio __code RGBKB_DET_N = GPIO(J, 3);
struct Gpio __code SB_KBCRST_N = GPIO(E, 6);
struct Gpio __code SCI_N = GPIO(D, 3);
struct Gpio __code SMI_N = GPIO(D, 4);

View File

@ -33,6 +33,7 @@ extern struct Gpio __code ME_WE;
extern struct Gpio __code PM_PWROK;
extern struct Gpio __code PWR_BTN_N;
extern struct Gpio __code PWR_SW_N;
extern struct Gpio __code RGBKB_DET_N;
extern struct Gpio __code SB_KBCRST_N;
extern struct Gpio __code SCI_N;
#define HAVE_SLP_SUS_N 0

View File

@ -27,6 +27,7 @@ struct Gpio __code PCH_DPWROK_EC = GPIO(F, 3);
struct Gpio __code PCH_PWROK_EC = GPIO(C, 6);
struct Gpio __code PWR_BTN_N = GPIO(D, 5);
struct Gpio __code PWR_SW_N = GPIO(B, 3);
struct Gpio __code RGBKB_DET_N = GPIO(J, 7);
struct Gpio __code SLP_SUS_N = GPIO(D, 4);
struct Gpio __code SUSB_N_PCH = GPIO(H, 6);
struct Gpio __code SUSC_N_PCH = GPIO(H, 1);

View File

@ -33,6 +33,7 @@ extern struct Gpio __code PCH_PWROK_EC;
#define HAVE_PM_PWROK 0
extern struct Gpio __code PWR_BTN_N;
extern struct Gpio __code PWR_SW_N;
extern struct Gpio __code RGBKB_DET_N;
extern struct Gpio __code SLP_SUS_N;
#define HAVE_SUS_PWR_ACK 0
extern struct Gpio __code SUSB_N_PCH;

View File

@ -27,6 +27,7 @@ struct Gpio __code PCH_DPWROK_EC = GPIO(F, 3);
struct Gpio __code PCH_PWROK_EC = GPIO(C, 6);
struct Gpio __code PWR_BTN_N = GPIO(D, 5);
struct Gpio __code PWR_SW_N = GPIO(B, 3);
struct Gpio __code RGBKB_DET_N = GPIO(E, 2);
struct Gpio __code SB_KBCRST_N = GPIO(E, 6);
struct Gpio __code SLP_S0_N = GPIO(H, 3);
struct Gpio __code SLP_SUS_N = GPIO(D, 4);

View File

@ -34,6 +34,7 @@ extern struct Gpio __code PCH_PWROK_EC;
#define HAVE_PM_PWROK 0
extern struct Gpio __code PWR_BTN_N;
extern struct Gpio __code PWR_SW_N;
extern struct Gpio __code RGBKB_DET_N;
extern struct Gpio __code SB_KBCRST_N;
extern struct Gpio __code SLP_S0_N;
extern struct Gpio __code SLP_SUS_N;

View File

@ -27,6 +27,7 @@ struct Gpio __code PCH_DPWROK_EC = GPIO(F, 3);
struct Gpio __code PCH_PWROK_EC = GPIO(C, 6);
struct Gpio __code PWR_BTN_N = GPIO(D, 5);
struct Gpio __code PWR_SW_N = GPIO(B, 3);
struct Gpio __code RGBKB_DET_N = GPIO(E, 2);
struct Gpio __code SINK_CTRL = GPIO(F, 7);
struct Gpio __code SLP_SUS_N = GPIO(H, 7);
struct Gpio __code SWI_N = GPIO(B, 5);

View File

@ -34,6 +34,7 @@ extern struct Gpio __code PCH_PWROK_EC;
#define HAVE_PM_PWROK 0
extern struct Gpio __code PWR_BTN_N;
extern struct Gpio __code PWR_SW_N;
extern struct Gpio __code RGBKB_DET_N;
extern struct Gpio __code SINK_CTRL;
extern struct Gpio __code SLP_SUS_N;
#define HAVE_SUSWARN_N 0