[PATCH v2 05/12] soundwire: intel: reinitialize IP+DSP in .prepare(), but only when resuming

2020-08-17 Thread Bard Liao
is handled via a simple boolean, updated when suspending, and tested for in the .prepare() case. Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart --- drivers/soundwire/cadence_master.h | 4 ++ drivers/soundwire/intel.c | 71 +- 2 files changed, 74

[PATCH v2 10/12] soundwire: intel_init: handle power rail dependencies for clock stop mode

2020-08-17 Thread Bard Liao
pm_runtime suspend routine. This choice of course has a power impact, and this mode should only be selected when latency requirements are critical or the parent device can enter D0ix modes. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- drivers/soundwire/intel_init.c | 13

[PATCH v2 01/12] soundwire: intel: add pm_runtime support

2020-08-17 Thread Bard Liao
unregister, otherwise we will see "Failed to power up link: -11" error on module remove test. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- drivers/soundwire/intel.c | 112 +++-- drivers/soundwire/intel_init.c | 5 +- 2 files changed, 112

[PATCH v2 08/12] soundwire: intel: add CLK_STOP_BUS_RESET support

2020-08-17 Thread Bard Liao
-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- drivers/soundwire/intel.c | 44 +++ 1 file changed, 44 insertions(+) diff --git a/drivers/soundwire/intel.c b/drivers/soundwire/intel.c index 68c1cdfb7999..ad476e9e4d25 100644 --- a/drivers/soundwire/intel.c

[PATCH v2 12/12] soundwire: intel: refine runtime pm for SDW_INTEL_CLK_STOP_BUS_RESET

2020-08-17 Thread Bard Liao
and the power rails will remain enabled. As a result, during the link resume step we can check if the context was preserved by verifying if the clock was stopped, and avoid doing a complete bus reset and re-enumeration. Signed-off-by: Rander Wang Signed-off-by: Bard Liao --- drivers/soundwire

[PATCH v2 02/12] soundwire: intel: reset pm_runtime status during system resume

2020-08-17 Thread Bard Liao
, and conditionally disable, set_active and re-enable the device on system resume. Note that pm_runtime_suspended() is used instead of pm_runtime_status_suspended() so that we can deal with the case where pm_runtime is disabled. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- drivers/soundwire

[PATCH v2 00/12] soundwire: intel: add power management support

2020-08-17 Thread Bard Liao
This series adds power management support for Intel soundwire links. Changes in v2: - Move "#include " to the first required patch. - Fit debug log in single line. Bard Liao (1): soundwire: intel: reinitialize IP+DSP in .prepare(), but only when resuming Pierre-Louis

[PATCH v2] soundwire: SDCA: add helper macro to access controls

2020-08-17 Thread Bard Liao
public but this information is released with explicit permission from the MIPI Board to avoid delays with SDCA support on Linux platforms. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Guennadi Liakhovetski Signed-off-by: Bard Liao --- Changelog: v2: - add

[PATCH v2] soundwire: SDCA: detect sdca_cascade interrupt

2020-08-17 Thread Bard Liao
the status of the sdca_cascade bit. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Guennadi Liakhovetski Signed-off-by: Bard Liao --- Changelog: v2: - Re-read SDW_DP0_INT while reading status again. --- drivers/soundwire/bus.c | 28 +++- inc

[PATCH] soundwire: SDCA: detect sdca_cascade interrupt

2020-08-14 Thread Bard Liao
the status of the sdca_cascade bit. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Guennadi Liakhovetski Signed-off-by: Bard Liao --- drivers/soundwire/bus.c | 14 ++ include/linux/soundwire/sdw.h | 4 2 files changed, 18 insertions(+) diff --git a/drivers

[PATCH] soundwire: SDCA: add helper macro to access controls

2020-08-14 Thread Bard Liao
public but this information is released with explicit permission from the MIPI Board to avoid delays with SDCA support on Linux platforms. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Guennadi Liakhovetski Signed-off-by: Bard Liao --- include/linux/soundwire

[PATCH v2] soundwire: master: enable pm runtime

2020-07-27 Thread Bard Liao
driver. We have set runtime pm ops in M driver already, but still need to enable runtime pm. Signed-off-by: Bard Liao --- Changes in v2: - Edit the commit message to explain why we need the patch. --- drivers/soundwire/master.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/sou

[PATCH] soundwire: master: enable pm runtime

2020-07-23 Thread Bard Liao
We should enable pm runtime. Signed-off-by: Bard Liao --- drivers/soundwire/master.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/soundwire/master.c b/drivers/soundwire/master.c index 5f0b2189defe..3488bb824e84 100644 --- a/drivers/soundwire/master.c +++ b/drivers/soundwire

