Add system76/lemp10

This commit is contained in:
Jeremy Soller
2020-12-29 10:15:50 -07:00
committed by Jeremy Soller
parent b156d18bc2
commit 8f340d6164
10 changed files with 782 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
#ifndef _BOARD_ESPI_H
#define _BOARD_ESPI_H
#include <ec/espi.h>
void espi_init(void);
void espi_reset(void);
void espi_event(void);
#endif // _BOARD_ESPI_H

View File

@@ -0,0 +1,58 @@
// SPDX-License-Identifier: GPL-3.0-only
#ifndef _BOARD_GPIO_H
#define _BOARD_GPIO_H
#include <ec/gpio.h>
#define GPIO_ALT 0x00
#define GPIO_IN 0x80
#define GPIO_OUT 0x40
#define GPIO_UP 0x04
#define GPIO_DOWN 0x02
void gpio_init(void);
void gpio_debug(void);
extern struct Gpio __code ACIN_N;
extern struct Gpio __code AC_PRESENT;
extern struct Gpio __code ALL_SYS_PWRGD;
extern struct Gpio __code BKL_EN;
extern struct Gpio __code BT_EN;
extern struct Gpio __code BUF_PLT_RST_N;
extern struct Gpio __code CCD_EN;
extern struct Gpio __code CPU_C10_GATE_N;
extern struct Gpio __code DD_ON;
extern struct Gpio __code EC_EN;
extern struct Gpio __code EC_RSMRST_N;
#define HAVE_LAN_WAKEUP_N 0
extern struct Gpio __code LED_ACIN;
#define HAVE_LED_AIRPLANE_N 0
#define HAVE_LED_BAT_CHG 0
#define HAVE_LED_BAT_FULL 0
extern struct Gpio __code LED_PWR;
extern struct Gpio __code LID_SW_N;
extern struct Gpio __code PCH_DPWROK_EC;
extern struct Gpio __code PCH_PWROK_EC;
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 SB_KBCRST_N;
extern struct Gpio __code SCI_N;
extern struct Gpio __code SLP_S0_N;
extern struct Gpio __code SLP_SUS_N;
extern struct Gpio __code SMI_N;
extern struct Gpio __code SUSB_N_PCH;
extern struct Gpio __code SUSC_N_PCH;
#define HAVE_SUSWARN_N 0
#define HAVE_SUS_PWR_ACK 0
extern struct Gpio __code SWI_N;
extern struct Gpio __code USB_PWR_EN_N;
extern struct Gpio __code VA_EC_EN;
extern struct Gpio __code VR_ON;
extern struct Gpio __code WLAN_EN;
extern struct Gpio __code WLAN_PWR_EN;
extern struct Gpio __code XLP_OUT;
#endif // _BOARD_GPIO_H

View File

@@ -0,0 +1,52 @@
// SPDX-License-Identifier: GPL-3.0-only
#ifndef _BOARD_KEYMAP_H
#define _BOARD_KEYMAP_H
// Keymap layers (normal, Fn)
#define KM_LAY 2
// Keymap output pins
#define KM_OUT 16
// Keymap input pins
#define KM_IN 8
// common/keymap.h requires KM_LAY, KM_OUT, and KM_IN definitions
#include <common/keymap.h>
// Conversion of physical layout to keyboard matrix
#define LAYOUT( \
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, \
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \
K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, \
K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, \
K50, K51, K52, K53, K54, K55, K56, K57, K58, K59, \
K60, K61, K62 \
) { \
{ ___, ___, ___, ___, ___, ___, K52, ___ }, \
{ ___, ___, ___, ___, ___, ___, K50, K56 }, \
{ ___, ___, ___, ___, ___, ___, K53, K55 }, \
{ ___, ___, ___, ___, ___, ___, K40, K4B }, \
{ K42, K41, K30, K31, K20, ___, K54, K21 }, \
{ K44, K43, ___, K33, ___, ___, ___, K23 }, \
{ K51, K45, K34, K35, K24, K25, ___, ___ }, \
{ ___, K46, K36, K26, K12, K11, K10, K00 }, \
{ K28, K47, K27, K15, K14, K13, K02, K01 }, \
{ K22, K37, K38, ___, K17, K16, K04, K03 }, \
{ K32, K48, K39, K29, K19, K18, K06, K05 }, \
{ ___, K58, K49, K3A, K2A, K1A, K08, K07 }, \
{ ___, ___, K4A, K3B, K2B, K1B, K0A, K09 }, \
{ ___, ___, K0D, K2C, K1C, K62, K0E, K0B }, \
{ ___, K2D, K60, K1D, K57, K0F, ___, K0G }, \
{ ___, ___, K3C, ___, K61, K0C, ___, K59 } \
}
// Position of physical Esc key in the matrix
#define MATRIX_ESC_INPUT 7
#define MATRIX_ESC_OUTPUT 7
// Position of physical Fn key in the matrix
#define MATRIX_FN_INPUT 0
#define MATRIX_FN_OUTPUT 6
#endif // _BOARD_KEYMAP_H