Updates for 5.3 include:
- module_sdw_driver macro for drivers
- Documentation updates for code-blocks
- Improvement from Pierre on intel and cadence driver
- Clarification of DisCo properties and updates
-----BEGIN PGP SIGNATURE-----
iQIcBAABAgAGBQJdHtldAAoJEHwUBw8lI4NHf6AP/2glTkehAHh0C/zW7pgTk8na
7bHvEfp0kopdH+qcxyUwa7kBmI1x1ODBtrPIU++ZU7pPC1gXw0RUlOeOTa5HIw9/
uFQKRjbNUJ7/cVuvJZ16WEp3q2Uv5UG5OXlnT/kBFE87T2Zwov5/LKSUQMiHstgn
Ix6aS0GgmHY9/4iFlxafR6SDhZ7Y1wN2gqKAM09K5QguFgGbG/6r+ioEOHEfkCSn
tMiMXy2Koazrq1dRqdWL9PscVe0Yz3JxUDv9lED4OkyIY4zGHM5/LgfLuxzdhqmF
vn9ZorS1AxOt7u5ewxuY8BLc//vqol1bbGzHFNfaOZ6/lmEsIBdXYKTQl8iyTZJP
p/tdp2t9vWs+dDJ9BYXQpIEI/72Gcuu7g2kcwutLaWymp/OdTAjPhQGPc3NPUXgV
aJv1D0Xwktdo/9jMBMpP4e8paM4KcGFeL1QkD545nVhVmCxt8Myf6RgktFEFtgS4
qLt6sl6ahea/0aAtOrQ9Uej3/dOG3S5dYpyXouyJ6mOkSNNAp3FSeNkQI1OayPBV
owFqdnFeAJ9CR/Ae/Ua0yDMSeRIdk+a4WVS3vH9sxWJZtyIPfxQcoWamIMmzxrg7
g9+HorQjz6uOX+o1MzwD70RR6Hosc+sZaNiUsq/yyNbiJ7Ol/to2REMWgT+3XoLE
X9Eio/OZ0sF9fZvCp8cI
=ZOYI
-----END PGP SIGNATURE-----
Merge tag 'soundwire-5.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire into char-misc-next
Vinod writes:
soundwire updates for v5.3-rc1
Updates for 5.3 include:
- module_sdw_driver macro for drivers
- Documentation updates for code-blocks
- Improvement from Pierre on intel and cadence driver
- Clarification of DisCo properties and updates
* tag 'soundwire-5.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire:
soundwire: add module_sdw_driver helper macro
docs: soundwire: locking: fix tags for a code-block
soundwire: intel_init: add checks on link numbers
soundwire: fix typo in comments
soundwire: Intel: add log for number of PCM and PDM PDIs
soundwire: cadence_master: check the number of bidir PDIs
soundwire: cadence_master: log Slave status mask on errors
soundwire: cadence_master: use rate_limited dynamic debug
soundwire: rename/clarify MIPI DisCo properties
soundwire: clarify comment
soundwire: mipi-disco: fix clock stop modes
soundwire: rename 'freq' fields
soundwire: mipi-disco: remove master_count property for masters
soundwire: remove master data port properties
soundwire: add port-related definitions
soundwire: mipi_disco: fix master/link error
soundwire: intel: filter SoundWire controller device search
soundwire: cdns: Fix compilation error on arm64
the msg lock is taken for multi-link cases only but released
unconditionally, leading to an unlock balance warning for single-link usages
This patch fixes this.
=====================================
WARNING: bad unlock balance detected!
5.1.0-16506-gc1c383a6f0a2-dirty #1523 Tainted: G W
-------------------------------------
aplay/2954 is trying to release lock (&bus->msg_lock) at:
do_bank_switch+0x21c/0x480
but there are no more locks to release!
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Sanyog Kale <sanyog.r.kale@intel.com>
[vkoul: edited the change log as suggested by Pierre]
Signed-off-by: Vinod Koul <vkoul@kernel.org>
The existing definitions are ambiguous and possibly misleading.
For DP0, 'flow-control' is only relevant for the BRA protocol and
should not be confused with async modes explicitly not supported for
DP0, add prefix to follow MIPI DisCo definition
The use of 'device_interrupts' is also questionable. The MIPI
SoundWire spec defines Slave-, DP0- and DPN-level
implementation-defined interrupts. Using the 'device' prefix in the
last two cases is misleading, not only is the term 'device' overloaded
but these properties are only valid at the DP0 and DPn levels. Rename
to follow the MIPI definitions, no need to be creative here.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Rename all fields with 'freq' as 'clk_freq' to follow the MIPI
specification and avoid confusion between bus clock and audio clocks.
No functionality change.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Assigning local iterator to array element and using it again for
indexing would cross the array boundary.
Fix this by directly referring array element without using the local
variable.
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
For improving code readability it helps to have a blank line between
function so add when missing.
Checkpatch complains:
CHECK: Please use a blank line after function/struct/union/enum
declarations
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Found few more typos in the code, fix them
CHECK: 'and and' may be misspelled - perhaps 'and'?
CHECK: 'smaple' may be misspelled - perhaps 'sample'?
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Found few more issues reported checkpatch on code alignment so fix those
as well in the soundwire core.
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Linux code style doesn't expect empty lines before or after braces and
gives warning:
CHECK: Blank lines aren't necessary after an open brace '{'
CHECK: Blank lines aren't necessary before a close brace '}'
Fix these instances in soundwire core
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
For some reason the newlines are not used everywhere. Fix as needed.
Reported-by: Joe Perches <joe@perches.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
no need to reset return value.
Detected with cppcheck:
[drivers/soundwire/stream.c:332]: (style) Variable 'ret' is assigned a
value that is never used.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
A multi link bankswitch can be done if the hardware supports and
the stream is handled by multiple Master(s).
This preparatory patch adds support to track m_rt in a stream.
Modifying m_rt_count and usage is added as part of the next patch.
Signed-off-by: Shreyas NC <shreyas.nc@intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
In cases of multiple Masters in a stream, synchronization
between multiple Master(s) is achieved by performing bank switch
together and using Master methods.
Add sdw_ml_bank_switch() to wait for completion of bank switch.
Signed-off-by: Sanyog Kale <sanyog.r.kale@intel.com>
Signed-off-by: Shreyas NC <shreyas.nc@intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
For each SoundWire stream operation, we need to parse master
list and operate upon all master runtime.
This is a preparatory patch to do the boilerplate conversion
of stream handling from single master runtime to handle a
list of master runtime. The code to support bank switch for
multiple master instances is added in the next patch.
Signed-off-by: Sanyog Kale <sanyog.r.kale@intel.com>
Signed-off-by: Shreyas NC <shreyas.nc@intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Currently, the stream concept is limited to single Master and one
or more Codecs.
This patch extends the concept to support multiple Master(s)
sharing the same reference clock and synchronized in the hardware.
Modify sdw_stream_runtime to support a list of sdw_master_runtime
for the same. The existing reference to a single m_rt is removed
in the next patch.
Typically to lock, one would acquire a global lock and then lock
bus instances. In this case, the caller framework(ASoC DPCM)
guarantees that stream operations on a card are always serialized.
So, there is no race condition and hence no need for global lock.
Bus lock(s) are acquired to reconfigure the bus while the stream
is set-up.
So, we add sdw_acquire_bus_lock()/sdw_release_bus_lock() APIs which
are used only to reconfigure the bus.
Signed-off-by: Sanyog Kale <sanyog.r.kale@intel.com>
Signed-off-by: Shreyas NC <shreyas.nc@intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
As part of sdw_stream_remove_master(), sdw_stream_remove_slave() is called
which results in bus lock being acquired twice.
So, fix it by performing specific Slave remove operations in
sdw_release_master_stream() instead of calling sdw_stream_remove_slave().
Signed-off-by: Sanyog Kale <sanyog.r.kale@intel.com>
Signed-off-by: Shreyas NC <shreyas.nc@intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
In sdw_stream_add_master() after the Master ports are configured,
the stream is released incorrectly.
So, fix it by avoiding stream release after configuring the Master
for the stream.
While at it, rename the label appropriately.
Signed-off-by: Shreyas NC <shreyas.nc@intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
For a SoundWire stream it is expected that a Slave is added to the
stream before Master is added.
So, move the stream state to CONFIGURED after the first Slave is
added and remove the stream state assignment for Master add.
Along with these changes, add additional comments to explain the same.
Signed-off-by: Shreyas NC <shreyas.nc@intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
As we move stuff around, some doc references are broken. Fix some of
them via this script:
./scripts/documentation-file-ref-check --fix
Manually checked that produced results are valid.
Acked-by: Matthias Brugger <matthias.bgg@gmail.com>
Acked-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Acked-by: Jonathan Corbet <corbet@lwn.net>
SoundWire supports two registers banks. So, program the alternate bank
with new configuration and then performs bank switch.
Signed-off-by: Sanyog Kale <sanyog.r.kale@intel.com>
Signed-off-by: Shreyas NC <shreyas.nc@intel.com>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Master and Slave port registers need to be programmed for each port
used in a stream. Add the helpers for port register programming.
Signed-off-by: Sanyog Kale <sanyog.r.kale@intel.com>
Signed-off-by: Shreyas NC <shreyas.nc@intel.com>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Add Soundwire port data structures and APIS for initialization
and release of ports.
Signed-off-by: Sanyog Kale <sanyog.r.kale@intel.com>
Signed-off-by: Shreyas NC <shreyas.nc@intel.com>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
This patch adds APIs and relevant stream data structures
for initialization and release of stream.
Signed-off-by: Hardik T Shah <hardik.t.shah@intel.com>
Signed-off-by: Sanyog Kale <sanyog.r.kale@intel.com>
Signed-off-by: Shreyas NC <shreyas.nc@intel.com>
Signed-off-by: Vinod Koul <vkoul@kernel.org>