summaryrefslogtreecommitdiff
path: root/sound/soc/rockchip/rk3399_gru_sound.c
AgeCommit message (Collapse)Author
2018-02-07Merge remote-tracking branches 'asoc/topic/max98373', 'asoc/topic/mtk', ↵Mark Brown
'asoc/topic/pcm', 'asoc/topic/rockchip' and 'asoc/topic/sam9g20_wm8731' into asoc-next
2018-01-24ASoC: rockchip: Use dummy_dai for rt5514 dsp dailinkJeffy Chen
The rt5514 dsp captures pcm data through spi directly, so we should not use rockchip-i2s as it's cpu dai like other codecs. Use dummy_dai for rt5514 dsp dailink to make voice wakeup work again. Reported-by: Jimmy Cheng-Yi Chiang <cychiang@google.com> Fixes: (72cfb0f20c75 ASoC: rockchip: Use codec of_node and dai_name for rt5514 dsp) Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com> Tested-by: Brian Norris <briannorris@chromium.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-11-27ASoC: rk3399_gru_sound: Map BTN_0 to KEY_PLAYPAUSEBenson Leung
The Android 3.5mm Headset jack specification mentions that BTN_0 should be mapped to KEY_MEDIA, but this is less logical than KEY_PLAYPAUSE, which has much broader userspace support. For example, the Chrome OS userspace now supports KEY_PLAYPAUSE to toggle play/pause of videos and audio, but does not handle KEY_MEDIA. Furthermore, Android itself now supports KEY_PLAYPAUSE equivalently, as the new USB headset spec requires KEY_PLAYPAUSE for BTN_0. https://source.android.com/devices/accessories/headset/usb-headset-spec Signed-off-by: Benson Leung <bleung@chromium.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-10-04ASoC: rockchip: Allocate enough memory so we don't overflow routesDouglas Anderson
In the recent commit d9f9c167edae ("ASoC: rockchip: Init dapm routes dynamically") we improperly allocated memory for the card->dapm_routes causing us to overflow the allocation on every boot. Oops. Let's allocate the correct amount of memory. We'll also add a check to make sure that we don't overrun memory even if we encounter some sort of weird device tree. Fixes: d9f9c167edae ("ASoC: rockchip: Init dapm routes dynamically") Signed-off-by: Douglas Anderson <dianders@chromium.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-09-19ASoC: rockchip: Use bus_type to distinguish rt5514 dsp from rt5514 codecJeffy Chen
Currently rt5514 dsp and rt5514 codec are sharing the same compatible. Use bus_type to distinguish rt5514 dsp from rt5514 codec. Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com> Reviewed-by: Matthias Kaehlcke <mka@chromium.org> Tested-by: Matthias Kaehlcke <mka@chromium.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-09-19ASoC: rockchip: Init dapm routes dynamicallyJeffy Chen
Currently we are using a fixed list of dapm routes. Init dapm routes dynamically when parsing dailinks, since we are supporting optional codecs. Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com> Reviewed-by: Matthias Kaehlcke <mka@chromium.org> Tested-by: Matthias Kaehlcke <mka@chromium.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-09-19Merge tag 'v4.14-rc1' into asoc-rockchipMark Brown
Linux 4.14-rc1
2017-09-19ASoC: rockchip: Add dapm route for HDMIJeffy Chen
Add dapm route for DP codec. Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-09-19ASoC: rockchip: Add dapm route for DMicJeffy Chen
Add dapm route for DMIC codec. Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-08-30ASoC: rockchip: constify snd_soc_ops structuresJeffy Chen
Add const to dp/dmic snd_soc_ops. Fixes: 626d84db64d7 (ASoC: rockchip: Add support for DMIC codec) Fixes: 3313faf1053e (ASoC: rockchip: Add support for DP codec) Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-08-29ASoC: rockchip: Add support for DMIC codecJeffy Chen
Add support for optional dmic codec. Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-08-29ASoC: rockchip: Add support for DP codecJeffy Chen
Add support for optional cdn dp codec. Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-08-29ASoC: rockchip: Parse dai links from dtsJeffy Chen
Refactor rockchip_sound_probe, parse dai links from dts instead of hard coding them. Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com> Reviewed-by: Matthias Kaehlcke <mka@chromium.org> Tested-by: Matthias Kaehlcke <mka@chromium.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-08-29ASoC: rockchip: Use codec of_node and dai_name for rt5514 dspJeffy Chen
Currently we are using codec name for rt5514 dsp dai link, use codec of_node instead. Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com> Reviewed-by: Matthias Kaehlcke <mka@chromium.org> Tested-by: Matthias Kaehlcke <mka@chromium.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-08-22ASoC: rockchip: Correct 'dmic-delay' property nameJeffy Chen
The 'dmic-delay' property name is different with the dt-binding. So correct it with 'dmic-wakeup-delay-ms'. Fixes: 3a6f9dce6116 (ASoC: rk3399_gru_sound: fix recording pop at first attempt) Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-08-21ASoC: rockchip: Remove unnecessary function callDonglin Peng
First of all,the address of pdev->dev is assigned to card->dev,then the function platform_set_drvdata copies the value the variable card to pdev->dev.driver_data, but when calling snd_soc_register_card,the function dev_set_drvdata(card->dev, card) will also do the same copy operation,so i think that the former copy operation can be removed. Signed-off-by: Peng Donglin <dolinux.peng@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-10-24ASoC: rockchip: constify snd_soc_ops structuresJulia Lawall
Check for snd_soc_ops structures that are only stored in the ops field of a snd_soc_dai_link structure. This field is declared const, so snd_soc_ops structures that have this property can be declared as const also. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @r disable optional_qualifier@ identifier i; position p; @@ static struct snd_soc_ops i@p = { ... }; @ok1@ identifier r.i; struct snd_soc_dai_link e; position p; @@ e.ops = &i@p; @ok2@ identifier r.i, e; position p; @@ struct snd_soc_dai_link e[] = { ..., { .ops = &i@p, }, ..., }; @bad@ position p != {r.p,ok1.p,ok2.p}; identifier r.i; struct snd_soc_ops e; @@ e@i@p @depends on !bad disable optional_qualifier@ identifier r.i; @@ static +const struct snd_soc_ops i = { ... }; // </smpl> The effect on the layout of the .o files is shown by the following output of the size command, first before then after the transformation: text data bss dec hex filename 5027 2488 416 7931 1efb sound/soc/rockchip/rk3399_gru_sound.o 5219 2312 416 7947 1f0b sound/soc/rockchip/rk3399_gru_sound.o text data bss dec hex filename 3499 1648 384 5531 159b sound/soc/rockchip/rockchip_max98090.o 3563 1584 384 5531 159b sound/soc/rockchip/rockchip_max98090.o text data bss dec hex filename 3455 1536 384 5375 14ff sound/soc/rockchip/rockchip_rt5645.o 3519 1480 384 5383 1507 sound/soc/rockchip/rockchip_rt5645.o Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-10-24ASoC: rk3399_gru_sound: Fix non static symbol warningWei Yongjun
Fixes the following sparse warning: sound/soc/rockchip/rk3399_gru_sound.c:41:14: warning: symbol 'rt5514_dmic_delay' was not declared. Should it be static? Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-24ASoC: rk3399_gru_sound: fix recording pop at first attemptWonjoon Lee
Pop happens when mclk applied but dmic's own boot-time Specify dmic delay times in dt to make sure clocks are ready earlier than dmic working Signed-off-by: Wonjoon Lee <woojoo.lee@samsung.com> Signed-off-by: Xing Zheng <zhengxing@rock-chips.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-16ASoC: rockchip: Support headset button function on rk3399Cheng-Yi Chiang
Set the mapping between button and media key event. Signed-off-by: Cheng-Yi Chiang <cychiang@chromium.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-19ASoC: rockchip: Add support rt5514 dsp summy dailinkXing Zheng
This patch can attach automaticlly rt5514 spi DAI with driver name "rt5514" in the snd_soc_find_dai process. Turn this feature on, we can enable the voice wake up via rt5514 dsp for RK3399 Gru Boards. Signed-off-by: Xing Zheng <zhengxing@rock-chips.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-08ASoC: rockchip: Add machine driver for RK3399 GRU BoardsXing Zheng
Because we need to support the multiple codecs (MAX98357A/RT5514/DA7219) on the RK3399 GRU boards, this patch can help us to support these codecs. Signed-off-by: Xing Zheng <zhengxing@rock-chips.com> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>