@@ -96,6 +96,9 @@ struct _FpiDeviceSynaTlsMoc
9696 guint32 event_recv ;
9797 guint num_pending_events ;
9898 gboolean event_read_in_legacy_mode ;
99+
100+ /* quirks */
101+ gboolean disable_image_metrics ;
99102};
100103
101104G_DEFINE_TYPE (FpiDeviceSynaTlsMoc , fpi_device_synatlsmoc , FP_TYPE_DEVICE );
@@ -105,7 +108,7 @@ static const FpIdEntry id_table[] = {
105108 /* the sensors commented out are untested, but should be suported */
106109 // { .vid = SYNAPTICS_VENDOR_ID, .pid = 0x00C9, },
107110 // { .vid = SYNAPTICS_VENDOR_ID, .pid = 0x00D1, },
108- // { .vid = SYNAPTICS_VENDOR_ID, .pid = 0x00E7, },
111+ { .vid = SYNAPTICS_VENDOR_ID , .pid = 0x00E7 , },
109112 { .vid = SYNAPTICS_VENDOR_ID , .pid = 0x00FF , },
110113 // { .vid = SYNAPTICS_VENDOR_ID, .pid = 0x0124, },
111114 // { .vid = SYNAPTICS_VENDOR_ID, .pid = 0x0169, },
@@ -1828,11 +1831,33 @@ recv_get_image_metrics (FpDevice *device, guint8 *buffer_in, gsize length_in, GE
18281831 }
18291832
18301833 FpiByteReader reader ;
1834+ fpi_byte_reader_init (& reader , buffer_in , length_in );
1835+
18311836 gboolean read_ok = TRUE;
1832- guint32 image_metrics_length , image_metrics_type ;
1837+ guint16 status ;
1838+ read_ok &= fpi_byte_reader_get_uint16_le (& reader , & status );
18331839
1834- fpi_byte_reader_init (& reader , buffer_in , length_in );
1835- read_ok &= fpi_byte_reader_skip (& reader , SENSOR_FW_REPLY_STATUS_HEADER_LEN );
1840+ if (read_ok && !status_is_success (status ))
1841+ {
1842+ if ((status == VCS_RESULT_SENSOR_BAD_CMD ) && (!self -> disable_image_metrics ))
1843+ {
1844+ fp_warn ("Received status 0x%04x on get_image_metrics, disabling them" ,
1845+ status );
1846+ self -> disable_image_metrics = TRUE;
1847+ fpi_ssm_next_state (self -> task_ssm );
1848+ return ;
1849+ }
1850+ else
1851+ {
1852+ fpi_ssm_mark_failed (
1853+ self -> task_ssm ,
1854+ set_and_report_error (FP_DEVICE_ERROR_PROTO , "received status: 0x%04x" ,
1855+ status ));
1856+ return ;
1857+ }
1858+ }
1859+
1860+ guint32 image_metrics_length , image_metrics_type ;
18361861 read_ok &= fpi_byte_reader_get_uint32_le (& reader , & image_metrics_type );
18371862 read_ok &= fpi_byte_reader_get_uint32_le (& reader , & image_metrics_length );
18381863
@@ -1937,7 +1962,7 @@ send_get_image_metrics (FpiDeviceSynaTlsMoc *self,
19371962
19381963 g_autofree guint8 * cmd = fpi_byte_writer_reset_and_get_data (& writer );
19391964
1940- synatlsmoc_exec_cmd (self , FALSE, TRUE , cmd , send_size , expected_recv_size ,
1965+ synatlsmoc_exec_cmd (self , FALSE, FALSE , cmd , send_size , expected_recv_size ,
19411966 recv_get_image_metrics );
19421967}
19431968
@@ -3913,7 +3938,10 @@ synatlsmoc_identify_verify_run_state (FpiSsm *ssm, FpDevice *device)
39133938 sensor_frame_finish (self );
39143939 break ;
39153940 case IDENTIFY_VERIFY_IMAGE_METRICS :
3916- send_get_image_metrics (self , MIS_IMAGE_METRICS_IMG_QUALITY );
3941+ if (self -> disable_image_metrics )
3942+ fpi_ssm_next_state (ssm );
3943+ else
3944+ send_get_image_metrics (self , MIS_IMAGE_METRICS_IMG_QUALITY );
39173945 break ;
39183946 case IDENTIFY_VERIFY_IDENTIFY_MATCH :
39193947 if (fpi_device_get_current_action (device ) == FPI_DEVICE_ACTION_IDENTIFY )
0 commit comments