@@ -101,6 +101,7 @@ static bool rt711_sdca_mbq_volatile_register(struct device *dev, unsigned int re
case 0x2000080:
case 0x2000081:
case 0x2000083:
+ case 0x200009f:
case 0x5800000:
case 0x5800001:
case 0x5f00001:
@@ -488,6 +488,12 @@ static void rt711_sdca_jack_init(struct rt711_sdca_priv *rt711)
/* set SCP_SDCA_IntMask2[0]=1 */
sdw_write_no_pm(rt711->slave, SDW_SCP_SDCA_INTMASK2, SDW_SCP_SDCA_INTMASK_SDCA_8);
dev_dbg(&rt711->slave->dev, "in %s enable\n", __func__);
+
+ /* trigger GE interrupt */
+ rt711_sdca_index_update_bits(rt711, RT711_VENDOR_HDA_CTL,
+ RT711_GE_MODE_RELATED_CTL, 0x0080, 0x0080);
+ rt711_sdca_index_update_bits(rt711, RT711_VENDOR_HDA_CTL,
+ RT711_GE_MODE_RELATED_CTL, 0x0080, 0x0000);
} else {
/* disable HID 1/2 event */
rt711_sdca_index_update_bits(rt711, RT711_VENDOR_HDA_CTL,
@@ -1493,7 +1499,7 @@ int rt711_sdca_io_init(struct device *dev, struct sdw_slave *slave)
{
struct rt711_sdca_priv *rt711 = dev_get_drvdata(dev);
int ret = 0;
- unsigned int val;
+ unsigned int val, hibernation_flag;
rt711->disable_irq = false;
@@ -1525,6 +1531,11 @@ int rt711_sdca_io_init(struct device *dev, struct sdw_slave *slave)
pm_runtime_get_noresume(&slave->dev);
+ rt711_sdca_index_read(rt711, RT711_VENDOR_REG, 0x9f, &val);
+ hibernation_flag = (val >> 8);
+ if (hibernation_flag)
+ goto _preset_ready_;
+
rt711_sdca_reset(rt711);
rt711_sdca_index_read(rt711, RT711_VENDOR_REG, RT711_JD_PRODUCT_NUM, &val);
@@ -1559,6 +1570,10 @@ int rt711_sdca_io_init(struct device *dev, struct sdw_slave *slave)
if (rt711->hs_jack)
rt711_sdca_jack_init(rt711);
+ if (!hibernation_flag)
+ rt711_sdca_index_update_bits(rt711, RT711_VENDOR_REG, 0x9f, 0x0100, 0x0100);
+
+_preset_ready_:
if (rt711->first_hw_init) {
regcache_cache_bypass(rt711->regmap, false);
regcache_mark_dirty(rt711->regmap);