- 29 11月, 2017 2 次提交
-
-
由 Maciej S. Szmigiero 提交于
We need to make sure that only proper channel slots (in SACCST register) are enabled at playback start time since some AC'97 CODECs (like VT1613 on UDOO board) were observed requesting via SLOTREQ spurious ones just after an AC'97 link is started but before the CODEC is configured by its driver. When a bit for some channel slot is set in a SLOTREQ request then SSI sets the relevant bit in SACCST automatically, which then 'sticks' until it is manually unset. The SACCST register is not writable directly, we have to use SACCDIS and SACCEN registers to configure it instead (these aren't normal registers: writing a '1' bit at some position in SACCEN sets the relevant bit in SACCST; SACCDIS operates in a similar way but allows unsetting bits in SACCST). Theoretically, this should be necessary only for the very first playback but since some CODECs are so untrustworthy and extra channel slots enabled mean ruined playback let's play safe here and make sure that no extra slots are enabled in SACCST every time a playback is started. Signed-off-by: NMaciej S. Szmigiero <mail@maciej.szmigiero.name> Acked-by: NNicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Maciej S. Szmigiero 提交于
In AC'97 mode we configure and start SSI RX / TX on probe path via a call to _fsl_ssi_set_dai_fmt() function. We don't need to call this function again later and in fact don't want to do it since this function temporarily sets STCR, SRCR and SCR to some intermediate values. Signed-off-by: NMaciej S. Szmigiero <mail@maciej.szmigiero.name> Acked-by: NNicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 28 11月, 2017 3 次提交
-
-
由 Maciej S. Szmigiero 提交于
We don't need to set CCSR_SSI_SIER_RFF0_EN / CCSR_SSI_SIER_TFE0_EN bits in reg->rx.sier / reg->tx.sier variables in a non-AC'97 mode considering we had just initialized these variables to these very values unconditionally a few lines earlier. Signed-off-by: NMaciej S. Szmigiero <mail@maciej.szmigiero.name> Acked-by: NNicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Maciej S. Szmigiero 提交于
AC'97 register access operations (both read and write) on SSI use a one, shared set of SSI registers for AC'97 register address and data. This means that only one such access is possible at a time and so all these operations need to be serialized. Since an AC'97 register access operation in this driver takes 100us+ let's use a mutex for this. Use this opportunity to also change a default value returned from AC'97 register read function from -1 to 0, since that's what AC'97 specs require to be returned when unknown / undefined registers are read. Signed-off-by: NMaciej S. Szmigiero <mail@maciej.szmigiero.name> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Maciej S. Szmigiero 提交于
AC'97 ops (register read / write) need SSI regmap and clock, so they have to be set after them. We also need to set these ops back to NULL if we fail the probe. Signed-off-by: NMaciej S. Szmigiero <mail@maciej.szmigiero.name> Acked-by: NNicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
-
- 19 9月, 2017 1 次提交
-
-
由 Nicolin Chen 提交于
The set_sysclk() now is used to override the output bit clock rate. But this is not a common way to implement a set_dai_sysclk(). And this creates a problem when a general machine driver (simple-card for example) tries to do set_dai_sysclk() by passing an input clock rate for the baud clock instead of setting the bit clock rate as fsl_ssi driver expected. So this patch solves this problem by firstly removing set_sysclk() since the hw_params() can calculate the bit clock rate. Secondly, in order not to break those TDM use cases which previously might have been using set_sysclk() to override the bit clock rate, this patch changes the driver to calculate the bit clock rate using the slot number and the slot width from the via set_tdm_slot(). The patch also removes an obsolete comment of the dir parameter. Signed-off-by: NNicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 15 8月, 2017 1 次提交
-
-
由 Markus Elfring 提交于
Omit an extra message for a memory allocation failure in these functions. This issue was detected by using the Coccinelle software. Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdfSigned-off-by: NMarkus Elfring <elfring@users.sourceforge.net> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 11 4月, 2017 2 次提交
-
-
由 Fabio Estevam 提交于
Code can be simplified by using the standard tolower() funtion. Signed-off-by: NFabio Estevam <fabio.estevam@nxp.com> Acked-by: NTimur Tabi <timur@tabi.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Fabio Estevam 提交于
The comment for the FSLSSI_I2S_RATES definition states that the driver currently only supports I2S slave mode, which is no longer correct. As FSLSSI_I2S_RATES is the same as the standard SNDRV_PCM_RATE_CONTINUOUS, just remove its definition and its comments to make the code simpler. Signed-off-by: NFabio Estevam <fabio.estevam@nxp.com> Acked-by: NTimur Tabi <timur@tabi.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 05 1月, 2017 1 次提交
-
-
由 Caleb Crome 提交于
The fsl_ssi fifo watermark is by default set to 2 free spaces (i.e. activate DMA on FIFO when only 2 spaces are left.) This means the DMA must service the fifo within 2 audio samples, which is just not enough time for many use cases with high data rate. In many configurations the audio channel slips (causing l/r swap in stereo configurations, or channel slipping in multi-channel configurations). This patch gives more breathing room and allows the SSI to operate reliably by changing the fifio refill watermark to 8. There is no change in behavior for older chips (with an 8-deep fifo). Only the newer chips with a 15-deep fifo get the new behavior. I suspect a new fifo depth setting could be optimized on the older chips too, but I have not tested. Signed-off-by: NCaleb Crome <caleb@crome.org> Reviewed-by: NFabio Estevam <fabio.estevam@nxp.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 30 9月, 2016 1 次提交
-
-
由 Mark Brown 提交于
The recent series of changes to the caching in the SSI driver have caused a number of problems to appear in some test systems. These are still not fully understood but we're coming up to the merge window so for now let's revert commit 7de2763d (ASoC: fsl_ssi: Remove .num_reg_defaults_raw from regmap_config) as backing that out seems to resolve the problem on affected systems. Reported-by: NMaciej S. Szmigiero" <mail@maciej.szmigiero.name> Signed-off-by: NMark Brown <broonie@kernel.org> Reviewed-by: NMarek Vasut <marex@denx.de>
-
- 21 9月, 2016 2 次提交
-
-
由 Marek Vasut 提交于
This driver provides no .reg_defaults_raw in regmap_config, so the .num_reg_defaults_raw is useless, and, in fact harmful. It triggers kernel crash in regmap_init which tries to access the register defaults. Signed-off-by: NMarek Vasut <marex@denx.de> Acked-by: NNicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Marek Vasut 提交于
Same as commit ce492b3b Subject: drm/fsl-dcu: use flat regmap cache Using flat regmap cache instead of RB-tree to avoid the following lockdep warning on driver load: WARNING: CPU: 0 PID: 1 at kernel/locking/lockdep.c:2871 lockdep_trace_alloc+0x104/0x128 DEBUG_LOCKS_WARN_ON(irqs_disabled_flags(flags)) The RB-tree regmap cache needs to allocate new space on first writes. However, allocations in an atomic context (e.g. when a spinlock is held) are not allowed. The function regmap_write calls map->lock, which acquires a spinlock in the fast_io case. Since the driver uses MMIO, the regmap bus of type regmap_mmio is being used which has fast_io set to true. Signed-off-by: NMarek Vasut <marex@denx.de> Acked-by: NNicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 30 6月, 2016 1 次提交
-
-
由 Alexander Shiyan 提交于
The i.MX51 datasheet says: Chapter 56.1.2.4 I2S Mode ... When I2S modes are entered (I2S master (01) or I2S slave (10)), the following settings are recommended: ... - TX Frame Rate should be 2 i.e. (STCCR[12:8] = 1) - RX Frame Rate should be 2 i.e. (SRCCR[12:8] = 1) Chapter 56.3.3.12 SSI Transmit and Receive Clock Control Registers (STCCR & SRCCR) ... Bits 12-8 DC4-DC0 Frame Rate Divider Control. These bits are used to control the divide ratio for the programmable frame rate dividers. The divide ratio works on the word clock. In Normal mode, this ratio determines the word transfer rate. In Network mode, this ratio sets the number of words per frame. The divide ratio ranges from 1 to 32 in Normal mode and from 2 to 32 in Network mode. In Normal mode, a divide ratio of 1 (DC=00000) provides continuous periodic data word transfer. A bit-length frame sync must be used in this case. Function fsl_ssi_hw_params() setup Normal mode for MONO output, so with DC=0, SSI enters to continuous periodic data word transfer. To fix this, setup DC for any I2S mode. Patch has tested on custom board based on Digi CCMX-51 module (i.MX51). Signed-off-by: NAlexander Shiyan <shc_work@mail.ru> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 13 5月, 2016 6 次提交
-
-
由 Arnaud Mouiche 提交于
Happened when the Playback (or Capture) is running continuously and Capture (or Playback) is restarted (xrun, manual stop/start...) Since the RX (or TX) FIFO are only reset when the whole SSI is disabled, pending samples from previous capture (or playback) session may still be present. They must be erased to not introduce channel slipping. FIFO Clear register fields are documented in IMX51, IMX35 reference manual. They are not documented in IMX50 or IMX6 RM, despite they are working as expected on IMX6SL and IMX6solo. Signed-off-by: NArnaud Mouiche <arnaud.mouiche@invoxia.com> Reviewed-by: NFabio Estevam <fabio.estevam@nxp.com> Tested-by: NCaleb Crome <caleb@crome.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Arnaud Mouiche 提交于
Previously, SCR.SSIEN and SCR.TE were enabled at once if no capture stream was also running. This may not give a chance for the DMA to write the first sample in TX FIFO before the streaming starts on the PCM bus, inserting void samples first. Those void samples are then responsible for slipping the channels. Signed-off-by: NArnaud Mouiche <arnaud.mouiche@invoxia.com> Reviewed-by: NFabio Estevam <fabio.estevam@nxp.com> Tested-by: NCaleb Crome <caleb@crome.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Arnaud Mouiche 提交于
If the capture is already running while playback is started, it is highly probable (>80% in a 8 channels scenario) that samples are lost between the DMA and TX fifo. The reason is that SIER.TDMAE is set before STCR.TFEN0, leaving a time window where the FIFO doesn't receive the samples written by the DMA. This particular case happened only if capture is already enabled as SCR.SSIEN is already set at the playback startup instant. Signed-off-by: NArnaud Mouiche <arnaud.mouiche@invoxia.com> Reviewed-by: NFabio Estevam <fabio.estevam@nxp.com> Tested-by: NCaleb Crome <caleb@crome.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Arnaud Mouiche 提交于
Most of functions only receive the ssi_private reference and don't have a knowledge of 'dev' pointer, even for debug purpose. Signed-off-by: NArnaud Mouiche <arnaud.mouiche@invoxia.com> Tested-by: NCaleb Crome <caleb@crome.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Arnaud Mouiche 提交于
im6sl reference manual 47.7.4: " Bit clock - Used to serially clock the data bits in and out of the SSI port. This clock is either generated internally (from SSI's sys clock) or taken from external clock source (through the Tx/Rx clock ports). [...] Care should be taken to ensure that the bit clock frequency (either internally generated by dividing the SSI's sys clock or sourced from external device through Tx/Rx clock ports) is never greater than 1/5 of the ipg_clk (from CCM) frequency. " Since, in master mode, the sysclk is a multiple of bitclk, we can easily reach a high sysclk value, whereas keeping a reasonable bitclk. ex: 8ch x 16bit x 48kHz = 6144000, requires a 24576000 sysclk (PM=1) yet ipg_clk/5 = 66Mhz/5 = 13.2 Signed-off-by: NArnaud Mouiche <arnaud.mouiche@invoxia.com> Reviewed-by: NFabio Estevam <fabio.estevam@nxp.com> Tested-by: NCaleb Crome <caleb@crome.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Arnaud Mouiche 提交于
The max number of slots in TDM mode is 32: - Frame Rate Divider Control is a 5bit value - Time slot mask registers control 32 slots. Signed-off-by: NArnaud Mouiche <arnaud.mouiche@invoxia.com> Reviewed-by: NFabio Estevam <fabio.estevam@nxp.com> Tested-by: NCaleb Crome <caleb@crome.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 29 4月, 2016 1 次提交
-
-
由 Caleb Crome 提交于
The CCSR_SSI_SOR is a register that clears the TX and/or the RX fifo on the i.MX SSI port. The fsl_ssi_trigger writes this register in order to clear the fifo at trigger time. However, since the CCSR_SSI_SOR register is not in the volatile list, the caching mechanism prevented the register write in the trigger function. This caused the fifo to not be cleared (because the value was unchanged from the last time the register was written), and thus causes the channels in both TDM or simple I2S mode to slip and be in the wrong time slots on SSI restart. This has gone unnoticed for so long because with simple stereo mode, the consequence is that left and right are swapped, which isn't that noticeable. However, it's catestrophic in some systems that require the channels to be in the right slots. Signed-off-by: NCaleb Crome <caleb@crome.org> Suggested-by: NArnaud Mouiche <arnaud.mouiche@invoxia.com> Reviewed-by: NFabio Estevam <fabio.estevam@nxp.com> Acked-by: NNicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 22 2月, 2016 2 次提交
-
-
由 Maciej S. Szmigiero 提交于
There is no guarantee that on fsl_ssi module load SSI registers will have their power-on-reset values. In fact, if the driver is reloaded the values in registers will be whatever they were set to previously. However, the cache needs to be fully populated at probe time to avoid non-atomic allocations during register access. Special case here is imx21-class SSI, since according to datasheet it don't have SACC{ST,EN,DIS} regs. This fixes hard lockup on fsl_ssi module reload, at least in AC'97 mode. Fixes: 05cf2379 ("ASoC: fsl_ssi: Add driver suspend and resume to support MEGA Fast") Signed-off-by: NMaciej S. Szmigiero <mail@maciej.szmigiero.name> Tested-by: NFabio Estevam <fabio.estevam@nxp.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Fabio Estevam 提交于
Commit 5c408fee ("ASoC: fsl_ssi: remove explicit register defaults") causes the driver to fail to probe: fsl-ssi-dai 2028000.ssi: No cache defaults, reading back from HW fsl-ssi-dai 2028000.ssi: Failed to init register map fsl-ssi-dai: probe of 2028000.ssi failed with error -22 , so revert this commit. Reported-by: NMika Penttilä <mika.penttila@nextfour.com> Signed-off-by: NFabio Estevam <fabio.estevam@nxp.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 25 1月, 2016 1 次提交
-
-
由 Maciej S. Szmigiero 提交于
There is no guarantee that on fsl_ssi module load SSI registers will have their power-on-reset values. In fact, if the driver is reloaded the values in registers will be whatever they were set to previously. However, the cache needs to be fully populated at probe time to avoid non-atomic allocations during register access. Special case here is imx21-class SSI, since according to datasheet it don't have SACC{ST,EN,DIS} regs. This fixes hard lockup on fsl_ssi module reload, at least in AC'97 mode. Fixes: 05cf2379 ("ASoC: fsl_ssi: Add driver suspend and resume to support MEGA Fast") Signed-off-by: NMaciej S. Szmigiero <mail@maciej.szmigiero.name> Tested-by: NFabio Estevam <fabio.estevam@nxp.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 10 1月, 2016 2 次提交
-
-
由 Maciej S. Szmigiero 提交于
Mark some registers precious since their reads have side effects (like clearing flags). Signed-off-by: NMaciej S. Szmigiero <mail@maciej.szmigiero.name> Reviewed-by: NFabio Estevam <fabio.estevam@nxp.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Maciej S. Szmigiero 提交于
SACNT register should be marked volatile since its WR and RD bits are cleared by SSI after completing the relevant operation. This unbreaks AC'97 register access. Fixes: 05cf2379 ("ASoC: fsl_ssi: Add driver suspend and resume to support MEGA Fast") Signed-off-by: NMaciej S. Szmigiero <mail@maciej.szmigiero.name> Reviewed-by: NFabio Estevam <fabio.estevam@nxp.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 25 11月, 2015 1 次提交
-
-
由 Zidan Wang 提交于
using params_width function to simplify code. Signed-off-by: NZidan Wang <zidan.wang@freescale.com> Acked-by: NNicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 16 11月, 2015 1 次提交
-
-
由 Zidan Wang 提交于
using macro for default register map Signed-off-by: NZidan Wang <zidan.wang@freescale.com> Acked-by: NNicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 06 10月, 2015 1 次提交
-
-
由 Zidan Wang 提交于
For i.MX6 SoloX, there is a mode of the SoC to shutdown all power source of modules during system suspend and resume procedure. Thus, SSI needs to save all the values of registers before the system suspend and restore them after the system resume. The register SFCSR is volatile, but some bits in it need to be recovered after suspend/resume. Signed-off-by: NZidan Wang <zidan.wang@freescale.com> Acked-by: NNicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 20 9月, 2015 1 次提交
-
-
由 Adam Thomson 提交于
Current code incorrectly treats dai format for AC97 as bit mask whereas it's actually an integer value. This causes DAI formats other than AC97 (e.g. DSP_B) to trigger AC97 related code, which is incorrect and breaks functionality. This patch fixes the code to correctly compare values to determine AC97 or not. Signed-off-by: NAdam Thomson <Adam.Thomson.Opensource@diasemi.com> Acked-by: NTimur Tabi <timur@tabi.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 15 8月, 2015 6 次提交
-
-
由 Maciej S. Szmigiero 提交于
Adjust set DAI format function in fsl_ssi driver so it doesn't fail and clears RXDIR in AC'97 mode. Signed-off-by: NMaciej Szmigiero <mail@maciej.szmigiero.name> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Maciej S. Szmigiero 提交于
Instantiate AC'97 CODEC in fsl_ssi driver AC'97 mode. Signed-off-by: NMaciej Szmigiero <mail@maciej.szmigiero.name> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Maciej S. Szmigiero 提交于
Check whether setting AC'97 ops succeeded and clean them on removal so the fsl_ssi driver can be reloaded. Signed-off-by: NMaciej Szmigiero <mail@maciej.szmigiero.name> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Maciej S. Szmigiero 提交于
AC'97 bus can support asymmetric playback/capture rates so enable them in this case in fsl_ssi driver. Signed-off-by: NMaciej Szmigiero <mail@maciej.szmigiero.name> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Maciej S. Szmigiero 提交于
AC'97 DAI driver struct need the same probe method as I2S one to setup DMA params in fsl_ssi driver. Signed-off-by: NMaciej Szmigiero <mail@maciej.szmigiero.name> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Maciej S. Szmigiero 提交于
IPG clock have to be enabled during AC'97 CODEC register access in fsl_ssi driver. Signed-off-by: NMaciej Szmigiero <mail@maciej.szmigiero.name> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 12 8月, 2015 1 次提交
-
-
由 Xiubo Li 提交于
There are too much noise about the typos for fsl's drivers. So I fix all the typos here in this patch in almost every file I touched. Signed-off-by: NXiubo Li <lixiubo@cmss.chinamobile.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 07 7月, 2015 2 次提交
-
-
由 Juergen Borleis 提交于
According to the datasheet 'pm', 'psr' and 'div2' should never be all 0. Since commit 541b03ad ("ASoC: fsl_ssi: Fix the incorrect limitation of the bit clock rate") this can happen, because for some bitclock rates 'pm' = 0 seems to be a valid choice but does not work due to hardware restrictions. This results into a bad hardware behaviour (slow audio for example). Feature tested on a i.MX25. Signed-off-by: NJuergen Borleis <jbe@pengutronix.de> Acked-by: NNicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Shengjiu Wang 提交于
As the ssi is not the only cpu dai, there are esai, spdif, sai. and imx_pcm_dma can be used by all of them. Especially ESAI need a larger DMA buffer size. So Add dedicated DMA buffer for each cpu dai. Signed-off-by: NShengjiu Wang <shengjiu.wang@freescale.com> Acked-by: NNicolin Chen <nicoleotsuka@gmail.com> Acked-by: NTimur Tabi <timur@tabi.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 08 5月, 2015 1 次提交
-
-
由 Fabio Estevam 提交于
The comment and the call to of_device_is_available() are not really needed. It is the expected behaviour to probe only the ssi nodes that are enabled in the device tree. Signed-off-by: NFabio Estevam <fabio.estevam@freescale.com> Acked-by: NTimur Tabi <timur@tabi.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-