diff --git a/src/drivers/intel/touch/chip.h b/src/drivers/intel/touch/chip.h index 69b58f83aa..83b5cd7d37 100644 --- a/src/drivers/intel/touch/chip.h +++ b/src/drivers/intel/touch/chip.h @@ -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 { diff --git a/src/drivers/intel/touch/hynitron.h b/src/drivers/intel/touch/hynitron.h index 9932bbeb65..8ad065fe9b 100644 --- a/src/drivers/intel/touch/hynitron.h +++ b/src/drivers/intel/touch/hynitron.h @@ -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 */ }, }; diff --git a/src/drivers/intel/touch/touch.c b/src/drivers/intel/touch/touch.c index 5bca4173c6..85dd7f9159 100644 --- a/src/drivers/intel/touch/touch.c +++ b/src/drivers/intel/touch/touch.c @@ -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;