[PATCH 10/13] soundwire: intel: add CLK_STOP_NOT_ALLOWED support

2020-07-22 Thread Bard Liao
From: Pierre-Louis Bossart In case the clock needs to keep running, we need to prevent the Master from entering pm_runtime suspend. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- drivers/soundwire/intel.c | 20 1 file changed, 20 insertions(+) diff

[PATCH 11/13] soundwire: intel_init: handle power rail dependencies for clock stop mode

2020-07-22 Thread Bard Liao
pm_runtime suspend routine. This choice of course has a power impact, and this mode should only be selected when latency requirements are critical or the parent device can enter D0ix modes. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- drivers/soundwire/intel_init.c | 14

[PATCH 09/13] soundwire: intel: add CLK_STOP_BUS_RESET support

2020-07-22 Thread Bard Liao
-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- drivers/soundwire/intel.c | 44 +++ 1 file changed, 44 insertions(+) diff --git a/drivers/soundwire/intel.c b/drivers/soundwire/intel.c index 1954eb48b86c..744fc0a4816a 100644 --- a/drivers/soundwire/intel.c

[PATCH 13/13] soundwire: intel: refine runtime pm for SDW_INTEL_CLK_STOP_BUS_RESET

2020-07-22 Thread Bard Liao
and the power rails will remain enabled. As a result, during the link resume step we can check if the context was preserved by verifying if the clock was stopped, and avoid doing a complete bus reset and re-enumeration. Signed-off-by: Rander Wang Signed-off-by: Bard Liao --- drivers/soundwire

[PATCH 12/13] soundwire: intel: support clock_stop mode without quirks

2020-07-22 Thread Bard Liao
From: Pierre-Louis Bossart In this mode, on restart the bus restarts immediately, the Slaves remain synchronized and all context is kept intact. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Rander Wang Signed-off-by: Bard Liao --- drivers/soundwire/intel.c | 21

[PATCH 06/13] soundwire: intel: reinitialize IP+DSP in .prepare(), but only when resuming

2020-07-22 Thread Bard Liao
is handled via a simple boolean, updated when suspending, and tested for in the .prepare() case. Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart --- drivers/soundwire/cadence_master.h | 4 ++ drivers/soundwire/intel.c | 71 +- 2 files changed, 74

[PATCH 00/13] soundwire: intel: add power management support

2020-07-22 Thread Bard Liao
This series adds power management support for Intel soundwire links. Bard Liao (1): soundwire: intel: reinitialize IP+DSP in .prepare(), but only when resuming Pierre-Louis Bossart (10): soundwire: intel: Add basic power management support soundwire: intel: add pm_runtime support

[PATCH 08/13] soundwire: intel: add CLK_STOP_TEARDOWN for pm_runtime suspend

2020-07-22 Thread Bard Liao
From: Pierre-Louis Bossart Now that we have options, add support for TEARDOWN mode (same functionality as existing code) All other modes will be added in follow-up patches. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- drivers/soundwire/intel.c | 82

[PATCH 07/13] soundwire: intel: pm_runtime idle scheduling

2020-07-22 Thread Bard Liao
connector. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Rander Wang Signed-off-by: Bard Liao --- drivers/soundwire/intel.c | 26 -- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/drivers/soundwire/intel.c b/drivers/soundwire/intel.c index 52a411669ec0

[PATCH 04/13] soundwire: intel: fix race condition on system resume

2020-07-22 Thread Bard Liao
: the pm_runtime suspend may conflict with the enumeration started by the system resume. This can be simply fixed by updating the status before exiting system resume. GitHub issue: https://github.com/thesofproject/linux/issues/1482 Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao

[PATCH 02/13] soundwire: intel: add pm_runtime support

2020-07-22 Thread Bard Liao
unregister, otherwise we will see "Failed to power up link: -11" error on module remove test. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- drivers/soundwire/intel.c | 112 +++-- drivers/soundwire/intel_init.c | 4 +- 2 files changed, 111

[PATCH 01/13] soundwire: intel: Add basic power management support

2020-07-22 Thread Bard Liao
-Louis Bossart Signed-off-by: Bard Liao --- drivers/soundwire/intel.c | 81 ++- 1 file changed, 79 insertions(+), 2 deletions(-) diff --git a/drivers/soundwire/intel.c b/drivers/soundwire/intel.c index 23b66dcf9966..eb628f255cf5 100644 --- a/drivers/soundwire

[PATCH 05/13] soundwire: intel: call helper to reset Slave states on resume

