summaryrefslogtreecommitdiffstats
path: root/sound/soc/rockchip
AgeCommit message (Collapse)AuthorFilesLines
2016-07-18ASoC: rockchip: correct the spdif clkChris Zhong1-16/+1
The spdif mclk should be 128 times of sample rate, and there is a internal divider, the real rate of spdif mclk is mclk / (div + 1). Hence, the original driver always get the good frequency for 48000/96000/44100/192000. But for 32000, the mclk is incorrect, it should be 32000*128, but get 48000*128. Do not use the internal divider here, just set all mclk to 128 * sample rate directly. Signed-off-by: Chris Zhong <zyw@rock-chips.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-30ASoC: rockchip: i2s: rename I2S_CKR_TRCM_TX/RXSHARE to I2S_CKR_TRCM_TX/RXONLYSugar Zhang2-4/+4
this patch make it more reasonable and readable, because when we chose I2S_CKR_TRCM_TXONLY, we only output clk_lrck_tx, and hardware need to confirm this signal is wired to external codec lrck_tx/rx at the same time. for convenience, we just handle lrck_txonly if we enable symmetric_rates in driver and dai_link. otherwise, we use the separate lrck_tx/rx. Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com> Signed-off-by: Xing Zheng <zhengxing@rock-chips.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-30ASoC: rockchip-max98090: Fix jack detection and event reporting.Enric Balletbo i Serra1-4/+9
Physically there is a jackset which includes a Headphone and a Jackset Mic pin. The patch add thw two pins with the correct pin name so the DAPM management can find the pin and make the jack detection and event reporting work again. The patch also shut up the following error: rockchip-snd-max98090 sound: ASoC: DAPM unknown pin Headset Jack Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-30ASoC: rockchip-max98090: Fix the Headset Mic route.Enric Balletbo i Serra1-1/+1
The path Headset Mic --> MICBIAS is wrong because connects a non-supply widget as a source with a supply widget as a sink. It's the other way around: MICBIAS (source) --> Headset Mic (sink). This patch also shut up the following error message: rockchip-snd-max98090 sound: Connecting non-supply widget to supply widget is not supported (Headset Mic -> MICBIAS) rockchip-snd-max98090 sound: ASoC: no dapm match for Headset Mic --> (null) --> MICBIAS rockchip-snd-max98090 sound: ASoC: Failed to add route Headset Mic -> direct -> MICBIAS Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-30ASoC: rockchip-max98090: Fix NULL pointer dereference while accessing to jack.Enric Balletbo i Serra1-23/+27
Commit f2ed6b07645e ("ASoC: Make aux_dev more like a generic component") caused a regression on this driver, since now a kernel oops is seen when rockchip-mac98090 driver is loaded. That commit changed the probing of aux_devs before checking new DAI links, so for this driver rk_98090_headset_init is called before rk_init and then the kernel oops due a NULL pointer dereference inside rk_98090_headset_init function since there is a call that tries to access the jack pointer which has not been allocated yet. This is the call chain that causes the crash: rk_98090_headset_init -> ts3a227e_enable_jack_detect -> snd_jack_set_key rk_init -> snd_soc_card_jack_new This patch moves the new jack object creation from rk_init to rk_98090_headset_init function making sure the jack is created before is accessed. Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-30ASoC: rockchip: i2s: configure the sdio pins' iomux modeSugar Zhang2-9/+65
There are 3 i2s sdio pins, which iomux mode is as follows: - sdi3_sdo1 - sdi2_sdo2 - sdi1_sdo3 we need to configure these pins' iomux mode via the GRF register when use multi channel playback/capture. Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-04ASoC: rockchip: Revert "ASoC: rockchip: i2s: separate capture and playback"John Keeping1-32/+40
This reverts commit eba65d179c1149cf79e68608d452631f33d7f017. This broke audio on Veyron Jerry Chromebooks and I now cannot reproduce the problem I was trying to fix even with this commit reverted, so it seems that this was completely the wrong thing to do. Reported-by: Enric Balletbo Serra <eballetbo@gmail.com> Signed-off-by: John Keeping <john@metanate.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-04ASoC: rockchip: Revert "ASoC: rockchip: i2s: remove unused variables"John Keeping1-0/+15
This reverts commit 5938448b99275cba95167c3f9d39ca9225fdad38. It turns out that the commit that made these variables unused is wrong so we're about to revert it. Bring back the variables in prepration. Signed-off-by: John Keeping <john@metanate.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-03-05ASoC: rockchip: add bindings for spdif controllerSugar Zhang1-3/+10
this patch add compatible for rk3366/rk3368/rk3399 spdif, these three spdifs share the same type. Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-03-05ASoC: rockchip: use __maybe_unused to hide st_irq_syscfg_resumeArnd Bergmann1-2/+2
The rockchip spdif driver uses SIMPLE_DEV_PM_OPS to conditionally set its power management functions, but we get a warning about rk_spdif_runtime_resume being unused when CONFIG_PM is not set: sound/soc/rockchip/rockchip_spdif.c:67:12: error: 'rk_spdif_runtime_resume' defined but not used [-Werror=unused-function] This adds a __maybe_unused annotation so the compiler knows it can silently drop it instead of warning. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-22ASoC: rockchip: i2s: add default values for registersSugar Zhang1-0/+10
this patch add default values for registers according description from TRM. Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-22ASoC: rockchip: add bindings for rk3399 i2sJianqun Xu1-0/+3
Add devicetree bindings for i2s controller found on rk3399 processors from rockchip. It's helpful to add full set of compatible strings for serials of Rockchip SoCs (rk3066, rk3188, rk3288, rk3399). Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-01-11Merge remote-tracking branches 'asoc/topic/rcar' and 'asoc/topic/rockchip' ↵Mark Brown1-2/+7
into asoc-next
2016-01-10ASoC: rockchip: i2s: Add SNDRV_PCM_FMTBIT_S32_LE supportMichael Trimarchi1-2/+7
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-12-23Merge remote-tracking branches 'asoc/topic/pxa', 'asoc/topic/qcom', ↵Mark Brown3-60/+82
'asoc/topic/rcar', 'asoc/topic/rk3036' and 'asoc/topic/rockchip' into asoc-next
2015-12-23Merge remote-tracking branches 'asoc/fix/davinci', 'asoc/fix/es8328', ↵Mark Brown2-3/+5
'asoc/fix/fsl-sai', 'asoc/fix/rockchip', 'asoc/fix/sgtl5000' and 'asoc/fix/wm8974' into asoc-linus
2015-12-12ASoC: rockchip: spdif: Set transmit data level to 16 samplesSjoerd Simons2-3/+5
Explicitly set the transmit data level on the transceiver to 16 samples rather then the default 0. This matches both the level set in the vendor kernel and the (seemingly very similar) i2s engine. This fixes audio glitches when playing back at 192k rate. At the same time, fix a trivial typo in the TDL mask definition Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-12-09ASoC: rockchip: i2s: remove unused variablesJohn Keeping1-15/+0
The previous commit removed the only use of these variables. Signed-off-by: John Keeping <john@metanate.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-12-09ASoC: rockchip: i2s: separate capture and playbackJohn Keeping1-40/+32
If we only clear the tx/rx state when both are disabled it is not possible to start/stop one multiple times while the other is running. Since the two are independently controlled, treat them as such and remove the false dependency between capture and playback. Signed-off-by: John Keeping <john@metanate.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-25ASoC: rockchip: Fix incorrect VDW value for 24 bitSjoerd Simons1-3/+3
Correct valid data word register value for 24 bit data width. The bit value should be 10 (aka 0x2), not 0x10. This fixes playback of 24 bit audio. Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk> Reviewed-by: Caesar Wang <wxt@rock-chips.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-16ASoC: rockchip: i2s: compatible with different chipsSugar Zhang1-5/+15
there maybe more than one i2s module inside chip, and these i2s modules have different channels features. for example: there are 3 i2s in rk3066, one support 8 channels playback and 2 channels capture, but the others only support 2 channels playback and 2 channels capture. in order to compatible with these various chips, we add playback and capture property to specify these values. there are default channels configuration in driver: 8 channels playback and 2 channels capture. if not add property, we use the default values. Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-16ASoC: fix rockchip 64-bit build warningArnd Bergmann1-1/+1
The rk_spdif_probe uses the device match data as a token to identify a particular device, but accidentally casts a pointer to 'int', which is not portable, as gcc points out in this warning on arm64: rockchip_spdif.c: In function 'rk_spdif_probe': rockchip_spdif.c:283:6: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] This changes the logic to compare two pointer values instead, using the same cast that was used for initializing the value in the first place. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-16ASoC: rockchip-rt5645: Allow more sample ratesCaesar Wang1-0/+6
The RT5645 audio codec support sample rates from 8 to 96 kHz as the dai claim. Signed-off-by: Caesar Wang <wxt@rock-chips.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-16ASoC: rockchip-max98090: Allow more sample ratesCaesar Wang1-0/+6
The MAX98090 audio codec support sample rates from 8 to 96 kHz as the dai claim. Signed-off-by: Caesar Wang <wxt@rock-chips.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-16ASoC: rockchip: i2s: change bclk and lrck according to sample ratesCaesar Wang1-0/+23
This patch sets the dividers autonomously. when i2s works on master mode, and sample rates changed. We need to change bclk and lrck at the same time for cpu internal side. As the input source clock to the module is MCLK_I2S, and by the divider of the module, the clock generator generates SCLK and LRCK to transmitter and receiver. Signed-off-by: Caesar Wang <wxt@rock-chips.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-23ASoC: rockchip: i2s: share tx/rx lrck when symmetric_rates enabledSugar Zhang2-0/+14
share lrck_tx to lrck_rx when symmetric_rates enabled. Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-23ASoC: rockchip: i2s: add 8 channels capture supportSugar Zhang2-2/+48
support max 8 channels capture, please add property 'rockchip,capture-channels' in dts to enable this, if not, support 2 channels capture default. Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-19ASoC: rockchip: spdif: Convert to use devm_snd_dmaengine_pcm_registerAxel Lin1-6/+2
Use resource managed API then we can remove snd_dmaengine_pcm_unregister() and snd_soc_unregister_component() calls in .probe error path and .remove. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-08ASoC: rockchip: Add rockchip SPDIF transceiver driverSjoerd Simons4-0/+482
Add a driver for the SPDIF transceiver available on RK3066, RK3188 and RK3288. Heavily based on the rockchip i2s driver. Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-06ASoC: rockchip: namespace rockchip i2s module nameSjoerd Simons1-2/+2
Change the rockchip i2s object name (and thus module name) from the rather generic snd-soc-i2s to the more specific snd-soc-rockchip-i2s Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-19ASoC: rockchip: Fix missing CLKDEV_LOOKUP dependencyAxel Lin1-2/+2
Make SND_SOC_ROCKCHIP_MAX98090 and SND_SOC_ROCKCHIP_RT5645 depend on CLKDEV_LOOKUP to fix below build warning: warning: (SND_SOC_ROCKCHIP_MAX98090 && SND_SOC_ROCKCHIP_RT5645) selects SND_SOC_ROCKCHIP_I2S which has unmet direct dependencies (SOUND && !M68K && !UML && SND && SND_SOC && CLKDEV_LOOKUP && SND_SOC_ROCKCHIP) Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-30Merge remote-tracking branches 'asoc/topic/rcar', 'asoc/topic/reg-default', ↵Mark Brown2-3/+1
'asoc/topic/rl6231', 'asoc/topic/rockchip' and 'asoc/topic/rt286' into asoc-next
2015-08-26ASoC: rockchip: fix platform_no_drv_owner.cocci warningskbuild test robot1-1/+0
sound/soc/rockchip/rockchip_rt5645.c:214:3-8: No need to set .owner here. The core will do it. Remove .owner field if calls are used which set it automatically Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-26ASoC: rockchip: fix platform_no_drv_owner.cocci warningskbuild test robot1-1/+0
sound/soc/rockchip/rockchip_max98090.c:225:3-8: No need to set .owner here. The core will do it. Remove .owner field if calls are used which set it automatically Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-26ASoC: rockchip: fix a misjudgement by returnXing Zheng1-1/+1
Being careless, judge the return value of snd_soc_card_jack_new is opposite, so it should be fixed. Signed-off-by: Xing Zheng <zhengxing@rock-chips.com> Reviewed-by: Dylan Reid <dgreid@chromium.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-21ASoC: Set missing card owner fieldAxel Lin2-0/+2
Set the card owner field to prevent the module from being removed from underneath its users. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-19ASoC: rockchip: i2s: Adjust devm usageVaishali Thakkar1-6/+2
Remove use of snd_soc_unregister_component in remove function as devm_snd_soc_register_component in probe function automatically handles it. Also, convert call of snd_dmaengine_pcm_register to managed resource function devm_snd_dmaengine_pcm_register and remove usage of snd_dmaengine_pcm_unregister in probe and remove functions. Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-20ASoC: rockchip: Add machine driver for rt5645/rt5650 codeczhengxing3-0/+236
The driver is used for rockchip board using a rt5645/rt5650. Reviewed-by: Dylan Reid <dgreid@chromium.org> Signed-off-by: zhengxing <zhengxing@rock-chips.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-20ASoC: rockchip: Add machine driver for max98090 codeczhengxing3-0/+250
The driver is used for rockchip board using a max98090. Reviewed-by: Dylan Reid <dgreid@chromium.org> Signed-off-by: zhengxing <zhengxing@rock-chips.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-26Merge branch 'for-linus' into for-nextTakashi Iwai1-0/+1
Sync with the latest 3.19-rc state for applying other ALSA sequencer core fixes.
2015-01-26Merge remote-tracking branches 'asoc/fix/adi', 'asoc/fix/compress', ↵Mark Brown1-0/+1
'asoc/fix/fsl-ssi', 'asoc/fix/imx', 'asoc/fix/intel', 'asoc/fix/omap', 'asoc/fix/rockchip' and 'asoc/fix/rt286' into asoc-linus
2015-01-08ASoC: rockchip: i2s: applys rate symmetry for CPU DAIJianqun Xu1-0/+1
This patch applys rate symmetry for rockchip i2s DAI. Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-12-24Merge remote-tracking branches 'asoc/topic/pxa', 'asoc/topic/rockchip', ↵Mark Brown1-0/+4
'asoc/topic/rt5670' and 'asoc/topic/rt5677' into asoc-next
2014-12-24ASoC: rockchip: i2s: set TDL and RDL to 16 samplesJianqun Xu1-0/+4
Set Transmit Data Level(TDL) and Receive Data Level(RDL) to 16 samples. Without this setting, the TDL is default to be 0x00 (means 0 sample), and the RDL is default to be 0x1f (means 32 samples). Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-12-24ASoC: rockchip: i2s: fix maxburst of dma data to 4Jianqun Xu1-2/+2
Since RK3288 DMAC's burst length only support max to 4, here set maxburst of playback and capture dma data to 4. Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-12-24ASoC: rockchip: i2s: fix error defination of transmit data levelJianqun Xu1-1/+1
According to description about "Transmit Data Level", This bit field controls the level at which a DMA request is made by the transmit logic. It is equal to the watermark level. That is, the dma_tx_req signal is generated when the number of valid data entries in the TXFIFO (TXFIFO0 if CSR=00 TXFIFO1 if CSR=01 TXFIFO2 if CSR=10 TXFIFO3 if CSR=11) is equal to or below this field value. Different to receive data level, transmit data level does not need to "-1". Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-12-14Merge tag 'driver-core-3.19-rc1' of ↵Linus Torvalds1-1/+0
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core Pull driver core update from Greg KH: "Here's the set of driver core patches for 3.19-rc1. They are dominated by the removal of the .owner field in platform drivers. They touch a lot of files, but they are "simple" changes, just removing a line in a structure. Other than that, a few minor driver core and debugfs changes. There are some ath9k patches coming in through this tree that have been acked by the wireless maintainers as they relied on the debugfs changes. Everything has been in linux-next for a while" * tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (324 commits) Revert "ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries" fs: debugfs: add forward declaration for struct device type firmware class: Deletion of an unnecessary check before the function call "vunmap" firmware loader: fix hung task warning dump devcoredump: provide a one-way disable function device: Add dev_<level>_once variants ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries ath: use seq_file api for ath9k debugfs files debugfs: add helper function to create device related seq_file drivers/base: cacheinfo: remove noisy error boot message Revert "core: platform: add warning if driver has no owner" drivers: base: support cpu cache information interface to userspace via sysfs drivers: base: add cpu_device_create to support per-cpu devices topology: replace custom attribute macros with standard DEVICE_ATTR* cpumask: factor out show_cpumap into separate helper function driver core: Fix unbalanced device reference in drivers_probe driver core: fix race with userland in device_add() sysfs/kernfs: make read requests on pre-alloc files use the buffer. sysfs/kernfs: allow attributes to request write buffer be pre-allocated. fs: sysfs: return EGBIG on write if offset is larger than file size ...
2014-12-08Merge remote-tracking branches 'asoc/topic/rcar', 'asoc/topic/rockchip', ↵Mark Brown1-2/+7
'asoc/topic/rt286' and 'asoc/topic/rt5631' into asoc-next
2014-11-24ASoC: rockchip: i2s: Fix Kconfig for I2S device driverAndreas Ruprecht1-2/+2
Currently, CONFIG_SND_SOC_ROCKCHIP_I2S could also be selected without having CONFIG_SND_SOC_ROCKCHIP enabled. As this makes no sense, a Kconfig dependency is added to CONFIG_SND_SOC_ROCKCHIP_I2S. This will make the item visible only if CONFIG_SND_SOC_ROCKCHIP is enabled. Additionally, as the code connected to CONFIG_SND_SOC_ROCKCHIP_I2S depends on CONFIG_SND_SOC_GENERIC_DMAENGINE_PCM, the dependency is moved to reflect this more clearly. Signed-off-by: Andreas Ruprecht <rupran@einserver.de> Reported-by: Jim Davis <jim.epost@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-11-03ASoC: rockchip: i2s: add text after tristate for SND_SOC_ROCKCHIP_I2SJianqun1-1/+6
For SND_SOC_ROCKCHIP_I2S, adding some text after the tristate to make this directly user selectable. Signed-off-by: Jianqun <jay.xu@rock-chips.com> Signed-off-by: Mark Brown <broonie@kernel.org>