summaryrefslogtreecommitdiffstats
path: root/sound/soc/sh/fsi.c
Commit message (Collapse)AuthorAgeFilesLines
* ASoC: fsi: don't reschedule DMA from an atomic contextGuennadi Liakhovetski2012-10-091-7/+8
| | | | | | | | | | | | 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
* ASoC: fsi: convert to devm_xxx()Kuninori Morimoto2012-09-101-17/+8
| | | | | Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: fsi: tidyup: remove un-necessary operation from fsi_probe()Kuninori Morimoto2012-09-101-1/+0
| | | | | | | | | | | 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>
* ASoC: fsi: fixup pm_runtime_disable() timing on fsi_probe()Kuninori Morimoto2012-09-101-1/+1
| | | | | | | | 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>
* Merge branch 'next' of git://git.infradead.org/users/vkoul/slave-dmaLinus Torvalds2012-07-241-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 ...
| * ASoC: fsi: prepare for conversion to the shdma base libraryGuennadi Liakhovetski2012-07-131-2/+2
| | | | | | | | | | | | | | | | 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>
* | ASoC: fsi: use PIO handler if DMA handler was invalidKuninori Morimoto2012-06-031-9/+20
| | | | | | | | | | | | | | | | 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>
* | ASoC: fsi: use dmaengine helper functionsKuninori Morimoto2012-06-031-15/+4
|/ | | | | | | | 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>
* ASoC: fsi: bugfix: ensure dma is terminatedKuninori Morimoto2012-05-301-0/+2
| | | | | | | | 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>
* ASoC: fsi: bugfix: correct dma areaKuninori Morimoto2012-05-301-9/+9
| | | | | | | | | 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>
* ASoC: fsi: bugfix: enable master clock control on DMA streamKuninori Morimoto2012-05-301-0/+5
| | | | | | | | 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>
* ASoC: sh: fsi: enable chip specific data transfer modeKuninori Morimoto2012-05-191-34/+143
| | | | | | | | | | | | | | | | | | 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>
* ASoC: sh: fsi: call fsi_hw_startup/shutdown from fsi_dai_trigger()Kuninori Morimoto2012-05-191-2/+5
| | | | | | | | | 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>
* ASoC: sh: fsi: use same format for IN/OUTKuninori Morimoto2012-05-191-16/+6
| | | | | Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: sh: fsi: add fsi_version() and removed meaningless version checkKuninori Morimoto2012-05-191-18/+8
| | | | | | | | | | 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>
* ASoC: sh: fsi: use register field macro name on IN/OUT_DMACKuninori Morimoto2012-05-191-2/+2
| | | | | Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: fsi: update for dmaengine prep_slave_sg fallout.Paul Mundt2012-04-181-4/+3
| | | | | | | | | | | | | | 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>
* ASoC: fsi: Add DMAEngine supportKuninori Morimoto2012-02-191-0/+232
| | | | | | | | | | 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>
* Merge tag 'v3.3-rc4' into for-3.4 in order to resolve the conflictMark Brown2012-02-191-5/+1
|\ | | | | | | | | | | | | | | | | | | 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
| * ASoC: fsi: fixup fsi_pointer() calculation methodKuninori Morimoto2012-02-091-5/+1
| | | | | | | | | | | | | | | | 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>
* | ASoC: fsi: add .init/.quit handler supportKuninori Morimoto2012-02-031-0/+4
| | | | | | | | | | | | | | 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>
* | ASoC: fsi: PortA/B information was controlled by sh_fsi_port_infoKuninori Morimoto2012-02-031-16/+16
| | | | | | | | | | | | | | | | | | | | | | 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>
* | ASoC: fsi: fsi_stream_is_working() care substream->runtimeKuninori Morimoto2012-02-031-4/+2
| | | | | | | | | | Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | ASoC: fsi: add .start_stop handler to fsi_stream_handlerKuninori Morimoto2012-02-031-22/+29
| | | | | | | | | | Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | ASoC: fsi: don't use is_play as a parameter of fsi functionsKuninori Morimoto2012-02-031-49/+45
| | | | | | | | | | | | | | | | 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>
* | ASoC: fsi: tidyup: fsi_pio_xxx() are gatheredKuninori Morimoto2012-02-031-52/+49
| | | | | | | | | | Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | ASoC: fsi: add fsi_stream_handler and PIO handlerKuninori Morimoto2012-02-031-15/+118
| | | | | | | | | | | | | | | | 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>
* | ASoC: fsi: use fsi_stream in fsi_get_current_fifo_samples() parameterKuninori Morimoto2012-02-031-3/+7
| | | | | | | | | | | | | | | | 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>
* | ASoC: fsi: re-define fsi_is_play() and fsi_stream_is_play()Kuninori Morimoto2012-02-031-5/+10
| | | | | | | | | | | | | | | | | | | | 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>
* | ASoC: fsi: modify fsi_pio_get_area() parameter and using positionKuninori Morimoto2012-02-031-26/+17
| | | | | | | | | | | | | | | | | | 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>
* | ASoC: fsi: rename fsi_stream_push/pop() to fsi_stream_init/quit()Kuninori Morimoto2012-02-031-4/+4
| | | | | | | | | | | | | | 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>
* | ASoC: fsi: remove unnecessary parameter from fsi_hw_shutdown()Kuninori Morimoto2012-02-031-4/+2
| | | | | | | | | | | | | | 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>
* | ASoC: fsi: tidyup: move fsi_fifo_init() onto fsi_hw_startup()Kuninori Morimoto2012-02-031-55/+54
| | | | | | | | | | | | | | 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>
* | ASoC: fsi: rename fsi_dma_soft_xxx() to fsi_pio_xxx()Kuninori Morimoto2012-02-031-14/+14
| | | | | | | | | | | | | | 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>
* | ASoC: fsi: data push/pop calculation part was dividedKuninori Morimoto2012-02-031-59/+45
| | | | | | | | | | | | | | | | | | 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>
* | ASoC: fsi: tidyup: fsi_stream_xx() functions were gatheredKuninori Morimoto2012-02-031-58/+57
| | | | | | | | | | | | | | 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>
* | ASoC: fsi: reduce runtime calculation by using pre-settingKuninori Morimoto2012-02-031-6/+5
| | | | | | | | | | Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | ASoC: fsi: Remove unneeded empty runtime PM callbacksMark Brown2012-01-311-14/+0
|/ | | | | | | 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>
* ASoC: Use core pm_runtime callbacks for fsiMark Brown2011-12-151-4/+0
| | | | | | | 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>
* ASoC: Convert sh directory to module_platform_driverAxel Lin2011-11-251-12/+1
| | | | | | | Factor out some boilerplate code. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Constify snd_soc_dai_ops structsLars-Peter Clausen2011-11-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | 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>
* ASoC: fsi: add valid data position control supportKuninori Morimoto2011-11-081-0/+15
| | | | | | | | | 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>
* ASoC: fsi: fixup compile warningKuninori Morimoto2011-11-081-3/+3
| | | | | | | | | | | | | | | | | 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>
* sound: Add module.h to the previously silent sound usersPaul Gortmaker2011-10-311-0/+1
| | | | | | | | 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>
* Merge branch 'topic/asoc' into for-linusTakashi Iwai2011-10-271-5/+5
|\
| * ASoC: sh: use correct __iomem annotationsArnd Bergmann2011-10-021-5/+5
| | | | | | | | | | | | | | | | This removes a few unnecessary type casts and avoids sparse warnings. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | sound: irq: Remove IRQF_DISABLEDYong Zhang2011-09-221-1/+1
|/ | | | | | | | | | | | | | | Since commit [e58aa3d2: genirq: Run irq handlers with interrupts disabled], We run all interrupt handlers with interrupts disabled and we even check and yell when an interrupt handler returns with interrupts enabled (see commit [b738a50a: genirq: Warn when handler enables interrupts]). So now this flag is a NOOP and can be removed. Signed-off-by: Yong Zhang <yong.zhang0@gmail.com> Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ASoC: core - Optimise and refactor pcm_new() to pass only rtdLiam Girdwood2011-06-071-3/+3
| | | | | | | | | | Currently pcm_new() passes in 3 arguments :- card, pcm and DAI. Refactor this to only pass in 1 argument (i.e. the rtd) since struct rtd contains card, pcm and DAI along with other members too that are useful too. Signed-off-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: sh: fsi: add fsi_hw_startup/shutdownKuninori Morimoto2011-05-241-14/+29
| | | | | | | | This patch is preparation of cleanup suspend/resume patch. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: sh: fsi: cleanup suspend/resumeKuninori Morimoto2011-05-241-55/+42
| | | | | | | | | | | | | | | Current FSI driver was using saved_xxx variable for suspend/resume. OTOH, the start and stop of power/clock are controlled by fsi_hw_startup/fsi_hw_shutdown in current FSI driver. The all necessary registers value are set by fsi_hw_startup. So, if fsi_hw_shutdown is called when "suspend" is generated, and fsi_hw_startup is called at "resume", the saved_xxx are not needed. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>