2020-07-22 Thread Bard Liao
-by: Bard Liao --- drivers/soundwire/intel.c | 12 1 file changed, 12 insertions(+) diff --git a/drivers/soundwire/intel.c b/drivers/soundwire/intel.c index b7d8ea6b331e..758387e345da 100644 --- a/drivers/soundwire/intel.c +++ b/drivers/soundwire/intel.c @@ -1519,6 +1519,12 @@ static int

[PATCH 03/13] soundwire: intel: reset pm_runtime status during system resume

2020-07-22 Thread Bard Liao
, and conditionally disable, set_active and re-enable the device on system resume. Note that pm_runtime_suspended() is used instead of pm_runtime_status_suspended() so that we can deal with the case where pm_runtime is disabled. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- drivers/soundwire

[PATCH v2 8/9] soundwire: intel: add wake interrupt support

2020-07-16 Thread Bard Liao
can check this value to skip the ghost devices defined in ACPI table but not populated in hardware. Signed-off-by: Rander Wang Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- drivers/soundwire/intel.c | 40 +- drivers/soundwire/inte

[PATCH v2 5/9] soundwire: intel_init: add implementation of sdw_intel_enable_irq()

2020-07-16 Thread Bard Liao
From: Pierre-Louis Bossart This function is required to enable all interrupts across all links. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- drivers/soundwire/intel_init.c | 24 1 file changed, 24 insertions(+) diff --git a/drivers/soundwire

[PATCH v2 6/9] soundwire: intel_init: use EXPORT_SYMBOL_NS

2020-07-16 Thread Bard Liao
at this time, in future patches we should also add namespaces for Cadence parts and the SoundWire core. Suggested-by: Greg KH Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- drivers/soundwire/intel_init.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git

[PATCH v2 2/9] soundwire: intel: revisit SHIM programming sequences.

2020-07-16 Thread Bard Liao
. Note that the SYNCPRD value is tied only to the XTAL value and not the current bus frequency or the frame rate. BugLink: https://github.com/thesofproject/linux/issues/1555 Signed-off-by: Rander Wang Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- drivers/soundwire/intel.c

[PATCH v2 9/9] Soundwire: intel_init: save Slave(s) _ADR info in sdw_intel_ctx

2020-07-16 Thread Bard Liao
Save ACPI information in context so that we can match machine driver with sdw _ADR matching tables. Suggested-by: Guennadi Liakhovetski Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart --- drivers/soundwire/intel_init.c | 24 1 file changed, 24 insertions

[PATCH v2 7/9] soundwire: intel/cadence: merge Soundwire interrupt handlers/threads

2020-07-16 Thread Bard Liao
because events on a SoundWire link are throttled by the bus frame rate (typically 8..48kHz). Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart --- drivers/soundwire/cadence_master.c | 18 ++ drivers/soundwire/cadence_master.h | 4 drivers/soundwire/intel.c

[PATCH v2 4/9] soundwire: intel: introduce helper for link synchronization

2020-07-16 Thread Bard Liao
From: Pierre-Louis Bossart After arming the synchronization, the SYNCGO field controls the hardware-based synchronization between links. Move the programming and wait for clear of SYNCGO to dedicated helper. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- drivers/soundwire

[PATCH v2 3/9] soundwire: intel: introduce a helper to arm link synchronization

2020-07-16 Thread Bard Liao
From: Pierre-Louis Bossart Move code from pre_bank_switch to dedicated helper, will be used in follow-up patches as recommended by programming flows. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- drivers/soundwire/intel.c | 26 -- 1 file changed, 16

[PATCH v2 0/9] soundwire: intel: revisit SHIM programming

2020-07-16 Thread Bard Liao
This series does some cleanup, revisits SHIM programming sequences, and merges Soundwire interrupt handlers/threads. changes in v2: - Resume M device instead of S device in intel_master_process_wakeen_event function. See the comment in intel_master_process_wakeen_event() in detail. Bard

[PATCH v2 1/9] soundwire: intel: reuse code for wait loops to set/clear bits

2020-07-16 Thread Bard Liao
From: Pierre-Louis Bossart Refactor code and use same routines on set/clear Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- drivers/soundwire/intel.c | 45 +-- 1 file changed, 19 insertions(+), 26 deletions(-) diff --git a/drivers

[PATCH 0/2] soundwire: sdw.h: fix PRBS/Static_1 swapped

2020-07-15 Thread Bard Liao
Fix PRBS/Static_1 swapped definitions and indentation in sdw.h Pierre-Louis Bossart (2): soundwire: sdw.h: fix PRBS/Static_1 swapped definitions soundwire: sdw.h: fix indentation include/linux/soundwire/sdw.h | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) --

