History log of /linux-master/sound/soc/codecs/rt5665.c
Revision Date Author Comments
# 00933c49 12-Feb-2024 Yinchuan Guo <guoych37@mail2.sysu.edu.cn>

ASoC: codecs: fix TYPO 'reguest' to 'request' in error log

This patch corrects a common misspelling of "request" as "reguest" found
in error log across multiple files within sound/soc/codecs.

Signed-off-by: Yinchuan Guo <guoych37@mail2.sysu.edu.cn>
Link: https://msgid.link/r/20240212144247.43744-1-guoych37@mail2.sysu.edu.cn
Signed-off-by: Mark Brown <broonie@kernel.org>


# 647a3c4c 17-Aug-2023 Linus Walleij <linus.walleij@linaro.org>

ASoC: rt5665: Convert to use GPIO descriptors

The RT5665 driver has some stub support for GPIO descriptors
going back to the initial driver commit, where there are
two GPIO descriptors for the LDO and headphone detection
defined in the device state. Well, let's make use of the
descriptor properly.

We remove the global GPIO number from the platform data,
but it is still possible to create board files using GPIO
descriptor tables, if desired.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230817-descriptors-asoc-rt-v2-2-02fa2ca3e5b0@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>


# c163108e 01-Aug-2023 Zhang Shurong <zhang_shurong@foxmail.com>

ASoC: rt5665: add missed regulator_bulk_disable

The driver forgets to call regulator_bulk_disable()

Add the missed call to fix it.

Fixes: 33ada14a26c8 ("ASoC: add rt5665 codec driver")
Signed-off-by: Zhang Shurong <zhang_shurong@foxmail.com>
Link: https://lore.kernel.org/r/tencent_A560D01E3E0A00A85A12F137E4B5205B3508@qq.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 487c9129 10-Jun-2023 Mark Brown <broonie@kernel.org>

ASoC: rt5665: Use maple tree register cache

The rt5665 can only support single register read and write operations
so does not benefit from block writes. This means it gets no benefit from
using the rbtree register cache over the maple tree register cache so
convert it to use maple trees instead, it is more modern.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230609-asoc-rt-maple-v1-13-729c6553cdcf@kernel.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


# 8ec35236 30-Jan-2023 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: rt: use helper function

Current ASoC has many helper function.
This patch use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87zg9zea4w.wl-kuninori.morimoto.gx@renesas.com
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>


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

ASoC: rt5665: clarify expression

cppcheck warning:

sound/soc/codecs/rt5665.c:4388:61: style: Boolean result is used in
bitwise operation. Clarify expression with
parentheses. [clarifyCondition]
(pll_code.m_bp ? 0 : pll_code.m_code) << RT5665_PLL_M_SFT |
^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210302212527.55158-17-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 467a2553 15-Jun-2020 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: codecs: rt*: rename to snd_soc_component_read()

We need to use snd_soc_component_read()
instead of snd_soc_component_read32()

This patch renames _read32() to _read()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87d05z4mce.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# f90aa354 22-Jul-2019 Christophe JAILLET <christophe.jaillet@wanadoo.fr>

ASoC: rt5665: Fix a typo in the name of a function

All function names start with rt5665_, except 'rt5655_set_verf()'.
It is likely a typo.

Fix it to be consistent.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/20190722212639.26954-1-christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>


# 590eb2f4 05-Jul-2019 Colin Ian King <colin.king@canonical.com>

ASoC: rt5665: remove redundant assignment to variable idx

The variable idx is being initialized with a value that is never
read and it is being updated later with a new value. The
initialization is redundant and can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20190705075303.14692-1-colin.king@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# d2912cb1 04-Jun-2019 Thomas Gleixner <tglx@linutronix.de>

treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500

Based on 2 normalized pattern(s):

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license version 2 as
published by the free software foundation

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license version 2 as
published by the free software foundation #

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-only

has been chosen to replace the boilerplate/reference in 4122 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Enrico Weigelt <info@metux.net>
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Allison Randal <allison@lohutok.net>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 1c96a2f6 01-Sep-2018 David Frey <dpfrey@gmail.com>

regmap: split up regmap_config.use_single_rw

Split regmap_config.use_single_rw into use_single_read and
use_single_write. This change enables drivers of devices which only
support bulk operations in one direction to use the regmap_bulk_*()
functions for both directions and have their bulk operation split into
single operations only when necessary.

Update all struct regmap_config instances where use_single_rw==true to
instead set both use_single_read and use_single_write. No attempt was
made to evaluate whether it is possible to set only one of
use_single_read or use_single_write.

