summaryrefslogtreecommitdiff
path: root/sound/soc/sh/rcar/adg.c
AgeCommit message (Collapse)Author
2017-08-30ASoC: rsnd: Add missing initialization of ADG req_rateGeert Uytterhoeven
commit 8b27418f300cafbdbbb8cfa9c29d398ed34d6723 upstream. If the "clock-frequency" DT property is not found, req_rate is used uninitialized, and the "audio_clkout" clock will be created with an arbitrary clock rate. This uninitialized kernel stack data may leak to userspace through /sys/kernel/debug/clk/clk_summary, cfr. the value in the "rate" column: clock enable_cnt prepare_cnt rate accuracy phase -------------------------------------------------------------------- audio_clkout 0 0 4001836240 0 0 Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Thong Ho <thong.ho.px@rvc.renesas.com> Signed-off-by: Nhan Nguyen <nhan.nguyen.yb@renesas.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-22ASoC: rsnd: remove duplicate parameter from rsnd_ssi_xxx()Kuninori Morimoto
rsnd_ssi_use_busif() and rsnd_ssi_is_pin_sharing() are the function which returns current SSI status. But these requests duplicated parameter. This patch removes duplicated parameter. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-16ASoC: rsnd: fixup clkout_name[] index error for single AUDIO_CLKOUT SoCKuninori Morimoto
2a46db4a3("ASoC: rsnd: add AUDIO_CLKOUT support") added AUDIO_CLKOUT support for ADG. But single AUDIO_CLKOUT needs clkout_name[CLKOUT], not clkout_name[i]. Kernel will have NULL pointer access without this patch. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14ASoC: rsnd: add AUDIO_CLKOUT supportKuninori Morimoto
Renesas sound has AUDIO_CLKOUT (in Gen1/Gen2) AUDIO_CLKOUT1/2/3 (in Gen3) This patch support these patches as clock provider. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14ASoC: rsnd: adg: ignore undefined clock errorKuninori Morimoto
undefined clock is not error. Accept such case. And this is prepare for clock out support in the same time. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14ASoC: rsnd: tidyup ADG debug message for clock selectionKuninori Morimoto
It didn't have "\n", and indicated different data Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14ASoC: rsnd: tidyup ADG clock calculate methodKuninori Morimoto
Current ADG clock calculation needs ADG and SSI settings. Thus, SSI side clock request function depends on ADG settings. After reconsideration, we can close this method inside ADG. This function uses new method. And it becomes preparation for AUDIO_CLKOUT support. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14ASoC: rsnd: ADG initial setup on rsnd_adg_ssi_clk_init()Kuninori Morimoto
ADG is special IP since it doesn't have MSTP. And now, ADG has common mod base register access. We can now setup ADG initial setting when probe timing. It is needed if sound card is based on AUIDO_CLK which is used as Master clock. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14ASoC: rsnd: add common mod confirm methodKuninori Morimoto
Renesas sound has SSI/SRC/DVC/MIX/ADG modules, and these have original register mapping. Thus this driver is using regmap field, and each module is using it based on each module ID. Sometimes, each module needs other module to controlling. but current each function is using just "mod" as parameter name. This is confusable. For example, if SSI0 and SRC2 are connected, and if SRC module function has bug of module access, and if it needs to control connected SSI, SRC function will access to SSI2 (It should access to SSI0, but it uses SRC's ID 2). This is easy to happen in current driver style. To avoid this kind of confusable trouble, this patch adds module confirm macro for debug purpose. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14ASoC: rsnd: ADG uses mod base common methodKuninori Morimoto
Renesas sound has ADG IP, but it is special device. (It is clock generater, and it doesn't need MSTP) Thus, ADG didn't use mod base common method on rsnd driver. But it can be confusable point. Let's use common method Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14ASoC: rsnd: remove unneeded sh_clk headerKuninori Morimoto
sh_clk header is not needed, and it will create confusion. Let's remove it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-27ASoC: rsnd: remove useless debug messageKuninori Morimoto
This patch removes useless debug message. especially some kind of "probed" message will be printed from core.c if it has #define DEBUG Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-22ASoC: rsnd: show debug info for sampling rate convertKuninori Morimoto
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-15ASoC: rsnd: remove unsed rdai parameter from each functionKuninori Morimoto
Current rsnd driver's many functions requests struct rsnd_dai (= rdai), but, 1) we can get rdai from rsnd_io_to_rsnd(), 2) almost all rdai is not used. Let's remove these rdai. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-15ASoC: rsnd: replace rsnd_dai_is_play() to rsnd_io_is_play()Kuninori Morimoto
Current rsnd driver can use rsnd_io_to_rdai() we can get play/capture direction via io now. Let's replace rsnd_dai_is_play() to rsnd_io_is_play() Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-12-03ASoC: rsnd: show master clock rate when ADG probeKuninori Morimoto
master clock rate is useful information for debug. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-05-13ASoC: rsnd: add DVC supportKuninori Morimoto
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>
2014-05-08ASoC: rsnd: remove old clock style supportKuninori Morimoto
All platform which used old style was switched to new style. R-Car sound can remove old style clock support, use device dependent clock now. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
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: 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-04ASoC: rsnd: modify rsnd_adg_ssi_ws_timing_gen2() parameterKuninori Morimoto
rsnd_adg_ssi_ws_timing_gen2() returns SSI WS timing, and it used "mod" as parameter. but, this "mod" is sometimes not ssi mod. Get SSI mod from rsnd_dai_stream Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-04ASoC: rsnd: 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>
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-12ASoC: rsnd: set DIV_EN register on rsnd_adg_set_convert_clk_gen2()Kuninori Morimoto
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>
2014-02-12ASoC: rsnd: tidyup original for_each_rsnd_xxx macroKuninori Morimoto
Current for_each_rsnd_xxx macro will read out-of-array's memory after last loop operation. It was not good C language operation, and the binary which was compiled by (at least) gcc 4.8.1 is broken This patch tidyup these issues Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-07ASoC: rsnd: use device dependency clockKuninori Morimoto
Current R-Car sound driver is using device independent audio clock, but it is not good design for DT support. This patch adds device dependent clock support. But, there are some platform which is using independent audio clock. It is still supported at this point, but it will be removed soon. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-03ASoC: rsnd: add Gen2 SRC and DMAEngine supportKuninori Morimoto
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>
2014-02-03ASoC: rsnd: merge SRC clock timing/settingKuninori Morimoto
SRC clock and timing setting register exist in SRU and ADG on Gen1. But, these are merged into ADG on Gen2. Current driver is supporting Gen1 SRC only at this point, but, above settings are set as different function. This patch merges these as preparation of Gen2 support. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
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: make sure variable name for 44.1kHz/48kHzKuninori Morimoto
This driver is assuming that RBGA is used as source clock of 44.1kHz category, and RBGB is used as source clock of 48kHz category. This patch clarifies the variable name. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-31ASoC: rsnd: add rsnd_adg_set_ssi_clk() and cleanup adgKuninori Morimoto
This patch adds rsnd_adg_set_ssi_clk() to access to AUDIO_CLK_SEL0/1/2, and removes last user of rsnd_write/read/bset which is very low level function. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-09-24ASoC: rsnd: remove rsnd_priv_read/write/bset()Kuninori Morimoto
adg.c only used rsnd_priv_read/write/bset() which is the only user of NULL mod. but, it can be removed. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-09-24ASoC: rcar: remove unnecessary mach/clock.hKuninori Morimoto
${LINUX}/sound/soc/sh driver can be compiled from SuperH and ARM. but, ${LINUX}/sound/soc/sh/rcar driver included SH-ARM specific header. This patch removes it 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 ADG 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) 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>