summaryrefslogtreecommitdiff
path: root/drivers/soundwire/cadence_master.c
AgeCommit message (Collapse)Author
2020-03-19soundwire: cadence: clear FIFO to avoid pop noise issue on playback startranderwang
Driver should clear FIFO in PDI, or the previously stored sample data in FIFO will generate pop noise when stream is started. The soft reset bit will clear all the FIFO to zero and is self-cleared after that. Signed-off-by: randerwang <rander.wang@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200317163329.25501-18-pierre-louis.bossart@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2020-03-19soundwire: cadence: multi-link supportPierre-Louis Bossart
Enable multi-link (aka multi-master configuration). In this configuration, updates and commands with the 'ssp_sync' tag will be deferred and controlled by the gsync hardware signal. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200317163329.25501-17-pierre-louis.bossart@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2020-03-19soundwire: cadence: commit changes in the exit_reset() sequencePierre-Louis Bossart
Follow recommended flows, the BUS_RESET must be programmed before the UPDATE_CONFIG. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200317163329.25501-16-pierre-louis.bossart@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2020-03-19soundwire: cadence: remove automatic command retriesPierre-Louis Bossart
This is a good idea on paper, but it's not recommended at all when operating in multi-master mode. It's also not recommended when doing bank switches, since the retransmission would happen at the next SSP, and the command protocol is stuck in the mean time. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200317163329.25501-15-pierre-louis.bossart@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2020-03-19soundwire: cadence: remove PREQ_DELAY assignmentPierre-Louis Bossart
The hardware default is 0x1F, and the existing code does an OR with 0xF. This is a no-op, remove. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200317163329.25501-14-pierre-louis.bossart@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2020-03-19soundwire: cadence: enable NORMAL operation in cdns_init()Pierre-Louis Bossart
Follow recommended programming sequences, this needs to be enabled before the reset sequence. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200317163329.25501-13-pierre-louis.bossart@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2020-03-19soundwire: cadence: reorder MCP_CONFIG settingsPierre-Louis Bossart
Follow hardware programming flows and add placeholder comment for multi-master mode. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200317163329.25501-12-pierre-louis.bossart@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2020-03-19soundwire: cadence: make SSP interval programmablePierre-Louis Bossart
In multi-master mode, the IP will only accept SSP intervals with integer relationships between the frame rate and the gsync frequency. E.g for a 48kHz frame rate and 4 kHz gsync signal, the SSP interval can only be 1, 2, 3, 4, 6, 12. To simplify we only allow one SSP per gsync interval. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200317163329.25501-11-pierre-louis.bossart@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2020-03-19soundwire: cadence: move clock/SSP related inits to dedicated functionPierre-Louis Bossart
This helps isolate code and align with recommended programming flows Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200317163329.25501-10-pierre-louis.bossart@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2020-03-19soundwire: cadence: merge routines to clear/set bitsPierre-Louis Bossart
Use a single loop to wait for hardware to set/clear fields. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200317163329.25501-9-pierre-louis.bossart@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2020-03-19soundwire: cadence: mask Slave interrupt before stopping clockPierre-Louis Bossart
Intel QA reported a very rare case, possibly hardware-dependent, where a Slave can become UNATTACHED during a clock stop sequence, which leads to timeouts and failed suspend sequences. This patch suppresses the handling of all Slave events while this transition happens. The two cases that matter are: a) alerts: if the Slave wants to signal an alert condition, it can do so using the in-band wake, so there's almost no impact with this patch. b) sync loss or imp-def reset: in those cases, bringing back the Slave to functional state requires a complete re-enumeration. It's better to just ignore this case and restart cleanly, rather than attempt a 'clean' suspend. Validation results show the timeouts no longer visible with this patch. GitHub issue: https://github.com/thesofproject/linux/issues/1678 Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200317163329.25501-8-pierre-louis.bossart@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2020-03-19soundwire: cadence: fix a io timeout issue in S3 testRander Wang
After system resumes from S3, io timeout occurs when setting one unused master on Comet Lake platform. In this case, the master is reset to default state, and FIFOLEVEL is reset to default value, but msg_count used for tracing FIFOLEVEL is still with old value, so FIFOLEVEL will not be set if a new msg FIFO usage is equal to the old msg_count. This patch updates msg_count to default value of FIFOLEVEL when resetting master. Tested on Comet Lake platform. Signed-off-by: Rander Wang <rander.wang@intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200317163329.25501-7-pierre-louis.bossart@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2020-03-19soundwire: cadence: add clock_stop/restart routinesRander Wang
Add support for clock stop and restart, with two configuration parameters: 1) when entering the ClockStop mode, Slave-initiated wakes can be prevented. 2) When exiting the ClockStop mode, the caller can request a Bus Reset (either if all Slaves were configured in ClockStopMode1 or the Master IP lost context and enumeration is required) The code handles the case where no Slaves are present by configuring the IP to treat COMMAND_IGNORED as success. The exit_reset part can be dealt with in the caller, along with the required syncArm/syncGo sequence in multi-link mode. Signed-off-by: Rander Wang <rander.wang@intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200317163329.25501-6-pierre-louis.bossart@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2020-03-19soundwire: cadence: handle error cases with CONFIG_UPDATEPierre-Louis Bossart
config_update() may time out or cannot be use in ClockStopMode Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200317163329.25501-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2020-03-19soundwire: cadence: add interface to check clock statusRander Wang
If master is in clock stop state, driver can't modify registers in master except the registers for clock stop setting. Signed-off-by: Rander Wang <rander.wang@intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200317163329.25501-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2020-03-19soundwire: cadence: simplifiy cdns_init()Rander Wang
There is no need for the clock_stop_exit argument with the latest implementation Signed-off-by: Rander Wang <rander.wang@intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200317163329.25501-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2020-03-19soundwire: cadence: s/update_config/config_updatePierre-Louis Bossart
Somehow we inverted the two, align with register definition to avoid further confusion. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200317163329.25501-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2020-01-16soundwire: cadence: fix kernel-doc parameter descriptionsPierre-Louis Bossart
Fix previous update, bad git merge likely. oops. Fixes: 39737a313085fa ("soundwire: cadence: update kernel-doc parameter descriptions") Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200114233124.13888-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2020-01-14soundwire: cadence: remove useless variable incrementationPierre-Louis Bossart
Fix cppcheck warning: drivers/soundwire/cadence_master.c:992:9: style: Variable 'offset' is assigned a value that is never used. [unreadVariable] offset += stream->num_out; ^ Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200113211025.27973-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2020-01-14soundwire: cadence: update kernel-doc parameter descriptionsPierre-Louis Bossart
make W=1 reports inconsistencies with parameter descriptions, fix Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200113211025.27973-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2020-01-14soundwire: cadence_master: handle multiple status reports per SlavePierre-Louis Bossart
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 <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200110215731.30747-6-pierre-louis.bossart@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2020-01-14soundwire: cadence_master: remove config update for interrupt settingRander Wang
Config only needs to be updated when setting MCP_Config, MCP_Control and MCP_CmdCtrl to make these register setting effective. When updating config in master, master will communicate with slave to update status. Communication will be failed when masters and slaves are in clock stop state, and this unnecessary config update makes interrupt setting failed. Tested on Comet Lake with soundwire enabled Signed-off-by: Rander Wang <rander.wang@intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200110215731.30747-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2020-01-14soundwire: cadence_master: log more useful information during timeoutsPierre-Louis Bossart
Add the type of command, device number, register offset and length to reverse engineer what caused the issue. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200110215731.30747-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2020-01-14soundwire: cadence_master: clear interrupt status before enabling interruptRander Wang
make sure all interrupts status are cleared before enabling interrupt so that there is no unexpected interrupt triggered. Signed-off-by: Rander Wang <rander.wang@intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200110215731.30747-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2020-01-14soundwire: cadence_master: filter out bad interruptsPierre-Louis Bossart
If somehow we read the interrupt status while the IP is not powered the result is probably undefined or 0xffffffff. We do know that some of the bits are reserved and read as zero, so use as a filter to discard invalid configurations. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200110215731.30747-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2019-10-24soundwire: cadence_master: make clock stop exit configurable on initPierre-Louis Bossart
The use of clock stop is not a requirement, the IP can e.g. be completely power gated and not detect any wakes while in s2idle/deep sleep. For now clock-stop is not supported anyways so the control parameter is always false. This will be revisited when we add clock stop. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20191022235448.17586-6-pierre-louis.bossart@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2019-10-24soundwire: intel/cadence: add flag for interrupt enablePierre-Louis Bossart
Prepare for future PM support and fix error handling by disabling interrupts as needed. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20191022235448.17586-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2019-10-24soundwire: cadence_master: add hw_reset capability in debugfsPierre-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 <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20191022235448.17586-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2019-10-24soundwire: intel/cadence: fix startup sequencePierre-Louis Bossart
Multiple changes squashed in single patch to avoid tick-tock effect and avoid breaking compilation/bisect 1. 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. Add a helper and do the update when the CONFIG is changed. 2. Move interrupt enable after interrupt handler registration 3. Add a new helper to start the hardware bus reset with maximum duration to make sure the Slave(s) correctly detect the reset pattern and to ensure electrical conflicts can be resolved. 4. flush command FIFOs Better error handling will be provided after interrupt disable is provided in follow-up patches. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20191022235448.17586-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2019-10-21soundwire: cadence_master: improve PDI allocationBard Liao
PDI number should match dai->id, there is no need to track if a PDI is allocated or not. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20190916192348.467-7-pierre-louis.bossart@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2019-10-21soundwire: intel: don't filter out PDI0/1Pierre-Louis Bossart
PDI0/1 are reserved for Bulk and filtered out in the existing code. That leads to endless confusions on whether the index is the raw or corrected one. In addition we will need support for Bulk at some point so it's just simpler to expose those PDIs and not use it for now than try to be smart 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 <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20190916192348.467-6-pierre-louis.bossart@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2019-10-21soundwire: cadence/intel: simplify PDI/port mappingPierre-Louis Bossart
The existing Linux code uses a 1:1 mapping between ports and PDIs, but still has an independent allocation of ports and PDIs. Let's simplify the code and remove the port layer by only using PDIs. This patch does not change any functionality, just removes unnecessary code. This will also allow for further simplifications where the PDIs are not dynamically allocated but instead described in a topology file. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20190916192348.467-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2019-09-22Merge tag 'soundwire-5.4-rc1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire Pull soundwire updates from Vinod Koul: "This includes DT support thanks to Srini and more work done by Intel (Pierre) on improving cadence and intel support. Summary: - Add DT bindings and DT support in core - Add debugfs support for soundwire properties - Improvements on streaming handling to core - Improved handling of Cadence module - More updates and improvements to Intel driver" * tag 'soundwire-5.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire: (30 commits) soundwire: stream: make stream name a const pointer soundwire: Add compute_params callback soundwire: core: add device tree support for slave devices dt-bindings: soundwire: add slave bindings soundwire: bus: set initial value to port_status soundwire: intel: handle disabled links soundwire: intel: add debugfs register dump soundwire: cadence_master: add debugfs register dump soundwire: add debugfs support soundwire: intel: remove unused variables soundwire: intel: move shutdown() callback and don't export symbol soundwire: cadence_master: add kernel parameter to override interrupt mask soundwire: intel_init: add kernel module parameter to filter out links soundwire: cadence_master: fix divider setting in clock register soundwire: cadence_master: make use of mclk_freq property soundwire: intel: read mclk_freq property from firmware soundwire: add new mclk_freq field for properties soundwire: stream: remove unnecessary variable initializations soundwire: stream: fix disable sequence soundwire: include mod_devicetable.h to avoid compiling warnings ...
2019-08-23soundwire: cadence_master: add debugfs register dumpPierre-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 <gregkh@linuxfoundation.org> Acked-by: Sanyog Kale <sanyog.r.kale@intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20190821185821.12690-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2019-08-21soundwire: intel: move shutdown() callback and don't export symbolPierre-Louis Bossart
All DAI callbacks are in intel.c except for shutdown. Move and remove export symbol Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20190806005522.22642-18-pierre-louis.bossart@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2019-08-21soundwire: cadence_master: add kernel parameter to override interrupt maskPierre-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 <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20190806005522.22642-17-pierre-louis.bossart@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2019-08-21soundwire: cadence_master: fix divider setting in clock registerRander 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 divider Signed-off-by: Rander Wang <rander.wang@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20190806005522.22642-14-pierre-louis.bossart@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2019-08-21soundwire: cadence_master: make use of mclk_freq propertyPierre-Louis Bossart
Now that the prototype and Intel implementation are enabled, use this property to avoid hard-coded values. For example for ICL the mclk_freq value is 38.4 MHz while on CNL/CML it's 24 MHz. The mclk_freq should not be confused with the max_clk_freq, which si the maximum bus clock. The mclk_freq 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 <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20190806005522.22642-13-pierre-louis.bossart@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2019-08-21soundwire: cadence_master: use firmware defaults for frame shapePierre-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 <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20190806005522.22642-7-pierre-louis.bossart@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2019-08-21soundwire: cadence_master: revisit interrupt settingsPierre-Louis Bossart
Adding missing interrupt masks (parity, etc) and missing checks. Clarify which masks are for which usage. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20190806005522.22642-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2019-08-02soundwire: cadence_master: fix definitions for INTSTAT0/1Pierre-Louis Bossart
Two off-by-one errors: INTSTAT0 missed BIT(31) and INTSTAT1 is only defined on first 16 bits. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20190725234032.21152-15-pierre-louis.bossart@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2019-08-02soundwire: cadence_master: fix register definition for SLAVE_STATEPierre-Louis Bossart
wrong prefix and wrong macro. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20190725234032.21152-14-pierre-louis.bossart@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2019-08-02soundwire: cadence_master: simplify bus clash interrupt clearPierre-Louis Bossart
The bus clash interrupts are generated when the status is one, and also cleared by writing a one. It's overkill/useless to use an OR when the bit is already set. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20190725234032.21152-12-pierre-louis.bossart@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2019-05-27soundwire: cadence_master: check the number of bidir PDIsPierre-Louis Bossart
There is an assumption that the first two PDIs are reserved for Bulk, so we need to make sure the number of bidir PDIs is indeed larger than two. If the configuration provided is incorrect, this could lead to allocating a huge amount of memory. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Vinod Koul <vkoul@kernel.org>
2019-05-27soundwire: cadence_master: log Slave status mask on errorsPierre-Louis Bossart
The Slave status mask exposes 4 sticky bits. When the device loses sync, the IP will report two status but the log will only show that the device lost sync. The status mask has all the information needed so let's report it instead. Also change the resolution of the mask, using 64 bits is not needed when you need 4. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Vinod Koul <vkoul@kernel.org>
2019-05-27soundwire: cadence_master: use rate_limited dynamic debugPierre-Louis Bossart
When commands start failing, e.g. due to a bad electrical connection or bus conflicts, the dmesg log is flooded. This should not happen for production devices but it's quite frequent when bringing-up a new platform. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Vinod Koul <vkoul@kernel.org>
2019-05-27soundwire: cdns: Fix compilation error on arm64Jan Kotas
On arm64 the cadence_master.c file doesn't compile. readl and writel are undefined. This patch fixes that by including io.h. Signed-off-by: Jan Kotas <jank@cadence.com> Reviewed-by: Mukesh Ojha <mojha@codeaurora.org> Signed-off-by: Vinod Koul <vkoul@kernel.org>
2019-05-02soundwire: cadence: remove empty line after bracesVinod Koul
Linux code style doesn't expect empty lines after braces and gives warning: CHECK: Blank lines aren't necessary after an open brace '{' Remove the empty line in cadence lib Signed-off-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-02soundwire: add missing newlines in dynamic debug logsPierre-Louis Bossart
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>
2019-05-02soundwire: cadence_master: remove spurious newlinePierre-Louis Bossart
Extra newline does not improve readability. 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>