Signed-off-by: David Frey <dpfrey@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 20ebbd2f 29-Jan-2018 Bard Liao <bardliao@realtek.com>

ASoC: rt5665: remove rt5668 support

Remove rt5668 support from rt5665 codec driver since rt5668 will
not go into mass production.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# fab70c27 28-Jan-2018 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: rt5665: replace codec to component

Now we can replace Codec to Component. Let's do it.

Note:
xxx_codec_xxx() -> xxx_component_xxx()
.idle_bias_off = 1 -> .idle_bias_on = 0
.ignore_pmdown_time = 0 -> .use_pmdown_time = 1
- -> .endianness = 1
- -> .non_legacy_dai_naming = 1

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# a180ba45 03-Aug-2017 Bhumika Goyal <bhumirks@gmail.com>

ASoC: codecs: add const to snd_soc_codec_driver structures

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>


# 7e5824c9 31-Jul-2017 Bard Liao <bardliao@realtek.com>

ASoC: rt5665: fix wrong register for bclk ratio control

The register of setting back ratio should be RT5665_ADDA_CLK_2
instead of RT5665_ADDA_CLK_1.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# abfedab1 23-Jul-2017 Arvind Yadav <arvind.yadav.cs@gmail.com>

ASoC: rt5665: constify acpi_device_id.

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>


# b833786b 24-Jul-2017 Bard Liao <bardliao@realtek.com>

ASoC: rt5665: add MONOVOL Playback Volume control

MONOVOL Playback Volume is a playback volume control on "MONOVOL MIX".

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 8bfa4268 19-Jul-2017 Bard Liao <bardliao@realtek.com>

ASoC: rt5665: add clock sync control for master mode

We can sleect the i2s clock source for each i2s bus in master mode.
The choice is depended on the HW design and the use case.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 01dfb1ec 19-Jul-2017 Bard Liao <bardliao@realtek.com>

ASoC: rt5665: add clcok control for master mode

Add i2s clock control for codec master mode.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# fa05899c 14-Jul-2017 Bard Liao <bardliao@realtek.com>

ASoC: rt5665: force using PLL if MCLK is not suitable

Idealy PLL will be set in machine driver if MCLK doesn't meet the
requirement of codec. To let the codec driver be more general, we
can use a common PLL setting once sysclk/pll doesn't set properly
in machine driver.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# b059ca72 29-Jun-2017 Bard Liao <bardliao@realtek.com>

ASoC: rt5665: calibration should be done before jack detection

We will set some volatile registers in jack detection function. But
those volatile registers will be clear in rt5665_calibrate function
because we set cache bypass and reset codec in rt5665_calibrate function.
This patch add a flag to make sure that rt5665_calibrate is done
before starting jack detection.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 18fe7869 16-May-2017 Wei Yongjun <weiyongjun1@huawei.com>

ASoC: rt5665: make local symbol rt5665_i2c_driver static

Fixes the following sparse warnings:

sound/soc/codecs/rt5665.c:4928:19: warning:
symbol 'rt5665_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>


# b98ae9ad 15-May-2017 Geert Uytterhoeven <geert@linux-m68k.org>

ASoC: rt5665: Fix uninitialized warning in rt5665_i2s_pin_event()

With gcc 4.1.2:

sound/soc/codecs/rt5665.c: In function ‘rt5665_i2s_pin_event’:
sound/soc/codecs/rt5665.c:2610: warning: ‘mask1’ may be used uninitialized in this function
sound/soc/codecs/rt5665.c:2610: warning: ‘val2’ may be used uninitialized in this function
sound/soc/codecs/rt5665.c:2610: warning: ‘val1’ may be used uninitialized in this function

The first one is currently a false positive, as rt5665_i2s_pin_event()
is never called with snd_soc_dapm_widget.shift set to a value not
handled by the switch() statement. But that may change, so
preinitialize mask1 to fix this, like is already done for mask2.

The last two are false-positives, the compiler is just not smart enough
to notice the mask and val variables are always used together.

Fixes: 9b5d3865b3b410d2 ("ASoC: rt5665: set i2s pin share configuration")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 30b7d88d 01-May-2017 Bard Liao <bardliao@realtek.com>

ASoC: rt5665: add ADC STO2 ASRC support

"ADC Stereo2 Filter" is with ASRC supported.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 27a655c4 11-May-2017 Arnd Bergmann <arnd@arndb.de>

ASoC: rt5665: fix gcc-7 warning

gcc-7 warns that there is a duplicate 'const' specifier in some
variables that are declared using the SOC_ENUM_SINGLE_DECL macro:

