mirror of
https://github.com/torvalds/linux.git
synced 2024-11-24 21:21:41 +00:00
ASoC: rt722: change the interrupt mask for jack type detection
This patch changed the interrupt mask from XU to GE. Signed-off-by: Shuming Fan <shumingf@realtek.com> Link: https://patch.msgid.link/20241105100557.1987917-1-shumingf@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
adf7ea48ce
commit
93b763a5ab
@ -177,7 +177,7 @@ static int rt722_sdca_update_status(struct sdw_slave *slave,
|
||||
* This also could sync with the cache value as the rt722_sdca_jack_init set.
|
||||
*/
|
||||
sdw_write_no_pm(rt722->slave, SDW_SCP_SDCA_INTMASK1,
|
||||
SDW_SCP_SDCA_INTMASK_SDCA_6);
|
||||
SDW_SCP_SDCA_INTMASK_SDCA_0);
|
||||
sdw_write_no_pm(rt722->slave, SDW_SCP_SDCA_INTMASK2,
|
||||
SDW_SCP_SDCA_INTMASK_SDCA_8);
|
||||
}
|
||||
@ -308,12 +308,8 @@ static int rt722_sdca_interrupt_callback(struct sdw_slave *slave,
|
||||
SDW_SCP_SDCA_INT_SDCA_0, SDW_SCP_SDCA_INT_SDCA_0);
|
||||
if (ret < 0)
|
||||
goto io_error;
|
||||
} else if (ret & SDW_SCP_SDCA_INTMASK_SDCA_6) {
|
||||
ret = sdw_update_no_pm(rt722->slave, SDW_SCP_SDCA_INT1,
|
||||
SDW_SCP_SDCA_INT_SDCA_6, SDW_SCP_SDCA_INT_SDCA_6);
|
||||
if (ret < 0)
|
||||
goto io_error;
|
||||
}
|
||||
|
||||
ret = sdw_read_no_pm(rt722->slave, SDW_SCP_SDCA_INT2);
|
||||
if (ret < 0)
|
||||
goto io_error;
|
||||
@ -444,7 +440,7 @@ static int __maybe_unused rt722_sdca_dev_system_suspend(struct device *dev)
|
||||
mutex_lock(&rt722_sdca->disable_irq_lock);
|
||||
rt722_sdca->disable_irq = true;
|
||||
ret1 = sdw_update_no_pm(slave, SDW_SCP_SDCA_INTMASK1,
|
||||
SDW_SCP_SDCA_INTMASK_SDCA_0 | SDW_SCP_SDCA_INTMASK_SDCA_6, 0);
|
||||
SDW_SCP_SDCA_INTMASK_SDCA_0, 0);
|
||||
ret2 = sdw_update_no_pm(slave, SDW_SCP_SDCA_INTMASK2,
|
||||
SDW_SCP_SDCA_INTMASK_SDCA_8, 0);
|
||||
mutex_unlock(&rt722_sdca->disable_irq_lock);
|
||||
@ -471,7 +467,7 @@ static int __maybe_unused rt722_sdca_dev_resume(struct device *dev)
|
||||
if (!slave->unattach_request) {
|
||||
mutex_lock(&rt722->disable_irq_lock);
|
||||
if (rt722->disable_irq == true) {
|
||||
sdw_write_no_pm(slave, SDW_SCP_SDCA_INTMASK1, SDW_SCP_SDCA_INTMASK_SDCA_6);
|
||||
sdw_write_no_pm(slave, SDW_SCP_SDCA_INTMASK1, SDW_SCP_SDCA_INTMASK_SDCA_0);
|
||||
sdw_write_no_pm(slave, SDW_SCP_SDCA_INTMASK2, SDW_SCP_SDCA_INTMASK_SDCA_8);
|
||||
rt722->disable_irq = false;
|
||||
}
|
||||
|
@ -190,8 +190,8 @@ static void rt722_sdca_jack_detect_handler(struct work_struct *work)
|
||||
if (!rt722->component->card || !rt722->component->card->instantiated)
|
||||
return;
|
||||
|
||||
/* SDW_SCP_SDCA_INT_SDCA_6 is used for jack detection */
|
||||
if (rt722->scp_sdca_stat1 & SDW_SCP_SDCA_INT_SDCA_6) {
|
||||
/* SDW_SCP_SDCA_INT_SDCA_0 is used for jack detection */
|
||||
if (rt722->scp_sdca_stat1 & SDW_SCP_SDCA_INT_SDCA_0) {
|
||||
ret = rt722_sdca_headset_detect(rt722);
|
||||
if (ret < 0)
|
||||
return;
|
||||
@ -294,7 +294,7 @@ static void rt722_sdca_jack_init(struct rt722_sdca_priv *rt722)
|
||||
if (rt722->hs_jack) {
|
||||
/* set SCP_SDCA_IntMask1[0]=1 */
|
||||
sdw_write_no_pm(rt722->slave, SDW_SCP_SDCA_INTMASK1,
|
||||
SDW_SCP_SDCA_INTMASK_SDCA_0 | SDW_SCP_SDCA_INTMASK_SDCA_6);
|
||||
SDW_SCP_SDCA_INTMASK_SDCA_0);
|
||||
/* set SCP_SDCA_IntMask2[0]=1 */
|
||||
sdw_write_no_pm(rt722->slave, SDW_SCP_SDCA_INTMASK2,
|
||||
SDW_SCP_SDCA_INTMASK_SDCA_8);
|
||||
@ -308,6 +308,7 @@ static void rt722_sdca_jack_init(struct rt722_sdca_priv *rt722)
|
||||
regmap_write(rt722->regmap,
|
||||
SDW_SDCA_CTL(FUNC_NUM_JACK_CODEC, RT722_SDCA_ENT_XU0D,
|
||||
RT722_SDCA_CTL_SELECTED_MODE, 0), 0);
|
||||
rt722_sdca_index_write(rt722, RT722_VENDOR_HDA_CTL, RT722_GE_RELATED_CTL1, 0x0000);
|
||||
/* trigger GE interrupt */
|
||||
rt722_sdca_index_update_bits(rt722, RT722_VENDOR_HDA_CTL,
|
||||
RT722_GE_RELATED_CTL2, 0x4000, 0x4000);
|
||||
|
Loading…
Reference in New Issue
Block a user