summaryrefslogtreecommitdiff
path: root/sound/soc/sh/fsi.c
AgeCommit message (Collapse)Author
2012-11-06ASoC: fsi: add master clock control functionsKuninori Morimoto
Current FSI driver required set_rate() platform callback function to set audio clock if it was master mode, because it seemed that CPG/FSI-DIV clocks calculation depend on platform/board/cpu. But it was calculable regardless of platform. This patch supports audio clock calculation method, but the sampling rate under 32kHz is not supported at this point. Old type set_rate() is still supported now, but it will be deleted on next version Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-11-01ASoC: fsi: care fsi_hw_start/stop() return valueKuninori Morimoto
Current FSI driver didn't care fsi_hw_start/stop() return value, and it causes WARNING() call if SNDRV_PCM_TRIGGER_START failed. This patch solved this issue Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-10-29ASoC: fsi: fsi_set_master_clk() was called from fsi_hw_xxx() onlyKuninori Morimoto
Current FSI driver is using fsi_set_master_clk() if it needs system clock. But this function was called from fsi_hw_shutdown()/fsi_dai_trigger()/fsi_resume() without a sense of unity. Because of this, sound playback after suspend failed sometimes. To keep consistency, fsi_master_clk() was called from fsi_hw_start/stop() only now. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-10-15ASoC: fsi: use devm_request_irq()Kuninori Morimoto
This patch uses devm_request_irq() instead of request_irq() and removed free_irq() from driver Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-10-15ASoC: fsi: fixup channels_min/maxKuninori Morimoto
FSI can support 1 - 8 channel input/output, but current driver is supporting 2 channel format only. This patch fixes channel mismatch Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-10-09ASoC: fsi: don't reschedule DMA from an atomic contextGuennadi Liakhovetski
shdma doesn't support transfer re-scheduling or triggering from callbacks or from atomic context. The fsi driver issues DMA transfers from a tasklet context, which is a bug. To fix it convert tasklet to a work. Reported-by: Do Q.Thang <dq-thang@jinso.co.jp> Tested-by: Do Q.Thang <dq-thang@jinso.co.jp> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@vger.kernel.org
2012-09-10ASoC: fsi: convert to devm_xxx()Kuninori Morimoto
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-10ASoC: fsi: tidyup: remove un-necessary operation from fsi_probe()Kuninori Morimoto
struct fsi_master *master became member of struct fsi_priv from 71f6e0645be42f93c0f90dfcc93b9d2d277c2ee6 (ASoC: sh_fsi: avoid using global variable) So, master = NULL is not necessary on fsi_probe() now. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-10ASoC: fsi: fixup pm_runtime_disable() timing on fsi_probe()Kuninori Morimoto
pm_runtime_disable() error handling timing on fsi_probe() was wrong. This patch fixes it up. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-07-24Merge branch 'next' of git://git.infradead.org/users/vkoul/slave-dmaLinus Torvalds
Pull slave-dmaengine update from Vinod Koul: "This time we have a new dmaengine driver from the tegra folks. Also we have Guennadi's cleanup of sh drivers which incudes a library for sh drivers. And the usual odd fixes in bunch of drivers and some nice cleanup of dw_dmac from Andy." Fix up conflicts in drivers/mmc/host/sh_mmcif.c * 'next' of git://git.infradead.org/users/vkoul/slave-dma: (46 commits) dmaengine: Cleanup logging messages mmc: sh_mmcif: switch to the new DMA channel allocation and configuration dma: sh: provide a migration path for slave drivers to stop using .private dma: sh: use an integer slave ID to improve API compatibility dmaengine: shdma: prepare to stop using struct dma_chan::private sh: remove unused DMA device pointer from SIU platform data ASoC: siu: don't use DMA device for channel filtering dmaengine: shdma: (cosmetic) simplify a static function dmaengine: at_hdmac: add a few const qualifiers dw_dmac: use 'u32' for LLI structure members, not dma_addr_t dw_dmac: mark dwc_dump_lli inline dma: mxs-dma: Export missing symbols from mxs-dma.c dma: shdma: convert to the shdma base library ASoC: fsi: prepare for conversion to the shdma base library usb: renesas_usbhs: prepare for conversion to the shdma base library ASoC: siu: prepare for conversion to the shdma base library serial: sh-sci: prepare for conversion to the shdma base library mmc: sh_mobile_sdhi: prepare for conversion to the shdma base library mmc: sh_mmcif: remove unneeded struct sh_mmcif_dma, prepare to shdma conversion dma: shdma: prepare for conversion to the shdma base library ...
2012-07-13ASoC: fsi: prepare for conversion to the shdma base libraryGuennadi Liakhovetski
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Cc: Liam Girdwood <lrg@ti.com> Cc: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
2012-06-03ASoC: fsi: use PIO handler if DMA handler was invalidKuninori Morimoto
PIO handler is not good performance, but works on all platform. So, switch to PIO handler if DMA handler was invalid case. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-03ASoC: fsi: use dmaengine helper functionsKuninori Morimoto
This patch used dmaengine helper functions instead of using hand setting. And reduced local variables Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-30ASoC: fsi: bugfix: ensure dma is terminatedKuninori Morimoto
FSI DMAEngine has to be stopped certainly at the start/stop time. Without this patch, it will include noise on playback. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-30ASoC: fsi: bugfix: correct dma areaKuninori Morimoto
FSI driver is using dma_sync_single_xxx(), but the dma area was not correct. This patch fix it up. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-30ASoC: fsi: bugfix: enable master clock control on DMA streamKuninori Morimoto
DMA stream handler didn't care about master clock. This patch fixes it up. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-19ASoC: sh: fsi: enable chip specific data transfer modeKuninori Morimoto
SupherH FSI2 can use special data transfer, but it depends on CPU-FSI2 connection style. We can use 16bit data stream mode if it was valid connection, and it is required for 16bit data DMA transfer / SPDIF sound output. We can use 24bit data transfer if it was invalid connection. We can select connection type if CPU is SH7372, and it is always valid connection if latest SuperH. This patch adds new bus_option and fsi_bus_setup() for supporting these feature. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-19ASoC: sh: fsi: call fsi_hw_startup/shutdown from fsi_dai_trigger()Kuninori Morimoto
fsi_hw_startup/shutdown() needs the setup of bus width, but it is impossible to get parameter of snd_pcm_runtime at this timing. So, these functions are changed so that be called from fsi_dai_trigger(). Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-19ASoC: sh: fsi: use same format for IN/OUTKuninori Morimoto
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-19ASoC: sh: fsi: add fsi_version() and removed meaningless version checkKuninori Morimoto
This patch adds fsi_version() function for accessing version. And there were some meaningless version check which never hit. This patch removed it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-19ASoC: sh: fsi: use register field macro name on IN/OUT_DMACKuninori Morimoto
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-18ASoC: fsi: update for dmaengine prep_slave_sg fallout.Paul Mundt
Leading up to the ->device_prep_slave_sg change in 185ecb5f4fd43911c35956d4cc7d94a1da30417f 'dmaengine: add context parameter to prep_slave_sg and prep_dma_cyclic' a generic wrapper was added in place to guard against the API change, though the fsi driver wasn't updated in the process (presumably its dmaengine support hadn't been merged yet at the time). This trivially switches over to the new wrapper and gets it building again. Signed-off-by: Paul Mundt <lethal@linux-sh.org> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-19ASoC: fsi: Add DMAEngine supportKuninori Morimoto
This patch supports DMAEngine to FSI driver. It supports only Tx case at this point. If platform/cpu doesn't support DMAEngine, FSI driver will use PIO transfer. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-19Merge tag 'v3.3-rc4' into for-3.4 in order to resolve the conflictMark Brown
resolved below within the FSI driver and allow the application of the dmaeengine conversion that depends on this resolution. Linux 3.3-rc4 Conflicts: sound/soc/sh/fsi.c
2012-02-09ASoC: fsi: fixup fsi_pointer() calculation methodKuninori Morimoto
current fsi_pointer() calculation was not correct for FSI driver. This patch fix it up. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-03ASoC: fsi: add .init/.quit handler supportKuninori Morimoto
This is preparation for DMAEngine support Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-03ASoC: fsi: PortA/B information was controlled by sh_fsi_port_infoKuninori Morimoto
Current FSI got each PortA/B parameter by porta_flags/portb_flags from platform. And .set_rate function was shared for PortA/B. This structure was not readable and not flexible. This patch adds sh_fsi_port_info, and its own settings was added on each platform. it is preparation for DMAEngine support Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-03ASoC: fsi: fsi_stream_is_working() care substream->runtimeKuninori Morimoto
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-03ASoC: fsi: add .start_stop handler to fsi_stream_handlerKuninori Morimoto
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-03ASoC: fsi: don't use is_play as a parameter of fsi functionsKuninori Morimoto
is_play should be kept as local valuable. it prepare cleanup for DMAEngine support Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-03ASoC: fsi: tidyup: fsi_pio_xxx() are gatheredKuninori Morimoto
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-03ASoC: fsi: add fsi_stream_handler and PIO handlerKuninori Morimoto
This patch adds struct fsi_stream_handler and defined fsi_pio_push/pop_handler. these are controled by fsi_steam_xxx() function. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-03ASoC: fsi: use fsi_stream in fsi_get_current_fifo_samples() parameterKuninori Morimoto
fsi_get_current_fifo_samples() uses fsi_stream instead of is_play. This is just prepare cleanup for DMAEngine support. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-03ASoC: fsi: re-define fsi_is_play() and fsi_stream_is_play()Kuninori Morimoto
This patch re-define fsi_is_play() and fsi_stream_is_play(). fsi_data_pop/push() function keeps direct value of "is_play" at this point, but it will be removed soon. This is just prepare cleanup for DMAEngine support. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-03ASoC: fsi: modify fsi_pio_get_area() parameter and using positionKuninori Morimoto
This patch modify fsi_pio_get_area() parameter to use struct fsi_stream, and used it on fsi_fifo_data_ctrl(). This is just prepare cleanup for DMAEngine support. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-03ASoC: fsi: rename fsi_stream_push/pop() to fsi_stream_init/quit()Kuninori Morimoto
This is preparation for DMAEngine support Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-03ASoC: fsi: remove unnecessary parameter from fsi_hw_shutdown()Kuninori Morimoto
This is preparation for DMAEngine support Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-03ASoC: fsi: tidyup: move fsi_fifo_init() onto fsi_hw_startup()Kuninori Morimoto
fsi_fifo_init() is called only from fsi_hw_startup() Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-03ASoC: fsi: rename fsi_dma_soft_xxx() to fsi_pio_xxx()Kuninori Morimoto
This is preparation for DMAEngine support Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-03ASoC: fsi: data push/pop calculation part was dividedKuninori Morimoto
Next transfer data size of "push" and "pop" had calculated on shared function. But it was not readable code. This patch divided it into for push, and for pop. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-03ASoC: fsi: tidyup: fsi_stream_xx() functions were gatheredKuninori Morimoto
This patch gathered fsi_stream_xxx() functions in order to make it readable. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-03ASoC: fsi: reduce runtime calculation by using pre-settingKuninori Morimoto
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-31ASoC: fsi: Remove unneeded empty runtime PM callbacksMark Brown
The runtime PM core no longer requires any callbacks so don't provide empty ones for it any more. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-15ASoC: Use core pm_runtime callbacks for fsiMark Brown
Now that the core holds a pm_runtime reference to the device while the link is active there is no need for the driver to do so. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-11-25ASoC: Convert sh directory to module_platform_driverAxel Lin
Factor out some boilerplate code. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-11-23ASoC: Constify snd_soc_dai_ops structsLars-Peter Clausen
Commit 1ee46ebd("ASoC: Make the DAI ops constant in the DAI structure") introduced the possibility to have constant DAI ops structures, yet this is barley used in both existing drivers and also new drivers being submitted, although none of them modifies its DAI ops structure. The later is not surprising since existing drivers are often used as templates for new drivers. So this patch just constifies all existing snd_soc_dai_ops structs to eliminate the issue altogether. The patch was generated with the following coccinelle semantic patch: // <smpl> @@ identifier ops; @@ -struct snd_soc_dai_ops ops = +const struct snd_soc_dai_ops ops = { ... }; // </smpl> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-11-08ASoC: fsi: add valid data position control supportKuninori Morimoto
FSI2 can control valid data position, like package in front/back or stream mode (16bit x 2). But current fsi driver is assuming it was in-back. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-11-08ASoC: fsi: fixup compile warningKuninori Morimoto
This patch fixup below warning ${linux}/sound/soc/sh/fsi.c:442:3:\ warning: passing argument 1 of '__fsi_reg_read' makes pointer\ from integer without a cast ${linux}/sound/soc/sh/fsi.c:517:3: \ warning: passing argument 1 of '__fsi_reg_write' makes pointer\ from integer without a cast ${linux}/sound/soc/sh/fsi.c:663:3: \ warning: passing argument 1 of '__fsi_reg_mask_set' makes pointer\ from integer without a cast Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-31sound: Add module.h to the previously silent sound usersPaul Gortmaker
Lots of sound drivers were getting module.h via the implicit presence of it in <linux/device.h> but we are going to clean that up. So fix up those users now. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2011-10-27Merge branch 'topic/asoc' into for-linusTakashi Iwai