summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/wcd9335.c
AgeCommit message (Collapse)AuthorFilesLines
2024-07-08ASoC: codecs: wcd9335: Simplify with cleanup.hKrzysztof Kozlowski1-13/+9
Allocate the memory with scoped/cleanup.h to reduce error handling (less error paths) and make the code a bit simpler. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://patch.msgid.link/20240703-asoc-cleanup-h-v1-3-71219dfd0aef@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-23ASoC: Few constifications (mostly arguments)Mark Brown1-1/+1
Merge series from Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>: Make few pointers in ASoC functions as pointers to const, so the code is clearer to read, a bit safer and allows further constifications (e.g. placing some data as rodata).
2024-06-18ASoC: codecs: wcd9335: Drop unused dmic rate handlingKrzysztof Kozlowski1-49/+3
Driver was prepared to adjust DMIC microphone parameters according to DMIC clock rate which is read from platform data or Devicetree. The latter part never happened, so the code is always called with dmic_clk_rate=0, prints error and uses default/fallback values. All this part can be simplified by dropping dead parts of code. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://msgid.link/r/20240612-asoc-wcd9xxx-wide-cleanups-v1-6-0d15885b2a06@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-18ASoC: codecs: wcd9335: Drop unneeded error messageKrzysztof Kozlowski1-4/+0
Error-level should not be used as debugging. The code (function wcd9335_get_dmic_clk_val()) will always be called with same parameters, so this is not really useful debug anyway, so drop it. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://msgid.link/r/20240612-asoc-wcd9xxx-wide-cleanups-v1-5-0d15885b2a06@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-18ASoC: codecs: wcd9335: Handle nicer probe deferral and simplify with ↵Krzysztof Kozlowski1-19/+9
dev_err_probe() wcd9335_parse_dt() function is called only from probe(), so printing errors on resource acquisition is discouraged, because it can pollute dmesg. Use dev_err_probe() to fix this and also make the code a bit simpler. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://msgid.link/r/20240612-asoc-wcd9xxx-wide-cleanups-v1-4-0d15885b2a06@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-18ASoC: codecs: wcd9335: Constify static dataKrzysztof Kozlowski1-5/+5
Driver does not modify few static data (arrays with sample rates, interrupt description, regmap config), so make them const for code safety. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://msgid.link/r/20240612-asoc-wcd9xxx-wide-cleanups-v1-3-0d15885b2a06@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-18ASoC: codecs: wcd9335: Drop unused state container fieldsKrzysztof Kozlowski1-4/+0
The driver does not use few 'struct wcd9335_codec' members, so just drop them for smaller code. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://msgid.link/r/20240612-asoc-wcd9xxx-wide-cleanups-v1-2-0d15885b2a06@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-18ASoC: Constify DAI passed to get_channel_mapKrzysztof Kozlowski1-1/+1
get_channel_map() is supposed to obtain map of channels without modifying the state of the given DAI, so make the pointer to 'struct snd_soc_dai' as pointing to const. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://msgid.link/r/20240617-n-asoc-const-auto-selectable-formats-v1-4-8004f346ee38@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2024-05-27ASoC: Constify channel mapping array arguments in set_channel_map()Krzysztof Kozlowski1-2/+4
There is no need for implementations of DAI set_channel_map() to modify contents of passed arrays with actual channel mapping. Additionally, the caller keeps full ownership of the array. Constify these pointer arguments so the code will be safer and easier to read (documenting the caller's ownership). Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://msgid.link/r/20240520-asoc-x1e80100-4-channel-mapping-v4-1-f657159b4aad@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2024-01-22ASoC: codecs: wcd9335: drop unused gain hack remnantJohan Hovold1-4/+0
The vendor driver appears to be modifying the gain settings behind the back of user space but these hacks never made it upstream except for some essentially dead code that adds a constant zero to the current gain setting on DAPM events. Note that the volume registers still need to be written after enabling clocks in order for any prior updates to take effect. Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Johan Hovold <johan+linaro@kernel.org> Link: https://msgid.link/r/20240119112420.7446-5-johan+linaro@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
2023-10-26ASoC: codecs: wcd9335: Handle component name prefixKrzysztof Kozlowski1-9/+9
Use snd_soc_dapm_widget_name_cmp() helper when comparing widget names, to include also the component's name prefix. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20231023095428.166563-9-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-17ASoC: wcd9335: Update to use maple tree register cacheMark Brown1-1/+1
The maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache. In v6.5 it has also acquired the ability to generate multi-register writes in sync operations, bringing performance up to parity with the rbtree cache there. Update the wcd9335 driver to use the more modern data structure. Signed-off-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20230712-asoc-qcom-maple-v1-1-15f8089664b9@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
2023-04-18ASoC: codecs: wcd9335: Simplify with dev_err_probeKrzysztof Kozlowski1-16/+11
Code can be a bit simpler with dev_err_probe(). Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20230417141453.919158-1-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2022-10-03Merge tag 'asoc-v6.1' of ↵Takashi Iwai1-5/+9
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Updates for v6.1 This has been a very quiet release for the core but quite a busy one for drivers with a big crop of new drivers and lots of feature additions and fixes to existing ones: - A new string helper parse_int_array_user(). - Improvements to the SOF IPC4 code, especially around trace. - Support for AMD Rembrant DSPs, AMD Pink Sardine ACP 6.2, Apple Silcon systems, Everest ES8326, Intel Sky Lake and Kaby Lake, MediaTek MT8186 support, NXP i.MX8ULP DSPs, Qualcomm SC8280XP, SM8250 and SM8450 and Texas Instruments SRC4392 There is a conflict with the conversion of I2C remove functions to void in the cs42l42 driver which is fairly straightforward to resolve but should be highlighted to Linus.
2022-09-23ASoC: wcd9335: fix order of Slimbus unprepare/disableKrzysztof Kozlowski1-1/+1
Slimbus streams are first prepared and then enabled, so the cleanup path should reverse it. The unprepare sets stream->num_ports to 0 and frees the stream->ports. Calling disable after unprepare was not really effective (channels was not deactivated) and could lead to further issues due to making transfers on unprepared stream. Fixes: 20aedafdf492 ("ASoC: wcd9335: add support to wcd9335 codec") Cc: <stable@vger.kernel.org> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20220921145354.1683791-1-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2022-08-31ASoC: wcd9335: remove always-true conditionPierre-Louis Bossart1-3/+1
cppcheck warning: sound/soc/codecs/wcd9335.c:1824:22: style: Condition 'tx_port==13' is always true [knownConditionTrueFalse] } else if (tx_port == 13) { ^ sound/soc/codecs/wcd9335.c:1802:16: note: Assuming that condition 'tx_port==12' is not redundant if ((tx_port == 12) || (tx_port >= 14)) { ^ sound/soc/codecs/wcd9335.c:1802:35: note: Assuming that condition 'tx_port>=14' is not redundant if ((tx_port == 12) || (tx_port >= 14)) { ^ sound/soc/codecs/wcd9335.c:1824:22: note: Condition 'tx_port==13' is always true } else if (tx_port == 13) { ^ sound/soc/codecs/wcd9335.c:1845:22: style: Condition 'tx_port==13' is always true [knownConditionTrueFalse] } else if (tx_port == 13) { ^ sound/soc/codecs/wcd9335.c:1802:16: note: Assuming that condition 'tx_port==12' is not redundant if ((tx_port == 12) || (tx_port >= 14)) { ^ sound/soc/codecs/wcd9335.c:1802:35: note: Assuming that condition 'tx_port>=14' is not redundant if ((tx_port == 12) || (tx_port >= 14)) { ^ sound/soc/codecs/wcd9335.c:1845:22: note: Condition 'tx_port==13' is always true } else if (tx_port == 13) { ^ Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Chao Song <chao.song@intel.com> Link: https://lore.kernel.org/r/20220822184239.169757-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-08-28ASoC: wcd9335: Convert irq chip to config regsAidan MacDonald1-2/+8
Type registers in regmap-irq have been deprecated in favor of config registers, which are more general. Chips using type_base can switch over to a single config base register and a standard ->set_irq_type() callback provided by regmap-irq, which uses the type info associated with each 'struct regmap_irq' to update type registers in the same way as the old code did. Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com> Link: https://lore.kernel.org/r/20220721102558.25457-2-aidanmacdonald.0x0@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-11ASoC: Merge up fixesMark Brown1-6/+11
Needed for the Rockchip driver.
2022-07-07ASoC: wcd9335: Use int array instead of bitmask for TX mixersYassine Oudjana1-6/+11
Currently slim_tx_mixer_get reports all TX mixers as enabled when at least one is, due to it reading the entire tx_port_value bitmask without testing the specific bit corresponding to a TX port. Furthermore, using the same bitmask for all capture DAIs makes setting one mixer affect them all. To prevent this, and since the SLIM TX muxes effectively only connect to one of the mixers at a time, turn tx_port_value into an int array storing the DAI index each of the ports is connected to. Signed-off-by: Yassine Oudjana <y.oudjana@protonmail.com> Link: https://lore.kernel.org/r/20220622061745.35399-1-y.oudjana@protonmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-29ASoC: wcd9335: Use DT bindings instead of local DAI definitionsYassine Oudjana1-11/+2
Get DAI indices from DT bindings and remove the currently used local definitions. Signed-off-by: Yassine Oudjana <y.oudjana@protonmail.com> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20220622161322.168017-3-y.oudjana@protonmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-24ASoC: wcd9335: Fix spurious event generationMark Brown1-0/+3
The slimbus mux put operation unconditionally reports a change in value which means that spurious events are generated. Fix this by exiting early in that case. Signed-off-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20220603124609.4024666-1-broonie@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-24ASoC: wcd9335: Remove RX channel from old list before adding it to a new oneYassine Oudjana1-1/+4
Currently in slim_rx_mux_put, an RX channel gets added to a new list even if it is already in one. This can mess up links and make either it, the new list head, or both, get linked to the wrong entries. This can cause an entry to link to itself which in turn ends up making list_for_each_entry in other functions loop infinitely. To avoid issues, always remove the RX channel from any list it's in before adding it to a new list. Signed-off-by: Yassine Oudjana <y.oudjana@protonmail.com> Link: https://lore.kernel.org/r/20220606152226.149164-1-y.oudjana@protonmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-14ASoC: Merge fixesMark Brown1-1/+7
Required for more changes for the ops.
2022-06-13ASoC: wcd9335: Fix spurious event generationMark Brown1-0/+3
The slimbus mux put operation unconditionally reports a change in value which means that spurious events are generated. Fix this by exiting early in that case. Signed-off-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20220603124609.4024666-1-broonie@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-13ASoC: wcd9335: Remove RX channel from old list before adding it to a new oneYassine Oudjana1-1/+4
Currently in slim_rx_mux_put, an RX channel gets added to a new list even if it is already in one. This can mess up links and make either it, the new list head, or both, get linked to the wrong entries. This can cause an entry to link to itself which in turn ends up making list_for_each_entry in other functions loop infinitely. To avoid issues, always remove the RX channel from any list it's in before adding it to a new list. Signed-off-by: Yassine Oudjana <y.oudjana@protonmail.com> Link: https://lore.kernel.org/r/20220606152226.149164-1-y.oudjana@protonmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-10ASoC: codecs: wcd9335: move gains from SX_TLV to S8_TLVSrinivas Kandagatla1-45/+36
move all the digital gains form using SX_TLV to S8_TLV, these gains are actually 8 bit gains with 7th signed bit and ranges from -84dB to +40dB rest of the Qualcomm wcd codecs uses these properly. Fixes: 8c4f021d806a ("ASoC: wcd9335: add basic controls") Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20220609111901.318047-3-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-06ASoC: wcd9335: remove redundant testsPierre-Louis Bossart1-2/+2
cppcheck warning: sound/soc/codecs/wcd9335.c:1810:23: style: Condition 'tx_port>=4' is always true [knownConditionTrueFalse] } else if ((tx_port >= 4) && (tx_port < 8)) { ^ sound/soc/codecs/wcd9335.c:1806:15: note: Assuming that condition 'tx_port<4' is not redundant if (tx_port < 4) { ^ sound/soc/codecs/wcd9335.c:1810:23: note: Condition 'tx_port>=4' is always true } else if ((tx_port >= 4) && (tx_port < 8)) { ^ Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Link: https://lore.kernel.org/r/20220520211719.607543-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-05-09ASoC: wcd9335: Add endianness flag in snd_soc_component_driverCharles Keepax1-0/+1
The endianness flag is used on the CODEC side to specify an ambivalence to endian, typically because it is lost over the hardware link. This device receives audio over a SLIMbus DAI and as such should have endianness applied. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20220504170905.332415-29-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-01-06ASoC: wcd9335: Keep a RX port value for each SLIM RX muxYassine Oudjana1-8/+9
Currently, rx_port_value is a single unsigned int that gets overwritten when slim_rx_mux_put() is called for any RX mux, then the same value is read when slim_rx_mux_get() is called for any of them. This results in slim_rx_mux_get() reporting the last value set by slim_rx_mux_put() regardless of which SLIM RX mux is in question. Turn rx_port_value into an array and store a separate value for each SLIM RX mux. Signed-off-by: Yassine Oudjana <y.oudjana@protonmail.com> Link: https://lore.kernel.org/r/20220104033356.343685-1-y.oudjana@protonmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-27ASoC: wcd9335: Use correct version to initialize Class HYassine Oudjana1-1/+1
The versioning scheme was changed in an earlier patch, which caused the version being used to initialize WCD9335 to be interpreted as if it was WCD937X, which changed code paths causing broken headphones output. Pass WCD9335 instead of WCD9335_VERSION_2_0 to wcd_clsh_ctrl_alloc to fix it. Fixes: 19c5d1f6a0c3 ("ASoC: codecs: wcd-clsh: add new version support") Signed-off-by: Yassine Oudjana <y.oudjana@protonmail.com> Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20210925022339.786296-1-y.oudjana@protonmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-26ASoC: wcd9335: Disable irq on slave ports in the remove functionChristophe JAILLET1-0/+11
The probe calls 'wcd9335_setup_irqs()' to enable interrupts on all slave ports. This must be undone in the remove function. Add a 'wcd9335_teardown_irqs()' function that undoes 'wcd9335_setup_irqs()' function, and call it from the remove function. Fixes: 20aedafdf492 ("ASoC: wcd9335: add support to wcd9335 codec") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Message-Id: <8f761244d79bd4c098af8a482be9121d3a486d1b.1629091028.git.christophe.jaillet@wanadoo.fr> Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-26ASoC: wcd9335: Fix a memory leak in the error handling path of the probe ↵Christophe JAILLET1-1/+10
function If 'wcd9335_setup_irqs()' fails, me must release the memory allocated in 'wcd_clsh_ctrl_alloc()', as already done in the remove function. Add an error handling path and the missing 'wcd_clsh_ctrl_free()' call. Fixes: 20aedafdf492 ("ASoC: wcd9335: add support to wcd9335 codec") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Message-Id: <6dc12372f09fabb70bf05941dbe6a1382dc93e43.1629091028.git.christophe.jaillet@wanadoo.fr> Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-26ASoC: wcd9335: Fix a double irq free in the remove functionChristophe JAILLET1-1/+0
There is no point in calling 'free_irq()' explicitly for 'WCD9335_IRQ_SLIMBUS' in the remove function. The irqs are requested in 'wcd9335_setup_irqs()' using a resource managed function (i.e. 'devm_request_threaded_irq()'). 'wcd9335_setup_irqs()' requests all what is defined in the 'wcd9335_irqs' structure. This structure has only one entry for 'WCD9335_IRQ_SLIMBUS'. So 'devm_request...irq()' + explicit 'free_irq()' would lead to a double free. Remove the unneeded 'free_irq()' from the remove function. Fixes: 20aedafdf492 ("ASoC: wcd9335: add support to wcd9335 codec") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Message-Id: <0614d63bc00edd7e81dd367504128f3d84f72efa.1629091028.git.christophe.jaillet@wanadoo.fr> Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-09ASoC: wcd9335: constify static struct snd_soc_dai_opsYe Bin1-1/+1
The snd_soc_dai_ops structures is only stored in the ops field of a snd_soc_dai_driver structure, so make the snd_soc_dai_ops structure const to allow the compiler to put it in read-only memory. Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Ye Bin <yebin10@huawei.com> Link: https://lore.kernel.org/r/20210408062644.802988-1-yebin10@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-10ASoC: wcd9335: clarify return valuePierre-Louis Bossart1-1/+1
cppcheck warning: sound/soc/codecs/wcd9335.c:5216:9: warning: Identical condition and return expression 'ret', return value is always 0 [identicalConditionAfterEarlyExit] return ret; ^ sound/soc/codecs/wcd9335.c:5211:6: note: If condition 'ret' is true, the function will return/exit if (ret) ^ sound/soc/codecs/wcd9335.c:5216:9: note: Returning identical expression 'ret' return ret; ^ Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20210218222916.89809-9-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-30Merge branch 'for-5.10' of ↵Mark Brown1-1/+1
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-5.11
2020-11-18ASoC: wcd9335: Remove unnecessary conversion to boolKaixu Xia1-1/+1
The '>=' expression itself is bool, no need to convert it to bool. Fix the following coccicheck warning: ./sound/soc/codecs/wcd9335.c:3982:25-30: WARNING: conversion to bool not needed here Reported-by: Tosk Robot <tencent_os_robot@tencent.com> Signed-off-by: Kaixu Xia <kaixuxia@tencent.com> Link: https://lore.kernel.org/r/1604652816-1330-1-git-send-email-kaixuxia@tencent.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-10-28ASoC: codecs: wcd9335: Set digital gain range correctlySrinivas Kandagatla1-1/+1
digital gain range is -84dB min to 40dB max, however this was not correctly specified in the range. Fix this by with correct range! Fixes: 8c4f021d806a ("ASoC: wcd9335: add basic controls") Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20201028154340.17090-2-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-22ASoC: codecs: wcd*: rename to snd_soc_component_read()Kuninori Morimoto1-24/+24
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> Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/87lfkn4mdy.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-04-20ASoC: wcd9335: remove unneeded semicolonJason Yan1-22/+22
Fix the following coccicheck warning: sound/soc/codecs/wcd9335.c:2606:2-3: Unneeded semicolon sound/soc/codecs/wcd9335.c:3619:2-3: Unneeded semicolon sound/soc/codecs/wcd9335.c:2849:2-3: Unneeded semicolon sound/soc/codecs/wcd9335.c:2955:2-3: Unneeded semicolon sound/soc/codecs/wcd9335.c:2988:2-3: Unneeded semicolon sound/soc/codecs/wcd9335.c:3960:2-3: Unneeded semicolon sound/soc/codecs/wcd9335.c:3776:2-3: Unneeded semicolon sound/soc/codecs/wcd9335.c:3924:2-3: Unneeded semicolon sound/soc/codecs/wcd9335.c:3355:2-3: Unneeded semicolon sound/soc/codecs/wcd9335.c:3832:2-3: Unneeded semicolon sound/soc/codecs/wcd9335.c:3079:2-3: Unneeded semicolon sound/soc/codecs/wcd9335.c:3089:2-3: Unneeded semicolon sound/soc/codecs/wcd9335.c:3232:2-3: Unneeded semicolon sound/soc/codecs/wcd9335.c:3878:2-3: Unneeded semicolon sound/soc/codecs/wcd9335.c:3578:2-3: Unneeded semicolon sound/soc/codecs/wcd9335.c:3728:2-3: Unneeded semicolon sound/soc/codecs/wcd9335.c:1922:3-4: Unneeded semicolon sound/soc/codecs/wcd9335.c:1938:3-4: Unneeded semicolon sound/soc/codecs/wcd9335.c:1944:2-3: Unneeded semicolon sound/soc/codecs/wcd9335.c:3144:2-3: Unneeded semicolon sound/soc/codecs/wcd9335.c:2568:2-3: Unneeded semicolon sound/soc/codecs/wcd9335.c:2219:2-3: Unneeded semicolon Signed-off-by: Jason Yan <yanaijie@huawei.com> Link: https://lore.kernel.org/r/20200420042847.19206-1-yanaijie@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-06ASoC: wcd9335: fix address map representationSrinivas Kandagatla1-9/+9
slimbus addresses are 16 bit wide, masking page numbers to wcd register at offset of 12 will limit the number for pages. So it becomes impossible to write to page 0x10 registers. Remove masking 0x800 (slimbus address range) from register address and making use of window parameters in regmap config should fix it and also will represent the registers exactly inline with Datasheet. Remove this unnessary masking and make the registers be inline with datasheet. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20200306152633.25836-1-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-01ASoC: wcd9335: clean up indentation issueColin Ian King1-5/+5
There is an if statement that is indented one level too deeply, remove the extraneous tabs. Signed-off-by: Colin Ian King <colin.king@canonical.com> Link: https://lore.kernel.org/r/20190925111023.7771-1-colin.king@canonical.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-09-11ASoC: wcd9335: remove redundant use of ret variableSaiyam Doshi1-16/+8
All these functions declares and initializes variable ret with '0' and without modifying 'ret' variable, it is returned. This patch removes this redundancy and returns '0' directly. Signed-off-by: Saiyam Doshi <saiyamdoshi.in@gmail.com> Link: https://lore.kernel.org/r/20190909174541.GA22718@SD Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-28ASoC: wcd9335: Fix primary interpolator max rateSrinivas Kandagatla1-8/+12
On this codec SLIMBus RX path supports 384000 rate on primary interpolator. Add this missing rate as supported rate. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20190822095653.7200-3-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2019-07-22ASoC: wcd9335: add irqflag IRQF_ONESHOT flagHariprasad Kelam1-1/+2
Add IRQF_ONESHOT to ensure "Interrupt is not reenabled after the hardirq handler finished". fixes below issue reported by coccicheck sound/soc/codecs/wcd9335.c:4068:8-33: ERROR: Threaded IRQ with no primary handler requested without IRQF_ONESHOT Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com> Link: https://lore.kernel.org/r/20190710021627.GA13396@hari-Inspiron-1545 Signed-off-by: Mark Brown <broonie@kernel.org>
2019-07-05ASoC: wcd9335: remove multiple defines.Srinivas Kandagatla1-5/+0
Found during review that there are multiple defines of same constants. This patch removes them! Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20190704165410.7173-1-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2019-05-29wcd9335: fix a incorrect use of kstrndup()Gen Zhang1-1/+1
In wcd9335_codec_enable_dec(), 'widget_name' is allocated by kstrndup(). However, according to doc: "Note: Use kmemdup_nul() instead if the size is known exactly." So we should use kmemdup_nul() here instead of kstrndup(). Signed-off-by: Gen Zhang <blackgod016574@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-02ASoC: wcd9335: fix a leaked reference by adding missing of_node_putWen Yang1-0/+1
The call to of_parse_phandle returns a node pointer with refcount incremented thus it must be explicitly decremented after the last usage. Detected by coccinelle with the following warnings: ./sound/soc/codecs/wcd9335.c:5193:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 5183, but without a correspon ding object release within this function. Signed-off-by: Wen Yang <wen.yang99@zte.com.cn> Cc: Liam Girdwood <lgirdwood@gmail.com> Cc: Mark Brown <broonie@kernel.org> Cc: Jaroslav Kysela <perex@perex.cz> Cc: Takashi Iwai <tiwai@suse.com> Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Cc: Vinod Koul <vkoul@kernel.org> Cc: Dan Carpenter <dan.carpenter@oracle.com> (commit_signer:1/11=9%,authored:1/11=9%) Cc: alsa-devel@alsa-project.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-06ASoC: wcd9335: remove some unnecessary NULL checksDan Carpenter1-12/+8
These are arrays, not pointers, and they can't be NULL. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-01-28ASoC: wcd9335: add audio routingsSrinivas Kandagatla1-0/+189
This patch adds audio routing for both playback and capture. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Reviewed-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>