summaryrefslogtreecommitdiffstats
path: root/sound/soc/fsl/fsl_spdif.c
Commit message (Collapse)AuthorAgeFilesLines
* ASoC: fsl_spdif: Add driver suspend and resume to support MEGA FastZidan Wang2015-10-051-0/+73
| | | | | | | | | | | | | 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, SPDIF needs to save all the values of registers before the system suspend and restore them after the system resume. The SRPC register should be volatile, LOCK bit is set by the hardware. Signed-off-by: Zidan Wang <zidan.wang@freescale.com> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
*-. Merge remote-tracking branches 'asoc/topic/fsl-spdif', 'asoc/topic/fsl-ssi', ↵Mark Brown2015-08-301-1/+2
|\ \ | | | | | | | | | 'asoc/topic/gtm601', 'asoc/topic/ics43432' and 'asoc/topic/ids' into asoc-next
| * | ASoC: fsl: fsl_spdif: signedness bug in fsl_spdif_startup()Dan Carpenter2015-07-141-1/+2
| |/ | | | | | | | | | | | | | | | | | | We need "i" to be signed or it leads to a forever loop in the error handling. Fixes: fa3be9208dcb ('ASoC: fsl: fsl_spdif: Check for clk_prepare_enable() error') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| |
| \
*-. \ Merge remote-tracking branches 'asoc/topic/fsi', 'asoc/topic/fsl', ↵Mark Brown2015-08-301-7/+15
|\ \ \ | |_|/ |/| | | | | 'asoc/topic/fsl-asrc', 'asoc/topic/fsl-card' and 'asoc/topic/fsl-sai' into asoc-next
| | * ASoC: fsl: fsl_spdif: Check for clk_prepare_enable() errorFabio Estevam2015-07-071-3/+11
| |/ |/| | | | | | | | | | | | | | | clk_prepare_enable() may fail, so we should better check its return value and propagate it in the case of error. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: fsl: fix typos for sound/soc/fsl/*Xiubo Li2015-08-121-3/+3
| | | | | | | | | | | | | | | | 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: Xiubo Li <lixiubo@cmss.chinamobile.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: fsl: Add dedicated DMA buffer size for each cpu daiShengjiu Wang2015-07-071-1/+1
|/ | | | | | | | | | | | 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: Shengjiu Wang <shengjiu.wang@freescale.com> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Acked-by: Timur Tabi <timur@tabi.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: fsl_spdif: Don't try to round-up for clock divisor calculationNicolin Chen2015-05-251-6/+4
| | | | | | | | | | | | As commit 6c8ca30eec7b ("ASoC: fsl_ssi: Don't try to round-up for PM divisor calculation") mentioned that there's no more need to use a round up work around to get a better divisor since the clk-divider driver has been refined a lot. So this patch applies the same modification to fsl_spdif driver. Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: fsl_spdif: fix struct clk pointer comparingShawn Guo2015-03-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | Since commit 035a61c314eb ("clk: Make clk API return per-user struct clk instances"), clk API users can no longer check if two struct clk pointers are pointing to the same hardware clock, i.e. struct clk_hw, by simply comparing two pointers. That's because with the per-user clk change, a brand new struct clk is created whenever clients try to look up the clock by calling clk_get() or sister functions like clk_get_sys() and of_clk_get(). This changes the original behavior where the struct clk is only created for once when clock driver registers the clock to CCF in the first place. The net change here is before commit 035a61c314eb the struct clk pointer is unique for given hardware clock, while after the commit the pointers returned by clk lookup calls become different for the same hardware clock. That said, the struct clk pointer comparing in the code doesn't work any more. Call helper function clk_is_match() instead to fix the problem. Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Michael Turquette <mturquette@linaro.org> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
*-. Merge remote-tracking branches 'asoc/topic/fsl-spdif', 'asoc/topic/imx', ↵Mark Brown2015-02-041-12/+3
|\ \ | | | | | | | | | 'asoc/topic/intel', 'asoc/topic/mxs-saif' and 'asoc/topic/nuc900' into asoc-next
| * | ASoC: fsl_spdif: Use dev_name() for registering the irqFabio Estevam2014-12-301-12/+3
| |/ | | | | | | | | | | | | | | | | | | | | The 'name' array is currently stored inside the fsl_spdif_priv private structure only for registering the interrupt name. This can be simplified by registering it with dev_name() instead. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: fsl_spdif: Make error message conciseFabio Estevam2015-01-081-1/+1
|/ | | | | | | | | | | Currently the error message uses 'np->full_name' which leads to a very verbose log that contains the full path of the node. We can have a concise log by using pdev->name instead. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: fsl: drop owner assignment from platform_driversWolfram Sang2014-10-201-1/+0
| | | | | | | A platform_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
*-. Merge remote-tracking branches 'asoc/topic/simple', 'asoc/topic/sirf', ↵Mark Brown2014-10-061-1/+0
|\ \ | | | | | | | | | 'asoc/topic/spdif', 'asoc/topic/ssm2602' and 'asoc/topic/ssm4567' into asoc-next
| | * ASoC: fsl_spdif: Remove unused includes of linux/clk-private.hTomeu Vizoso2014-10-031-1/+0
| |/ | | | | | | | | Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: fsl-spdif: Convert to use regmap framework's endianness method.Xiubo Li2014-08-271-4/+1
|/ | | | | Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
*---. Merge remote-tracking branches 'asoc/topic/fsl', 'asoc/topic/fsl-asrc', ↵Mark Brown2014-08-041-40/+48
|\ \ \ | | | | | | | | | | | | 'asoc/topic/fsl-spdif' and 'asoc/topic/imx-audmux' into asoc-next
| | | * ASoC: fsl_spdif: Add support for output sample rates 96kHz and 192kHzAnssi Hannula2014-06-171-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for the output sample rates 96kHz and 192kHz. Tested with a Cubox-i imx6 system and an Onkyo TX-SR607 receiver. Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| | | * ASoC: fsl_spdif: Improve coding styleNicolin Chen2014-06-171-37/+35
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | 1) Apply better indentations 2) Drop braces for single statement. 3) Use simpler ternary to reduce code. Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| * | ASoC: fsl_spdif: Add stream names for DPCM usageNicolin Chen2014-07-311-0/+2
| |/ | | | | | | | | | | | | | | | | | | DPCM needs extra dapm routes in the machine driver to route audio between Front-End and Back-End. In order to differ the stream names in the route map from CODECs, we here add specific stream names to SPDIF driver so that we can implement ASRC via DPCM to it. Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* | ASoC: fsl_spdif: Fix integer overflow when calculating divisorsAnssi Hannula2014-06-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The calculation code does u64 = (u32 - u32) * 100000; The 64 bits are of no help here as the type is casted only after the multiplication, and therefore the result may overflow, possibly causing inoptimal or wrong clock setup in an unfortunate case (the maximum result value of the first substraction is currently 47999). Fix the code to cast before multiplication. Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi> Acked-by: Nicolin Chen <Guangyu.Chen@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* | ASoC: fsl_spdif: Fix incorrect usage of regmap_read()Nicolin Chen2014-06-091-1/+1
|/ | | | | | | | | We should not copy the return value into this val since it's supposed to get the value of the register not the success result of regmap_read(). Thus fix it. Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
*-. Merge remote-tracking branches 'asoc/topic/devm', 'asoc/topic/fsl', ↵Mark Brown2014-05-221-50/+136
|\ \ | | | | | | | | | 'asoc/topic/fsl-esai', 'asoc/topic/fsl-sai', 'asoc/topic/fsl-spdif' and 'asoc/topic/fsl-ssi' into asoc-next
| | * ASoc: fsl_spdif: Add descriptions for fsl_spdif_privNicolin Chen2014-05-051-0/+21
| | | | | | | | | | | | | | | | | | | | | Other people would clearly understand each member and improve if they want. Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| | * ASoC: fsl_spdif: Print actual sample rate for debugNicolin Chen2014-05-051-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | People would simply know what the driver gets the best for the current sample rate playback. Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| | * ASoC: fsl_spdif: Add sysclk df support to derive txclk from sysclkNicolin Chen2014-05-051-30/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The sysclk is one the clock sources that could be selected to derive tx clock. But the route for sysclk is a bit different that it does not only contain txclk df divider but also have an extra sysclk df. So this patch mainly adds syclk df configuration support so as to let the driver be able to get clock from sysclk. Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| | * ASoC: fsl_spdif: Rename all _div to _dfNicolin Chen2014-05-051-21/+20
| | | | | | | | | | | | | | | | | | | | | | | | We should have used _df by following the reference manual at the beginning. So this patch just renames them. Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| | * ASoC: fsl_spdif: Use clk_set_rate() for spdif root clock onlyNicolin Chen2014-05-051-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The clock mux for the Freescale S/PDIF controller has eight clock sources while most of them are from other moudles and even system clocks that do not allow a rate-changing operation. So we here only allow the clk_set_rate() and clk_round_rate() happened to spdif root clock, the private clock for S/PDIF controller. Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| | * ASoC: fsl_spdif: Fix clock source for rxclk rate measurementNicolin Chen2014-04-291-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | The rxclk rate actually uses sysclk, ipg clock for example, as its reference clock to calculate it. But the driver currently doesn't pass a correct clock source. So fix it. Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| | * ASoC: fsl_spdif: Add core clock control for DMA accessNicolin Chen2014-04-241-1/+21
| |/ |/| | | | | | | | | | | | | | | | | Regmap is able to enable/disable the core clock automatically each time it's going to access the registers. But for DMA cases during playback or recording, it's totally beyong control of regmap. So we have to open the clock manually. Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| * ASoC: spdif: Add VF610+ compatibles support.Xiubo Li2014-04-141-0/+1
| | | | | | | | | | | | Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Acked-by: Nicolin Chen <Guangyu.Chen@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| * ASoC: spdif: Sort the header files alphabetically.Xiubo Li2014-04-141-4/+4
|/ | | | | | Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Acked-by: Nicolin Chen <Guangyu.Chen@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
*-. Merge remote-tracking branches 'asoc/topic/da7213', 'asoc/topic/da732x', ↵Mark Brown2014-03-121-3/+6
|\ \ | | | | | | | | | 'asoc/topic/da9055', 'asoc/topic/davinci', 'asoc/topic/fsl', 'asoc/topic/fsl-esai', 'asoc/topic/fsl-sai' and 'asoc/topic/fsl-spdif' into asoc-next
| | * ASoC: fsl-spdif: big-endian supportXiubo Li2014-02-121-1/+4
| |/ |/| | | | | | | | | | | | | | | | | For most platforms, the CPU and SPDIF device is in the same endianess mode. While for the LS1 platform, the CPU is in LE mode and the SPDIF is in BE mode. Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Acked-by: Nicolin Chen <Guangyu.Chen@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| * ASoC: fsl: use snd_soc_dai_init_dma_data()Xiubo Li2014-02-031-2/+2
|/ | | | | | Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Acked-by: Nicolin Chen <Guangyu.Chen@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: fsl: Use devm_snd_dmaengine_pcm_register()Lars-Peter Clausen2013-12-021-8/+0
| | | | | | | Makes the code shorter. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
* Merge remote-tracking branch 'asoc/topic/fsl' into asoc-nextMark Brown2013-11-081-7/+2
|\
| * ASoC: fsl: fsl_spdif: No need to check the return value of ↵Fabio Estevam2013-11-041-5/+0
| | | | | | | | | | | | | | | | | | | | platform_get_resource() When using devm_ioremap_resource(), we do not need to check the return value of platform_get_resource(), so just remove it. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| * ASoC: fsl_spdif: fix return value check in fsl_spdif_probe()Wei Yongjun2013-10-261-2/+2
| | | | | | | | | | | | | | | | | | In case of error, the function platform_get_resource() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Mark Brown <broonie@linaro.org>
| * ASoC: fsl_spdif: Remove redundant semicolonSachin Kamat2013-09-171-2/+2
| | | | | | | | | | | | | | Redundant semicolon at the end of brace is removed. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Mark Brown <broonie@linaro.org>
* | ASoC: fsl_spdif: Use devm_snd_soc_register_componentSachin Kamat2013-09-191-11/+3
|/ | | | | | | devm_snd_soc_register_component makes code simpler. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: fsl_spdif: Staticse non-exported symbolsMark Brown2013-09-011-4/+4
| | | | | Signed-off-by: Mark Brown <broonie@linaro.org> Acked-by: Nicolin Chen <B42378@freescale.com>
* ASoC: fsl: Add wrapping for dev_dbg() in fsl_spdif.cNicolin Chen2013-08-301-2/+2
| | | | | | | Add wrapping '\n' for dev_dbg() in fsl_spdif.c Signed-off-by: Nicolin Chen <b42378@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: fsl_spdif: remove redundant dev_err call in fsl_spdif_probe()Wei Yongjun2013-08-291-3/+1
| | | | | | | | | There is a error message within devm_ioremap_resource already, so remove the dev_err call to avoid redundant error message. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: fsl_spdif: Reduce the noise on commentsFabio Estevam2013-08-261-7/+1
| | | | | | | | | | Remove the "====" pattern to let the comments cleaner and more uniform. Also, do not use multi-line style for a single line comment. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Acked-by: Nicolin Chen <b42378@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: fsl_spdif: Remove unnecessary dev_set_drvdata()Fabio Estevam2013-08-261-4/+1
| | | | | | | | | Driver core clears the driver data to NULL after device_release or on probe failure, so just remove it from here. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Reviewed-by: Nicolin Chen <b42378@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: fsl: Add S/PDIF CPU DAI driverNicolin Chen2013-08-221-0/+1236
This patch implements a device-tree-only CPU DAI driver for Freescale S/PDIF controller that supports stereo playback and record feature. Signed-off-by: Nicolin Chen <b42378@freescale.com> Acked-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Mark Brown <broonie@linaro.org>
OpenPOWER on IntegriCloud