summaryrefslogtreecommitdiff
path: root/sound/soc/sh/rcar/ssi.c
AgeCommit message (Collapse)Author
2014-03-21ASoC: rsnd: add DeviceTree supportKuninori Morimoto
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>
2014-03-05ASoC: rsnd: rename scu to srcKuninori Morimoto
R-Car sound has SCU unit which has SRC/CTU/MIX/DVC, and current rsnd driver has scu.c and scu module. Current scu.c has SRC support only. My first concept was control these feature on scu.c but, it become difficult and un-understandable now. This patch rename scu to src Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-05ASoC: rsnd: remove all rsnd_xxx_remove()Kuninori Morimoto
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>
2014-03-05ASoC: rsnd: use mod probe method on SSIKuninori Morimoto
Now, it can use .probe Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-05ASoC: rsnd: call rsnd_scu_ssi_mode_init() from SSIKuninori Morimoto
Current R-Car sound driver is assuming that SCU mod is used even though it is not needed. Because scu.c is controlling SSIU too. (it is Gen1 compatibility) But, SCU mod will be really not used if new platform dai feature was added. Thus, rsnd_scu_ssi_mode_init() is called from SSI directory by this patch. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-05ASoC: rsnd: add rsnd_scu_enable_ssi_irq()Kuninori Morimoto
Current R-Car sound driver is assuming that SCU mod is used even though it is not needed. Because scu.c is controlling SSIU too. (it is Gen1 compatibility) But, SCU mod will be really not used if new platform dai feature was used. Thus, SSIU irq setting is called from SSI directory by this patch. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-05ASoC: rsnd: Get correct SCU IDKuninori Morimoto
Current rsnd driver is assuming that SCU/SRU ID is same as SSIU/SSI ID, because Gen1 can't select it. But, Gen2 can select it. The SCU/SRU/SSIU/SSI pair depends on the platform. This patch get correct SCU ID from platform info. To keep compatible, it still assuming SCU ID = SSI ID if platform doesn't have info Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-05ASoC: rsnd: add struct rsnd_dai_platform_infoKuninori Morimoto
R-Car sound DAI consists from SSI/SCU/SSIU/SRU... Current R-Car sound DAI is decided from these settings, but it is intuitively unclear, and is not good design for DT support. This patch adds new rsnd_dai_platform_info to solve this issue. But now, many platform is using this driver without rsnd_dai_platform_info. So, this patch still supports DAI settings via SSI to keep compatible. It will be removed in next Linux version. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-04ASoC: rsnd: get ssi/scu from rsnd_dai_streamKuninori Morimoto
Current driver is assuming that SSI id = SCU id. But, now, it can get correct SSI/SCU from rsnd_dai_stream. use it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-04ASoC: rsnd: use mod array instead of list on rdaiKuninori Morimoto
struct rsnd_dai_stream used list for mod list. It added only odd flexibility to current driver, and it is a factor which makes extendibility difficult. rsnd use mod array instead of list from now. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-03ASoC: rsnd: remove verbose debug message from scu/ssiKuninori Morimoto
scu/ssi probe() already have more detail debug message. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-03ASoC: rsnd: remove verbose function parameterKuninori Morimoto
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>
2014-02-03ASoC: rsnd: remove SSI dependent DMAEngine callbackKuninori Morimoto
Renesas Gen2 sound will use 2 DMAC which are Audio-DMAC, and Audio-DMAC-peri-peri. Current driver has callback function for each DMAC, because it assumed each DMAC needs special settings. But it became clear that these can share settings. This patch removes unnecessary callback Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-03ASoC: rsnd: extracts Gen1/Gen2 common partsKuninori Morimoto
Renesas sound IP Gen1/Gen2 are similar, but different. This patch extracts Gen1/Gen2 common and dependency parts, and create Gen1/Gen2 ops to control it. According to this structure, SSIU setup which has been implemented on ssi.c can be moved to scu.c (SRU/SSIU/SCU should be implemented on scu.c) Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-03ASoC: rsnd: add rsnd_ssi_is_play()Kuninori Morimoto
SCU needs SSI direction if Gen2. Add rsnd_ssi_is_play() function for it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-03ASoC: rsnd: remove ssiu from ssi.cKuninori Morimoto
Now, SSI_MODE0/1 are controlled under scu.c ssiu is no longer needed on ssi.c Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-03ASoC: rsnd: SSI_MODE0/1 settings goes to scu.cKuninori Morimoto
SRU (Gen1) / SCU (Gen2) / SSIU (Gen2) are controlled under scu.c. (SCU + SSIU (Gen2) was SRU (Gen1)) And register of SSI_MODE0/1 are mapped on these IP. But these have been implemented under ssi.c on this driver. The naming is very confusable, but it should be implemented under scu.c Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-03ASoC: rsnd: remove pin sync optionKuninori Morimoto
Renesas Chip is supporting multi pin sound, but the HW setting is very difficult and confusable. But driver is supporting it halfway. Remove SYNC option at this point. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-03ASoC: rsnd: rsnd_dai_is_clk_master() can be sharedKuninori Morimoto
Current rsnd driver is using ssi local rsnd_rdai_is_clk_master() for checking clock master. But it can be rsnd_dai_is_clk_master(), and share in each file Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-03ASoC: rsnd: remove meaningless rsnd_ssi_non()Kuninori Morimoto
rsnd_ssi_non_ops callback functions are never called. remove these meaningless callback Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-03ASoC: rsnd: cleanup debug information methodKuninori Morimoto
rsnd_mod debug information is implemented in each callback functions now. But, it can be implemented in rsnd_mod_call(), and share this code. This patch adds it Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-01-02Merge remote-tracking branches 'asoc/topic/ad1836', 'asoc/topic/ad193x', ↵Mark Brown
'asoc/topic/adav80x', 'asoc/topic/adsp', 'asoc/topic/ak4641', 'asoc/topic/ak4642', 'asoc/topic/arizona', 'asoc/topic/atmel', 'asoc/topic/au1x', 'asoc/topic/axi', 'asoc/topic/bcm2835', 'asoc/topic/blackfin', 'asoc/topic/cs4271', 'asoc/topic/cs42l52', 'asoc/topic/da7210', 'asoc/topic/davinci', 'asoc/topic/ep93xx', 'asoc/topic/fsl', 'asoc/topic/fsl-mxs', 'asoc/topic/generic', 'asoc/topic/hdmi', 'asoc/topic/jack', 'asoc/topic/jz4740', 'asoc/topic/max98090', 'asoc/topic/mxs', 'asoc/topic/omap', 'asoc/topic/pxa', 'asoc/topic/rcar', 'asoc/topic/s6000', 'asoc/topic/sai', 'asoc/topic/samsung', 'asoc/topic/sgtl5000', 'asoc/topic/spear', 'asoc/topic/ssm2518', 'asoc/topic/ssm2602', 'asoc/topic/tegra', 'asoc/topic/tlv320aic3x', 'asoc/topic/twl6040', 'asoc/topic/txx9', 'asoc/topic/uda1380', 'asoc/topic/width', 'asoc/topic/wm8510', 'asoc/topic/wm8523', 'asoc/topic/wm8580', 'asoc/topic/wm8711', 'asoc/topic/wm8728', 'asoc/topic/wm8731', 'asoc/topic/wm8741', 'asoc/topic/wm8750', 'asoc/topic/wm8753', 'asoc/topic/wm8776', 'asoc/topic/wm8804', 'asoc/topic/wm8900', 'asoc/topic/wm8901', 'asoc/topic/wm8940', 'asoc/topic/wm8962', 'asoc/topic/wm8974', 'asoc/topic/wm8985', 'asoc/topic/wm8988', 'asoc/topic/wm8990', 'asoc/topic/wm8991', 'asoc/topic/wm8994', 'asoc/topic/wm8995', 'asoc/topic/wm9081' and 'asoc/topic/x86' into asoc-next
2013-12-31ASoC: rsnd: add SRC (Sampling Rate Converter) supportKuninori Morimoto
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>
2013-12-31ASoC: rsnd: tidyup rsnd_ssi_master_clk_start() parameterKuninori Morimoto
Renesas sound has SRC (= Sampling Rate Converter), but, the HW implementation depends on its generation. It was part of SRU on Gen1, and SCU on Gen2. This SCU needs DMA transfer to use it. Current rsnd driver is using it as DMA transfer buffer (= no rate convert), and Gen1 is only supported at this point. This patch cleanup it with focusing about SRC and Gen2 part. ssi clock which is calculated from rsnd_ssi_master_clk_start() should have flexibility since Renesas sound has SRC (= Sampling Rate Converter). But current implementation is using runtime->rate directly. This patch tidyup rsnd_ssi_master_clk_start() parameter as preparation of future SRC support Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-31ASoC: rsnd: INT_ENABLE is needed only Gen2Kuninori Morimoto
INT_ENABLE is needed only Gen2. rsnd_mod_write() do nothing on Gen1, but it is confusable. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-31ASoC: rsnd: tidyup ssi commentKuninori Morimoto
we can check rsnd_ssi_init(), not, rsnd_ssi_start() Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-04ASoC: rcar: use devm_clk_get() instead of clk_get()Kuninori Morimoto
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-29ASoC: rcar: add Gen2 sound supportKuninori Morimoto
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>
2013-11-08Merge remote-tracking branch 'asoc/topic/warn' into asoc-nextMark Brown
2013-11-07ASoC: rcar: Use WARN_ON() instead of BUG_ON()Takashi Iwai
Use WARN_ON() and handle the error cases accordingly. Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-10-20ASoC: rcar: remove RSND_SSI_CLK_FROM_ADGKuninori Morimoto
R-Car sound has clock pin for each SSI, and sometimes, these pins are shared with paired SSI. It may sometimes become "SSI-A clock pin is master" and "SSI-B clock pin is slave", but "SSI-A/B clock pins are shared". SSI-B needs SSI-A clock in this case. Current R-Car sound driver is using RSND_SSI_xxx flag to control this kind of shared pin behavior. But, this information, especially clock master setting, can be got from ASoC set_fmt settings. This patch removes rsnd_ssi_mode_init() and extend rsnd_ssi_mode_set() to controlling pin settings via .set_fmt. This patch doesn't removes RSND_SSI_CLK_FROM_ADG flag at this point to avoid conflict branch merging between ASoC <-> SH-ARM. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-10-20ASoC: rcar: add rsnd_scu_hpbif_is_enable()Kuninori Morimoto
Current SSI needs RSND_SSI_DEPENDENT flag to decide dependent/independent mode. And SCU needs RSND_SCU_USE_HPBIF flag to decide HPBIF is enable/disable. But these 2 means same things. This patch adds new rsnd_scu_hpbif_is_enable() function, and merges above methods. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-08-06ASoC: rsnd: SSI supports DMA transfer via BUSIFKuninori Morimoto
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>
2013-08-06ASoC: rsnd: SSI supports DMA transferKuninori Morimoto
This patch adds DMAEngine transfer on SSI. But, it transfers sound data from memory to SSI directly without using HPBIF at this time. It will be updated soon Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-08-06ASoC: rsnd: remove platform dai and add dai_id on platform settingKuninori Morimoto
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>
2013-07-28ASoC: add Renesas R-Car SSI featureKuninori Morimoto
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>