summaryrefslogtreecommitdiff
path: root/sound/soc/sh/fsi.c
AgeCommit message (Collapse)Author
2017-10-04ASoC: fsi: Use of_device_get_match_data() helperGeert Uytterhoeven
Use the of_device_get_match_data() helper instead of open coding. Note that when used with DT, there's always a valid match. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-09-01Merge remote-tracking branches 'asoc/topic/dwc', 'asoc/topic/es8316', ↵Mark Brown
'asoc/topic/fsi', 'asoc/topic/fsl' and 'asoc/topic/hdmi' into asoc-next
2017-08-17ASoC: sh: make snd_pcm_hardware constBhumika Goyal
Make these const as they are only passed as the 2nd argument to the function snd_soc_set_runtime_hwparams, which is const. Done using Coccinelle. Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-08-14ASoC: fsi: Delete an error message for a failed memory allocation in fsi_probe()Markus Elfring
Omit an extra message for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-08-14ASoC: sh: constify snd_pcm_ops structuresArvind Yadav
snd_pcm_ops are not supposed to change at runtime. All functions working with snd_pcm_ops provided by <sound/soc.h> work with const snd_pcm_ops. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-08-14ASoC: sh: make snd_soc_platform_driver constBhumika Goyal
Make these const as they are either passed as the 2nd argument to the function devm_snd_soc_register_platform or snd_soc_register_platform, and the arguments are of type const. Done using Coccinelle. Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-07-17ASoC: fsi: constify dev_pm_ops structureGustavo A. R. Silva
This dev_pm_ops structure is only stored in the pm field of a device_driver structure. This field is declared const, so dev_pm_ops structures that have this property can be declared as const also. Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-17ASoC: fsi: Move inline fsi_stream_is_play() before useGeert Uytterhoeven
With gcc 4.1.2: sound/soc/sh/fsi.c:304: warning: ‘fsi_stream_is_play’ declared inline after being called sound/soc/sh/fsi.c:304: warning: previous declaration of ‘fsi_stream_is_play’ was here Move fsi_stream_is_play() up to fix this, removing the need for a forward declaration as well. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-21ASoC: sh: fix fsi build warnings for 64 bitArnd Bergmann
As this driver can now be compiled for ARM64, we get a new warning as a result of passing a DMA filter data pointer through an 'int': sound/soc/sh/fsi.c: In function 'fsi_dma_probe': sound/soc/sh/fsi.c:1372:24: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] shdma_chan_filter, (void *)io->dma_id, We already know that we only need the legacy filter function on arch/sh, so we can hide the legacy DMA interface function behind an #ifdef. This has the other advantage of no longer depending on the shdma_chan_filter function to be visible. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-16ASoC: fsi: Remove obsolete sh_fsi2 platform_device_id entryGeert Uytterhoeven
Since the removal of the r8a7740 legacy board code in commit 1fa59bda21c7fa36 ("ARM: shmobile: Remove legacy board code for Armadillo-800 EVA"), all former users of the "sh_fsi2" platform device name are only supported in generic DT-only ARM multi-platform builds. The driver doesn't need to match platform devices by name anymore, hence remove the corresponding platform_device_id entry. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-24Merge branch 'for-linus' of git://git.infradead.org/users/vkoul/slave-dmaLinus Torvalds
Pull slave-dmaengine updates from Vinod Koul: - new drivers for: - Ingenic JZ4780 controller - APM X-Gene controller - Freescale RaidEngine device - Renesas USB Controller - remove device_alloc_chan_resources dummy handlers - sh driver cleanups for peri peri and related emmc and asoc patches as well - fixes and enhancements spread over the drivers * 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma: (59 commits) dmaengine: dw: don't prompt for DW_DMAC_CORE dmaengine: shdmac: avoid unused variable warnings dmaengine: fix platform_no_drv_owner.cocci warnings dmaengine: pch_dma: fix memory leak on failure path in pch_dma_probe() dmaengine: at_xdmac: unlock spin lock before return dmaengine: xgene: devm_ioremap() returns NULL on error dmaengine: xgene: buffer overflow in xgene_dma_init_channels() dmaengine: usb-dmac: Fix dereferencing freed memory 'desc' dmaengine: sa11x0: report slave capabilities to upper layers dmaengine: vdma: Fix compilation warnings dmaengine: fsl_raid: statify fsl_re_chan_probe dmaengine: Driver support for FSL RaidEngine device. dmaengine: xgene_dma_init_ring_mngr() can be static Documentation: dma: Add documentation for the APM X-Gene SoC DMA device DTS binding arm64: dts: Add APM X-Gene SoC DMA device and DMA clock DTS nodes dmaengine: Add support for APM X-Gene SoC DMA engine driver dmaengine: usb-dmac: Add Renesas USB DMA Controller (USB-DMAC) driver dmaengine: renesas,usb-dmac: Add device tree bindings documentation dmaengine: edma: fixed wrongly initialized data parameter to the edma callback dmaengine: ste_dma40: fix implicit conversion ...
2015-04-01ASoC: fsi: mark several data structures as constUwe Kleine-König
A driver's platform_device_id and device data should and can be const. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-01ASoC: fsi: reorder code to make a forward declaration superfluousUwe Kleine-König
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-31ASoC: fsi: fix license specificationUwe Kleine-König
According to the file header only GPL v2 applies to it. Fix the MODULE_LICENSE parameter accordingly. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-22ASoC: fsi: constify of_device_id arrayFabian Frederick
of_device_id is always used as const. (See driver.of_match_table and open firmware functions) Signed-off-by: Fabian Frederick <fabf@skynet.be> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-02-23ASoC: fsi: Configure DMA slave settingsKuninori Morimoto
Current FSI driver is assuming that dst_addr/src_addr of DMAEngine will be set by platform data. But it should be set via dmaengine_slave_config(). Special thanks to Arnd Reported-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Acked-by: Mark Brown <broonie@kernel.org> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2015-02-23ASoC: fsi: remove slave_id settings for DMAEngineKuninori Morimoto
Current fsi sets dma_slave_config :: slave_id field for DMAEngine, but it is no longer needed. Let's remove it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Acked-by: Mark Brown <broonie@kernel.org> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2015-02-04Merge remote-tracking branches 'asoc/topic/rx51', 'asoc/topic/samsung', ↵Mark Brown
'asoc/topic/sh', 'asoc/topic/simple' and 'asoc/topic/sta32x' into asoc-next
2015-01-05ASoC: sh: Remove unnecessary snd_pcm_lib_preallocate_free_for_all()Lars-Peter Clausen
The ALSA core takes care that all preallocated memory is freed when the PCM itself is freed. There is no need to do this manually in the driver. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-05ASoC: fsi: Deletion of unnecessary checks before the function call "clk_enable"Markus Elfring
The clk_enable() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-12-08Merge remote-tracking branches 'asoc/topic/davinci', 'asoc/topic/doc', ↵Mark Brown
'asoc/topic/dpcm', 'asoc/topic/dwc' and 'asoc/topic/fsi' into asoc-next
2014-12-03ASoC: fsi: Deletion of unnecessary checks before the function call "clk_disable"Markus Elfring
The clk_disable() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-10-29ASoC: fsi: remove unsupported PAUSE flagKuninori Morimoto
FSI doesn't support PAUSE. Remove SNDRV_PCM_INFO_PAUSE flags from snd_pcm_hardware info Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
2014-08-17ASoC: sh: Fix dma direction typeLars-Peter Clausen
dmaengine_prep_slave_single() expects a enum dma_transfer_direction and not a enum dma_data_direction. Since the integer representations of both DMA_TO_DEVICE and DMA_MEM_TO_DEV aswell as DMA_FROM_DEVICE and DMA_DEV_TO_MEM have the same value the code worked fine even though it was using the wrong type. Fixes the following warnings from sparse: sound/soc/sh/fsi.c:1307:42: warning: mixing different enum types sound/soc/sh/fsi.c:1307:42: int enum dma_data_direction versus sound/soc/sh/fsi.c:1307:42: int enum dma_transfer_direction Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-08-04Merge remote-tracking branches 'asoc/topic/rt5670', 'asoc/topic/rt5677', ↵Mark Brown
'asoc/topic/s6000', 'asoc/topic/samsung' and 'asoc/topic/sh-fsi' into asoc-next
2014-06-28ASoC: fsi: use dmaengine_prep_dma_cyclic() for DMA transferKuninori Morimoto
Current FSI driver is using DMAEngine directly, but, ASoC is requesting to use common DMA transfer method, like snd_dmaengine_pcm_trigger() or dmaengine_pcm_ops. It is difficult to switch at this point, since Renesas driver is also supporting PIO transfer. This patch uses dmaengine_prep_dma_cyclic() instead of dmaengine_prep_slave_single(). It is used in requested method, and is good first step to switch over. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-06-28ASoC: fsi: add fsi_pointer_update() for common pointer methodKuninori Morimoto
fsi PIO/DMA handler are using each own pointer update method, but these can be share. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-06-28ASoC: fsi: use SNDRV_DMA_TYPE_DEV for sound bufferKuninori Morimoto
Current fsi driver is using SNDRV_DMA_TYPE_CONTINUOUS for snd_pcm_lib_preallocate_pages_for_all(). But, it came from original dma-sh7760.c, and no longer needed. This patch exchange its parameter, and removed original dma mapping and un-needed dma_sync_single_xxx() from driver. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-06-21ASoC: sh/fsi: Make one-bit bitfields unsignedLars-Peter Clausen
One-bit signed bitfields have two possible values: 0 and -1. This sometimes leads to unexpected results (e.g. foo.bar = 1; foo.bar == 1 => false) which is why it is recommended to make one-bit bitfields unsigned. This fixes the following sparse warnings: sound/soc/sh/fsi.c:267:25: error: dubious one-bit signed bitfield sound/soc/sh/fsi.c:268:22: error: dubious one-bit signed bitfield sound/soc/sh/fsi.c:269:20: error: dubious one-bit signed bitfield sound/soc/sh/fsi.c:270:28: error: dubious one-bit signed bitfield sound/soc/sh/fsi.c:271:26: error: dubious one-bit signed bitfield sound/soc/sh/fsi.c:272:25: error: dubious one-bit signed bitfield Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-14ASoC: fsi: fixup SND_SOC_DAIFMT_CBx_CFx flagsKuninori Morimoto
SND_SOC_DAIFMT_CBx_CFx means "codec" side master/slave mode. Then, FSI will be master mode if it was SND_SOC_DAIFMT_CBS_CFS. This patch fixup platform settings too. Then, it tidyups SND_SOC_DAIFMT_INV settings. Acked-by: Simon Horman <horms+renesas@verge.net.au> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-01-16Merge remote-tracking branches 'asoc/topic/adsp', 'asoc/topic/atmel', ↵Mark Brown
'asoc/topic/bcm2835', 'asoc/topic/docs', 'asoc/topic/fsl', 'asoc/topic/generic', 'asoc/topic/kirkwood', 'asoc/topic/mc13783', 'asoc/topic/mxs', 'asoc/topic/nuc900', 'asoc/topic/sai', 'asoc/topic/sh', 'asoc/topic/ssm2602', 'asoc/topic/tlv320aic3x', 'asoc/topic/twl4030', 'asoc/topic/ux500', 'asoc/topic/width' and 'asoc/topic/x86' into for-tiwai
2014-01-09ASoC: sh: Don't set unused struct snd_pcm_hardware fieldsLars-Peter Clausen
The ASoC core assumes that the PCM component of the ASoC card transparently moves data around and does not impose any restrictions on the memory layout or the transfer speed. It ignores all fields from the snd_pcm_hardware struct for the PCM driver that are related to this. Setting these fields in the PCM driver might suggest otherwise though, so rather not set them. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-11ASoC: fsi: remove original filter from fsi_dma_probe()Kuninori Morimoto
Remove original filter from fsi_dma_probe(), and use SH-DMA suitable filter. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-08-26ASoC: fsi: reserve prefetch period on DMA transferringKuninori Morimoto
Current FSI is supporting DMAEngine transfer, but, it needs to use work queue. Therefore, DMA transfer settings might be late if there is heavy task. This patch reserves next period beforehand on DMA transfer function. Android sound will be breaking up without this patch. Tested-by: Tomohito Esaki <etom@igel.co.jp> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-05-28ASoC: fsi: fixup sparse errorsKuninori Morimoto
This patch fixup below sparse errors ${LINUX}/sound/soc/sh/fsi.c:1459:9: \ error: incompatible types in conditional expression (different base types) ${LINUX}/sound/soc/sh/fsi.c:1634:25: \ error: incompatible types in conditional expression (different base types) ${LINUX}/sound/soc/sh/fsi.c:1639:17: \ error: incompatible types in conditional expression (different base types) ${LINUX}/sound/soc/sh/fsi.c:2093:9: \ error: incompatible types in conditional expression (different base types) ${LINUX}/sound/soc/sh/fsi.c:2105:9: \ error: incompatible types in conditional expression (different base types) Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-12Merge remote-tracking branch 'asoc/topic/fsi' into asoc-nextMark Brown
2013-03-15ASoC: fsi: use snd_soc_register_component() instead of snd_soc_register_dais()Kuninori Morimoto
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-13ASoC: fsi: remove unused irqKuninori Morimoto
FSI is using devm_request_irq() from 1ddd82868cc888e008ed520465c172a6cdddd689 (ASoC: fsi: use devm_request_irq()) master->irq is no longer needed. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-01-16ASoC: fsi: Remove __devinitconstThierry Reding
__devinitconst and friends have recently been removed and must not be used anymore. Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-01-14ASoC: fsi: add device tree supportKuninori Morimoto
Support for loading the Renesas FSI driver via devicetree. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-01-03ASoC: fsi: don't use platform info pointer on probe()Kuninori Morimoto
Current FSI driver is using platform info pointer, but it is not good design for DT support. This patch made it not to use platform info pointer. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-12-24ASoC: fsi: remove SH_FSI_xxx_INV flagsKuninori Morimoto
3449f5fab8c51e37a8a48bc2516588c615373191 (ASoC: fsi: add SND_SOC_DAIFMT_INV_xxx support) added clock inversion support via snd_soc_dai_set_fmt(). Thus, this patch removed SH_FSI_xxx_INV and fsi_get_info() from fsi driver, and modified platform settings to use new style. Then, it cleaned up meaningless settings from platform. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Acked-by: Simon Horman <horms+renesas@verge.net.au> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-12-24ASoC: fsi: remove platform depended .set_rate() callback supportKuninori Morimoto
ab6f6d85210c4d0265cf48e9958c04e08595055a (ASoC: fsi: add master clock control functions) added driver level clock control functions. And now, platform depended .set_rate() is no longer needed. This patch removed unnecessary .set_rate() platform callback support. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-12-02Merge remote-tracking branch 'asoc/topic/fsi' into asoc-nextMark Brown
2012-11-20ASoC: fsi: add SND_SOC_DAIFMT_INV_xxx supportKuninori Morimoto
Current FSI driver is using platform information pointer, but it is not good design for DT support. This patch adds SND_SOC_DAIFMT_INV_xxx support, and it is possible to independent from platform information pointer. Old type SH_FSI_xxx_INV is still supported, but it will be removed soon. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-11-20ASoC: fsi: stream mode become independent from platform flagsKuninori Morimoto
Current FSI driver is using platform information pointer, but it is not good design for DT support. This patch makes stream mode format independent from platform information pointer. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-11-20ASoC: fsi: master clock selection become independent from platform flagsKuninori Morimoto
Current FSI driver is using platform information pointer, but it is not good design for DT support. This patch makes master clock selection independent from platform information pointer. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-11-20ASoC: fsi: SPDIF format become independent from platform flagsKuninori Morimoto
Current FSI driver is using platform information pointer, but it is not good design for DT support. This patch makes spdif format independent from platform information pointer. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-11-20ASoC: fsi: tidyup sh_fsi_platform_info pointerKuninori Morimoto
Current FSI driver is requesting sh_fsi_platform_info pointer from platform, and it didn't allowed NULL pointer. This patch fixes it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-11-20ASoC: fsi: tidyup FSIA/B settingsKuninori Morimoto
This patch tidyup to use fsi pointer for FSIA/B settings Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>