History log of /linux-master/sound/soc/codecs/rt1015.c
Revision Date Author Comments
# 74d71f62 14-Sep-2023 Shuming Fan <shumingf@realtek.com>

ASoC: rt1015: fix the first word being cut off

This patch adds a control that there are four options to control the digital volume output.
The user could select "immediate" to make volume updates immediately.
In default, the driver selects the volume update with "zero detection + soft inc/dec change".

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Link: https://lore.kernel.org/r/20230915020530.83452-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# c7a7f444 12-Aug-2023 Linus Walleij <linus.walleij@linaro.org>

ASoC: rt1015: Drop GPIO include

This driver include the GPIO legacy header <linux/gpio.h yet
doesn't use symbols from it. Drop the include.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org
Link: https://lore.kernel.org/r/20230812-descriptors-asoc-v1-2-eb4dca1f68af@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org


# 9abcd240 25-Apr-2023 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

ASoC: Switch i2c drivers back to use .probe()

After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new()
call-back type"), all drivers being converted to .probe_new() and then
03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert
back to (the new) .probe() to be able to eventually drop .probe_new() from
struct i2c_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de
Link: https://lore.kernel.org/r/20230425095716.331419-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org


# a524837d 23-Jun-2022 Charles Keepax <ckeepax@opensource.cirrus.com>

ASoC: rt*: Remove now redundant non_legacy_dai_naming flag

The ASoC core has now been changed to default to the non-legacy DAI
naming, as such drivers using the new scheme no longer need to specify
the non_legacy_dai_naming flag.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220623125250.2355471-57-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 35b88858 05-Apr-2022 Stephen Kitt <steve@sk2.org>

ASoC: rt*: use simple i2c probe function

The i2c probe functions here don't use the id information provided in
their second argument, so the single-parameter i2c probe function
("probe_new") can be used instead.

This avoids scanning the identifier tables during probes.

Signed-off-by: Stephen Kitt <steve@sk2.org>
Link: https://lore.kernel.org/r/20220405130326.2107293-1-steve@sk2.org
Signed-off-by: Mark Brown <broonie@kernel.org>


# a4db95b2 24-Sep-2021 Colin Ian King <colin.king@canonical.com>

ASoC: codecs: Fix spelling mistake "Unsupport" -> "Unsupported"

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>


# d019403a 23-Aug-2021 Tzung-Bi Shih <tzungbi@google.com>

ASoC: rt1015: remove possible unused variable `bclk_ms'

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>


# bc1c8e4e 26-Jul-2021 Jack Yu <jack.yu@realtek.com>

ASoC: rt1015: Remove unnecessary flush work on rt1015 driver

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>


# 9f44673b 21-Mar-2021 Jack Yu <jack.yu@realtek.com>

ASoC: rt1015: Add bclk detection and dc detection

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>


# 4354ad55 02-Mar-2021 Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

ASoC: rt1015: clarify expression

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>


# 3084e5f7 24-Feb-2021 Rikard Falkeborn <rikard.falkeborn@gmail.com>

ASoC: rt*: Constify static struct acpi_device_id

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>


# f9e56a34 24-Feb-2021 Rikard Falkeborn <rikard.falkeborn@gmail.com>

ASoC: rt*: Constify static struct snd_soc_dai_ops

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>


# 2979ef76 22-Feb-2021 Jack Yu <jack.yu@realtek.com>

ASoC: rt1015: enable BCLK detection after calibration

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>


# 7fb08871 22-Feb-2021 Jack Yu <jack.yu@realtek.com>

ASoC: rt1015: fix i2c communication error

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>


# 0d2b6e39 22-Feb-2021 Jack Yu <jack.yu@realtek.com>

ASoC: rt1015: enable BCLK detection after calibration

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>


# 9e0bdaa9 22-Feb-2021 Jack Yu <jack.yu@realtek.com>

ASoC: rt1015: fix i2c communication error

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>


# 81a6320d 24-Dec-2020 Tzung-Bi Shih <tzungbi@google.com>

ASoC: rt1015: remove bclk_ratio

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>


# d750570e 24-Dec-2020 Tzung-Bi Shih <tzungbi@google.com>

ASoC: rt1015: re-calibrate again when resuming

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>


# a5db2ca5 24-Dec-2020 Tzung-Bi Shih <tzungbi@google.com>

ASoC: rt1015: remove unneeded variables in rt1015_priv

- `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>


