Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions drivers/soundwire/cadence_master.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,7 @@ MODULE_PARM_DESC(cdns_mcp_int_mask, "Cadence MCP IntMask");
#define CDNS_MCP_INT_IRQ BIT(31)
#define CDNS_MCP_INT_RESERVED1 GENMASK(30, 17)
#define CDNS_MCP_INT_WAKEUP BIT(16)
#define CDNS_MCP_INT_SLAVE_RSVD BIT(15)
#define CDNS_MCP_INT_SLAVE_ALERT BIT(14)
#define CDNS_MCP_INT_SLAVE_ATTACH BIT(13)
#define CDNS_MCP_INT_SLAVE_NATTACH BIT(12)
#define CDNS_MCP_INT_SLAVE_MASK GENMASK(15, 12)
/* CDNS_MCP_INT_SLAVE_xxx defines are moved to cadence_master.h */
#define CDNS_MCP_INT_DPINT BIT(11)
#define CDNS_MCP_INT_CTRL_CLASH BIT(10)
#define CDNS_MCP_INT_DATA_CLASH BIT(9)
Expand Down Expand Up @@ -1113,7 +1109,7 @@ static void cdns_update_slave_status_work(struct work_struct *work)

/* unmask Slave interrupt now */
cdns_updatel(cdns, CDNS_MCP_INTMASK,
CDNS_MCP_INT_SLAVE_MASK, CDNS_MCP_INT_SLAVE_MASK);
CDNS_MCP_INT_SLAVE_MASK, cdns->peripheral_int_mask);

}

Expand Down Expand Up @@ -1199,7 +1195,7 @@ static void cdns_enable_slave_interrupts(struct sdw_cdns *cdns, bool state)

mask = cdns_readl(cdns, CDNS_MCP_INTMASK);
if (state)
mask |= CDNS_MCP_INT_SLAVE_MASK;
mask |= cdns->peripheral_int_mask;
else
mask &= ~CDNS_MCP_INT_SLAVE_MASK;

Expand All @@ -1224,7 +1220,7 @@ int sdw_cdns_enable_interrupt(struct sdw_cdns *cdns, bool state)
slave_intmask1 = CDNS_MCP_SLAVE_INTMASK1_MASK;

/* enable detection of all slave state changes */
mask = CDNS_MCP_INT_SLAVE_MASK;
mask = cdns->peripheral_int_mask;

/* enable detection of bus issues */
mask |= CDNS_MCP_INT_CTRL_CLASH | CDNS_MCP_INT_DATA_CLASH |
Expand Down Expand Up @@ -1830,6 +1826,7 @@ int sdw_cdns_probe(struct sdw_cdns *cdns)
{
init_completion(&cdns->tx_complete);
cdns->bus.port_ops = &cdns_port_ops;
cdns->peripheral_int_mask = CDNS_MCP_INT_SLAVE_MASK;

mutex_init(&cdns->status_update_lock);

Expand Down
8 changes: 8 additions & 0 deletions drivers/soundwire/cadence_master.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@

#define SDW_CADENCE_MCP_IP_OFFSET 0x4000

#define CDNS_MCP_INT_SLAVE_RSVD BIT(15)
#define CDNS_MCP_INT_SLAVE_ALERT BIT(14)
#define CDNS_MCP_INT_SLAVE_ATTACH BIT(13)
#define CDNS_MCP_INT_SLAVE_NATTACH BIT(12)
#define CDNS_MCP_INT_SLAVE_MASK GENMASK(15, 12)

/**
* struct sdw_cdns_pdi: PDI (Physical Data Interface) instance
*
Expand Down Expand Up @@ -108,6 +114,7 @@ struct sdw_cdns_dai_runtime {
* @dev: Linux device
* @bus: Bus handle
* @instance: instance number
* @peripheral_int_mask: Peripheral interrupt mask
* @ip_offset: version-dependent offset to access IP_MCP registers and fields
* @response_buf: SoundWire response buffer
* @tx_complete: Tx completion
Expand All @@ -125,6 +132,7 @@ struct sdw_cdns {
struct device *dev;
struct sdw_bus bus;
unsigned int instance;
unsigned int peripheral_int_mask;

u32 ip_offset;

Expand Down
4 changes: 4 additions & 0 deletions drivers/soundwire/intel_auxdevice.c
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,7 @@ static int __maybe_unused intel_suspend(struct device *dev)
u32 clock_stop_quirks;
int ret;

cdns->peripheral_int_mask = CDNS_MCP_INT_SLAVE_ALERT;
if (bus->prop.hw_disabled || !sdw->startup_done) {
dev_dbg(dev, "SoundWire master %d is disabled or not-started, ignoring\n",
bus->link_id);
Expand Down Expand Up @@ -686,6 +687,7 @@ static int __maybe_unused intel_suspend_runtime(struct device *dev)
u32 clock_stop_quirks;
int ret;

cdns->peripheral_int_mask = CDNS_MCP_INT_SLAVE_ALERT;
if (bus->prop.hw_disabled || !sdw->startup_done) {
dev_dbg(dev, "SoundWire master %d is disabled or not-started, ignoring\n",
bus->link_id);
Expand Down Expand Up @@ -724,6 +726,7 @@ static int __maybe_unused intel_resume(struct device *dev)
struct sdw_bus *bus = &cdns->bus;
int ret;

cdns->peripheral_int_mask = CDNS_MCP_INT_SLAVE_MASK;
if (bus->prop.hw_disabled || !sdw->startup_done) {
dev_dbg(dev, "SoundWire master %d is disabled or not-started, ignoring\n",
bus->link_id);
Expand Down Expand Up @@ -781,6 +784,7 @@ static int __maybe_unused intel_resume_runtime(struct device *dev)
u32 clock_stop_quirks;
int ret;

cdns->peripheral_int_mask = CDNS_MCP_INT_SLAVE_MASK;
if (bus->prop.hw_disabled || !sdw->startup_done) {
dev_dbg(dev, "SoundWire master %d is disabled or not-started, ignoring\n",
bus->link_id);
Expand Down
Loading