summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/rt5514.c
AgeCommit message (Collapse)AuthorFilesLines
2022-06-27ASoC: rt*: Remove now redundant non_legacy_dai_naming flagCharles Keepax1-1/+0
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>
2022-05-04ASoC: Pull in fixesMark Brown1-1/+1
Cleanups for the dmaengine code build on top of current fixes.
2022-05-03ASoC: rt5514: Fix event generation for "DSP Voice Wake Up" controlMark Brown1-1/+1
The driver has a custom put function for "DSP Voice Wake Up" which does not generate event notifications on change, instead returning 0. Since we already exit early in the case that there is no change this can be fixed by unconditionally returning 1 at the end of the function. Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220428162444.3883147-1-broonie@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
2022-04-06ASoC: rt*: use simple i2c probe functionStephen Kitt1-3/+2
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>
2021-09-27ASoC: codecs: Fix spelling mistake "Unsupport" -> "Unsupported"Colin Ian King1-1/+1
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-03ASoC: rt5514: make array div static const, makes object smallerColin Ian King1-1/+1
Don't populate the array div on the stack but instead it static const. Makes the object code smaller by 48 bytes. Before: text data bss dec hex filename 53894 16368 128 70390 112f6 ./sound/soc/codecs/rt5514.o After: text data bss dec hex filename 53750 16464 128 70342 112c6 ./sound/soc/codecs/rt5514.o (gcc version 10.2.0) Signed-off-by: Colin Ian King <colin.king@canonical.com> Link: https://lore.kernel.org/r/20210801064023.138359-1-colin.king@canonical.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-06-19treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500Thomas Gleixner1-4/+1
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>
2019-01-07ASoC: codecs: fix kernel doc descriptionsPierre-Louis Bossart1-0/+1
Missing or spurious parameter descriptions. Fix warnings with W=1 Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-21Merge remote-tracking branches 'regmap/topic/noinc' and ↵Mark Brown1-1/+2
'regmap/topic/single-rw' into regmap-next
2018-09-07regmap: split up regmap_config.use_single_rwDavid Frey1-1/+2
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>
2018-08-16ASoC: rt5514: Fix the issue of the delay volume applied againOder Chiou1-4/+4
After our evaluation, we need to modify the default values to make sure the volume applied immediately. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-24ASoC: rt5514: Fix the issue of the delay volume appliedOder Chiou1-4/+4
The patch fixes the issue of the delay volume applied. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-04-16ASoC: rt5514: Add the missing register in the readable tableoder_chiou@realtek.com1-0/+3
The patch adds the missing register in the readable table. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-03-01ASoC: rt5514: Fix uninitialized calibration valueGeert Uytterhoeven1-0/+1
With gcc-4.1.2, if CONFIG_SND_SOC_RT5514_SPI is not set: sound/soc/codecs/rt5514.c: In function ‘rt5514_dsp_voice_wake_up_put’: sound/soc/codecs/rt5514.c:363: warning: ‘buf[0]’ is used uninitialized in this function sound/soc/codecs/rt5514.c:363: warning: ‘buf[1]’ is used uninitialized in this function sound/soc/codecs/rt5514.c:363: warning: ‘buf[2]’ is used uninitialized in this function sound/soc/codecs/rt5514.c:363: warning: ‘buf[3]’ is used uninitialized in this function Fix this by initializing the buffer with zeroes, to avoid random bits being written to the calibration register later. Fixes: fc9cab05837639ce ("ASoC: rt5514: The DSP clock can be calibrated by the other clock source") Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-03-01ASoC: rt5514: Fix rt5514_spi_burst_read() buffer passingGeert Uytterhoeven1-2/+1
rt5514_dsp_voice_wake_up_put() passes "(u8 *)&buf" to rt5514_spi_burst_read(), where the cast is needed to silence a compiler warning: sound/soc/codecs/rt5514.c: In function ‘rt5514_dsp_voice_wake_up_put’: sound/soc/codecs/rt5514.c:357: warning: passing argument 2 of ‘rt5514_spi_burst_read’ from incompatible pointer type However, as the variable is declared as an array ("u8 buf[8]"), the function should just pass "buf" instead. Fixes: fc9cab05837639ce ("ASoC: rt5514: The DSP clock can be calibrated by the other clock source") Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-02-12ASoC: rt5514: replace codec to componentKuninori Morimoto1-66/+58
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>
2018-01-05Merge remote-tracking branches 'asoc/topic/rl6231', 'asoc/topic/rt5514' and ↵Mark Brown1-0/+85
'asoc/topic/rt5645' into asoc-next
2017-11-24ASoC: rt5514: Make sure the DMIC delay will be happened after normal SUPPLY ↵oder_chiou@realtek.com1-1/+1
widgets power on The patch makes sure the DMIC delay will be happened after normal SUPPLY widgets power on. If there are some platforms that provide the MCLK using the SUPPLY widget, it will make sure the delay time is helpful. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-11-07ASoC: rt5514: The DSP clock can be calibrated by the other clock sourceoder_chiou@realtek.com1-0/+85
Add the option for the DSP clock that can be calibrated by the other clock source. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-11-03ASoC: rt5514: The ACPI also should use the function rt5514_parse_dp()oder_chiou@realtek.com1-3/+3
The patch fixed that the ACPI cannot access the device property from the function rt5514_parse_dp(). Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-09-15ASoC: rt5514: Revert Hotword Model controlHsin-Yu Chao1-63/+0
This reverts commit eb33869c7206 ("ASoC: rt5514: Guard Hotword Model bytes loading") and commit d18420b0a0b8 ("ASoC: rt5514: expose Hotword Model control") It is discouraged to use SND_SOC_BYTES_TLV to load arbitrary bytes from userspace to driver. Removing the 'Hotword Model' control until we have a good way to verify the content of hotword model blobs. Signed-off-by: Hsin-Yu Chao <hychao@chromium.org> Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-09-01Merge remote-tracking branches 'asoc/topic/rk3036', 'asoc/topic/rockchip', ↵Mark Brown1-35/+137
'asoc/topic/rt274' and 'asoc/topic/rt5514' into asoc-next
2017-08-29ASoC: rt5514: Guard Hotword Model bytes loadingHsin-Yu Chao1-1/+12
If the rt5514-spi driver is not enabled in kernel, hotword model will not be loaded when "DSP Voice Wake Up" is set to turn on DSP mode, and an error is logged instead. Signed-off-by: Hsin-Yu Chao <hychao@chromium.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-08-24ASoC: rt5514: expose Hotword Model controlHsin-Yu Chao1-0/+52
This change exposes mixer control 'Hotword Model' for switching hotword model in runtime. This new function requires updated firmware to load hotword model at address 0x4ff80000. Signed-off-by: Hsin-Yu Chao <hychao@chromium.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-08-14ASoC: rt5514: make array rt5514_dai staticColin Ian King1-1/+1
The array rt5514_dai is local to the source and does not need to be in global scope, so make it static. Cleans up sparse warnings: symbol 'rt5514_dai' was not declared. Should it be static? warning: symbol 'rt5514_dai' was not declared. Should it be static? Signed-off-by: Colin Ian King <colin.king@canonical.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-09ASoC: rt5514: Eliminate the noise in the ASRC caseoder_chiou@realtek.com1-2/+4
In the ASRC case, there is the noise if the clock is asynchronous with the LRCK. The default settings will eliminate the noise. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-07-26ASoC: rt5514: Use the IS_ENABLED to supports the module buildoder_chiou@realtek.com1-3/+3
The patch uses the macro IS_ENABLED to make sure that the SPI function also supports the module build. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-07-24ASoC: rt5514: 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-24ASoC: rt5514: Add the I2S ASRC supportoder_chiou@realtek.com1-0/+19
The patch adds the I2S ASRC support. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-07-20ASoC: rt5514: Support the TDM docking modeoder_chiou@realtek.com1-1/+32
The TDM docking mode can share the bus to other devices simultaneously. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-07-17ASoC: rt5514: 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. Also, make rt5514_aif_dai_ops static, as it is not used outside this module. Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-07-17ASoC: rt5514: Move the auto disable DSP function to set_bias_level()oder_chiou@realtek.com1-31/+18
Move the auto disable DSP function from the widget event "DAPM Pre" to the set_bias_level() function to avoid the unexpected behavior. While the SPI was recording using the DAI "rt5514-dsp-cpu-dai", the event "DAPM Pre" would be manipulated even the DAPM widgets were not connected, and it also would power off the DSP that cause the DSP buffered data lost. So the auto disable DSP function should move to the set_bias_level() function to make sure that it is only manipulated by the DAPM widgets are connected. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-07-03Merge remote-tracking branches 'asoc/topic/rt5614', 'asoc/topic/rt5645', ↵Mark Brown1-2/+2
'asoc/topic/rt5651', 'asoc/topic/rt5665' and 'asoc/topic/rt5670' into asoc-next
2017-05-17ASoC: rt5514: Add ACPI match IDOder Chiou1-0/+10
This patch adds the ACPI match ID for rt5514 codec. Signed-off-by: Hsin-Yu Chao <hychao@chromium.org> Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-14ASoC: rt5514: Add more width and channels support in the TDM modeOder Chiou1-2/+21
This patch adds more width and channels support in the TDM mode. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-14ASoC: rt5514: fix gcc-7 warningArnd Bergmann1-2/+2
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/rt5514.c:398:14: error: duplicate 'const' declaration specifier [-Werror=duplicate-decl-specifier] static const SOC_ENUM_SINGLE_DECL( sound/soc/codecs/rt5514.c:405:14: error: duplicate 'const' declaration specifier [-Werror=duplicate-decl-specifier] static const SOC_ENUM_SINGLE_DECL( This removes one to fix the warning. Fixes: 4a6180ea7399 ("ASoC: rt5514: add rt5514 codec driver") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-14ASoC: rt5514: Unconfuse the rt5514 at probe / resume timeDouglas Anderson1-0/+28
The rt5514 can get confused and incorrectly detect a start bit if the SCL/SDA lines happen to both go low and then high again. This situation has been seen to happen at reboot time and is also theoretically possible during suspend/resume if the rt5514 keeps power but we shut down the i2c connection. When this happens the rt5514 is confused about the state of the i2c bus and won't recognize its own address. That will lead to the rt5514 incorrectly NAKing the first transfer. A single i2c transfer to any address should be enough to get the rt5514 out of this funky state. It is currently believed that this problem should be fixed in the rt5514 driver itself because it seems that the i2c controller in the rt5514 is easily confused. Most i2c devices wouldn't detect a start bit in this case. Signed-off-by: Douglas Anderson <dianders@chromium.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-14ASoC: rt5514: Avoid relying on uninitialized "val" valueDouglas Anderson1-3/+3
In rt5514_i2c_probe() if the regmap_read(RT5514_VENDOR_ID2) fails then "val" may be left as uninitialized. Current code relies on "val" not being RT5514_DEVICE_ID, but that's potentially unsafe. Let's check for errors from regmap_read() and also explicitly init the value do we're not passing a possibly uninitialized int to printk. Signed-off-by: Douglas Anderson <dianders@chromium.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-14ASoC: rt5514: Mark rt5514_i2c_driver as staticDouglas Anderson1-1/+1
There's no reason for rt5514_i2c_driver to be non-static. Signed-off-by: Douglas Anderson <dianders@chromium.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-10-25ASoC: rt5514: Add the DMIC initial delay to wait it ready.Oder Chiou1-0/+17
Due to the DMIC that needs time to initial after the MCLK is provided, the field of delay time is implemented by the platform data. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-29Merge remote-tracking branches 'asoc/topic/ac97', 'asoc/topic/ak4104', ↵Mark Brown1-6/+8
'asoc/topic/arizona', 'asoc/topic/atmel' and 'asoc/topic/codec-component' into asoc-next
2016-09-12ASoC: rt5514: make the volume TLV to match the units 0.01dBOder Chiou1-3/+3
The volume have a step of 0.375dB, but TLV uses the units 0.01dB. It should be changed to a step of 0.75dB to match the units of TLV. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-08ASoC: codec duplicated callback function goes to component on rt5514Kuninori Morimoto1-6/+8
codec driver and component driver has duplicated callback functions, and codec side functions are just copied to component side when register timing. This was quick-hack, but no longer needed. This patch moves these functions from codec driver to component driver. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-07-24Merge remote-tracking branches 'asoc/topic/rt5514', 'asoc/topic/rt5614', ↵Mark Brown1-2/+166
'asoc/topic/rt5670' and 'asoc/topic/s8' into asoc-next
2016-06-22ASoC: rt5514: Add the MCLK handlingOder Chiou1-0/+32
The patch adds the control of MCLK that depends on the status of DAPM. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-07ASoC: rt5514: add rt5514 SPI driverOder Chiou1-2/+134
The device has multiple control interfaces, I2C and SPI. The I2C interface mainly controls the register settings of codec. The SPI interface is in order to provide the high speed transmission of data. For example, high bandwidth memory read/write of DSP. The patch adds the rt5514 SPI driver for loading the firmware of DSP and retrieving the voice data from DSP after the system is waked up by specific voice. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-03ASoC: rt5514: add rt5514 codec driverOder Chiou1-0/+982
This is the initial codec driver for rt5514. The codec includes a low power DSP for voice wake up. The register address is incremental by 4 in the DSP memory map. In order to recover the codec settings in the codec mode and manipulate the DSP mode for voice wake up, we use the multi-level register map. One is for ALSA API in codec mode that can be recovered by cache before recording. Another is for DSP related settings that can be accessed with 32bit address of the DSP in the application of voice wake up. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>