soundwire: intel/cadence: add flag for interrupt enable
Prepare for future PM support and fix error handling by disabling interrupts as needed. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20191022235448.17586-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
This commit is contained in:

کامیت شده توسط
Vinod Koul

والد
dfbe642d1e
کامیت
9e3d47fb2b
@@ -815,14 +815,17 @@ EXPORT_SYMBOL(sdw_cdns_exit_reset);
|
||||
* sdw_cdns_enable_interrupt() - Enable SDW interrupts and update config
|
||||
* @cdns: Cadence instance
|
||||
*/
|
||||
int sdw_cdns_enable_interrupt(struct sdw_cdns *cdns)
|
||||
int sdw_cdns_enable_interrupt(struct sdw_cdns *cdns, bool state)
|
||||
{
|
||||
u32 mask;
|
||||
u32 slave_intmask0 = 0;
|
||||
u32 slave_intmask1 = 0;
|
||||
u32 mask = 0;
|
||||
|
||||
cdns_writel(cdns, CDNS_MCP_SLAVE_INTMASK0,
|
||||
CDNS_MCP_SLAVE_INTMASK0_MASK);
|
||||
cdns_writel(cdns, CDNS_MCP_SLAVE_INTMASK1,
|
||||
CDNS_MCP_SLAVE_INTMASK1_MASK);
|
||||
if (!state)
|
||||
goto update_masks;
|
||||
|
||||
slave_intmask0 = CDNS_MCP_SLAVE_INTMASK0_MASK;
|
||||
slave_intmask1 = CDNS_MCP_SLAVE_INTMASK1_MASK;
|
||||
|
||||
/* enable detection of all slave state changes */
|
||||
mask = CDNS_MCP_INT_SLAVE_MASK;
|
||||
@@ -845,6 +848,9 @@ int sdw_cdns_enable_interrupt(struct sdw_cdns *cdns)
|
||||
if (interrupt_mask) /* parameter override */
|
||||
mask = interrupt_mask;
|
||||
|
||||
update_masks:
|
||||
cdns_writel(cdns, CDNS_MCP_SLAVE_INTMASK0, slave_intmask0);
|
||||
cdns_writel(cdns, CDNS_MCP_SLAVE_INTMASK1, slave_intmask1);
|
||||
cdns_writel(cdns, CDNS_MCP_INTMASK, mask);
|
||||
|
||||
/* commit changes */
|
||||
|
مرجع در شماره جدید
Block a user