[PATCH 1/2] soundwire: sdw.h: fix PRBS/Static_1 swapped definitions

2020-07-15 Thread Bard Liao
Signed-off-by: Bard Liao --- include/linux/soundwire/sdw.h | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/linux/soundwire/sdw.h b/include/linux/soundwire/sdw.h index 4057adf7f049..6452bac957b3 100644 --- a/include/linux/soundwire/sdw.h +++ b/include/linux/sound

[PATCH 2/2] soundwire: sdw.h: fix indentation

2020-07-15 Thread Bard Liao
From: Pierre-Louis Bossart Not sure how this went undetected for years. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Guennadi Liakhovetski Reviewed-by: Rander Wang Signed-off-by: Bard Liao --- include/linux/soundwire/sdw.h | 8 1 file changed, 4 insertions(+), 4 deletions

[PATCH v2 2/5] soundwire: stream: add helper to startup/shutdown streams

2020-07-01 Thread Bard Liao
From: Pierre-Louis Bossart To handle streams at the dailink level, expose two helpers that will be called from machine drivers. Reviewed-by: Ranjani Sridharan Reviewed-by: Guennadi Liakhovetski Reviewed-by: Kai Vehmanen Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao

[PATCH v2 1/5] soundwire: intel: implement get_sdw_stream() operations

2020-07-01 Thread Bard Liao
From: Pierre-Louis Bossart This is needed to retrieve the information when the stream is allocated at the dai_link level. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- drivers/soundwire/intel.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/drivers

[PATCH v2 0/5] soundwire: handle stream at the dailink level

2020-07-01 Thread Bard Liao
Currently, stream is handled at the dai level. But we have to handle stream at the dailink level in the multi-cpu dailink usage. changes in v2: - Add kernel doc - Use single line trace log Pierre-Louis Bossart (5): soundwire: intel: implement get_sdw_stream() operations soundwire: stream:

[PATCH v2 3/5] soundwire: intel: remove stream allocation/free

2020-07-01 Thread Bard Liao
From: Pierre-Louis Bossart To support streaming across multiple links, the stream allocation/free needs to be at the dailink level, not the dai. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- drivers/soundwire/intel.c | 57 +-- 1 file

[PATCH v2 4/5] soundwire: cadence: allocate/free dma_data in set_sdw_stream

2020-07-01 Thread Bard Liao
-by: Bard Liao --- drivers/soundwire/cadence_master.c | 52 ++ 1 file changed, 38 insertions(+), 14 deletions(-) diff --git a/drivers/soundwire/cadence_master.c b/drivers/soundwire/cadence_master.c index 9ea87538b9ef..613dbd415b91 100644 --- a/drivers/soundwire

[PATCH v2 5/5] soundwire: intel: don't free dma_data in DAI shutdown

2020-07-01 Thread Bard Liao
From: Pierre-Louis Bossart Now that the DMA data is allocated/freed in set_sdw_stream(), remove free operations. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- drivers/soundwire/intel.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/drivers/soundwire/intel.c b

[PATCH 2/9] soundwire: intel: revisit SHIM programming sequences.

2020-06-23 Thread Bard Liao
. Note that the SYNCPRD value is tied only to the XTAL value and not the current bus frequency or the frame rate. BugLink: https://github.com/thesofproject/linux/issues/1555 Signed-off-by: Rander Wang Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- drivers/soundwire/intel.c

[PATCH 6/9] soundwire: intel_init: use EXPORT_SYMBOL_NS

2020-06-23 Thread Bard Liao
at this time, in future patches we should also add namespaces for Cadence parts and the SoundWire core. Suggested-by: Greg KH Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- drivers/soundwire/intel_init.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git

[PATCH 5/9] soundwire: intel_init: add implementation of sdw_intel_enable_irq()

2020-06-23 Thread Bard Liao
From: Pierre-Louis Bossart This function is required to enable all interrupts across all links. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- drivers/soundwire/intel_init.c | 24 1 file changed, 24 insertions(+) diff --git a/drivers/soundwire

[PATCH 8/9] soundwire: intel: add wake interrupt support

2020-06-23 Thread Bard Liao
can check this value to skip the ghost devices defined in ACPI table but not populated in hardware. Signed-off-by: Rander Wang Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- drivers/soundwire/intel.c | 48 +- drivers/soundwire/inte

[PATCH 1/9] soundwire: intel: reuse code for wait loops to set/clear bits

2020-06-23 Thread Bard Liao
From: Pierre-Louis Bossart Refactor code and use same routines on set/clear Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- drivers/soundwire/intel.c | 45 +-- 1 file changed, 19 insertions(+), 26 deletions(-) diff --git a/drivers

