summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/rt1015.c
AgeCommit message (Collapse)Author
2021-09-27ASoC: codecs: Fix spelling mistake "Unsupport" -> "Unsupported"Colin Ian King
There are spelling mistakes in dev_err error messages. Fix them. Signed-off-by: Colin Ian King <colin.king@canonical.com> Link: https://lore.kernel.org/r/20210924231003.144502-1-colin.king@canonical.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-23ASoC: rt1015: remove possible unused variable `bclk_ms'Tzung-Bi Shih
bclk_ms is possible unused by using the given config (see [1]). sound/soc/codecs/rt1015.c:724:2: warning: Value stored to 'bclk_ms' is never read [clang-analyzer-deadcode.DeadStores] bclk_ms = frame_size > 32; ^ ~~~~~~~~~~~~~~~ In addition, bclk_ms is meaningless and confusing after applying commit a5db2ca51367 ("ASoC: rt1015: remove unneeded variables in rt1015_priv"). The "> 32" in the expression looks like a typo but it was not. Let's remove the confusing variable bclk_ms. [1]: https://lkml.org/lkml/2021/8/23/305 Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20210823153323.1297723-1-tzungbi@google.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-26ASoC: rt1015: Remove unnecessary flush work on rt1015 driverJack Yu
Remove workqueue of flush work in rt1015 driver since we don't need it after internal discussion, and there is no impact on performance without this workqueue. Signed-off-by: Jack Yu <jack.yu@realtek.com> Link: https://lore.kernel.org/r/3ef458a6ad754589b96d6a94abda1e55@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-25ASoC: rt1015: Add bclk detection and dc detectionJack Yu
Add bclk detection and dc detection before playback. Signed-off-by: Jack Yu <jack.yu@realtek.com> Link: https://lore.kernel.org/r/20210322055053.31797-1-jack.yu@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-10ASoC: rt1015: clarify expressionPierre-Louis Bossart
cppcheck warning: sound/soc/codecs/rt1015.c:894:61: style: Boolean result is used in bitwise operation. Clarify expression with parentheses. [clarifyCondition] (pll_code.m_bp ? 0 : pll_code.m_code) << RT1015_PLL_M_SFT | ^ Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20210302212527.55158-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-10ASoC: rt*: Constify static struct acpi_device_idRikard Falkeborn
These are never modified, so make them const to allow the compiler to put them in read-only memory. Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> Link: https://lore.kernel.org/r/20210224211918.39109-4-rikard.falkeborn@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-10ASoC: rt*: Constify static struct snd_soc_dai_opsRikard Falkeborn
The only usage of them is to assign their address to the ops field in the snd_soc_dai_driver struct, which is a pointer to const. Make them const to allow the compiler to put them in read-only memory. Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> Link: https://lore.kernel.org/r/20210224211918.39109-3-rikard.falkeborn@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-10ASoC: rt1015: enable BCLK detection after calibrationJack Yu
Enable BCLK detection after calibration. Signed-off-by: Jack Yu <jack.yu@realtek.com> Link: https://lore.kernel.org/r/20210222090057.29532-2-jack.yu@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-10ASoC: rt1015: fix i2c communication errorJack Yu
Remove 0x100 cache re-sync to solve i2c communication error. Signed-off-by: Jack Yu <jack.yu@realtek.com> Link: https://lore.kernel.org/r/20210222090057.29532-1-jack.yu@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-05ASoC: rt1015: remove bclk_ratioTzung-Bi Shih
bclk_ratio is unused. Removes bclk_ratio and .set_bclk_ratio callback. Removes snd_soc_dai_set_bclk_ratio() in a few machine drivers which are obviously using rt1015. Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20201224101854.3024823-1-tzungbi@google.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-05ASoC: rt1015: re-calibrate again when resumingTzung-Bi Shih
Assuming the calibration state gets lost after system suspend. Re-calibrates again when resuming. The rt1015_priv is alloced by kzalloc. No need to initialize cali_done to 0 in component probe callback. Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20201225030845.4138497-1-tzungbi@google.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-29ASoC: rt1015: remove unneeded variables in rt1015_privTzung-Bi Shih
- `lrck' is only used in .hw_params callback so that it can be local. - `bclk' is unused. - `id' is unused. - `amp_ver' is unused. Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20201224100607.3006171-6-tzungbi@google.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-29ASoC: rt1015: refactor retry loop and rt1015_priv allocationTzung-Bi Shih
Refactors retry loop in flush DAC work. It is more clear to use a for-loop here. Uses !rt1015 to check if NULL. Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20201224100607.3006171-5-tzungbi@google.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-29ASoC: rt1015: return error if any when setting bypass_boostTzung-Bi Shih
Returns -EBUSY if DAC is using when setting bypass_boost. Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20201224100607.3006171-4-tzungbi@google.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-29ASoC: rt1015: save boost_mode only if validTzung-Bi Shih
Saves boost_mode only if valid. Also returns -EINVAL if it is invalid. Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20201224100607.3006171-3-tzungbi@google.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-29ASoC: rt1015: sort header inclusionsTzung-Bi Shih
Sorts header inclusions. ASCII value of 'r' is less than 's'. Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20201224100607.3006171-2-tzungbi@google.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-28ASoC: rt1015: modify calibration sequence for better performanceJack Yu
New calibration sequence to fix power issue in idle state. Signed-off-by: Jack Yu <jack.yu@realtek.com> Link: https://lore.kernel.org/r/ec66399502514edbb1de3cf9bff08b1d@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-09ASoC: rt1015: check the return value of regmap_read during i2c probeDerek Fang
In some projects, the device ID register is not read correctly. This patch helps to verify the issue is caused from i2c host or client. Signed-off-by: Derek Fang <derek.fang@realtek.com> Link: https://lore.kernel.org/r/20201209091308.2823-1-derek.fang@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-30Merge branch 'for-5.10' of ↵Mark Brown
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-5.11
2020-11-13ASoC: rt1015: increase the time to detect BCLKShuming Fan
To meet the most platform, the detection time should be increased to avoid that the flushing DAC data fails. Signed-off-by: Shuming Fan <shumingf@realtek.com> Link: https://lore.kernel.org/r/20201113092125.19206-1-shumingf@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-09ASoC: rt1015: modification for calibration to get better performanceJack Yu
Modification for calibration to get better performance. Signed-off-by: Jack Yu <jack.yu@realtek.com> Link: https://lore.kernel.org/r/20201109062958.16917-1-jack.yu@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-05ASoC: rt1015: add delay to fix pop noise from speakerJack Yu
Add delay to fix pop noise from speaker. Signed-off-by: Jack Yu <jack.yu@realtek.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20201105030804.31115-1-jack.yu@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-04ASoC: rt1015: support TDM slot configurationShuming Fan
Add TDM slot callback function to support TDM configuration Signed-off-by: Shuming Fan <shumingf@realtek.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20201104092005.2227-1-shumingf@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-14ASoC: rt1015: Fix the failure to flush DAC data before playbackderek.fang
Fix the failure to flush DAC data before playback. Signed-off-by: derek.fang <derek.fang@realtek.com> Link: https://lore.kernel.org/r/1600073839-6762-2-git-send-email-derek.fang@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-14ASoC: rt1015: Fix DC calibration on bypass boost modederek.fang
Fix the DC calibration unsuccessful issue on rt1015 bypass boost mode. Signed-off-by: derek.fang <derek.fang@realtek.com> Link: https://lore.kernel.org/r/1600073839-6762-1-git-send-email-derek.fang@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-25ASoC: rt1015: add missing header inclusionTzung-Bi Shih
To fix compilation error: error: implicit declaration of function 'ACPI_PTR' [-Werror,-Wimplicit-function-declaration] .acpi_match_table = ACPI_PTR(rt1015_acpi_match), ^ Adds the missing header "acpi.h" inclusion and sorts in alphabetical. Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20200625153543.85039-4-tzungbi@google.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-16ASoC: rt1015: Flush DAC data before playback.Jack Yu
Flush DAC data before playback. Signed-off-by: Jack Yu <jack.yu@realtek.com> Link: https://lore.kernel.org/r/20200616023644.4523-1-jack.yu@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-15ASoC: rt1015: Update rt1015 default register value according to spec ↵Jack Yu
modification. Update rt1015 default register value according to spec modification. Signed-off-by: Jack Yu <jack.yu@realtek.com> Link: https://lore.kernel.org/r/20200615032433.31061-1-jack.yu@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-29ASoC: rt1015: Enable class-D silence and clock detectionsderek.fang
Avoid noise under bypass boost mode. Signed-off-by: derek.fang <derek.fang@realtek.com> Link: https://lore.kernel.org/r/1590750310-30085-1-git-send-email-derek.fang@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-04ASoC: rt1015: Add condition to prevent SoC providing bclk in ratio of 50 ↵Jack Yu
times of sample rate. Add condition to prevent SoC providing bclk in ratio of 50 times of sample rate. Signed-off-by: Jack Yu <jack.yu@realtek.com> Link: https://lore.kernel.org/r/20200504112013.2499-1-jack.yu@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-04Merge branch 'for-5.6' of ↵Mark Brown
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-5.7
2020-03-03ASoC: rt1015: modify pre-divider for sysclkJack Yu
Modify pre-divider for system clock. Signed-off-by: Jack Yu <jack.yu@realtek.com> Link: https://lore.kernel.org/r/20200303025913.24499-1-jack.yu@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-02Merge branch 'for-5.6' of ↵Mark Brown
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-5.7
2020-03-02ASoC: rt1015: set snd_soc_dai_ops in rt1015_dai driverYueHaibing
snd_soc_dai_driver should set ops in rt1015_dai driver. Also make the two variable static to fix sparse warnings. Fixes: df31007400c3 ("ASoC: rt1015: add rt1015 amplifier driver") Signed-off-by: YueHaibing <yuehaibing@huawei.com> Link: https://lore.kernel.org/r/20200302070522.48104-1-yuehaibing@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-02ASoC: rt1015: add operation callback function for rt1015_dai[]Jack Yu
Add operation callback function for rt1015_dai[]. Signed-off-by: Jack Yu <jack.yu@realtek.com> Link: https://lore.kernel.org/r/20200302015424.9075-1-jack.yu@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-02-28ASoC: rt1015: modify some structure to be static.Jack Yu
Modify rt1015_aif_dai_ops and rt1015_dai[] to be static. Signed-off-by: Jack Yu <jack.yu@realtek.com> Link: https://lore.kernel.org/r/20200227020637.15135-1-jack.yu@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-02-17ASoC: rt1015: fix typo for bypass boost controlJack Yu
Fix typo for "Bypass Boost" control. Signed-off-by: Jack Yu <jack.yu@realtek.com> Link: https://lore.kernel.org/r/20200217020311.12793-1-jack.yu@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-24ASoC: rt1015: Remove unnecessary constNathan Chancellor
Clang warns: ../sound/soc/codecs/rt1015.c:392:14: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier] static const SOC_ENUM_SINGLE_DECL(rt1015_boost_mode_enum, 0, 0, ^ ../include/sound/soc.h:355:2: note: expanded from macro 'SOC_ENUM_SINGLE_DECL' SOC_ENUM_DOUBLE_DECL(name, xreg, xshift, xshift, xtexts) ^ ../include/sound/soc.h:352:2: note: expanded from macro 'SOC_ENUM_DOUBLE_DECL' const struct soc_enum name = SOC_ENUM_DOUBLE(xreg, xshift_l, xshift_r, \ ^ 1 warning generated. Remove the const after static to fix it. Fixes: df31007400c3 ("ASoC: rt1015: add rt1015 amplifier driver") Link: https://github.com/ClangBuiltLinux/linux/issues/845 Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Link: https://lore.kernel.org/r/20200124155750.33753-1-natechancellor@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-23ASoC: rt1015: add rt1015 amplifier driverJack Yu
This is initial amplifier driver for rt1015. Signed-off-by: Jack Yu <jack.yu@realtek.com> Link: https://lore.kernel.org/r/20200115112519.22050-1-jack.yu@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>