sound/soc/codecs/rt5665.c:915:14: error: duplicate 'const' declaration specifier [-Werror=duplicate-decl-specifier]
static const SOC_ENUM_SINGLE_DECL(rt5665_if1_1_01_adc_enum,
sound/soc/codecs/rt5665.c:918:14: error: duplicate 'const' declaration specifier [-Werror=duplicate-decl-specifier]
static const SOC_ENUM_SINGLE_DECL(rt5665_if1_1_23_adc_enum,
sound/soc/codecs/rt5665.c:921:14: error: duplicate 'const' declaration specifier [-Werror=duplicate-decl-specifier]
static const SOC_ENUM_SINGLE_DECL(rt5665_if1_1_45_adc_enum,
sound/soc/codecs/rt5665.c:924:14: error: duplicate 'const' declaration specifier [-Werror=duplicate-decl-specifier]
static const SOC_ENUM_SINGLE_DECL(rt5665_if1_1_67_adc_enum,
...

This removes one to fix the 68 warnings in this file

Fixes: 33ada14a26c8 ("ASoC: add rt5665 codec driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 97c415a6 11-Apr-2017 Bard Liao <bardliao@realtek.com>

ASoC: rt5665: move rt5665_set_jack_detect to .set_jack

Now, we can use .set_jack callback function on codec level. So we
don't need export rt5665_set_jack_detect.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 17febfa6 19-Mar-2017 Bard Liao <bardliao@realtek.com>

ASoC: rt5665: fix wrong pre div reg of IF2 and IF3

The pre divider control register of IF1 and IF2/3 are different.
The driver used the same register for all interfaces which was a
mistake.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 83749aba 19-Mar-2017 Bard Liao <bardliao@realtek.com>

ASoC: rt5665: fix wrong shift rt5665_if2_1_adc_in_enum

The shift is RT5665_IF2_1_ADC_IN_SFT not RT5665_IF3_ADC_IN_SFT.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 9b5d3865 15-Mar-2017 Bard Liao <bardliao@realtek.com>

ASoC: rt5665: set i2s pin share configuration

I2S2 and I2S3 are share pins. We need to configure it when i2s is
active and disable it when i2s is inactive. To disable i2s pins
means to set them as gpio.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 28d2ca39 09-Mar-2017 Bard Liao <bardliao@realtek.com>

ASoC: rt5665: move set_sysclk to codec level

Move set_sysclk to codec level and people can use it at both
codec and dai level.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# ccd00d59 09-Mar-2017 Bard Liao <bardliao@realtek.com>

ASoC: rt5665: move set_pll to codec level

Move set_pll function to codec level and people can use it at both
codec and dai level. Also, lower case "source" to keep it consistent.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 39841944 08-Mar-2017 Bard Liao <bardliao@realtek.com>

ASoC: rt5665: enhance jack type detection function

Use manual mode for jack detection function to increase accuracy.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 948059dd 08-Mar-2017 Bard Liao <bardliao@realtek.com>

ASoC: rt5665: enable TDM if more than 2 channels

TDM is necessary for more than 2 channels. And there is no control bit
to specify which slots are using. Machine driver will not need to call
snd_soc_dai_set_tdm_slot if we do it in rt5665_hw_params.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 246126b0 08-Mar-2017 Bard Liao <bardliao@realtek.com>

ASoC: rt5665: increase button detection accuracy

Use sar adc for button detection to increase accuracy.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 09b50c37 08-Mar-2017 Bard Liao <bardliao@realtek.com>

ASoC: rt5665: CLKDET is also a power of ASRC

We need to power on CLKDET to use ASRC function.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 8f365313 08-Mar-2017 Bard Liao <bardliao@realtek.com>

ASoC: rt5665: Vref3 is necessary for Mono Amp

Vref3 is necessary for Mono Amp. So add it to dapm routes

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 593dd5d9 08-Mar-2017 Bard Liao <bardliao@realtek.com>

ASoC: rt5665: increase LDO level

Too low LDO level will cause a few functions unstable.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# f1994a9c 08-Mar-2017 Bard Liao <bardliao@realtek.com>

ASoC: rt5665: fix getting wrong work handler container

We got rt5665 private data from wrong work. It will result in kernel
panic.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org


# f2826c1f 16-Nov-2016 Axel Lin <axel.lin@ingics.com>

ASoC: rt5665: Use devm_gpio_request_one()

Simplify the code a bit.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 0c95666f 16-Nov-2016 Axel Lin <axel.lin@ingics.com>

ASoC: rt5665: Fix missing mutex_unlock in rt5665_calibrate

Reported-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 33ada14a 13-Nov-2016 Bard Liao <bardliao@realtek.com>

ASoC: add rt5665 codec driver

This is the initial codec driver for rt5665.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>