# 3128f1c3 24-Dec-2020 Tzung-Bi Shih <tzungbi@google.com>

ASoC: rt1015: refactor retry loop and rt1015_priv allocation

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>


# e48b41e9 24-Dec-2020 Tzung-Bi Shih <tzungbi@google.com>

ASoC: rt1015: return error if any when setting bypass_boost

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>


# bf1eb056 24-Dec-2020 Tzung-Bi Shih <tzungbi@google.com>

ASoC: rt1015: save boost_mode only if valid

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>


# 4ac275ed 24-Dec-2020 Tzung-Bi Shih <tzungbi@google.com>

ASoC: rt1015: sort header inclusions

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>


# 6bdd75a1 21-Dec-2020 Jack Yu <jack.yu@realtek.com>

ASoC: rt1015: modify calibration sequence for better performance

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>


# 397e089b 09-Dec-2020 Derek Fang <derek.fang@realtek.com>

ASoC: rt1015: check the return value of regmap_read during i2c probe

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>


# 106e6d8d 13-Nov-2020 Shuming Fan <shumingf@realtek.com>

ASoC: rt1015: increase the time to detect BCLK

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>


# 95370acd 08-Nov-2020 Jack Yu <jack.yu@realtek.com>

ASoC: rt1015: modification for calibration to get better performance

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>


# 93bd813c 04-Nov-2020 Jack Yu <jack.yu@realtek.com>

ASoC: rt1015: add delay to fix pop noise from speaker

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>


# 7e9a2387 04-Nov-2020 Shuming Fan <shumingf@realtek.com>

ASoC: rt1015: support TDM slot configuration

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>


# 8d9a14fc 14-Sep-2020 derek.fang <derek.fang@realtek.com>

ASoC: rt1015: Fix the failure to flush DAC data before playback

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>


# da145172 14-Sep-2020 derek.fang <derek.fang@realtek.com>

ASoC: rt1015: Fix DC calibration on bypass boost mode

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>


# 72ac4a4b 25-Jun-2020 Tzung-Bi Shih <tzungbi@google.com>

ASoC: rt1015: add missing header inclusion

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>


# 668b1508 15-Jun-2020 Jack Yu <jack.yu@realtek.com>

ASoC: rt1015: Flush DAC data before playback.

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>


# e74a1e7e 14-Jun-2020 Jack Yu <jack.yu@realtek.com>

ASoC: rt1015: Update rt1015 default register value according to spec 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>


# 2aec8ccc 29-May-2020 derek.fang <derek.fang@realtek.com>

ASoC: rt1015: Enable class-D silence and clock detections

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>


# d696a614 04-May-2020 Jack Yu <jack.yu@realtek.com>

ASoC: rt1015: Add condition to prevent SoC providing bclk in ratio of 50 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>


# 4b01618b 02-Mar-2020 Jack Yu <jack.yu@realtek.com>

ASoC: rt1015: modify pre-divider for sysclk

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>


# a79ee2e0 02-Mar-2020 YueHaibing <yuehaibing@huawei.com>

ASoC: rt1015: set snd_soc_dai_ops in rt1015_dai driver

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>


# d237851d 01-Mar-2020 Jack Yu <jack.yu@realtek.com>

ASoC: rt1015: add operation callback function for rt1015_dai[]

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>


# 4a88b7de 26-Feb-2020 Jack Yu <jack.yu@realtek.com>

ASoC: rt1015: modify some structure to be static.

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>


# 2f0b4203 16-Feb-2020 Jack Yu <jack.yu@realtek.com>

ASoC: rt1015: fix typo for bypass boost control

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>


# e91440dd 24-Jan-2020 Nathan Chancellor <nathan@kernel.org>

ASoC: rt1015: Remove unnecessary const

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>


# df310074 15-Jan-2020 Jack Yu <jack.yu@realtek.com>

ASoC: rt1015: add rt1015 amplifier driver

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>