drivers/intel/touch: Add support for new Intel touch I2C _DSD entries

This update enhances the Intel touch driver by incorporating support for
newly added _DSD entries specific to I2C devices. The enhancements
include:

- Adding new entries in the I2C _DSD to enable configurations for
  maximum frame size and interrupt delay settings.
- Introducing device-specific interrupt delay settings tailored for
  Hynitron devices.

These changes ensure improved configurability and performance tuning for
supported devices. It is crucial to use this update with an operating
system that includes corresponding changes for this new support.

ATTENTION: This change requires a THC driver fix. If the OS does not
have the driver fix, please use LPSS I2C or disable the touchscreen
and touchpad. For instance, on the Google Fatcat board, use the
following CBI fw_config options:
TOUCHSCREEN field: TOUCHSCREEN_LPSS_I2C or TOUCHSCREEN_NONE
TOUCHPAD field: TOUCHPAD_LPSS_I2C or TOUCHPAD_NONE

BUG=none

Signed-off-by: Cliff Huang <cliff.huang@intel.com>
Change-Id: Iaab8329c97247161395d203a5efa92c053acb3a1
Reviewed-on: https://review.coreboot.org/c/coreboot/+/89214
Reviewed-by: Jérémy Compostella <jeremy.compostella@intel.com>
Reviewed-by: Kim, Kyoung Il <kyoung.il.kim@intel.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Cliff Huang 2025-09-16 10:24:22 -07:00 committed by Matt DeVillier
commit e6a8143d8b
3 changed files with 27 additions and 2 deletions

View file

@ -20,6 +20,10 @@ struct intel_thc_hidi2c_dev_info {
* Otherwise, if not specified, use the speed setting from the platform.
*/
enum i2c_speed connection_speed;
/* Maximum Frame Size Value: FSVL; FSEN will be set if FSVL has non-zero value */
uint64_t max_frame_size_value;
/* Interrupt delay value: INDV; INDE will be set if INDV has non-zero value */
uint64_t interrupt_delay_value;
};
struct intel_thc_hidspi_dev_info {

View file

@ -13,6 +13,8 @@ static const struct drivers_intel_touch_config hynitron_touch_config = {
.intf.hidi2c.addr = 0x2c,
.intf.hidi2c.descriptor_address = 0x20,
.intf.hidi2c.connection_speed = I2C_SPEED_FAST, /* fast mode */
.intf.hidi2c.interrupt_delay_value = 4, /* unit: 10 usec */
.intf.hidi2c.max_frame_size_value = 50, /* bytes */
},
};

View file

@ -237,7 +237,7 @@ static void touch_generate_acpi_i2cdev_dsd(const struct device *dev)
acpigen_write_name("ICRS");
acpigen_emit_byte(BUFFER_OP);
acpigen_write_len_f();
acpigen_write_integer(12); /* total size of ICRS + 1 */
acpigen_write_integer(2 + 8 + 1 + 1); /* total size of ICRS + 1 */
acpigen_pop_len(); /* Name */
acpigen_write_create_buffer_word_field("ICRS", 0x00, "DADR");
acpigen_write_create_buffer_qword_field("ICRS", 0x02, "DSPD");
@ -246,7 +246,7 @@ static void touch_generate_acpi_i2cdev_dsd(const struct device *dev)
acpigen_write_name("ISUB");
acpigen_emit_byte(BUFFER_OP);
acpigen_write_len_f();
acpigen_write_integer(145); /* total size of ISUB + 1 */
acpigen_write_integer(22 * 8 + 1); /* total size of ISUB + 1 */
acpigen_pop_len();
acpigen_write_create_buffer_qword_field("ISUB", 0x00, "SMHX");
acpigen_write_create_buffer_qword_field("ISUB", 0x08, "SMLX");
@ -266,6 +266,10 @@ static void touch_generate_acpi_i2cdev_dsd(const struct device *dev)
acpigen_write_create_buffer_qword_field("ISUB", 0x78, "HMTD");
acpigen_write_create_buffer_qword_field("ISUB", 0x80, "HMRD");
acpigen_write_create_buffer_qword_field("ISUB", 0x88, "HMSL");
acpigen_write_create_buffer_qword_field("ISUB", 0x90, "FSEN");
acpigen_write_create_buffer_qword_field("ISUB", 0x98, "FSVL");
acpigen_write_create_buffer_qword_field("ISUB", 0xa0, "INDE");
acpigen_write_create_buffer_qword_field("ISUB", 0xa8, "INDV");
acpigen_write_store_int_to_namestr(touch_get(dev, dev_hidi2c.intf.hidi2c.addr), "DADR");
@ -305,6 +309,21 @@ static void touch_generate_acpi_i2cdev_dsd(const struct device *dev)
acpigen_write_store_int_to_namestr(touch_soc_get(dev, hidi2c, hm_sda_hold_rx_period), "HMRD");
acpigen_write_store_int_to_namestr(touch_soc_get(dev, hidi2c, suppressed_spikes_h_fp), "HMSL");
if (get_driver_config(dev)->dev_hidi2c.intf.hidi2c.max_frame_size_value) {
acpigen_write_store_int_to_namestr(1, "FSEN");
acpigen_write_store_int_to_namestr(touch_get(dev, dev_hidi2c.intf.hidi2c.max_frame_size_value), "FSVL");
} else {
acpigen_write_store_int_to_namestr(0, "FSEN");
acpigen_write_store_int_to_namestr(0, "FSVL");
}
if (get_driver_config(dev)->dev_hidi2c.intf.hidi2c.interrupt_delay_value) {
acpigen_write_store_int_to_namestr(1, "INDE");
acpigen_write_store_int_to_namestr(touch_get(dev, dev_hidi2c.intf.hidi2c.interrupt_delay_value), "INDV");
} else {
acpigen_write_store_int_to_namestr(0, "INDE");
acpigen_write_store_int_to_namestr(0, "INDV");
}
dsd_pkg_cnt = 4;
if (touch_get(dev, add_acpi_dma_property))
dsd_pkg_cnt += 2;