[PATCH 7/9] soundwire: intel/cadence: merge Soundwire interrupt handlers/threads

2020-06-23 Thread Bard Liao
because events on a SoundWire link are throttled by the bus frame rate (typically 8..48kHz). Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart --- drivers/soundwire/cadence_master.c | 18 ++ drivers/soundwire/cadence_master.h | 4 drivers/soundwire/intel.c

[PATCH 9/9] Soundwire: intel_init: save Slave(s) _ADR info in sdw_intel_ctx

2020-06-23 Thread Bard Liao
Save ACPI information in context so that we can match machine driver with sdw _ADR matching tables. Suggested-by: Guennadi Liakhovetski Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart --- drivers/soundwire/intel_init.c | 24 1 file changed, 24 insertions

[PATCH 3/9] soundwire: intel: introduce a helper to arm link synchronization

2020-06-23 Thread Bard Liao
From: Pierre-Louis Bossart Move code from pre_bank_switch to dedicated helper, will be used in follow-up patches as recommended by programming flows. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- drivers/soundwire/intel.c | 26 -- 1 file changed, 16

[PATCH 0/9] soundwire: intel: revisit SHIM programming

2020-06-23 Thread Bard Liao
This series does some cleanup, revisits SHIM programming sequences, and merges Soundwire interrupt handlers/threads. Bard Liao (2): soundwire: intel/cadence: merge Soundwire interrupt handlers/threads Soundwire: intel_init: save Slave(s) _ADR info in sdw_intel_ctx Pierre-Louis Bossart (6

[PATCH 4/9] soundwire: intel: introduce helper for link synchronization

2020-06-23 Thread Bard Liao
From: Pierre-Louis Bossart After arming the synchronization, the SYNCGO field controls the hardware-based synchronization between links. Move the programming and wait for clear of SYNCGO to dedicated helper. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- drivers/soundwire

[PATCH 4/5] soundwire: cadence: allocate/free dma_data in set_sdw_stream

2020-06-23 Thread Bard Liao
-by: Bard Liao --- drivers/soundwire/cadence_master.c | 52 ++ 1 file changed, 38 insertions(+), 14 deletions(-) diff --git a/drivers/soundwire/cadence_master.c b/drivers/soundwire/cadence_master.c index 5c0df066bfc6..24eafe0aa1c3 100644 --- a/drivers/soundwire

[PATCH 5/5] soundwire: intel: don't free dma_data in DAI shutdown

2020-06-23 Thread Bard Liao
From: Pierre-Louis Bossart Now that the DMA data is allocated/freed in set_sdw_stream(), remove free operations. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- drivers/soundwire/intel.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/drivers/soundwire/intel.c b

[PATCH 3/5] soundwire: intel: remove stream allocation/free

2020-06-23 Thread Bard Liao
From: Pierre-Louis Bossart To support streaming across multiple links, the stream allocation/free needs to be at the dailink level, not the dai. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- drivers/soundwire/intel.c | 57 +-- 1 file

[PATCH 1/5] soundwire: intel: implement get_sdw_stream() operations

2020-06-23 Thread Bard Liao
From: Pierre-Louis Bossart This is needed to retrieve the information when the stream is allocated at the dai_link level. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- drivers/soundwire/intel.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/drivers

[PATCH 2/5] soundwire: stream: add helper to startup/shutdown streams

2020-06-23 Thread Bard Liao
From: Pierre-Louis Bossart To handle streams at the dailink level, expose two helpers that will be called from machine drivers. Reviewed-by: Ranjani Sridharan Reviewed-by: Guennadi Liakhovetski Reviewed-by: Kai Vehmanen Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao

[PATCH 0/5] soundwire: handle stream at the dailink level

2020-06-23 Thread Bard Liao
Currently, stream is handled at the dai level. But we have to handle stream at the dailink level in the multi-cpu dailink usage. Pierre-Louis Bossart (5): soundwire: intel: implement get_sdw_stream() operations soundwire: stream: add helper to startup/shutdown streams soundwire: intel:

[PATCH 3/4] soundwire: extend SDW_SLAVE_ENTRY

2020-06-09 Thread Bard Liao
to be exposed. For SoundWire 1.0 and 1.1 devices, a wildcard is used so class and version information are ignored. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Guennadi Liakhovetski Signed-off-by: Bard Liao --- drivers/soundwire/bus_type.c | 13 + include

[PATCH 4/4] soundwire: bus: initialize bus clock base and scale registers

2020-06-09 Thread Bard Liao
. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Kai Vehmanen Reviewed-by: Guennadi Liakhovetski Signed-off-by: Bard Liao --- drivers/soundwire/bus.c | 107 include/linux/soundwire/sdw_registers.h | 10 +++ 2 files changed, 117 insertions(+) diff

[PATCH 2/4] soundwire: bus_type: convert open-coded while() to for() loop

2020-06-09 Thread Bard Liao
From: Pierre-Louis Bossart No functionality change, just more structured code. Suggested-by: Guennadi Liakhovetski Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Guennadi Liakhovetski Signed-off-by: Bard Liao --- drivers/soundwire/bus_type.c | 6 ++ 1 file

[PATCH 0/4] soundwire: add SoundWire 1.2 spec support

2020-06-09 Thread Bard Liao
This series adds basic support for SoundWire 1.2. Pierre-Louis Bossart (4): soundwire: add definitions for 1.2 spec soundwire: bus_type: convert open-coded while() to for() loop soundwire: extend SDW_SLAVE_ENTRY soundwire: bus: initialize bus clock base and scale registers

[PATCH 1/4] soundwire: add definitions for 1.2 spec

2020-06-09 Thread Bard Liao
-by: Bard Liao --- include/linux/soundwire/sdw_registers.h | 107 +++- 1 file changed, 106 insertions(+), 1 deletion(-) diff --git a/include/linux/soundwire/sdw_registers.h b/include/linux/soundwire/sdw_registers.h index a686f7988156..12f9ffc3eb3b 100644 --- a/include/linux

[PATCH v2 4/6] soundwire: intel_init: use devm_ allocation

2020-06-01 Thread Bard Liao
From: Pierre-Louis Bossart Make error handling simpler with devm_ allocation. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- drivers/soundwire/intel_init.c | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/drivers/soundwire/intel_init.c b

[PATCH v2 6/6] soundwire: intel: transition to 3 steps initialization

2020-06-01 Thread Bard Liao
enumerated. This step is only done during the card creation stage, after the DSP is powered to account for internal power rail dependencies. These 3 steps are already supported in the Sound Open firmware drivers and upstream. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao

[PATCH v2 5/6] soundwire: intel_init: pass link information as platform data

2020-06-01 Thread Bard Liao
From: Pierre-Louis Bossart It's not clear how this code ever worked, the link information is used in intel.c but never passed as platform_data. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- drivers/soundwire/intel_init.c | 2 ++ 1 file changed, 2 insertions(+) diff --git

[PATCH v2 0/6] soundwire: intel: transition to 3 steps initialization

2020-06-01 Thread Bard Liao
This series is to split the original "soundwire: intel: transition to 3 steps initialization" patch into different patches for better review. It also address comments from Vinod. Pierre-Louis Bossart (6): soundwire: intel: cleanups for indirections/logs soundwire: intel: clarify drvdata and

[PATCH v2 1/6] soundwire: intel: cleanups for indirections/logs

2020-06-01 Thread Bard Liao
From: Pierre-Louis Bossart The code can be simplified a bit to have a more consistent use of 'dev' and 'bus', as well as move definitions around. This will help make the major changes in follow-up patches easier to review. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao

[PATCH v2 2/6] soundwire: intel: clarify drvdata and remove more indirections

2020-06-01 Thread Bard Liao
' to make the code more readable. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- drivers/soundwire/intel.c | 38 +++--- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/drivers/soundwire/intel.c b/drivers/soundwire/intel.c index

[PATCH v2 3/6] soundwire: intel_init: remove useless test

2020-06-01 Thread Bard Liao
From: Pierre-Louis Bossart No need to test link_mask twice Suggested-by: Rander Wang Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- drivers/soundwire/intel_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soundwire/intel_init.c b/drivers

[PATCH] soundwire: clarify SPDX use of GPL-2.0

2020-05-31 Thread Bard Liao
Reviewed-by: Guennadi Liakhovetski Signed-off-by: Bard Liao --- drivers/soundwire/bus.c | 2 +- drivers/soundwire/bus.h | 2 +- drivers/soundwire/bus_type.c| 2 +- drivers/soundwire/cadence_master.c | 2 +- drivers/soundwire/cadence_master.h | 2

[PATCH] soundwire: bus: clock_stop: don't deal with UNATTACHED Slave devices

2020-05-31 Thread Bard Liao
We don't need to do anything for the slave if it is unattached during clock stop prepare and exit sequences. Signed-off-by: Bard Liao --- drivers/soundwire/bus.c | 23 +-- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/drivers/soundwire/bus.c b/drivers

[PATCH 1/2] soundwire: intel: use a single module

2020-05-20 Thread Bard Liao
-by: Bard Liao --- drivers/soundwire/Makefile | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/soundwire/Makefile b/drivers/soundwire/Makefile index 7319918e0aec..4f6094767212 100644 --- a/drivers/soundwire/Makefile +++ b/drivers/soundwire/Makefile @@ -16,12 +16,9

[PATCH 2/2] soundwire: intel: transition to 3 steps initialization

2020-05-20 Thread Bard Liao
() callback lighter-weight with only hardware register setup. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- drivers/soundwire/intel.c | 76 +- drivers/soundwire/intel.h | 15 ++ drivers/soundwire/intel_init.c | 249 ++--- 3 files

[PATCH 3/3] soundwire: add Slave sysfs support

2020-05-19 Thread Bard Liao
. Depending on the discussions the SoundWire Device Class, we may add it later as is or follow the new specification. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- .../ABI/testing/sysfs-bus-soundwire-slave | 91 ++ drivers/soundwire/Makefile| 3 +- drivers

[PATCH 2/3] soundwire: master: add sysfs support

2020-05-19 Thread Bard Liao
Bossart Signed-off-by: Bard Liao --- .../ABI/testing/sysfs-bus-soundwire-master| 23 + drivers/soundwire/master.c| 84 +++ 2 files changed, 107 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-bus-soundwire-master diff --git a/Documentation

[PATCH 0/3] soundwire: add sysfs support

2020-05-19 Thread Bard Liao
Add soundwire sysfs support. Pierre-Louis Bossart (3): soundwire: disco: s/ch/channels/ soundwire: master: add sysfs support soundwire: add Slave sysfs support .../ABI/testing/sysfs-bus-soundwire-master| 23 ++ .../ABI/testing/sysfs-bus-soundwire-slave | 91 ++

[PATCH 1/3] soundwire: disco: s/ch/channels/

2020-05-19 Thread Bard Liao
From: Pierre-Louis Bossart Use more meaningful member names in preparation for sysfs support. No functionality change. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- drivers/soundwire/mipi_disco.c | 11 ++- include/linux/soundwire/sdw.h | 8 2 files

[PATCH v2 2/5] soundwire: bus_type: introduce sdw_slave_type and sdw_master_type

2020-05-18 Thread Bard Liao
other than moving code around. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- drivers/soundwire/bus_type.c | 19 +-- drivers/soundwire/slave.c | 8 +++- include/linux/soundwire/sdw_type.h | 9 - 3 files changed, 28 insertions(+), 8

[PATCH v2 5/5] soundwire: master: add runtime pm support

2020-05-18 Thread Bard Liao
We need to enable runtime_pm on master device with generic helpers, so that a Slave-initiated wake is propagated to the bus parent. Signed-off-by: Bard Liao --- drivers/soundwire/master.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/soundwire/master.c b/drivers/soundwire

[PATCH v2 4/5] soundwire: bus_type: add sdw_master_device support

2020-05-18 Thread Bard Liao
uis Bossart Signed-off-by: Bard Liao --- drivers/soundwire/Makefile| 2 +- drivers/soundwire/bus.c | 14 -- drivers/soundwire/bus.h | 3 ++ drivers/soundwire/intel.c | 1 - drivers/soundwire/master.c| 81 +++ drivers/soundwire/qco

[PATCH v2 1/5] soundwire: bus: rename sdw_bus_master_add/delete, add arguments

2020-05-18 Thread Bard Liao
. The Intel code is currently unused, the two additional arguments are only needed for compilation. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- Documentation/driver-api/soundwire/summary.rst | 7 --- drivers/soundwire/bus.c| 15 +-- drivers

[PATCH v2 3/5] soundwire: bus: add unique bus id

2020-05-18 Thread Bard Liao
Adding an unique id for each bus. Suggested-by: Vinod Koul Signed-off-by: Bard Liao --- drivers/soundwire/bus.c | 20 include/linux/soundwire/sdw.h | 2 ++ 2 files changed, 22 insertions(+) diff --git a/drivers/soundwire/bus.c b/drivers/soundwire/bus.c index

[PATCH v2 0/5] soundwire: bus_type: add sdw_master_device support

2020-05-18 Thread Bard Liao
This series adds sdw master devices support. changes in v2: - Allocate sdw_master_device dynamically - Use unique bus id as master id - Keep checking parent devices - Enable runtime_pm on Master device Bard Liao (2): soundwire: bus: add unique bus id soundwire: master: add runtime pm

[PATCH 2/3] soundwire: bus_type: introduce sdw_slave_type and sdw_master_type

2020-04-30 Thread Bard Liao
other than moving code around. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- drivers/soundwire/bus_type.c | 19 +-- drivers/soundwire/slave.c | 8 +++- include/linux/soundwire/sdw_type.h | 9 - 3 files changed, 28 insertions(+), 8

[PATCH 1/3] soundwire: bus: rename sdw_bus_master_add/delete, add arguments

2020-04-30 Thread Bard Liao
. The Intel code is currently unused, the two additional arguments are only needed for compilation. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- Documentation/driver-api/soundwire/summary.rst | 7 --- drivers/soundwire/bus.c| 15 +-- drivers

[PATCH 3/3] soundwire: bus_type: add sdw_master_device support

2020-04-30 Thread Bard Liao
-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- drivers/soundwire/Makefile| 2 +- drivers/soundwire/bus.c | 12 -- drivers/soundwire/bus.h | 3 ++ drivers/soundwire/master.c| 79 +++ drivers/soundwire/qcom.c | 1 - include/linux

[PATCH 0/3] soundwire: bus_type: add sdw_master_device support

2020-04-30 Thread Bard Liao
This series adds sdw master devices support. Pierre-Louis Bossart (3): soundwire: bus: rename sdw_bus_master_add/delete, add arguments soundwire: bus_type: introduce sdw_slave_type and sdw_master_type soundwire: bus_type: add sdw_master_device support .../driver-api/soundwire/summary.rst

[PATCH] soundwire: qcom: fix error handling in probe

2020-04-30 Thread Bard Liao
From: Pierre-Louis Bossart Make sure all error cases are properly handled and all resources freed. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao Reviewed-by: Srinivas Kandagatla --- drivers/soundwire/qcom.c | 26 +- 1 file changed, 17 insertions(+), 9

[PATCH] soundwire: bus: set initial value to port_status

2019-08-30 Thread Bard liao
From: Bard Liao port_status[port_num] are assigned for each port_num in some if conditions. So some of the port_status may not be initialized. Signed-off-by: Bard Liao --- drivers/soundwire/bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soundwire/bus.c b

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

2019-07-25 Thread Bard liao
On 7/26/2019 7:40 AM, 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. Add the mask definition and use cdns_updatel to update

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

2019-07-25 Thread Bard liao
On 7/26/2019 7:40 AM, Pierre-Louis Bossart wrote: Per the hardware documentation, all changes to MCP_CONFIG, MCP_CONTROL, MCP_CMDCTRL and MCP_PHYCTRL need to be validated with a self-clearing write to MCP_CONFIG_UPDATE. For some reason, the existing code only does this write to CONFIG_UPDATE

RE: [PATCH][next] ASoC: rt5668: fix incorrect 'and' operator

2018-04-20 Thread Bard Liao
> -Original Message- > From: Colin King [mailto:colin.k...@canonical.com] > Sent: Thursday, April 19, 2018 10:35 PM > To: Bard Liao; Oder Chiou; Liam Girdwood; Mark Brown; Jaroslav Kysela; > Takashi Iwai; alsa-de...@alsa-project.org > Cc: kernel-janit...@vger.kernel

RE: [PATCH][next] ASoC: rt5668: fix incorrect 'and' operator

2018-04-20 Thread Bard Liao
> -Original Message- > From: Colin King [mailto:colin.k...@canonical.com] > Sent: Thursday, April 19, 2018 10:35 PM > To: Bard Liao; Oder Chiou; Liam Girdwood; Mark Brown; Jaroslav Kysela; > Takashi Iwai; alsa-de...@alsa-project.org > Cc: kernel-janit...@vger.kernel

RE: [PATCH 1/2] ASoC: rt5651: Enable jack detection on JD1_1

2017-10-19 Thread Bard Liao
> -Original Message- > From: Carlo Caione [mailto:carlo.cai...@gmail.com] On Behalf Of Carlo > Caione > Sent: Thursday, October 19, 2017 7:03 PM > To: li...@endlessm.com; Bard Liao; Oder Chiou; > pierre-louis.boss...@linux.intel.com; broo...@kernel.org; > alsa-de...@al

RE: [PATCH 1/2] ASoC: rt5651: Enable jack detection on JD1_1

2017-10-19 Thread Bard Liao
> -Original Message- > From: Carlo Caione [mailto:carlo.cai...@gmail.com] On Behalf Of Carlo > Caione > Sent: Thursday, October 19, 2017 7:03 PM > To: li...@endlessm.com; Bard Liao; Oder Chiou; > pierre-louis.boss...@linux.intel.com; broo...@kernel.org; > alsa-de...@al

<    1   2   3   4   >