summaryrefslogtreecommitdiffstats
path: root/sound/soc/sh/rcar/gen.c
Commit message (Collapse)AuthorAgeFilesLines
...
* ASoC: rsnd: add recovery support for under/over flow error on SRCKuninori Morimoto2015-01-121-0/+15
| | | | | | | | | L/R channel will be switched if under/over flow error happen on Renesas R-Car sound device by the HW bugs. Then, HW restart is required for salvage. This patch add salvage support for SRC. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: rsnd: Add Volume Ramp supportKuninori Morimoto2014-11-101-0/+3
| | | | | | | | | | | | | | | This patch adds Volume Ramp to Renesas sound driver. amixer set "DVC Out" 100% amixer set "DVC Out Ramp Up Rate" "0.125 dB/64 steps" amixer set "DVC Out Ramp Down Rate" "0.125 dB/512 steps" amixer set "DVC Out Ramp" on aplay xxx.wav & amixer set "DVC Out" 80% // Volume Down amixer set "DVC Out" 100% // Volume Up Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: rsnd: tidyup debug message format and timingKuninori Morimoto2014-11-101-3/+3
| | | | | | | | | | | | Current Renesas R-Car sound driver debug message is using random format (ex "ssi0: xxx" / "SSI0 xxx" / "ssi[0]: xxx") and confusable timing ("xxx probe failed" and "xxx probed" are shown in same time) This patch fixes these Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: rsnd: tidyup debug information when read/writeKuninori Morimoto2014-10-221-7/+20
| | | | | | | | | | | | | | b8c637864a6904a9ba8e0df556d5bdf9f26b2c54 (ASoC: rsnd: use regmap_mmio instead of original regmap bus) added regmap_mmio support on Renesas R-Car sound driver. Then, debug information of register read/write indicates regmap index, not register address. This is a little bit confusable information. This patch tidyup debug message, and added regmap debug hint on comment area. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: rcar: Use && instead of & for boolean expressionsLars-Peter Clausen2014-08-171-1/+1
| | | | | | | | | | | | | Sparse spits out the following warning: sound/soc/sh/rcar/gen.c:250:21: warning: dubious: x & !y It does this because sometimes mixing boolean and bit-wise logic has not the intended result. In this case we are fine, but replacing the bit-wise '&' with the boolean '&&' silences the sparse warning. The generated code for both cases is the same. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: rsnd: add missing dev_dbg() in rsnd_bset()Kuninori Morimoto2014-07-311-0/+4
| | | | | | | | | | b8c637864a6904a9ba8e0df556d5bdf9f26b2c54 (ASoC: rsnd: use regmap_mmio instead of original regmap bus) used regmap_mmio and modified dev_dbg() for rsnd_read/write(). But rsnd_bset() is missing it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: rsnd: care audio local bus data format consistencyKuninori Morimoto2014-07-311-0/+1
| | | | | | | | | | | | R-Car sound uses Audio Local Bus which uses Lch/Rch format. This bus is used if driver uses BUSIF. But sound data is written as Rch/Lch format in register. This means Rch <-> Lch will be inverted. SSIU :: BUSIF_DALIGN is used to controlling data format. Reported-by: Jun Watanabe <jun.watanabe.ue@renesas.com> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: rsnd: use regmap_mmio instead of original regmap busKuninori Morimoto2014-07-291-251/+188
| | | | | | | | | | | Current rsnd driver is using regmap and regmap_field. It used original regmap bus which is single regmap instance for multi register mapping. This patch modifies it to use regmap_mmio bus, and tidyuped probe method Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: rsnd: DMA cleanup for flexible SSI/SRC selectionKuninori Morimoto2014-07-021-40/+31
| | | | | | | | | | | Current R-Car sound SSI/SRC/DVC selection has feature limit. (It is assuming that SSI/SRC are using same index number) So that enabling SSI/SRC flexible selection, this patch modifies DMA settings. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: rsnd: SSI + DMA can select BUSIFKuninori Morimoto2014-06-281-23/+41
| | | | | | | | | | | | | | | | | | | | | Sound data needs to be sent to R-Car sound SSI when playback. But, there are 2 interfaces for it. 1st is SSITDR/SSIRDR which are mapped on SSI. 2nd is SSIn_BUSIF which are mapped on SSIU. 2nd SSIn_BUSIF is used when DMA transfer, and it is always used if sound data came from via SRC. But, we can use it when SSI+DMA case too. (Current driver is assuming 1st SSITDR/SSIRDR for it) 2nd SSIn_BUSIF can be used as FIFO. This is very helpful/useful for SSI+DMA. But DMA address / DMA ID are not same between 1st/2nd cases. This patch care about these settings. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: rsnd: fixup rsnd_gen_dma_addr() for Gen1Kuninori Morimoto2014-06-181-12/+21
| | | | | | | | | | | | | | | ad32d0c7b0e993433df152ae747652647eb65a27 (ASoC: rsnd: add rsnd_gen_dma_addr() for DMAC addr) added rsnd_gen_dma_addr() to calculate DMA addr, but, it is necessary only for Gen2. This patch ignores Gen1 case. Kernel will be panic without this patch. Special thanks to Simon Reported-by: Simon Horman <horms@verge.net.au> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Tested-by: Simon Horman <horms+renesas@verge.net.au> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: rsnd: add rsnd_gen_dma_addr() for DMAC addrKuninori Morimoto2014-05-261-0/+95
| | | | | | | | | The DMAC src/dst addr needs to be set from driver when DT case. (It was set from SoC/DMAEngine code when non-DT case) This patch adds rsnd_gen_dma_addr() to set DMAC src/dst addr. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: rsnd: Fix warnings due to improper printk formatsLaurent Pinchart2014-05-151-7/+7
| | | | | | | | | | Use the %pap printk specifier to print resource_size_t variables. This fixes warnings on platforms where resource_size_t has a different size than int. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: rsnd: add DVC supportKuninori Morimoto2014-05-131-0/+11
| | | | | | | | This patch adds DVC (Digital Volume Controller) support which is member of CMD unit. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: rsnd: add DeviceTree supportKuninori Morimoto2014-03-211-0/+15
| | | | | | | Support for loading the Renesas R-Car sound driver via DeviceTree. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: rsnd: remove all rsnd_xxx_remove()Kuninori Morimoto2014-03-051-5/+0
| | | | | | | | Now, rsnd_xxx_remove() do nothing. remove these Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: rsnd: remove unused SSI_CONTROLKuninori Morimoto2014-03-041-1/+0
| | | | | Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: rsnd: run rsnd_path_init() when probe() timingKuninori Morimoto2014-03-041-56/+0
| | | | | | | | | | | Current rsnd SSIU/SSI/SCU/SRU path is set when playback/capture starts up. But it is meaningless method, since the path is based on platform and can be set in probe() timing. This patch sets the path on probe() timing. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: rsnd: remove verbose function parameterKuninori Morimoto2014-03-031-5/+2
| | | | | | | | priv has rcar_snd_info pointer. having priv and info in same time is verbose. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: rsnd: set DIV_EN register on rsnd_adg_set_convert_clk_gen2()Kuninori Morimoto2014-02-121-0/+1
| | | | | | | DIV_EN register enable bit is required when you use Gen2 SRC Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: rsnd: add Gen2 SRC and DMAEngine supportKuninori Morimoto2014-02-031-0/+26
| | | | | | | | | | | | | | Renesas sound Gen2 has SRC (= Sampling Rate Converter) which needs 2 DMAC. The data path image when you use SRC on Gen2 is [mem] -> Audio-DMAC -> SRC -> Audio-DMAC-peri-peri -> SSIU -> SSI This patch support SRC and DMAEnine. It is tested on R-Car H2 Lager board Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: rsnd: SCU should be called before SSIKuninori Morimoto2014-02-031-4/+4
| | | | | Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: rsnd: fixup Gen2 module namingKuninori Morimoto2014-02-031-1/+1
| | | | | | | Gen2 has SCU, not SRU Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: rsnd: tidyup register naming of BUSIF_MODEKuninori Morimoto2014-02-031-1/+1
| | | | | | | | | Gen1:SRU has only 1 BUSIF_MODE, but Gen2:SSIU/SCU has SRCm_BUSIF_MODE, and SSIn_BUSIF_MODE. This patch rename current BUSIF_MODE to SRC_BUSIF_MODE. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: rsnd: add SRC (Sampling Rate Converter) supportKuninori Morimoto2013-12-311-0/+10
| | | | | | | | | | | | This patch adds SRC support to Renesas sound driver. SRC converts sampling rate between codec <-> cpu. It needs special codec chip, or very simple DA/AD converter to use it. This patch was tested via ak4554 codec, and supports Gen1 only at this point. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: rsnd: tidyup register namingKuninori Morimoto2013-12-311-2/+2
| | | | | | | Use correct register name which appears in the datasheet Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: rsnd: gen: fixup Gen2 channel sizeKuninori Morimoto2013-12-101-2/+2
| | | | | | | Gen2 has 0 - 9, total 10 channels, not 9 channels. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: rcar: add Gen2 sound supportKuninori Morimoto2013-11-291-5/+86
| | | | | | | | This patch adds Gen2 sound support for Renesas R-Car. But, it is supporting PIO transfer only at this point Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: rcar: remove rcar_gen_opsKuninori Morimoto2013-11-291-27/+6
| | | | | | | | | | | Current rcar driver gen.c is using rcar_gen_ops which was made with the assumption that Gen1 and Gen2 need different behavior. but it was not needed. This patch removes unnecessary complex method. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: rcar: remove .path_init/exit from rsnd_gen_opsKuninori Morimoto2013-11-291-39/+15
| | | | | | | | | | | | rsnd_gen_ops has .path_init/exit callback function which cares SRU/SSI (if Gen1) SCU/SSIU/SSI (if Gen2) path settings. But, the differences between Gen1/Gen2 are cared in ssi.c/scu.c, and the path itself is same in Gen1/Gen2. This patch removes .path_init/exit callback. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: rcar: add rsnd_is_accessible_reg()Kuninori Morimoto2013-11-291-0/+26
| | | | | | | | | | | | Current rcar driver is supporting Gen1, and Gen2 will be supported soon. Then, some registers are used from Gen1 only, or from Gen2 only. To avoid NULL pointer access, this patch adds register accessible check function. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: rcar: separate regmap init common fieldKuninori Morimoto2013-11-291-21/+28
| | | | | | | | | | The repmap initialization difference between Gen1/Gen2 is only register offset. This patch separates rsnd_gen1_regmap_init() into common part and Gen1 specific part. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: rcar: remove unused register settingsKuninori Morimoto2013-11-291-3/+0
| | | | | | | AUDIO_CLK_SEL4/5 are not used Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: rsnd: use regmap instead of original register mapping methodKuninori Morimoto2013-09-241-81/+143
| | | | | | | | | Current Linux kernel is supporting regmap/regmap_field, and, it is good match for Renesas Sound Gen1/Gen2 register mapping. This patch uses regmap instead of original method for register access Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: rsnd: gen: rsnd_gen_ops cares .probe and .removeKuninori Morimoto2013-09-171-17/+24
| | | | | | | | | Current rsnd_gen_ops didn't care about .probe and .remove functions, but it was not good sense. This patch tidyup it Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: rsnd: SSI supports DMA transfer via BUSIFKuninori Morimoto2013-08-061-3/+7
| | | | | | | | | This patch adds BUSIF support for R-Car sound DMAEngine transfer. The sound data will be transferred via FIFO which can cover blank time which will happen when DMA channel is switching. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: rsnd: remove platform dai and add dai_id on platform settingKuninori Morimoto2013-08-061-5/+5
| | | | | | | | | | | | Current rsnd driver is using struct rsnd_dai_platform_info so that indicate sound DAI information (playback/capture SSI ID). But, SSI settings were also required separately. Thus, platform settings was very un-understandable. This patch adds dai_id to SSI settings, and removed rsnd_dai_platform_info. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: rcar: fix return value check in rsnd_gen1_probe()Wei Yongjun2013-07-311-13/+4
| | | | | | | | | | | In case of error, the function devm_ioremap_resource() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(), and also remove the dev_err call to avoid redundant error message. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: add Renesas R-Car SSI featureKuninori Morimoto2013-07-281-2/+22
| | | | | | | | | | | | | | Renesas R-Car series sound circuit consists of SSI and its peripheral. But this peripheral circuit is different between R-Car Generation1 (E1/M1/H1) and Generation2 (E2/M2/H2) (Actually, there are many difference in Generation1 chips) As 1st protype, this patch adds SSI feature on this driver. But, it is PIO sound playback support only at this point. The DMA transfer, and capture feature will be supported in the future Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: add Renesas R-Car ADG featureKuninori Morimoto2013-07-281-2/+18
| | | | | | | | | | | | Renesas R-Car series sound circuit consists of SSI and its peripheral. But this peripheral circuit is different between R-Car Generation1 (E1/M1/H1) and Generation2 (E2/M2/H2) (Actually, there are many difference in Generation1 chips) This patch adds ADG feature which controls sound clock Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: add Renesas R-Car SCU featureKuninori Morimoto2013-07-281-0/+95
| | | | | | | | | | | | | Renesas R-Car series sound circuit consists of SSI and its peripheral. But this peripheral circuit is different between R-Car Generation1 (E1/M1/H1) and Generation2 (E2/M2/H2) (Actually, there are many difference in Generation1 chips) This patch adds SCU feature on this driver. But, it defines SCU style only, does nothing at this point. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: add Renesas R-Car Generation featureKuninori Morimoto2013-07-281-0/+154
Renesas R-Car series sound circuit consists of SSI and its peripheral. But this peripheral circuit is different between R-Car Generation1 (E1/M1/H1) and Generation2 (E2/M2/H2) (Actually, there are many difference in Generation1 chips) The main difference between Gen1 and Gen2 are 1) register offset, 2) data path In order to control Gen1/Gen2 by same method, this patch adds gen.c. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>