From 1910779d4185d4806bae1a3a1e21da3bc22f4e1e Mon Sep 17 00:00:00 2001 From: Furquan Shaikh Date: Thu, 24 May 2018 05:16:40 -0700 Subject: [PATCH] it83xx: Add a config option for enabling mouse LDN Not all boards using ITE83XX use mouse LDN. This change adds a config option to allow boards to explicity enable this device. Currently, this device is enabled only for glkrvp_ite and it83xx_evb. It is disabled for reef_ite and bip. Change-Id: I7149fd0cb35cc9f49f2b7b80f6c2deefe2edda55 Signed-off-by: Furquan Shaikh Reviewed-on: https://chromium-review.googlesource.com/1070785 Commit-Ready: Furquan Shaikh Tested-by: Furquan Shaikh Reviewed-by: Jett Rink Reviewed-by: Dino Li --- board/glkrvp_ite/board.h | 1 + board/it83xx_evb/board.h | 1 + chip/it83xx/ec2i.c | 4 ++++ include/config.h | 3 +++ 4 files changed, 9 insertions(+) diff --git a/board/glkrvp_ite/board.h b/board/glkrvp_ite/board.h index 52bf94e3f1..4209a06bf8 100644 --- a/board/glkrvp_ite/board.h +++ b/board/glkrvp_ite/board.h @@ -101,6 +101,7 @@ #define CONFIG_VSTORE_SLOT_COUNT 1 /* Optional feature - used by ITE */ +#define CONFIG_IT83XX_ENABLE_MOUSE_DEVICE #define CONFIG_IT83XX_FLASH_CLOCK_48MHZ /* I2C ports */ diff --git a/board/it83xx_evb/board.h b/board/it83xx_evb/board.h index a3e02f1c8e..b018fb65c6 100644 --- a/board/it83xx_evb/board.h +++ b/board/it83xx_evb/board.h @@ -17,6 +17,7 @@ #define CONFIG_FANS 1 #define CONFIG_I2C #define CONFIG_I2C_MASTER +#define CONFIG_IT83XX_ENABLE_MOUSE_DEVICE #define CONFIG_IT83XX_SMCLK2_ON_GPC7 #define CONFIG_KEYBOARD_BOARD_CONFIG #define CONFIG_KEYBOARD_PROTOCOL_8042 diff --git a/chip/it83xx/ec2i.c b/chip/it83xx/ec2i.c index 3804061407..38216592ad 100644 --- a/chip/it83xx/ec2i.c +++ b/chip/it83xx/ec2i.c @@ -45,6 +45,7 @@ static const struct ec2i_t keyboard_settings[] = { {HOST_INDEX_LDA, 0x01}, }; +#ifdef CONFIG_IT83XX_ENABLE_MOUSE_DEVICE static const struct ec2i_t mouse_settings[] = { /* Select logical device 05h(mouse) */ {HOST_INDEX_LDN, LDN_KBC_MOUSE}, @@ -53,6 +54,7 @@ static const struct ec2i_t mouse_settings[] = { /* Enable logical device */ {HOST_INDEX_LDA, 0x01}, }; +#endif static const struct ec2i_t pm1_settings[] = { /* Select logical device 11h(PM1 ACPI) */ @@ -297,7 +299,9 @@ static void pnpcfg_init(void) IT83XX_EC2I_LSIOHA |= 0x3; PNPCFG(keyboard); +#ifdef CONFIG_IT83XX_ENABLE_MOUSE_DEVICE PNPCFG(mouse); +#endif PNPCFG(pm1); PNPCFG(pm2); PNPCFG(smfi); diff --git a/include/config.h b/include/config.h index 4a44d82df8..a094bbff42 100644 --- a/include/config.h +++ b/include/config.h @@ -1817,6 +1817,9 @@ /* Number of IRQs supported on the EC chip */ #undef CONFIG_IRQ_COUNT +/* Enable LDN for KBC mouse */ +#undef CONFIG_IT83XX_ENABLE_MOUSE_DEVICE + /* * The IT8320 supports e-flash clock up to 48 MHz (IT8390 maximum is 32 MHz). * Enable it if we want better performance of fetching instruction from e-flash.