Commit f3be8613 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Merge tag 'soundwire-5.12-rc1' of...

Merge tag 'soundwire-5.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire into char-misc-next

Vinod writes:

soundwire updates for 5.12-rc1

Updates forv5.12-rc1 are:
 - New no_pm IO routines and the usage in Intel drivers
 - Intel driver & Cadence lib updates

* tag 'soundwire-5.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire:
  soundwire: bus: clarify dev_err/dbg device references
  soundwire: bus: fix confusion on device used by pm_runtime
  soundwire: export sdw_write/read_no_pm functions
  soundwire: bus: use no_pm IO routines for all interrupt handling
  soundwire: bus: use sdw_write_no_pm when setting the bus scale registers
  soundwire: bus: use sdw_update_no_pm when initializing a device
  soundwire: Revert "soundwire: debugfs: use controller id instead of link_id"
  soundwire: return earlier if no slave is attached
  soundwire: bus: add better dev_dbg to track complete() calls
  soundwire: cadence: adjust verbosity in response handling
  soundwire: cadence: fix ACK/NAK handling
  soundwire: bus: add more details to track failed transfers
  soundwire: cadence: add status in dev_dbg 'State change' log
  soundwire: use consistent format for Slave devID logs
  soundwire: intel: don't return error when clock stop failed
  soundwire: debugfs: use controller id instead of link_id
  MAINTAINERS: soundwire: Add soundwire tree
  soundwire: sysfs: Constify static struct attribute_group
  soundwire: cadence: reduce timeout on transactions
  soundwire: intel: Use kzalloc for allocating only one thing
