Commit 0e53a9e0 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

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

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

Vinod writes:

soundwire updates for 5.16-rc1

 - Update on sysfs wildcard documentation
 - debugfs update for core and qcom driver
 - invalid slave pointer fix for bus

* tag 'soundwire-5.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire:
  soundwire: qcom: add debugfs entry for soundwire register dump
  soundwire: bus: stop dereferencing invalid slave pointer
  ABI: sysfs-bus-soundwire-slave: use wildcards on What definitions
  ABI: sysfs-bus-soundwire-master: use wildcards on What definitions
  soundwire: debugfs: use controller id and link_id for debugfs
parents 7b473ae7 abd9a604
What: /sys/bus/soundwire/devices/sdw-master-N/revision
/sys/bus/soundwire/devices/sdw-master-N/clk_stop_modes
/sys/bus/soundwire/devices/sdw-master-N/clk_freq
/sys/bus/soundwire/devices/sdw-master-N/clk_gears
/sys/bus/soundwire/devices/sdw-master-N/default_col
/sys/bus/soundwire/devices/sdw-master-N/default_frame_rate
/sys/bus/soundwire/devices/sdw-master-N/default_row
/sys/bus/soundwire/devices/sdw-master-N/dynamic_shape
/sys/bus/soundwire/devices/sdw-master-N/err_threshold
/sys/bus/soundwire/devices/sdw-master-N/max_clk_freq
What: /sys/bus/soundwire/devices/sdw-master-<N>/revision
/sys/bus/soundwire/devices/sdw-master-<N>/clk_stop_modes
/sys/bus/soundwire/devices/sdw-master-<N>/clk_freq
/sys/bus/soundwire/devices/sdw-master-<N>/clk_gears
/sys/bus/soundwire/devices/sdw-master-<N>/default_col
/sys/bus/soundwire/devices/sdw-master-<N>/default_frame_rate
/sys/bus/soundwire/devices/sdw-master-<N>/default_row
/sys/bus/soundwire/devices/sdw-master-<N>/dynamic_shape
/sys/bus/soundwire/devices/sdw-master-<N>/err_threshold
/sys/bus/soundwire/devices/sdw-master-<N>/max_clk_freq
Date: April 2020
......
......@@ -64,37 +64,37 @@ Description: SoundWire Slave Data Port-0 DisCo properties.
Data port 0 are used by the bus to configure the Data Port 0.
What: /sys/bus/soundwire/devices/sdw:.../dpN_src/max_word
/sys/bus/soundwire/devices/sdw:.../dpN_src/min_word
/sys/bus/soundwire/devices/sdw:.../dpN_src/words
/sys/bus/soundwire/devices/sdw:.../dpN_src/type
/sys/bus/soundwire/devices/sdw:.../dpN_src/max_grouping
/sys/bus/soundwire/devices/sdw:.../dpN_src/simple_ch_prep_sm
/sys/bus/soundwire/devices/sdw:.../dpN_src/ch_prep_timeout
/sys/bus/soundwire/devices/sdw:.../dpN_src/imp_def_interrupts
/sys/bus/soundwire/devices/sdw:.../dpN_src/min_ch
/sys/bus/soundwire/devices/sdw:.../dpN_src/max_ch
/sys/bus/soundwire/devices/sdw:.../dpN_src/channels
/sys/bus/soundwire/devices/sdw:.../dpN_src/ch_combinations
/sys/bus/soundwire/devices/sdw:.../dpN_src/max_async_buffer
/sys/bus/soundwire/devices/sdw:.../dpN_src/block_pack_mode
/sys/bus/soundwire/devices/sdw:.../dpN_src/port_encoding
/sys/bus/soundwire/devices/sdw:.../dpN_sink/max_word
/sys/bus/soundwire/devices/sdw:.../dpN_sink/min_word
/sys/bus/soundwire/devices/sdw:.../dpN_sink/words
/sys/bus/soundwire/devices/sdw:.../dpN_sink/type
/sys/bus/soundwire/devices/sdw:.../dpN_sink/max_grouping
/sys/bus/soundwire/devices/sdw:.../dpN_sink/simple_ch_prep_sm
/sys/bus/soundwire/devices/sdw:.../dpN_sink/ch_prep_timeout
/sys/bus/soundwire/devices/sdw:.../dpN_sink/imp_def_interrupts
/sys/bus/soundwire/devices/sdw:.../dpN_sink/min_ch
/sys/bus/soundwire/devices/sdw:.../dpN_sink/max_ch
/sys/bus/soundwire/devices/sdw:.../dpN_sink/channels
/sys/bus/soundwire/devices/sdw:.../dpN_sink/ch_combinations
/sys/bus/soundwire/devices/sdw:.../dpN_sink/max_async_buffer
/sys/bus/soundwire/devices/sdw:.../dpN_sink/block_pack_mode
/sys/bus/soundwire/devices/sdw:.../dpN_sink/port_encoding
What: /sys/bus/soundwire/devices/sdw:.../dp<N>_src/max_word
/sys/bus/soundwire/devices/sdw:.../dp<N>_src/min_word
/sys/bus/soundwire/devices/sdw:.../dp<N>_src/words
/sys/bus/soundwire/devices/sdw:.../dp<N>_src/type
/sys/bus/soundwire/devices/sdw:.../dp<N>_src/max_grouping
/sys/bus/soundwire/devices/sdw:.../dp<N>_src/simple_ch_prep_sm
/sys/bus/soundwire/devices/sdw:.../dp<N>_src/ch_prep_timeout
/sys/bus/soundwire/devices/sdw:.../dp<N>_src/imp_def_interrupts
/sys/bus/soundwire/devices/sdw:.../dp<N>_src/min_ch
/sys/bus/soundwire/devices/sdw:.../dp<N>_src/max_ch
/sys/bus/soundwire/devices/sdw:.../dp<N>_src/channels
/sys/bus/soundwire/devices/sdw:.../dp<N>_src/ch_combinations
/sys/bus/soundwire/devices/sdw:.../dp<N>_src/max_async_buffer
/sys/bus/soundwire/devices/sdw:.../dp<N>_src/block_pack_mode
/sys/bus/soundwire/devices/sdw:.../dp<N>_src/port_encoding
/sys/bus/soundwire/devices/sdw:.../dp<N>_sink/max_word
/sys/bus/soundwire/devices/sdw:.../dp<N>_sink/min_word
/sys/bus/soundwire/devices/sdw:.../dp<N>_sink/words
/sys/bus/soundwire/devices/sdw:.../dp<N>_sink/type
/sys/bus/soundwire/devices/sdw:.../dp<N>_sink/max_grouping
/sys/bus/soundwire/devices/sdw:.../dp<N>_sink/simple_ch_prep_sm
/sys/bus/soundwire/devices/sdw:.../dp<N>_sink/ch_prep_timeout
/sys/bus/soundwire/devices/sdw:.../dp<N>_sink/imp_def_interrupts
/sys/bus/soundwire/devices/sdw:.../dp<N>_sink/min_ch
/sys/bus/soundwire/devices/sdw:.../dp<N>_sink/max_ch
/sys/bus/soundwire/devices/sdw:.../dp<N>_sink/channels
/sys/bus/soundwire/devices/sdw:.../dp<N>_sink/ch_combinations
/sys/bus/soundwire/devices/sdw:.../dp<N>_sink/max_async_buffer
/sys/bus/soundwire/devices/sdw:.../dp<N>_sink/block_pack_mode
/sys/bus/soundwire/devices/sdw:.../dp<N>_sink/port_encoding
Date: May 2020
......
......@@ -1110,7 +1110,7 @@ int sdw_bus_exit_clk_stop(struct sdw_bus *bus)
if (!simple_clk_stop) {
ret = sdw_bus_wait_for_clk_prep_deprep(bus, SDW_BROADCAST_DEV_NUM);
if (ret < 0)
dev_warn(&slave->dev, "clock stop deprepare wait failed:%d\n", ret);
dev_warn(bus->dev, "clock stop deprepare wait failed:%d\n", ret);
}
list_for_each_entry(slave, &bus->slaves, node) {
......
......@@ -19,7 +19,7 @@ void sdw_bus_debugfs_init(struct sdw_bus *bus)
return;
/* create the debugfs master-N */
snprintf(name, sizeof(name), "master-%d", bus->link_id);
snprintf(name, sizeof(name), "master-%d-%d", bus->id, bus->link_id);
bus->debugfs = debugfs_create_dir(name, sdw_debugfs_root);
}
......
......@@ -7,6 +7,7 @@
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/debugfs.h>
#include <linux/of.h>
#include <linux/of_irq.h>
#include <linux/of_device.h>
......@@ -83,6 +84,7 @@
#define SWRM_DP_PORT_HCTRL_BANK(n, m) (0x1134 + 0x100 * (n - 1) + 0x40 * m)
#define SWRM_DP_BLOCK_CTRL3_BANK(n, m) (0x1138 + 0x100 * (n - 1) + 0x40 * m)
#define SWRM_DIN_DPn_PCM_PORT_CTRL(n) (0x1054 + 0x100 * (n - 1))
#define SWR_MSTR_MAX_REG_ADDR (0x1740)
#define SWRM_DP_PORT_CTRL_EN_CHAN_SHFT 0x18
#define SWRM_DP_PORT_CTRL_OFFSET2_SHFT 0x10
......@@ -127,6 +129,9 @@ struct qcom_swrm_ctrl {
struct device *dev;
struct regmap *regmap;
void __iomem *mmio;
#ifdef CONFIG_DEBUG_FS
struct dentry *debugfs;
#endif
struct completion broadcast;
struct completion enumeration;
struct work_struct slave_work;
......@@ -1192,6 +1197,22 @@ static int qcom_swrm_get_port_config(struct qcom_swrm_ctrl *ctrl)
return 0;
}
#ifdef CONFIG_DEBUG_FS
static int swrm_reg_show(struct seq_file *s_file, void *data)
{
struct qcom_swrm_ctrl *swrm = s_file->private;
int reg, reg_val;
for (reg = 0; reg <= SWR_MSTR_MAX_REG_ADDR; reg += 4) {
swrm->reg_read(swrm, reg, &reg_val);
seq_printf(s_file, "0x%.3x: 0x%.2x\n", reg, reg_val);
}
return 0;
}
DEFINE_SHOW_ATTRIBUTE(swrm_reg);
#endif
static int qcom_swrm_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
......@@ -1302,6 +1323,12 @@ static int qcom_swrm_probe(struct platform_device *pdev)
(ctrl->version >> 24) & 0xff, (ctrl->version >> 16) & 0xff,
ctrl->version & 0xffff);
#ifdef CONFIG_DEBUG_FS
ctrl->debugfs = debugfs_create_dir("qualcomm-sdw", ctrl->bus.debugfs);
debugfs_create_file("qualcomm-registers", 0400, ctrl->debugfs, ctrl,
&swrm_reg_fops);
#endif
return 0;
err_master_add:
......
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