File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -392,6 +392,12 @@ static int hda_dsp_update_d0i3c_register(struct snd_sof_dev *sdev, u8 value)
392
392
snd_sof_dsp_update8 (sdev , HDA_DSP_HDA_BAR , chip -> d0i3_offset ,
393
393
SOF_HDA_VS_D0I3C_I3 , value );
394
394
395
+ /*
396
+ * The value written to the D0I3C::I3 bit may not be taken into account immediately.
397
+ * A delay is recommended before checking if D0I3C::CIP is cleared
398
+ */
399
+ usleep_range (30 , 40 );
400
+
395
401
/* Wait for cmd in progress to be cleared before exiting the function */
396
402
ret = hda_dsp_wait_d0i3c_done (sdev );
397
403
if (ret < 0 ) {
@@ -400,6 +406,12 @@ static int hda_dsp_update_d0i3c_register(struct snd_sof_dev *sdev, u8 value)
400
406
}
401
407
402
408
reg = snd_sof_dsp_read8 (sdev , HDA_DSP_HDA_BAR , chip -> d0i3_offset );
409
+ /* Confirm d0i3 state changed with paranoia check */
410
+ if ((reg ^ value ) & SOF_HDA_VS_D0I3C_I3 ) {
411
+ dev_err (sdev -> dev , "failed to update D0I3C!\n" );
412
+ return - EIO ;
413
+ }
414
+
403
415
trace_sof_intel_D0I3C_updated (sdev , reg );
404
416
405
417
return 0 ;
You can’t perform that action at this time.
0 commit comments