parents e666b79e 6d7a1ff7
......@@ -16667,6 +16667,7 @@ R: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
R: Sanyog Kale <sanyog.r.kale@intel.com>
L: alsa-devel@alsa-project.org (moderated for non-subscribers)
S: Supported
T: git git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire.git
F: Documentation/driver-api/soundwire/
F: drivers/soundwire/
F: include/linux/soundwire/
......
This diff is collapsed.
......@@ -188,7 +188,7 @@ MODULE_PARM_DESC(cdns_mcp_int_mask, "Cadence MCP IntMask");
#define CDNS_PDI_CONFIG_PORT GENMASK(4, 0)
/* Driver defaults */
#define CDNS_TX_TIMEOUT 2000
#define CDNS_TX_TIMEOUT 500
#define CDNS_SCP_RX_FIFOLEVEL 0x2
......@@ -483,11 +483,11 @@ cdns_fill_msg_resp(struct sdw_cdns *cdns,
for (i = 0; i < count; i++) {
if (!(cdns->response_buf[i] & CDNS_MCP_RESP_ACK)) {
no_ack = 1;
dev_dbg_ratelimited(cdns->dev, "Msg Ack not received\n");
if (cdns->response_buf[i] & CDNS_MCP_RESP_NACK) {
nack = 1;
dev_err_ratelimited(cdns->dev, "Msg NACK received\n");
}
dev_vdbg(cdns->dev, "Msg Ack not received, cmd %d\n", i);
}
if (cdns->response_buf[i] & CDNS_MCP_RESP_NACK) {
nack = 1;
dev_err_ratelimited(cdns->dev, "Msg NACK received, cmd %d\n", i);
}
}
......@@ -734,21 +734,18 @@ static void cdns_read_response(struct sdw_cdns *cdns)
}
static int cdns_update_slave_status(struct sdw_cdns *cdns,
u32 slave0, u32 slave1)
u64 slave_intstat)
{
enum sdw_slave_status status[SDW_MAX_DEVICES + 1];
bool is_slave = false;
u64 slave;
u32 mask;
int i, set_status;
/* combine the two status */
slave = ((u64)slave1 << 32) | slave0;
memset(status, 0, sizeof(status));
for (i = 0; i <= SDW_MAX_DEVICES; i++) {
mask = (slave >> (i * CDNS_MCP_SLAVE_STATUS_NUM)) &
CDNS_MCP_SLAVE_STATUS_BITS;
mask = (slave_intstat >> (i * CDNS_MCP_SLAVE_STATUS_NUM)) &
CDNS_MCP_SLAVE_STATUS_BITS;
if (!mask)
continue;
......@@ -918,13 +915,17 @@ static void cdns_update_slave_status_work(struct work_struct *work)
struct sdw_cdns *cdns =
container_of(work, struct sdw_cdns, work);
u32 slave0, slave1;
dev_dbg_ratelimited(cdns->dev, "Slave status change\n");
u64 slave_intstat;
slave0 = cdns_readl(cdns, CDNS_MCP_SLAVE_INTSTAT0);
slave1 = cdns_readl(cdns, CDNS_MCP_SLAVE_INTSTAT1);
cdns_update_slave_status(cdns, slave0, slave1);
/* combine the two status */
slave_intstat = ((u64)slave1 << 32) | slave0;
dev_dbg_ratelimited(cdns->dev, "Slave status change: 0x%llx\n", slave_intstat);
cdns_update_slave_status(cdns, slave_intstat);
cdns_writel(cdns, CDNS_MCP_SLAVE_INTSTAT0, slave0);
cdns_writel(cdns, CDNS_MCP_SLAVE_INTSTAT1, slave1);
......
......@@ -967,7 +967,7 @@ static int intel_hw_params(struct snd_pcm_substream *substream,
}
/* Port configuration */
pconfig = kcalloc(1, sizeof(*pconfig), GFP_KERNEL);
pconfig = kzalloc(sizeof(*pconfig), GFP_KERNEL);
if (!pconfig) {
ret = -ENOMEM;
goto error;
......@@ -1673,10 +1673,12 @@ static int __maybe_unused intel_suspend_runtime(struct device *dev)
} else if (clock_stop_quirks & SDW_INTEL_CLK_STOP_BUS_RESET ||
!clock_stop_quirks) {
bool wake_enable = true;
ret = sdw_cdns_clock_stop(cdns, true);
if (ret < 0) {
dev_err(dev, "cannot enable clock stop on suspend\n");
return ret;
wake_enable = false;
}
ret = sdw_cdns_enable_interrupt(cdns, false);
......@@ -1691,7 +1693,7 @@ static int __maybe_unused intel_suspend_runtime(struct device *dev)
return ret;
}
intel_shim_wake(sdw, true);
intel_shim_wake(sdw, wake_enable);
} else {
dev_err(dev, "%s clock_stop_quirks %x unsupported\n",
__func__, clock_stop_quirks);
......
......@@ -163,15 +163,13 @@ int sdw_acpi_find_slaves(struct sdw_bus *bus)
if (id.unique_id != id2.unique_id) {
dev_dbg(bus->dev,
"Valid unique IDs %x %x for Slave mfg %x part %d\n",
id.unique_id, id2.unique_id,
id.mfg_id, id.part_id);
"Valid unique IDs 0x%x 0x%x for Slave mfg_id 0x%04x, part_id 0x%04x\n",
id.unique_id, id2.unique_id, id.mfg_id, id.part_id);
ignore_unique_id = false;
} else {
dev_err(bus->dev,
"Invalid unique IDs %x %x for Slave mfg %x part %d\n",
id.unique_id, id2.unique_id,
id.mfg_id, id.part_id);
"Invalid unique IDs 0x%x 0x%x for Slave mfg_id 0x%04x, part_id 0x%04x\n",
id.unique_id, id2.unique_id, id.mfg_id, id.part_id);
return -ENODEV;
}
}
......
......@@ -130,7 +130,7 @@ static struct attribute *slave_dev_attrs[] = {
* we don't use ATTRIBUTES_GROUP here since we want to add a subdirectory
* for device-level properties
*/
static struct attribute_group sdw_slave_dev_attr_group = {
static const struct attribute_group sdw_slave_dev_attr_group = {
.attrs = slave_dev_attrs,
.name = "dev-properties",
};
......
......@@ -1005,6 +1005,8 @@ int sdw_bus_exit_clk_stop(struct sdw_bus *bus);
int sdw_read(struct sdw_slave *slave, u32 addr);
int sdw_write(struct sdw_slave *slave, u32 addr, u8 value);
int sdw_write_no_pm(struct sdw_slave *slave, u32 addr, u8 value);
int sdw_read_no_pm(struct sdw_slave *slave, u32 addr);
int sdw_nread(struct sdw_slave *slave, u32 addr, size_t count, u8 *val);
int sdw_nwrite(struct sdw_slave *slave, u32 addr, size_t count, u8 *val);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment