[RFC PATCH 11/11] soundwire: intel: free all resources on hw_free()

2019-08-21 Thread Pierre-Louis Bossart
From: Rander Wang Make sure all calls to the SoundWire stream API are done and involve callback Signed-off-by: Rander Wang Signed-off-by: Pierre-Louis Bossart --- drivers/soundwire/intel.c | 21 +++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/drivers

[RFC PATCH 05/11] soundwire: intel: don't filter out PDI0/1

2019-08-21 Thread Pierre-Louis Bossart
unless we have to remove the smarts. This patch requires a topology change to use PDIs starting at offset 2 explicitly. Note that there is a known discrepancy between hardware documentation and what ALH stream works in practice, future fixes are likely. Signed-off-by: Pierre-Louis Bossart

[RFC PATCH 00/11] soundwire: intel: simplify DAI/PDI handling

2019-08-21 Thread Pierre-Louis Bossart
in the code that can be improved, hence the RFC state. Bard Liao (3): soundwire: intel: fix intel_register_dai PDI offsets and numbers soundwire: intel: remove playback/capture stream_name soundwire: cadence_master: improve PDI allocation Pierre-Louis Bossart (3): soundwire: remove DAI_ID_RANGE

[RFC PATCH 01/11] soundwire: intel: fix intel_register_dai PDI offsets and numbers

2019-08-21 Thread Pierre-Louis Bossart
DIs. Again this was not detected since PDM was not supported earlier. Reported-by: Ranjani Sridharan Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart --- drivers/soundwire/intel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/soundwire/intel.c b/driv

[RFC PATCH 09/11] soundwire: intel: add trigger support in sdw dai driver

2019-08-21 Thread Pierre-Louis Bossart
From: Rander Wang Sdw stream is enabled and disabled in trigger function. Signed-off-by: Rander Wang Signed-off-by: Pierre-Louis Bossart --- drivers/soundwire/intel.c | 39 +++ 1 file changed, 39 insertions(+) diff --git a/drivers/soundwire/intel.c b

[RFC PATCH 10/11] soundwire: intel: do sdw stream setup in setup function

2019-08-21 Thread Pierre-Louis Bossart
From: Rander Wang The sdw stream is allocated and stored in dai to share the sdw runtime information. Signed-off-by: Rander Wang Signed-off-by: Pierre-Louis Bossart --- drivers/soundwire/intel.c | 57 ++- 1 file changed, 56 insertions(+), 1 deletion

[RFC PATCH 07/11] soundwire: intel: improve .config_stream callback, add .free_stream

2019-08-21 Thread Pierre-Louis Bossart
From: Rander Wang We need the link_id as a parameter for the config callback, and we also need a matching free callback in case any resources need to be released. Signed-off-by: Rander Wang Signed-off-by: Pierre-Louis Bossart --- drivers/soundwire/intel.c | 19

[RFC PATCH 02/11] soundwire: remove DAI_ID_RANGE definitions

2019-08-21 Thread Pierre-Louis Bossart
There is no reason to reserve a range of DAI IDs for SoundWire. This is not scalable and it's better to let the ASoC core allocate the dai->id when registering a component. Signed-off-by: Pierre-Louis Bossart --- drivers/soundwire/intel.c | 2 -- include/linux/soundwire/sdw.h | 3 ---

Re: [alsa-devel] [PATCH 0/6] soundwire: inits and PM additions for 5.4

2019-08-21 Thread Pierre-Louis Bossart
On 8/13/19 4:32 PM, Pierre-Louis Bossart wrote: This is an update on the RFC, to be applied after the '[PATCH v2 0/3] soundwire: debugfs support for 5.4' and '[PATCH 00/17] soundwire: fixes for 5.4' series. Total that makes 28 patches submitted for review, broken in 3 sets. I double

[PATCH v3 2/4] soundwire: cadence_master: add debugfs register dump

2019-08-21 Thread Pierre-Louis Bossart
Add debugfs file to dump the Cadence master registers. Credits: this patch is based on an earlier internal contribution by Vinod Koul, Sanyog Kale, Shreyas Nc and Hardik Shah. Reviewed-by: Greg Kroah-Hartman Acked-by: Sanyog Kale Signed-off-by: Pierre-Louis Bossart --- drivers/soundwire

[PATCH v3 4/4] soundwire: intel: handle disabled links

2019-08-21 Thread Pierre-Louis Bossart
to the OS with an Intel-specific _DSD property. The same capability will be added to revisions of the MIPI DisCo specification. Signed-off-by: Pierre-Louis Bossart --- drivers/soundwire/intel.c | 26 ++ include/linux/soundwire/sdw.h | 2 ++ 2 files changed, 24 insertions

[PATCH v3 0/4] soundwire: debugfs support for 5.4

2019-08-21 Thread Pierre-Louis Bossart
capabilities) squashed patch 3 Pierre-Louis Bossart (4): soundwire: add debugfs support soundwire: cadence_master: add debugfs register dump soundwire: intel: add debugfs register dump soundwire: intel: handle disabled links drivers/soundwire/Makefile | 4 + drivers/soundwire/bus.c

[PATCH v3 1/4] soundwire: add debugfs support

2019-08-21 Thread Pierre-Louis Bossart
Vinod Koul, Sanyog Kale, Shreyas Nc and Hardik Shah. Reviewed-by: Greg Kroah-Hartman Acked-by: Sanyog Kale Signed-off-by: Pierre-Louis Bossart --- drivers/soundwire/Makefile| 4 + drivers/soundwire/bus.c | 6 ++ drivers/soundwire/bus.h | 16 drivers/soundwire/bus_typ

[PATCH v3 3/4] soundwire: intel: add debugfs register dump

2019-08-21 Thread Pierre-Louis Bossart
Add debugfs file to dump the Intel SoundWire registers Credits: this patch is based on an earlier internal contribution by Vinod Koul, Sanyog Kale, Shreyas Nc and Hardik Shah. Reviewed-by: Greg Kroah-Hartman Acked-by: Sanyog Kale Signed-off-by: Pierre-Louis Bossart --- drivers/soundwire

[PATCH v2 2/3] ASoC: SOF: Add OF DSP device support

2019-08-21 Thread Pierre-Louis Bossart
From: Daniel Baluta Add support for device tree based SOF DSP devices. Signed-off-by: Daniel Baluta Signed-off-by: Pierre-Louis Bossart --- sound/soc/sof/Kconfig | 10 +++ sound/soc/sof/Makefile | 3 + sound/soc/sof/sof-of-dev.c | 143 + 3

[PATCH v2 1/3] dt-bindings: dsp: fsl: Add DSP core binding support

2019-08-21 Thread Pierre-Louis Bossart
From: Daniel Baluta This describes the DSP device tree node. Signed-off-by: Daniel Baluta Reviewed-by: Rob Herring Signed-off-by: Pierre-Louis Bossart --- .../devicetree/bindings/dsp/fsl,dsp.yaml | 88 +++ 1 file changed, 88 insertions(+) create mode 100644

[PATCH v2 3/3] ASoC: SOF: imx: Add i.MX8 HW support

2019-08-21 Thread Pierre-Louis Bossart
From: Daniel Baluta Add support for the audio DSP hardware found on NXP i.MX8 platform. Signed-off-by: Daniel Baluta Signed-off-by: Pierre-Louis Bossart --- sound/soc/sof/Kconfig | 1 + sound/soc/sof/Makefile | 1 + sound/soc/sof/imx/Kconfig | 22 +++ sound/soc/sof/imx

[PATCH v2 0/3] ASoC: SOF: initial support for i.MX8

2019-08-21 Thread Pierre-Louis Bossart
The reviews for these patches took place already on mailing lists and GitHub, and the code is already integrated in the SOF tree (along with dependencies already accepted in the i.MX tree) Changes since v1: As agreed with Daniel and Mark, this v2 series includes the DT bindings (Fixed

Re: [alsa-devel] [PATCH 00/17] soundwire: fixes for 5.4

2019-08-21 Thread Pierre-Louis Bossart
On 8/21/19 4:07 AM, Vinod Koul wrote: On 05-08-19, 19:55, Pierre-Louis Bossart wrote: This series provides an update on the initial RFC. Debugfs and Intel updates will be provided in follow-up patches. The order of patches was changed since the RFC so detailed change logs are provided below

Re: [alsa-devel] [PATCH v2 0/3] soundwire: debugfs support for 5.4

2019-08-16 Thread Pierre-Louis Bossart
On 8/16/19 4:43 AM, Vinod Koul wrote: On 12-08-19, 18:59, Pierre-Louis Bossart wrote: This patchset enables debugfs support and corrects all the feedback provided on an earlier RFC ('soundwire: updates for 5.4') There is one remaining hard-coded value in intel.c that will need to be fixed

Re: [alsa-devel] [RFC PATCH 31/40] soundwire: intel: move shutdown() callback and don't export symbol

2019-08-14 Thread Pierre-Louis Bossart
+void intel_shutdown(struct snd_pcm_substream *substream, +    struct snd_soc_dai *dai) +{ +    struct sdw_cdns_dma_data *dma; + +    dma = snd_soc_dai_get_dma_data(dai, substream); +    if (!dma) +    return; + +    snd_soc_dai_set_dma_data(dai, substream, NULL); +    kfree(dma);

Re: [alsa-devel] [PATCH v2 3/5] ASoC: core: add support to snd_soc_dai_get_sdw_stream()

2019-08-14 Thread Pierre-Louis Bossart
On 8/13/19 11:11 PM, Vinod Koul wrote: On 13-08-19, 20:58, Mark Brown wrote: On Tue, Aug 13, 2019 at 02:38:53PM -0500, Pierre-Louis Bossart wrote: Indeed. I don't have a full understanding of that part to be honest, nor why we need something SoundWire-specific. We already abused

Re: [alsa-devel] [PATCH 06/17] soundwire: cadence_master: use firmware defaults for frame shape

2019-08-14 Thread Pierre-Louis Bossart
+static u32 cdns_set_initial_frame_shape(int n_rows, int n_cols) +{ +    u32 val; +    int c; +    int r; + +    r = sdw_find_row_index(n_rows); +    c = sdw_find_col_index(n_cols) & CDNS_MCP_FRAME_SHAPE_COL_MASK; + +    val = (r << CDNS_MCP_FRAME_SHAPE_ROW_OFFSET) | c; + +    return val; +} +

[PATCH 3/6] soundwire: intel: add helper for initialization

2019-08-13 Thread Pierre-Louis Bossart
Move code to helper for reuse in power management routines Signed-off-by: Pierre-Louis Bossart --- drivers/soundwire/intel.c | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/soundwire/intel.c b/drivers/soundwire/intel.c index 5f14c6acce80

[PATCH 2/6] soundwire: cadence_master: add hw_reset capability in debugfs

2019-08-13 Thread Pierre-Louis Bossart
Provide debugfs capability to kick link and devices into hard-reset (as defined by MIPI). This capability is really useful when some devices are no longer responsive and/or to check the software handling of resynchronization. Signed-off-by: Pierre-Louis Bossart --- drivers/soundwire

[PATCH 0/6] soundwire: inits and PM additions for 5.4

2019-08-13 Thread Pierre-Louis Bossart
Clarified commit messages Pierre-Louis Bossart (6): soundwire: fix startup sequence for Intel/Cadence soundwire: cadence_master: add hw_reset capability in debugfs soundwire: intel: add helper for initialization soundwire: intel: Add basic power management support soundwire: cadence_master: make

[PATCH 6/6] soundwire: intel: add pm_runtime support

2019-08-13 Thread Pierre-Louis Bossart
Add basic hooks in DAI .startup and .shutdown callbacks. The SoundWire IP should be powered between those two calls. By default the platform_device is in SUSPENDED mode, it is required to call pm_runtime_set_active() before _enable() Signed-off-by: Pierre-Louis Bossart --- drivers/soundwire

[PATCH 4/6] soundwire: intel: Add basic power management support

2019-08-13 Thread Pierre-Louis Bossart
Implement suspend/resume capabilities (not runtime_pm for now) Credits: this patch is based on an earlier internal contribution by Vinod Koul, Sanyog Kale, Shreyas Nc and Hardik Shah. Signed-off-by: Pierre-Louis Bossart --- drivers/soundwire/cadence_master.c | 18 ++-- drivers/soundwire

[PATCH 5/6] soundwire: cadence_master: make clock stop exit configurable on init

2019-08-13 Thread Pierre-Louis Bossart
-Louis Bossart --- drivers/soundwire/cadence_master.c | 15 --- drivers/soundwire/cadence_master.h | 2 +- drivers/soundwire/intel.c | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/soundwire/cadence_master.c b/drivers/soundwire/cadence_master.c

[PATCH 1/6] soundwire: fix startup sequence for Intel/Cadence

2019-08-13 Thread Pierre-Louis Bossart
-by: Pierre-Louis Bossart --- drivers/soundwire/cadence_master.c | 84 +- drivers/soundwire/cadence_master.h | 1 + drivers/soundwire/intel.c | 14 - 3 files changed, 73 insertions(+), 26 deletions(-) diff --git a/drivers/soundwire/cadence_master.c b/drivers

Re: [alsa-devel] [PATCH v2] soundwire: Make slave.o depend on ACPI and rename to acpi_slave.o

2019-08-13 Thread Pierre-Louis Bossart
ncies and align with other serial links") Link: https://github.com/ClangBuiltLinux/linux/issues/637 Signed-off-by: Nathan Chancellor Sounds good, thanks for the fix. Acked-by: Pierre-Louis Bossart --- v1 -> v2: * Rename slave.o to acpi_slave.o * Reword commit message to reflect th

Re: [alsa-devel] [PATCH v2 3/5] ASoC: core: add support to snd_soc_dai_get_sdw_stream()

2019-08-13 Thread Pierre-Louis Bossart
On 8/13/19 2:18 PM, Mark Brown wrote: On Tue, Aug 13, 2019 at 02:15:18PM -0500, Pierre-Louis Bossart wrote: On 8/13/19 1:06 PM, Srinivas Kandagatla wrote: sorry for the confusion. It was too quick reply. :-) I was suppose to say sdw_stream_add_slave() instead of set_sdw_stream(). ok, so

Re: [alsa-devel] [PATCH v2 3/5] ASoC: core: add support to snd_soc_dai_get_sdw_stream()

2019-08-13 Thread Pierre-Louis Bossart
On 8/13/19 1:06 PM, Srinivas Kandagatla wrote: On 13/08/2019 18:51, Pierre-Louis Bossart wrote: On 8/13/19 11:50 AM, Srinivas Kandagatla wrote: Thanks for the review, On 13/08/2019 15:44, Pierre-Louis Bossart wrote: On 8/13/19 3:35 AM, Srinivas Kandagatla wrote: On platforms which have

Re: [PATCH v2 1/5] soundwire: Add compute_params callback

2019-08-13 Thread Pierre-Louis Bossart
On 8/13/19 1:17 PM, Srinivas Kandagatla wrote: On 13/08/2019 15:34, Pierre-Louis Bossart wrote: On 8/13/19 3:35 AM, Srinivas Kandagatla wrote: From: Vinod Koul This callback allows masters to compute the bus parameters required. This looks like a partial use of the patch ('soundwire: Add

Re: [alsa-devel] [PATCH v2 3/5] ASoC: core: add support to snd_soc_dai_get_sdw_stream()

2019-08-13 Thread Pierre-Louis Bossart
On 8/13/19 11:50 AM, Srinivas Kandagatla wrote: Thanks for the review, On 13/08/2019 15:44, Pierre-Louis Bossart wrote: On 8/13/19 3:35 AM, Srinivas Kandagatla wrote: On platforms which have smart speaker amplifiers connected via soundwire and modeled as aux devices in ASoC, in such usecases

Re: [PATCH v2 1/5] soundwire: Add compute_params callback

2019-08-13 Thread Pierre-Louis Bossart
On 8/13/19 3:35 AM, Srinivas Kandagatla wrote: From: Vinod Koul This callback allows masters to compute the bus parameters required. This looks like a partial use of the patch ('soundwire: Add Intel resource management algorithm')? see comments below Signed-off-by: Vinod Koul

Re: [alsa-devel] [PATCH v2 3/5] ASoC: core: add support to snd_soc_dai_get_sdw_stream()

2019-08-13 Thread Pierre-Louis Bossart
On 8/13/19 3:35 AM, Srinivas Kandagatla wrote: On platforms which have smart speaker amplifiers connected via soundwire and modeled as aux devices in ASoC, in such usecases machine driver should be able to get sdw master stream from dai so that it can use the runtime stream to setup slave

Re: [alsa-devel] [PATCH] soundwire: Don't build sound.o without CONFIG_ACPI

2019-08-13 Thread Pierre-Louis Bossart
On 8/13/19 1:10 AM, Nathan Chancellor wrote: clang warns when CONFIG_ACPI is unset: ../drivers/soundwire/slave.c:16:12: warning: unused function 'sdw_slave_add' [-Wunused-function] static int sdw_slave_add(struct sdw_bus *bus, ^ 1 warning generated. Before commit 8676b3ca4673

Re: [alsa-devel] Regression in next with codec unload and snd_soc_component_get/put

2019-08-13 Thread Pierre-Louis Bossart
On 8/13/19 6:29 AM, Mark Brown wrote: On Tue, Aug 13, 2019 at 03:24:51AM -0700, Tony Lindgren wrote: * Takashi Iwai [190809 08:24]: ... and it was already fixed in the later commit 0e36f36b04e7 "ASoC: soc-core: fix module_put() warning in soc_cleanup_component". Mark, looks like this

Re: linux-next: build failure after merge of the sound-asoc tree

2019-08-13 Thread Pierre-Louis Bossart
Looks like the merge resolution is not quite right. I have used the sound-asoc tree from next-20190808 for today. I am still getting this failure ... Intel people, any thoughts? I provided a solution on alsa-devel yesterday, see 'ASoC: SOF: fix HDA direct MMIO access'

[PATCH v2 2/3] soundwire: cadence_master: add debugfs register dump

2019-08-12 Thread Pierre-Louis Bossart
Add debugfs file to dump the Cadence master registers. Credits: this patch is based on an earlier internal contribution by Vinod Koul, Sanyog Kale, Shreyas Nc and Hardik Shah. Signed-off-by: Pierre-Louis Bossart --- drivers/soundwire/cadence_master.c | 107

[PATCH v2 3/3] soundwire: intel: add debugfs register dump

2019-08-12 Thread Pierre-Louis Bossart
Add debugfs file to dump the Intel SoundWire registers Credits: this patch is based on an earlier internal contribution by Vinod Koul, Sanyog Kale, Shreyas Nc and Hardik Shah. Signed-off-by: Pierre-Louis Bossart --- drivers/soundwire/intel.c | 121 ++ 1 file

[PATCH v2 1/3] soundwire: add debugfs support

2019-08-12 Thread Pierre-Louis Bossart
Vinod Koul, Sanyog Kale, Shreyas Nc and Hardik Shah. Signed-off-by: Pierre-Louis Bossart --- drivers/soundwire/Makefile| 4 + drivers/soundwire/bus.c | 6 ++ drivers/soundwire/bus.h | 16 drivers/soundwire/bus_type.c | 3 + drivers/soundwire/debugfs

[PATCH v2 0/3] soundwire: debugfs support for 5.4

2019-08-12 Thread Pierre-Louis Bossart
compilation removed intermediate variables removed hard-coded constants in loops (used registers offsets and hardware capabilities) squashed patch 3 Pierre-Louis Bossart (3): soundwire: add debugfs support soundwire: cadence_master: add debugfs register dump soundwire: intel: add debugfs

Re: [alsa-devel] [PATCH 2/3] soundwire: cadence_master: add debugfs register dump

2019-08-12 Thread Pierre-Louis Bossart
On 8/10/19 2:03 AM, Greg KH wrote: On Fri, Aug 09, 2019 at 05:43:40PM -0500, Pierre-Louis Bossart wrote: +/** + * sdw_cdns_debugfs_init() - Cadence debugfs init + * @cdns: Cadence instance + * @root: debugfs root + */ +void sdw_cdns_debugfs_init(struct sdw_cdns *cdns, struct dentry *root

Re: [alsa-devel] [PATCH 1/3] soundwire: add debugfs support

2019-08-12 Thread Pierre-Louis Bossart
#Cadence Objs diff --git a/drivers/soundwire/bus.c b/drivers/soundwire/bus.c index 49f64b2115b9..89d5f1537d9b 100644 --- a/drivers/soundwire/bus.c +++ b/drivers/soundwire/bus.c @@ -49,6 +49,8 @@ int sdw_add_bus_master(struct sdw_bus *bus) } } + bus->debugfs =

[PATCH 1/3] soundwire: add debugfs support

2019-08-09 Thread Pierre-Louis Bossart
Vinod Koul, Sanyog Kale, Shreyas Nc and Hardik Shah. Signed-off-by: Pierre-Louis Bossart --- drivers/soundwire/Makefile| 5 ++ drivers/soundwire/bus.c | 6 ++ drivers/soundwire/bus.h | 24 ++ drivers/soundwire/bus_type.c | 3 + drivers/soundwire/debugfs

[PATCH 2/3] soundwire: cadence_master: add debugfs register dump

2019-08-09 Thread Pierre-Louis Bossart
Add debugfs file to dump the Cadence master registers Credits: this patch is based on an earlier internal contribution by Vinod Koul, Sanyog Kale, Shreyas Nc and Hardik Shah. Signed-off-by: Pierre-Louis Bossart --- drivers/soundwire/cadence_master.c | 104 + drivers

[PATCH 0/3] soundwire: debugfs support for 5.4

2019-08-09 Thread Pierre-Louis Bossart
if CONFIG_DEBUG_FS is selected used static inlines for fallback compilation removed intermediate variables removed hard-coded constants in loops (used registers offsets and hardware capabilities) squashed patch 3 Pierre-Louis Bossart (3): soundwire: add debugfs support soundwire: cadence_master: add

[PATCH 3/3] soundwire: intel: add debugfs register dump

2019-08-09 Thread Pierre-Louis Bossart
Add debugfs file to dump the Intel SoundWire registers Credits: this patch is based on an earlier internal contribution by Vinod Koul, Sanyog Kale, Shreyas Nc and Hardik Shah. Signed-off-by: Pierre-Louis Bossart --- drivers/soundwire/intel.c | 114 ++ 1 file

Re: [alsa-devel] [PATCH v2 4/4] ASoC: codecs: add wsa881x amplifier support

2019-08-08 Thread Pierre-Louis Bossart
+/* 4 ports */ +static struct sdw_dpn_prop wsa_sink_dpn_prop[WSA881X_MAX_SWR_PORTS] = { +    { +    /* DAC */ +    .num = 1, +    .type = SDW_DPN_SIMPLE, IIRC we added the REDUCED type in SoundWire 1.1 to cover the PDM case with channel packing (or was it grouping) used by

Re: [PATCH v2 1/4] dt-bindings: soundwire: add slave bindings

2019-08-08 Thread Pierre-Louis Bossart
+++ b/Documentation/devicetree/bindings/soundwire/slave.txt @@ -0,0 +1,46 @@ +SoundWire slave device bindings. + +SoundWire is a 2-pin multi-drop interface with data and clock line. +It facilitates development of low cost, efficient, high performance systems. + +SoundWire slave devices: +Every

Re: [alsa-devel] [PATCH v2 4/4] ASoC: codecs: add wsa881x amplifier support

2019-08-08 Thread Pierre-Louis Bossart
+/* 4 ports */ +static struct sdw_dpn_prop wsa_sink_dpn_prop[WSA881X_MAX_SWR_PORTS] = { + { + /* DAC */ + .num = 1, + .type = SDW_DPN_SIMPLE, IIRC we added the REDUCED type in SoundWire 1.1 to cover the PDM case with channel packing (or was it

Re: [PATCH v2 2/4] soundwire: core: add device tree support for slave devices

2019-08-08 Thread Pierre-Louis Bossart
@@ -35,6 +36,7 @@ static int sdw_slave_add(struct sdw_bus *bus, slave->dev.release = sdw_slave_release; slave->dev.bus = _bus_type; + slave->dev.of_node = of_node_get(to_of_node(fwnode)); shouldn't this protected by #if IS_ENABLED(CONFIG_OF) ? slave->bus = bus;

Re: [alsa-devel] [PATCH] soundwire: fix regmap dependencies and align with other serial links

2019-08-07 Thread Pierre-Louis Bossart
Hi Mark, Vinod, Mark, any feedback? There will be a set of SoundWire codec drivers provided upstream soonish and we'll get a number of kbuild errors without this patch. I think I'm missing context here, I've basically been zoning out all the soundwire stuff - the patch series are huge

Re: [Sound-open-firmware] [PATCH v2 3/5] ASoC: SOF: Add DT DSP device support

2019-08-07 Thread Pierre-Louis Bossart
On 8/7/19 10:29 AM, Daniel Baluta wrote: On Tue, Jul 23, 2019 at 6:19 PM Pierre-Louis Bossart wrote: diff --git a/sound/soc/sof/Kconfig b/sound/soc/sof/Kconfig index 61b97fc55bb2..2aa3a1cdf60c 100644 --- a/sound/soc/sof/Kconfig +++ b/sound/soc/sof/Kconfig @@ -36,6 +36,15 @@ config

Re: [Sound-open-firmware] [PATCH v2 3/5] ASoC: SOF: Add DT DSP device support

2019-08-07 Thread Pierre-Louis Bossart
+static int sof_dt_probe(struct platform_device *pdev) +{ + struct device *dev = >dev; + const struct sof_dev_desc *desc; + /*TODO: create a generic snd_soc_xxx_mach */ + struct snd_soc_acpi_mach *mach; I wonder if you really need to use the same structures. For Intel we get

Re: [alsa-devel] [PATCH] soundwire: fix regmap dependencies and align with other serial links

2019-08-07 Thread Pierre-Louis Bossart
On 7/19/19 4:04 AM, Rafael J. Wysocki wrote: On Fri, Jul 19, 2019 at 1:02 AM Pierre-Louis Bossart wrote: The existing code has a mixed select/depend usage which makes no sense. config SOUNDWIRE_BUS tristate select REGMAP_SOUNDWIRE config REGMAP_SOUNDWIRE tristate

Re: [PATCH 09/17] soundwire: stream: remove unnecessary variable initializations

2019-08-06 Thread Pierre-Louis Bossart
On 8/6/19 10:31 AM, Cezary Rojewski wrote: On 2019-08-06 02:55, Pierre-Louis Bossart wrote: @@ -1493,6 +1493,11 @@ static int _sdw_prepare_stream(struct sdw_stream_runtime *stream)   }   } +    if (!bus) { +    pr_err("Configuration error in %s\n", __func__); +

Re: [alsa-devel] [PATCH 06/17] soundwire: cadence_master: use firmware defaults for frame shape

2019-08-06 Thread Pierre-Louis Bossart
On 8/6/19 10:27 AM, Cezary Rojewski wrote: On 2019-08-06 02:55, Pierre-Louis Bossart wrote: diff --git a/drivers/soundwire/cadence_master.c b/drivers/soundwire/cadence_master.c index 5d9729b4d634..89c55e4bb72c 100644 --- a/drivers/soundwire/cadence_master.c +++ b/drivers/soundwire

[PATCH 01/17] soundwire: intel: prevent possible dereference in hw_params

2019-08-05 Thread Pierre-Louis Bossart
-off-by: Pierre-Louis Bossart --- drivers/soundwire/intel.c | 6 -- include/linux/soundwire/sdw_intel.h | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/soundwire/intel.c b/drivers/soundwire/intel.c index 3d9ca6479e94..a906789c7f78 100644 --- a/drivers

[PATCH 07/17] soundwire: include mod_devicetable.h to avoid compiling warnings

2019-08-05 Thread Pierre-Louis Bossart
ice_id *id); ^ Fix by adding the relevant include Reported-by: kbuild test robot Signed-off-by: Bard liao Signed-off-by: Pierre-Louis Bossart --- include/linux/soundwire/sdw.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/soundwire/sdw.h b/i

[PATCH 08/17] soundwire: stream: fix disable sequence

2019-08-05 Thread Pierre-Louis Bossart
and alternate banks. Signed-off-by: Pierre-Louis Bossart --- drivers/soundwire/stream.c | 19 ++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/drivers/soundwire/stream.c b/drivers/soundwire/stream.c index 53f5e790fcd7..75b9ad1fb1a6 100644 --- a/drivers/soundwire/stream.c

[PATCH 12/17] soundwire: cadence_master: make use of mclk_freq property

2019-08-05 Thread Pierre-Louis Bossart
is typically tied to the oscillator frequency and does not change between platforms. The max_clk_freq value is linked to the maximum bandwidth needed and topology/trace length. Signed-off-by: Pierre-Louis Bossart --- drivers/soundwire/cadence_master.c | 14 ++ 1 file changed, 10

[PATCH 06/17] soundwire: cadence_master: use firmware defaults for frame shape

2019-08-05 Thread Pierre-Louis Bossart
Remove hard-coding and use firmware (BIOS/DT) values. If they are wrong use default 48x2 frame shape. Signed-off-by: Pierre-Louis Bossart --- drivers/soundwire/cadence_master.c | 26 +++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/drivers/soundwire

[PATCH 11/17] soundwire: intel: read mclk_freq property from firmware

2019-08-05 Thread Pierre-Louis Bossart
The BIOS provides an Intel-specific property, let's use it to avoid hard-coded clock dividers. Signed-off-by: Pierre-Louis Bossart --- drivers/soundwire/intel.c | 26 ++ 1 file changed, 26 insertions(+) diff --git a/drivers/soundwire/intel.c b/drivers/soundwire/intel.c

[PATCH 13/17] soundwire: cadence_master: fix divider setting in clock register

2019-08-05 Thread Pierre-Louis Bossart
-by: Pierre-Louis Bossart --- drivers/soundwire/cadence_master.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/soundwire/cadence_master.c b/drivers/soundwire/cadence_master.c index 049ecfad2c00..fb198a806efd 100644 --- a/drivers/soundwire/cadence_master.c

[PATCH 10/17] soundwire: add new mclk_freq field for properties

2019-08-05 Thread Pierre-Louis Bossart
To help pass platform-specific values, add a new field that can either be set by the Master driver or read from firmware (BIOS/DT). Signed-off-by: Pierre-Louis Bossart --- include/linux/soundwire/sdw.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/soundwire/sdw.h b/include

[PATCH 03/17] soundwire: cadence_master: revisit interrupt settings

2019-08-05 Thread Pierre-Louis Bossart
Adding missing interrupt masks (parity, etc) and missing checks. Clarify which masks are for which usage. Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart --- drivers/soundwire/cadence_master.c | 29 + 1 file changed, 25 insertions(+), 4 deletions

[PATCH 14/17] soundwire: intel: handle disabled links

2019-08-05 Thread Pierre-Louis Bossart
to the OS with an Intel-specific _DSD property. The same capability will be added to revisions of the MIPI DisCo specification. Signed-off-by: Pierre-Louis Bossart --- drivers/soundwire/intel.c | 26 ++ include/linux/soundwire/sdw.h | 2 ++ 2 files changed, 24 insertions

[PATCH 05/17] soundwire: export helpers to find row and column values

2019-08-05 Thread Pierre-Louis Bossart
in the following patch. Signed-off-by: Pierre-Louis Bossart --- drivers/soundwire/bus.h| 7 +-- drivers/soundwire/stream.c | 14 -- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/drivers/soundwire/bus.h b/drivers/soundwire/bus.h index 648436a995a3..89e74adf96fa 100644

[PATCH 16/17] soundwire: cadence_master: add kernel parameter to override interrupt mask

2019-08-05 Thread Pierre-Louis Bossart
The code has a set of defaults which may not be relevant in all cases, add kernel parameter as a helper - mostly for early board bring-up. Signed-off-by: Pierre-Louis Bossart --- drivers/soundwire/cadence_master.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/soundwire

[PATCH 15/17] soundwire: intel_init: add kernel module parameter to filter out links

2019-08-05 Thread Pierre-Louis Bossart
will select the second and third links only. options soundwire_intel_init sdw_link_mask=0x6 Signed-off-by: Pierre-Louis Bossart --- drivers/soundwire/intel_init.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/drivers/soundwire/intel_init.c b/drivers/soundwire/intel_init.c

[PATCH 17/17] soundwire: intel: move shutdown() callback and don't export symbol

2019-08-05 Thread Pierre-Louis Bossart
All DAI callbacks are in intel.c except for shutdown. Move and remove export symbol Signed-off-by: Pierre-Louis Bossart --- drivers/soundwire/cadence_master.c | 14 -- drivers/soundwire/cadence_master.h | 2 -- drivers/soundwire/intel.c | 17 +++-- 3 files

[PATCH 09/17] soundwire: stream: remove unnecessary variable initializations

2019-08-05 Thread Pierre-Louis Bossart
A number of variables don't need to be initialized. In a couple of cases where we loop on a list of runtimes, the code handling of the 'bus' variable leads to warnings that it may not be initialized. Add a specific error case to trap such cases. Signed-off-by: Pierre-Louis Bossart --- drivers

[PATCH 04/17] soundwire: bus: improve dynamic debug comments for enumeration

2019-08-05 Thread Pierre-Louis Bossart
update comments to provide better understanding of enumeration flows. Signed-off-by: Pierre-Louis Bossart --- drivers/soundwire/bus.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/soundwire/bus.c b/drivers/soundwire/bus.c index 89d5f1537d9b..40f7d0dc59a6 100644

[PATCH 02/17] soundwire: intel: fix channel number reported by hardware

2019-08-05 Thread Pierre-Louis Bossart
On all released Intel controllers (CNL/CML/ICL), PDI2 reports an invalid count, force the correct hardware-supported value This may have to be revisited with platform-specific values if the hardware changes, but for now this is good enough. Signed-off-by: Pierre-Louis Bossart --- drivers

[PATCH 00/17] soundwire: fixes for 5.4

2019-08-05 Thread Pierre-Louis Bossart
Pierre-Louis Bossart (15): soundwire: intel: prevent possible dereference in hw_params soundwire: intel: fix channel number reported by hardware soundwire: cadence_master: revisit interrupt settings soundwire: bus: improve dynamic debug comments for enumeration soundwire: export helpers

Re: [alsa-devel] [RFC PATCH 28/40] soundwire: intel: handle disabled links

2019-08-05 Thread Pierre-Louis Bossart
On 8/5/19 11:57 AM, Sanyog Kale wrote: On Thu, Jul 25, 2019 at 06:40:20PM -0500, Pierre-Louis Bossart wrote: On most hardware platforms, SoundWire interfaces are pin-muxed with other interfaces (typically DMIC or I2S) and the status of each link needs to be checked at boot time. For Intel

Re: [alsa-devel] [RFC PATCH 23/40] soundwire: stream: fix disable sequence

2019-08-05 Thread Pierre-Louis Bossart
On 8/5/19 11:32 AM, Sanyog Kale wrote: On Mon, Aug 05, 2019 at 10:33:25AM -0500, Pierre-Louis Bossart wrote: On 8/5/19 4:56 AM, Sanyog Kale wrote: On Thu, Jul 25, 2019 at 06:40:15PM -0500, Pierre-Louis Bossart wrote: When we disable the stream and then call hw_free, two bank switches

Re: [alsa-devel] [RFC PATCH 27/40] soundwire: Add Intel resource management algorithm

2019-08-05 Thread Pierre-Louis Bossart
+static int sdw_select_row_col(struct sdw_bus *bus, int clk_freq) +{ + struct sdw_master_prop *prop = >prop; + int frame_int, frame_freq; + int r, c; + + for (c = 0; c < SDW_FRAME_COLS; c++) { + for (r = 0; r < SDW_FRAME_ROWS; r++) { +

Re: [alsa-devel] [RFC PATCH 26/40] soundwire: cadence_master: fix divider setting in clock register

2019-08-05 Thread Pierre-Louis Bossart
@@ -988,9 +989,11 @@ int sdw_cdns_init(struct sdw_cdns *cdns) /* Set clock divider */ divider = (prop->mclk_freq / prop->max_clk_freq) - 1; val = cdns_readl(cdns, CDNS_MCP_CLK_CTRL0); reg read of CLK_CTRL0 can be removed. yes for both comments. Thanks for the review

Re: [alsa-devel] [RFC PATCH 25/40] soundwire: intel: use BIOS information to set clock dividers

2019-08-05 Thread Pierre-Louis Bossart
On 8/5/19 5:28 AM, Sanyog Kale wrote: On Thu, Jul 25, 2019 at 06:40:17PM -0500, Pierre-Louis Bossart wrote: The BIOS provides an Intel-specific property, let's use it to avoid hard-coded clock dividers. Signed-off-by: Pierre-Louis Bossart --- drivers/soundwire/cadence_master.c | 26

Re: [alsa-devel] [RFC PATCH 23/40] soundwire: stream: fix disable sequence

2019-08-05 Thread Pierre-Louis Bossart
On 8/5/19 4:56 AM, Sanyog Kale wrote: On Thu, Jul 25, 2019 at 06:40:15PM -0500, Pierre-Louis Bossart wrote: When we disable the stream and then call hw_free, two bank switches will be handled and as a result we re-enable the stream on hw_free. I didnt quite get why there will be two bank

Re: [alsa-devel] [RFC PATCH 21/40] soundwire: export helpers to find row and column values

2019-08-05 Thread Pierre-Louis Bossart
On 8/5/19 4:39 AM, Sanyog Kale wrote: On Thu, Jul 25, 2019 at 06:40:13PM -0500, Pierre-Louis Bossart wrote: Add a prefix for common tables and export 2 helpers to set the frame shapes based on row/col values. Signed-off-by: Pierre-Louis Bossart --- drivers/soundwire/bus.h| 7

Re: [alsa-devel] [RFC PATCH 02/40] soundwire: cadence_master: add debugfs register dump

2019-08-05 Thread Pierre-Louis Bossart
+static ssize_t cdns_reg_read(struct file *file, char __user *user_buf, +size_t count, loff_t *ppos) +{ + struct sdw_cdns *cdns = file->private_data; + char *buf; + ssize_t ret; + int i, j; + + buf = kzalloc(RD_BUF, GFP_KERNEL); +

Re: [RFC PATCH 35/40] soundwire: intel: export helper to exit reset

2019-08-02 Thread Pierre-Louis Bossart
On 8/2/19 12:31 PM, Vinod Koul wrote: On 25-07-19, 18:40, Pierre-Louis Bossart wrote: Here as well I squashed this with earlier patches to fix the init sequence in one shot Signed-off-by: Pierre-Louis Bossart --- drivers/soundwire/cadence_master.c | 9 +++-- drivers/soundwire

Re: [RFC PATCH 34/40] soundwire: intel: ignore disabled links for suspend/resume

2019-08-02 Thread Pierre-Louis Bossart
On 8/2/19 12:30 PM, Vinod Koul wrote: On 25-07-19, 18:40, Pierre-Louis Bossart wrote: Please add explanation why.. yes missed this Signed-off-by: Pierre-Louis Bossart --- drivers/soundwire/intel.c | 12 1 file changed, 12 insertions(+) diff --git a/drivers/soundwire

Re: [alsa-devel] [RFC PATCH 31/40] soundwire: intel: move shutdown() callback and don't export symbol

2019-08-02 Thread Pierre-Louis Bossart
On 8/2/19 12:28 PM, Vinod Koul wrote: On 26-07-19, 09:46, Pierre-Louis Bossart wrote: On 7/26/19 5:38 AM, Cezary Rojewski wrote: On 2019-07-26 01:40, Pierre-Louis Bossart wrote: +void intel_shutdown(struct snd_pcm_substream *substream, +    struct snd_soc_dai *dai) +{ +    struct

Re: [RFC PATCH 26/40] soundwire: cadence_master: fix divider setting in clock register

2019-08-02 Thread Pierre-Louis Bossart
On 8/2/19 12:19 PM, Vinod Koul wrote: On 25-07-19, 18:40, Pierre-Louis Bossart wrote: From: Rander Wang The existing code uses an OR operation which would mix the original divider setting with the new one, resulting in an invalid configuration that can make codecs hang. This looked fine

Re: [RFC PATCH 25/40] soundwire: intel: use BIOS information to set clock dividers

2019-08-02 Thread Pierre-Louis Bossart
On 8/2/19 12:17 PM, Vinod Koul wrote: On 25-07-19, 18:40, Pierre-Louis Bossart wrote: The BIOS provides an Intel-specific property, let's use it to avoid hard-coded clock dividers. Signed-off-by: Pierre-Louis Bossart --- drivers/soundwire/cadence_master.c | 26

Re: [RFC PATCH 24/40] soundwire: cadence_master: use BIOS defaults for frame shape

2019-08-02 Thread Pierre-Louis Bossart
On 8/2/19 12:10 PM, Vinod Koul wrote: On 25-07-19, 18:40, Pierre-Louis Bossart wrote: Remove hard-coding and use BIOS values. If they are wrong use default BIOS :) this is cadence, am sure this can be used outside BIOS :D It would be better to say firmware (ACPI/DT) yes 48x2 frame

Re: [RFC PATCH 20/40] soundwire: prototypes for suspend/resume

2019-08-02 Thread Pierre-Louis Bossart
On 8/2/19 12:03 PM, Vinod Koul wrote: On 25-07-19, 18:40, Pierre-Louis Bossart wrote: Please do provide the changelog on why this change is needed. not needed for now, will remove. Signed-off-by: Pierre-Louis Bossart --- drivers/soundwire/cadence_master.h | 3 +++ 1 file changed, 3

Re: [RFC PATCH 19/40] soundwire: bus: improve dynamic debug comments for enumeration

2019-08-02 Thread Pierre-Louis Bossart
On 8/2/19 12:00 PM, Vinod Koul wrote: On 25-07-19, 18:40, Pierre-Louis Bossart wrote: update comments to provide better understanding of enumeration flows. Signed-off-by: Pierre-Louis Bossart --- drivers/soundwire/bus.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git

Re: [RFC PATCH 17/40] soundwire: bus: use runtime_pm_get_sync/pm when enabled

2019-08-02 Thread Pierre-Louis Bossart
On 8/2/19 11:58 AM, Vinod Koul wrote: On 25-07-19, 18:40, Pierre-Louis Bossart wrote: Not all platforms support runtime_pm for now, let's use runtime_pm only when enabled. We discussed this with Ulf sometime back and it was a consensus the core should handle it, but that may take a while. So

Re: [alsa-devel] [RFC PATCH 06/40] soundwire: intel: prevent possible dereference in hw_params

2019-08-02 Thread Pierre-Louis Bossart
On 8/2/19 10:57 AM, Vinod Koul wrote: On 02-08-19, 10:16, Pierre-Louis Bossart wrote: On 8/2/19 6:55 AM, Vinod Koul wrote: On 25-07-19, 18:39, Pierre-Louis Bossart wrote: This should not happen in production systems but we should test for all callback arguments before invoking

Re: [RFC PATCH 15/40] soundwire: cadence_master: handle multiple status reports per Slave

2019-08-02 Thread Pierre-Louis Bossart
On 8/2/19 11:01 AM, Vinod Koul wrote: On 02-08-19, 10:29, Pierre-Louis Bossart wrote: On 8/2/19 7:20 AM, Vinod Koul wrote: On 25-07-19, 18:40, Pierre-Louis Bossart wrote: + status[i] = SDW_SLAVE_UNATTACHED; + break

Re: [RFC PATCH 15/40] soundwire: cadence_master: handle multiple status reports per Slave

2019-08-02 Thread Pierre-Louis Bossart
On 8/2/19 7:20 AM, Vinod Koul wrote: On 25-07-19, 18:40, Pierre-Louis Bossart wrote: When a Slave reports multiple status in the sticky bits, find the latest configuration from the mirror of the PING frame status and update the status directly. Signed-off-by: Pierre-Louis Bossart

Re: [RFC PATCH 12/40] soundwire: cadence_master: revisit interrupt settings

2019-08-02 Thread Pierre-Louis Bossart
@@ -761,10 +769,21 @@ int sdw_cdns_enable_interrupt(struct sdw_cdns *cdns) cdns_writel(cdns, CDNS_MCP_SLAVE_INTMASK1, CDNS_MCP_SLAVE_INTMASK1_MASK); + /* enable detection of slave state changes */ mask = CDNS_MCP_INT_SLAVE_RSVD | CDNS_MCP_INT_SLAVE_ALERT

Re: [RFC PATCH 09/40] soundwire: cadence_master: fix usage of CONFIG_UPDATE

2019-08-02 Thread Pierre-Louis Bossart
On 8/2/19 7:03 AM, Vinod Koul wrote: On 25-07-19, 18:40, Pierre-Louis Bossart wrote: int sdw_cdns_enable_interrupt(struct sdw_cdns *cdns) { - int ret; - _cdns_enable_interrupt(cdns); - ret = cdns_clear_bit(cdns, CDNS_MCP_CONFIG_UPDATE

<    2   3   4   5   6   7   8   9   10   11   >