summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/rt5663.c
AgeCommit message (Collapse)AuthorFilesLines
2017-09-01Merge remote-tracking branches 'asoc/topic/rt5563', 'asoc/topic/rt5616', ↵Mark Brown1-46/+214
'asoc/topic/rt5645', 'asoc/topic/rt5659' and 'asoc/topic/rt5663' into asoc-next
2017-08-30ASoC: rt5663: Add delay for jack plug inoder_chiou@realtek.com1-0/+3
Codec initialize takes some time when 3.5mm jack plugged in. Add a delay to report jack plugged event to user space to avoid pop noise. Signed-off-by: Hsinyu Chao <hychao@chromium.org> Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-08-21Merge branch 'topic/msm8916' of ↵Mark Brown1-9/+9
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-const
2017-08-21Merge tag 'v4.13-rc6' into asoc-msm8916Mark Brown1-9/+9
Linux 4.13-rc6
2017-08-18ASoC: codecs: constify snd_soc_dai_ops structuresArvind Yadav1-1/+1
snd_soc_dai_ops are not supposed to change at runtime. All functions working with snd_soc_dai_ops provided by <sound/soc-dai.h> work with const snd_soc_dai_ops. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-08-14ASoC: rt5663: Fine tune for the headphone output pop soundoder_chiou@realtek.com1-5/+16
The patch fine tunes for the headphone output pop sound. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-08-10ASoC: codecs: add const to snd_soc_codec_driver structuresBhumika Goyal1-1/+1
Declare snd_soc_codec_driver structures as const as they are only passed as an argument to the function snd_soc_register_codec. This argument is of type const, so declare the structures with this property as const. In file codecs/sn95031.c, snd_soc_codec_driver structure is also used in a copy operation along with getting passed to snd_soc_register_codec. So, it can be made const too. Done using Coccinelle: @match disable optional_qualifier@ identifier s; position p; @@ static struct snd_soc_codec_driver s@p={...}; @good1@ identifier match.s; position p; @@ snd_soc_register_codec(...,&s@p,...) @bad@ identifier match.s; position p!={match.p,good1.p}; @@ s@p @depends on !bad disable optional_qualifier@ identifier match.s; @@ static +const struct snd_soc_codec_driver s={...}; Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-08-02ASoC: rt5663: Seprate the DC offset between headphone and headsetoder_chiou@realtek.com1-14/+38
The patch seprates the DC offset between headphone and headset. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-08-01ASoC: rt5663: Add the delay time to correct the calibrationoder_chiou@realtek.com1-0/+1
The patch adds the delay time to correct the calibration. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-07-24ASoC: rt5663: constify acpi_device_id.Arvind Yadav1-1/+1
acpi_device_id are not supposed to change at runtime. All functions working with acpi_device_id provided by <acpi/acpi_bus.h> work with const acpi_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-07-19ASoC: rt5663: Correct the mixer switch setting and remove redundant routing pathoder_chiou@realtek.com1-6/+4
The patch corrects the mixer siwtch setting that was the mistake in the previous commitment. And remove the redundant routing paths. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-07-18ASoC: rt5663: Modify the default value for ASRC functionoder_chiou@realtek.com1-1/+2
The patch modifies the default value for ASRC function. It could prevent the pop noise and recording no sound with ASRC function. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-07-17ASoC: rt5663: constify snd_soc_dai_ops structureGustavo A. R. Silva1-1/+1
This structure is only stored in the ops field of a snd_soc_dai_driver structure. That field is declared const, so snd_soc_dai_ops structures that have this property can be declared as const also. Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-07-17ASoC: rt5663: Add the manual offset field to compensate the DC offsetoder_chiou@realtek.com1-5/+50
The patch adds the manual offset field in the devicetree to compensate the DC offset that will be different between the PCB layout. It only can be measured by the real production. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-07-17ASoC: rt5663: add in missing loop counter to avoid infinite loopColin Ian King1-1/+1
The loop counter 'count' is missing an increment, so we could end up with an infinite loop. Add in a pre-increment to count to fix this. Detected by CoverityScan, CID#1450120 ("Logically Dead Code") Fixes: 1a425dbf1a10 ("ASoC: rt5663: Update the calibration funciton") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-07-17ASoC: rt5663: Modify the power sequence for reducing the pop soundoder_chiou@realtek.com1-7/+29
The patch modifies the power sequence for reducing the pop sound. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-07-17ASoC: rt5663: Optimize the Jack Type detectionoder_chiou@realtek.com1-9/+14
The patch optimizes the Jack Type detection. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-07-17ASoC: rt5663: Update the calibration funcitonoder_chiou@realtek.com1-21/+79
The patch updates the calibration funciton for getting the correct DC offset of headphone output. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-07-10ASoC: rt5663: Update the HW default values based on the shipping versionoder_chiou@realtek.com1-9/+9
The patch update the HW default values based on the shipping version. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-06-13ASoC: rt5663: Check the JD status in the resume functionOder Chiou1-0/+2
In the suspend, the IRQ function will not work in some machines. So the JD status should be checked in the resume function. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-06-06ASoC: rt5663: Fix the IRQ issueOder Chiou1-1/+1
The patch fixed the IRQ issue. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-12-12Merge remote-tracking branches 'asoc/topic/rt5514', 'asoc/topic/rt5616', ↵Mark Brown1-565/+572
'asoc/topic/rt5640', 'asoc/topic/rt5660' and 'asoc/topic/rt5663' into asoc-next
2016-10-24ASoC: rt5663: rename rt5668 as rt5663 v2Bard Liao1-566/+564
The "rt5668" codec supported in this driver is actually a revision of "rt5663". So the patch is renamed to "rt5663 v2" Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-10-21ASoC: Add jd function for rt5663.Jack Yu1-1/+10
Add initial setting for rt5663 jd to irq. Signed-off-by: Jack Yu <jack.yu@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-10-13ASoC: rt5663: fix a debug statementDan Carpenter1-2/+2
We increment "i" before printing the debug statement. That makes it the wrong sleep_time[] information and Smatch complains that the last increment could be beyond the end of the array. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-20ASoC: rt5663: fix platform_no_drv_owner.cocci warningskbuild test robot1-1/+0
sound/soc/codecs/rt5663.c:3203: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> Acked-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-20ASoC: rt5663: fix sparse warningsWei Yongjun1-6/+6
Fixes the following sparse warnings: sound/soc/codecs/rt5663.c:1367:14: warning: duplicate const sound/soc/codecs/rt5663.c:1577:5: warning: symbol 'rt5663_button_detect' was not declared. Should it be static? sound/soc/codecs/rt5663.c:2857:24: warning: symbol 'rt5663_aif_dai_ops' was not declared. Should it be static? sound/soc/codecs/rt5663.c:2866:27: warning: symbol 'rt5663_dai' was not declared. Should it be static? sound/soc/codecs/rt5663.c:3193:6: warning: symbol 'rt5663_i2c_shutdown' was not declared. Should it be static? sound/soc/codecs/rt5663.c:3200:19: warning: symbol 'rt5663_i2c_driver' 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-16ASoC: rt5663: refine error handlingArnd Bergmann1-0/+3
The newly added rt5663 codec driver introduces a couple of warnings when built with -Wmaybe-uninitialized: codecs/rt5663.c: In function 'rt5663_set_tdm_slot': codecs/rt5663.c:2680:2: error: 'reg' may be used uninitialized in this function [-Werror=maybe-uninitialized] codecs/rt5663.c: In function 'rt5663_set_dai_pll': codecs/rt5663.c:2556:12: error: 'shift' may be used uninitialized in this function [-Werror=maybe-uninitialized] codecs/rt5663.c:2596:2: error: 'mask' may be used uninitialized in this function [-Werror=maybe-uninitialized] We can avoid those warnings by always returning an error from the switch() statements instead of falling through with an uninitialized variable when we hit an unexpected case. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Fixes: df7c52168ee1 ("ASoC: add rt5663 codec driver") Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-14ASoC: add rt5663 codec driverBard Liao1-0/+3216
This is the initial codec driver for both rt5663 rt5668 codec. Signed-off-by: John Lin <john.lin@realtek.com> Signed-off-by: Jack Yu <jack.yu@realtek.com> Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>