mb/google/brya/var/guren: Add Stylus Pen Function

New Stylus Pen for MAXEYE/0585501490 module for Guren360 project.
1. Add STYLUS fw_config setting
2. Enable stylus device settings
3. Disable the stylus GPIO pins based on fw_config

BUG=b:406168542
BRANCH=firmware-nissa-15217.B
TEST=1. emerge-nissa coreboot
     2. Confirm command evtest for stylus PRP0001:00 and workable.

Change-Id: I46d679d29b35d0f4fc70d63b74975d3bdfc40b7b
Signed-off-by: Daniel Peng <Daniel_Peng@pegatron.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/87235
Reviewed-by: Eric Lai <ericllai@google.com>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
Reviewed-by: Daniel Peng <daniel_peng@pegatron.corp-partner.google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Daniel Peng 2025-04-09 11:48:31 +08:00 committed by Subrata Banik
commit cdfd2104bd
3 changed files with 32 additions and 4 deletions

View file

@ -27,6 +27,13 @@ static const struct pad_config lte_disable_pads[] = {
PAD_NC(GPP_H23, NONE),
};
static const struct pad_config stylus_disable_pads[] = {
/* F13 : SOC_PEN_DETECT_R_ODL */
PAD_NC_LOCK(GPP_F13, NONE, LOCK_CONFIG),
/* F15 : SOC_PEN_DETECT_ODL */
PAD_NC_LOCK(GPP_F15, NONE, LOCK_CONFIG),
};
void fw_config_gpio_padbased_override(struct pad_config *padbased_table)
{
if (!fw_config_probe(FW_CONFIG(DB_USB, DB_HDMI_LTE))
@ -44,4 +51,10 @@ void fw_config_gpio_padbased_override(struct pad_config *padbased_table)
gpio_padbased_override(padbased_table, lte_disable_pads,
ARRAY_SIZE(lte_disable_pads));
}
if (fw_config_probe(FW_CONFIG(STYLUS, STYLUS_ABSENT))) {
printk(BIOS_INFO, "Disable Stylus GPIO pins.\n");
gpio_padbased_override(padbased_table, stylus_disable_pads,
ARRAY_SIZE(stylus_disable_pads));
}
}

View file

@ -26,10 +26,6 @@ static const struct pad_config override_gpio_table[] = {
PAD_CFG_GPI(GPP_E5, NONE, DEEP),
/* F12 : WWAN_RST_L */
PAD_CFG_GPO_LOCK(GPP_F12, 1, LOCK_CONFIG),
/* F13 : GSXSLOAD ==> NC */
PAD_NC_LOCK(GPP_F13, NONE, LOCK_CONFIG),
/* F15 : GSXSRESET# ==> NC */
PAD_NC_LOCK(GPP_F15, NONE, LOCK_CONFIG),
/* H19 : SOC_I2C_SUB_INT_ODL */
PAD_CFG_GPI_APIC(GPP_H19, NONE, PLTRST, LEVEL, NONE),
/* H22 : IMGCLKOUT3 ==> NC */

View file

@ -21,6 +21,10 @@ fw_config
option WIFI_SAR_ID_INTEL_CONVERTIBLE 0
option WIFI_SAR_ID_INTEL_CLAMSHELL 1
end
field STYLUS 15
option STYLUS_ABSENT 0
option STYLUS_PRESENT 1
end
field WFC 17 18
option WFC_ABSENT 0
option WFC_PRESENT 1
@ -389,6 +393,21 @@ chip soc/intel/alderlake
probe TOUCHSCREEN_SOURCE TOUCHSCREEN_FTSC1000
end
end
chip drivers/generic/gpio_keys
register "name" = ""PENH""
register "gpio" = "ACPI_GPIO_INPUT_ACTIVE_LOW(GPP_F13)"
register "key.wake_gpe" = "GPE0_DW2_15"
register "key.wakeup_route" = "WAKEUP_ROUTE_SCI"
register "key.wakeup_event_action" = "EV_ACT_DEASSERTED"
register "key.dev_name" = ""EJCT""
register "key.linux_code" = "SW_PEN_INSERTED"
register "key.linux_input_type" = "EV_SW"
register "key.label" = ""pen_eject""
device generic 0 on
probe STYLUS STYLUS_PRESENT
end
end
end #I2C1
device ref i2c2 on
chip drivers/i2c/sx9324