summaryrefslogtreecommitdiff
path: root/sound/soc/sh
AgeCommit message (Collapse)Author
2019-02-28Merge tag 'asoc-v5.1-2' of ↵Takashi Iwai
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next ASoC: More changes for v5.1 Another batch of changes for ASoC, no big core changes - it's mainly small fixes and improvements for individual drivers. - A big refresh and cleanup of the Samsung drivers, fixing a number of issues which allow the driver to be used with a wider range of userspaces. - Fixes for the Intel drivers to make them more standard so less likely to get bitten by core issues. - New driver for Cirrus Logic CS35L26.
2019-02-26Merge branch 'for-5.0' of ↵Mark Brown
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-5.1
2019-02-26ASoC: rsnd: gen: fix SSI9 4/5/6/7 busif related register addressJiada Wang
Currently each SSI unit 's busif mode/adinr/dalign address is registered by: (in busif4 case) RSND_GEN_M_REG(SSI_BUSIF4_MODE, 0x500, 0x80) RSND_GEN_M_REG(SSI_BUSIF4_ADINR,0x504, 0x80) RSND_GEN_M_REG(SSI_BUSIF4_DALIGN, 0x508, 0x80) But according to user manual 41.1.4 Register Configuration ssi9 4/5/6/7 busif mode/adinr/dalign register address ( SSI9-[4/5/6/7]_BUSIF_[MODE/ADINR/DALIGN] ) are out of this rule. This patch registers ssi9 4/5/6/7 mode/adinr/dalign register as single register, and access these registers in case of SSI9 BUSIF 4/5/6/7. Fixes: commit 8c9d75033340 ("ASoC: rsnd: ssiu: Support BUSIF other than BUSIF0") Signed-off-by: Jiada Wang <jiada_wang@mentor.com> Signed-off-by: Timo Wischer <twischer@de.adit-jv.com> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-18ASoC: fsi: fix spelling mistake "doens't" -> "doesn't"Colin Ian King
There is a spelling mistake in a dev_err message. Fix it. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-13Merge branch 'for-5.0' of ↵Mark Brown
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-5.1
2019-02-08Merge branch 'for-linus' into for-nextTakashi Iwai
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-02-08Merge tag 'asoc-v5.1' of ↵Takashi Iwai
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next ASoC: Updates for v5.1 Lots and lots of new drivers so far, a highlight being the MediaTek BTCVSD which is a driver for a Bluetooth radio chip - the first such driver we've had upstream. Hopefully we will soon also see a baseband with an upstream driver! - Support for only powering up channels that are actively being used. - Quite a few improvements to simplify the generic card drivers, especially the merge of the SCU cards into the main generic drivers. - Lots of fixes for probing on Intel systems, trying to rationalize things to look more standard from a framework point of view. - New drivers for Asahi Kasei Microdevices AK4497, Cirrus Logic CS4341, Google ChromeOS embedded controllers, Ingenic JZ4725B, MediaTek BTCVSD, MT8183 and MT6358, NXP MICFIL, Rockchip RK3328, Spreadtrum DMA controllers, Qualcomm WCD9335, Xilinx S/PDIF and PCM formatters.
2019-02-07ASoC: rsnd: ssiu: correct shift bit for ssiu9Jiada Wang
Currently "0xf << 36" is used to clear SSIU-9 internal buffer state, which overflows 32-bit value according to user reference manual, it is always bit4 ~ bit7 of SSI_SYS_STATUS[1,3,5,7] registers indicate SSIU-9's buffer state, so "0xf << 4" should be used. This patch fix incorrect shifting issue in SSIU-9 case Fixes: commit b7169ddea2f2 ("ASoC: rsnd: remove RSND_REG_ from rsnd_reg") Signed-off-by: Jiada Wang <jiada_wang@mentor.com> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-06ASoC: rsnd: fixup rsnd_ssi_master_clk_start() user count checkKuninori Morimoto
commit 4d230d1271064 ("ASoC: rsnd: fixup not to call clk_get/set under non-atomic") added new rsnd_ssi_prepare() and moved rsnd_ssi_master_clk_start() to .prepare. But, ssi user count (= ssi->usrcnt) is incremented at .init (= rsnd_ssi_init()). Because of these timing exchange, ssi->usrcnt check at rsnd_ssi_master_clk_start() should be adjusted. Otherwise, 2nd master clock setup will be no check. This patch fixup this issue. Fixes: commit 4d230d1271064 ("ASoC: rsnd: fixup not to call clk_get/set under non-atomic") Reported-by: Yusuke Goda <yusuke.goda.sx@renesas.com> Reported-by: Valentine Barshak <valentine.barshak@cogentembedded.com> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Tested-by: Yusuke Goda <yusuke.goda.sx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-06Merge branch 'asoc-5.0' into asoc-5.1 for dapm tableMark Brown
2019-02-06ASoC: sh: Drop superfluous PCM preallocation error checksTakashi Iwai
snd_pcm_lib_preallocate_pages() and co always succeed, so the error check is simply redundant. Drop it. Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Jaroslav Kysela <perex@perex.cz> Acked-by: Mark Brown <broonie@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-02-05ASoC: sh: Avoid passing NULL to memory allocatorsTakashi Iwai
We should pass a proper non-NULL device object to memory allocators although it was accepted in the past. The card->dev points to the most appropriate device object in such a case, so let's put it. Acked-by: Christoph Hellwig <hch@lst.de> Acked-by: Mark Brown <broonie@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-02-02ASoC: rsnd: fixup TDM Split mode check for CTUKuninori Morimoto
Renesas sound card need to judge that whether it is using "TDM Split mode". To judge it and for other purpose, it has rsnd_parse_connect_simple() and rsnd_parse_connect_graph(), but these are using different judgement policy for TDM Split mode. It is pointless and confusable. This patch add new rsnd_parse_tdm_split_mode() and use common judgement policy for simple-card/audio-graph. Without this patch, CTU will be judged as TDM Split mode on audio-graph card. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-02ASoC: rsnd: synchronize connection check for simple-card/audio-graphKuninori Morimoto
Current rsnd driver has below function to check connection rsnd_parse_connect_simple() rsnd_parse_connect_graph() But these have different parameters. This patch synchronize these for cleanup. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-02ASoC: rsnd: fixup MIX kctrl registrationKuninori Morimoto
Renesas sound device has many IPs and many situations. If platform/board uses MIXer, situation will be more complex. To avoid duplicate DVC kctrl registration when MIXer was used, it had original flags. But it was issue when sound card was re-binded, because no one can't cleanup this flags then. To solve this issue, commit 9c698e8481a15237a ("ASoC: rsnd: tidyup registering method for rsnd_kctrl_new()") checks registered card->controls, because if card was re-binded, these were cleanuped automatically. This patch could solve re-binding issue. But, it start to avoid MIX kctrl. To solve these issues, we need below. To avoid card re-binding issue: check registered card->controls To avoid duplicate DVC registration: check registered rsnd_kctrl_cfg To allow multiple MIX registration: check registered rsnd_kctrl_cfg This patch do it. Fixes: 9c698e8481a15237a ("ASoC: rsnd: tidyup registering method for rsnd_kctrl_new()") Reported-by: Jiada Wang <jiada_wang@mentor.com> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Tested-By: Jiada Wang <jiada_wang@mentor.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-01-07ASoC: rsnd: update BSDSR/BSDISR handlingKuninori Morimoto
Current BSDSR/BSDISR are using temporary/generic settings, but it can't handle all SRCx/SoC. It needs to handle correctry. Otherwise, sampling rate converted sound channel will be broken if it was TDM. One note is that it needs to overwrite settings on E3 case. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Tested-by: chaoliang qin <chaoliang.qin.jg@renesas.com> Tested-by: Yusuke Goda <yusuke.goda.sx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-01-03ASoC: dma-sh7760: cleanup a debug printkDan Carpenter
The intent was to print the address as a hexadecimal but there is an extra "u" in the "0x%08ulx" format specification so it is displayed as decimal. Fixes: aef3b06ac697 ("[ALSA] SH7760 ASoC support") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-12-13Merge branch 'for-4.20' of ↵Mark Brown
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-4.21 intel dep
2018-12-12ASoC: rsnd: remove RSND_REG_ from rsnd_regKuninori Morimoto
Current rsnd is using RSND_REG_xxx for register naming, and using RSND_REG_##f style macro for read/write. The biggest reason why it uses this style is that we can avoid non-existing register access. But, its demerit is sequential register access code will be very ugly. Current rsnd driver is well tested, so, let's remove RSND_REG_ from rsnd_reg, and cleanup sequential register access code. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Tested-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-12-04ASoC: rsnd: add missing TDM Split mode support for simple-cardKuninori Morimoto
commit f69f452243e4e1 ("ASoC: rsnd: add TDM Split mode support") added TDM Split mode support for rsnd driver. But, it cares audio-graph-card style only. We can't use TDM Split mode on simple-card style now. This patch fixup this issue. Fixes: f69f452243e4e1 ("ASoC: rsnd: add TDM Split mode support") Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-12-04ASoC: rsnd: fixup mod ID for CTU regmap read/writeKuninori Morimoto
commit c16015f36cc12824 ("ASoC: rsnd: add .get_id/.get_id_sub") add new .get_id/.get_id_sub to indicate module ID/subID. It is used for SSIU and CTU. In SSIU case, subID indicates BUSIF, but register settings is based on SSIU ID. OTOH, in CTU case, subID indicates CTU channel, and register settings is based on it. This means regmap read/write function needs to care it. This patch fixup this issue. It can't play MIXed sound without this patch. Fixes: c16015f36cc12824 ("ASoC: rsnd: add .get_id/.get_id_sub") Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-12-04ASoC: rsnd: indicates Channel and Mode for debugKuninori Morimoto
For TDM debug purpose, indicating Channel and Mode is very useful. This patch indicate it if it has #define DEBUG Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-11-28ASoC: rsnd: tidyup registering method for rsnd_kctrl_new()Kuninori Morimoto
Current rsnd dvc.c is using flags to avoid duplicating register for MIXer case. OTOH, commit e894efef9ac7 ("ASoC: core: add support to card rebind") allows to rebind sound card without rebinding all drivers. Because of above patch and dvc.c flags, it can't re-register kctrl if only sound card was rebinded, because dvc is keeping old flags. (Of course it will be no problem if rsnd driver also be rebinded, but it is not purpose of above patch). This patch checks current card registered kctrl when registering. In MIXer case, it can avoid duplicate register if card already has same kctrl. In rebind case, it can re-register kctrl because card registered kctl had been removed when unbinding. This patch is updated version of commit b918f1bc7f1ce ("ASoC: rsnd: DVC kctrl sets once") Reported-by: Nguyen Viet Dung <dung.nguyen.aj@renesas.com> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Tested-by: Nguyen Viet Dung <dung.nguyen.aj@renesas.com> Cc: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-11-21ASoC: rsnd: makes rsnd_ssi_is_dma_mode() staticKuninori Morimoto
ssi.c only is using rsnd_ssi_is_dma_mode(). Let's move it as static function. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-11-21ASoC: rsnd: tidyup rsnd_parse_connect_ssiu_compatible()Kuninori Morimoto
rsnd_parse_connect_ssiu_compatible() is doing - using rsnd_ssiu_id(), but we use it via rsnd_mod_id() - we can break loop if rsnd_dai_connect() was called This patch fixup these. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-11-09ASoC: rsnd: use ring buffer for rsnd_mod_name()Kuninori Morimoto
commit c0ea089dbad4 ("ASoC: rsnd: rsnd_mod_name() handles both name and ID") merged "name" and "ID" on rsnd_mod_name() to handle sub-ID (= for CTU/BUSIF). Then, it decided to share static char to avoid pointless memory. But, it doesn't work correctry in below case, because last called name will be used. dev_xxx(dev, "%s is connected to %s\n", rsnd_mod_name(mod_a), /* ssiu[00] */ rsnd_mod_name(mod_b)); /* ssi[0] */ -> rcar_sound ec500000.sound: ssi[0] is connected to ssi[0] ~~~~~~ ~~~~~~ We still don't want to have pointless memory, so let's use ring buffer. 16byte x 5 is very enough for this purpose. dev_xxx(dev, "%s is connected to %s\n", rsnd_mod_name(mod_a), /* ssiu[00] */ rsnd_mod_name(mod_b)); /* ssi[0] */ -> rcar_sound ec500000.sound: ssiu[00] is connected to ssi[0] ~~~~~~~~ ~~~~~~ Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-11-06ASoC: rsnd: add TDM Split mode supportKuninori Morimoto
This patch adds TDM Split mode support. rsnd driver is assuming audio-graph-scu-card is used for Sound Card. This is very simple sample DT settings to use it. sound_card: sound { compatible = "audio-graph-scu-card"; ... convert-channels = <8>; /* TDM Split */ dais = <&rsnd_port0 /* playback ch1/ch2 */ &rsnd_port1 /* playback ch3/ch4 */ &rsnd_port2 /* playback ch5/ch6 */ &rsnd_port3 /* playback ch7/ch8 */ >; }; audio-codec { ... port { codec_0: endpoint@1 { remote-endpoint = <&rsnd_ep0>; }; codec_1: endpoint@2 { remote-endpoint = <&rsnd_ep1>; }; codec_2: endpoint@3 { remote-endpoint = <&rsnd_ep2>; }; codec_3: endpoint@4 { remote-endpoint = <&rsnd_ep3>; }; }; }; &rcar_sound { ... ports { rsnd_port0: port@0 { rsnd_ep0: endpoint { remote-endpoint = <&codec_0>; ... playback = <&ssiu30 &ssi3>; }; }; rsnd_port1: port@1 { rsnd_ep1: endpoint { remote-endpoint = <&codec_1>; ... playback = <&ssiu31 &ssi3>; }; }; rsnd_port2: port@2 { rsnd_ep2: endpoint { remote-endpoint = <&codec_2>; ... playback = <&ssiu32 &ssi3>; }; }; rsnd_port3: port@3 { rsnd_ep3: endpoint { remote-endpoint = <&codec_3>; ... playback = <&ssiu33 &ssi3>; }; }; }; }; Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-11-06ASoC: rsnd: add SSIU BUSIF supportKuninori Morimoto
Gen2 has BUSIF0-3, Gen3 has BUSIF0-7 on some SSIU. Current driver is assuming it is using BUSIF0 as default. Thus, SSI is attaching SSIU (with BUSIF0) by using rsnd_ssiu_attach(). But, TDM split mode also needs other BUSIF to use it. This patch adds missing SSIU BUSIFx support. BUSIF is handled by SSIU instead of SSI anymore. Thus, its settings no longer needed on SSI node on DT. This patch removes its settings from Document, but driver is still keeping compatibility. Thus, old DT style is still working. But, to avoid confusing, it doesn't indicate old compatibility things on Document. New SoC should have SSIU on DT from this patch. 1) old style DT is still supported (= no rcar_sound,ssiu node on DT) 2) If ssiu is not indicated on playback/capture, BUSIF0 will be used as default playback = <&ssi3>; /* ssiu30 will be selected */ 3) you can select own ssiu playback = <&ssi32 &ssi3>; /* ssiu32 will be selected */ Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-11-06ASoC: rsnd: handle DPCM converted rate/chan under coreKuninori Morimoto
converted rate/chan are handled each rated module, but it will be used other module too. For examle, converted channel is currently used for CTU, but, it will be used for TDM Split mode, too. This patch move/merge SRC/CTU hw_param under core.c and handles converted rate/chan under rsnd_dai_stream. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-11-06ASoC: rsnd: move HDMI information from ssi.c to core.cKuninori Morimoto
Current driver is supporting HDMI output, and its information are handled under ssi.c. But, it is stream information. Let's move it from ssi.c to core.c. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-11-06ASoC: rsnd: use defined io_playback/io_captureKuninori Morimoto
rdai->playback/rdai->capture are defined as io_playback/io_capture on __rsnd_dai_probe(). Let's use it instead of original one. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-11-06ASoC: rsnd: rename rsnd_runtime_is_ssi_xxx()Kuninori Morimoto
Current rsnd driver has rsnd_runtime_is_ssi_xxx() functions, but it is not only related to SSI, thus, it is misunderstandable. This patch renames it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-11-06ASoC: rsnd: remove endpoint bidirectional checkKuninori Morimoto
DTC commit df536831d02c ("checks: add graph binding checks") is checking endpoint bidirectional, and it is upstreamed to linux by commit 50aafd60898a ("scripts/dtc: Update to upstream version v1.4.6-21-g84e414b0b5bc"). Let's remove own bidirectional check Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-11-05ASoC: rsnd: rsnd_mod_name() handles both name and IDKuninori Morimoto
Current rsnd driver is using "%s[%d]" for mod name and ID, but, this ID portion might confusable. For example currently, CTU ID is 0 to 7, but using 00 to 13 (= 00, 01, 02, 03, 10, 11, 12, 13) is very best matching to datasheet. In the future, we will support BUSIFn, but it will be more complicated numbering. To avoid future confusable code, this patch modify rsnd_mod_name() to return understandable name. To avoid using pointless memory, it uses static char and snprintf, thus, rsnd_mod_name() user should use it immediately, and shouldn't keep its pointer. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-11-05ASoC: rsnd: add .get_id/.get_id_subKuninori Morimoto
ID for CTU and SSIU are confusable. 1 CTU has 4 sub nodes. This means, CTU0 has CTU01 - CTU03, CTU1 has CTU10 - CTU13. SSIU is more confusable. Gen2 SSIU has BUSIF0-3, Gen3 SSIU has BUSIF0-7, but not for all SSIU. In rsnd driver, each mod drivers are assuming rsnd_mod_id() returns main device ID (In CTU case CTU0-1, SSIU case SSIU0-9), not serial number. This patch adds new .id/.id_sub to handling more detail ID. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-11-05ASoC: rsnd: move .get_status under rsnd_mod_opsKuninori Morimoto
Each mod needs to have .get_status, but current driver is handling it under rsnd_mod, instead of rsnd_mod_ops. It is not any make sence. This patch moves it to rsnd_mod_ops, and tidyup its parameter order to align to other callback functions. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-31ASoC: rsnd: fixup clock start checkerKuninori Morimoto
commit 4d230d12710646 ("ASoC: rsnd: fixup not to call clk_get/set under non-atomic") fixuped clock start timing. But it exchanged clock start checker from ssi->usrcnt to ssi->rate. Current rsnd_ssi_master_clk_start() is called from .prepare, but some player (for example GStreamer) might calls it many times. In such case, the checker might returns error even though it was not error. It should check ssi->usrcnt instead of ssi->rate. This patch fixup it. Without this patch, GStreamer can't switch 48kHz / 44.1kHz. Reported-by: Yusuke Goda <yusuke.goda.sx@renesas.com> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Tested-by: Yusuke Goda <yusuke.goda.sx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-17ASoC: rsnd: tidyup SSICR::SWSP for TDMKuninori Morimoto
R-Car datasheet is indicating that WS output settings of SSICR::SWSP is inverted on TDM mode from non TDM mode settings. But, it is meaning that TDM should use 0 here. Without this patch, sound input/output 1ch will be 2ch, 2ch will be 3ch ..., be jumbled on I2S + TDM settings. This patch fixup it. This patch is tested on R-Car H3 ulcb-kf board, SSI3/4 TDM sound. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-17ASoC: rsnd: enable TDM settings for SSI parentKuninori Morimoto
Some SSIs are sharing each pins (= WS/CLK pin for playback/capture). Then, SSI parent needs control WS/CLK setting for SSI slave. In such case, SSI parent needs TDM settings if SSI slave is working as TDM mode. But it is not cared in current driver. It can't capture TDM sound without this patch if SSIs were pin sharing. This patch is tested on R-Car H3 ulcb-kf board, SSI3/4 with TDM sound. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-10ASoC: rsnd: use 32bit TDM width as defaultKuninori Morimoto
commit fb2815f44a9e ("ASoC: rsnd: add support for 16/24 bit slot widths") added TDM width check, and return error if it was not 16/24/32 bit. But it is too strict. This patch uses 32bit same as default. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-21ASoC: rsnd: fixup SSI clock during suspend/resume modesDmytro Prokopchuk
Prepare <-> Cleanup functions pair has balanced calls. But in case of suspend mode no call to rsnd_soc_dai_shutdown() function, so cleanup isn't called. OTOH during resume mode function rsnd_soc_dai_prepare() is called, but calling rsnd_ssi_prepare() is skipped (rsnd_status_update() returns zero, bacause was not cleanup before). We need to call rsnd_ssi_prepare(), because it enables SSI clocks by calling rsnd_ssi_master_clk_start(). This patch allows to call prepare/cleanup functions always. Signed-off-by: Dmytro Prokopchuk <dmytro.prokopchuk@globallogic.com> Tested-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com> [kuninori: adjusted to upstream] Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-20ASoC: add for_each_dpcm_be() macroKuninori Morimoto
To be more readable code, this patch adds new for_each_dpcm_be() macro, and replace existing code to it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-10Merge branch 'asoc-4.19' into asoc-4.20 Cirrus conflictMark Brown
2018-09-10ASoC: sh: use devm_snd_soc_register_component()Kuninori Morimoto
Now we have devm_snd_soc_register_component(). Let's use it instead of snd_soc_register_component(). Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-06ASoC: rsnd: don't use %p for dev_dbg()Kuninori Morimoto
rsnd driver sometimes want to know which address is used when debugging. But it will indicate "(____ptrval____)" if it used "%p" on dev_dbg(). Let's use "%pa" or "%px" for it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Tested-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-06ASoC: rsnd: don't fallback to PIO mode when -EPROBE_DEFERKuninori Morimoto
Current rsnd driver will fallback to PIO mode if it can't get DMA handler. But, DMA might return -EPROBE_DEFER when probe timing. This driver always fallback to PIO mode especially from commit ac6bbf0cdf4206c ("iommu: Remove IOMMU_OF_DECLARE") because of this reason. The DMA driver will be probed later, but sound driver might be probed as PIO mode in such case. This patch fixup this issue. Then, -EPROBE_DEFER is not error. Thus, let's don't indicate error message in such case. And it needs to call rsnd_adg_remove() individually if probe failed, because it registers clk which should be unregister. Maybe PIO fallback feature itself is not needed, but let's keep it so far. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-06ASoC: rsnd: adg: care clock-frequency sizeKuninori Morimoto
ADG has buffer over flow bug if DT has more than 3 clock-frequency. This patch fixup this issue, and uses first 2 values. clock-frequency = <x y>; /* this is OK */ clock-frequency = <x y z>; /* this is NG */ Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Tested-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-06ASoC: rsnd: gen: use tab instead of white-spaceKuninori Morimoto
commit 8c9d75033340 ("ASoC: rsnd: ssiu: Support BUSIF other than BUSIF0") added new SSIU registers. But it is using white-space for it. This patch fixup it to use tab. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-03ASoC: rsnd: merge .nolock_start and .prepareKuninori Morimoto
Main purpose of .nolock_start is we need to call some function without spinlock. OTOH we have .prepare which main purpose is called under atomic context. Then, it is called without spinlock. In summary, our main callback init/quit, and start/stop are called under "atomic context and with spinlock". And some function need to be called under "non-atomic context or without spinlock". Let's merge .nolock_start and prepare to be more clear code. Then, let's rename nolock_stop to cleanup Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Tested-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-03Merge branch 'asoc-4.19' into asoc-4.20 for rcar depMark Brown