Commit Graph
35 Commits
Author SHA1 Message Date
Kuninori Morimoto 1fddf424b3 ASoC: mediatek: remove snd_pcm_ops
snd_pcm_ops is no longer needed.
Let's use component driver callback.

Signed-off-by: Kuninori Morimoto <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2019-10-08 13:48:07 +01:00
Kuninori Morimoto 9a0b72b71d ASoC: mediatek: mtk-btcvsd: remove snd_pcm_ops
snd_pcm_ops is no longer needed.
Let's use component driver callback.

Signed-off-by: Kuninori Morimoto <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2019-10-08 13:47:59 +01:00
Mark Brown bb83178611 Merge branch 'asoc-5.4' into asoc-next 2019-09-09 14:55:20 +01:00
Jiaxin Yu d2ac1fe034 ASoC: mediatek: mt8183: fix tdm out data align issue
Mt8183 tdm out support S16_LE/S24_LE/S32_LE formats. When output S32_LE,
we need set hd_align so that memif can output MSB 24bits. When output
S24_LE, we need reset hd_align so that memif can output LSB 24bits.

Signed-off-by: Jiaxin Yu <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2019-08-27 20:38:59 +01:00
Stephen Boyd cf9441adb1 ASoC: Remove dev_err() usage after platform_get_irq()
We don't need dev_err() messages when platform_get_irq() fails now that
platform_get_irq() prints an error message itself when something goes
wrong. Let's remove these prints with a simple semantic patch.

// <smpl>
@@
expression ret;
struct platform_device *E;
@@

ret =
(
platform_get_irq(E, ...)
|
platform_get_irq_byname(E, ...)
);

if ( \( ret < 0 \| ret <= 0 \) )
{
(
-if (ret != -EPROBE_DEFER)
-{ ...
-dev_err(...);
-... }
|
...
-dev_err(...);
)
...
}
// </smpl>

While we're here, remove braces on if statements that only have one
statement (manually).

Cc: Liam Girdwood <[email protected]>
Cc: Mark Brown <[email protected]>
Cc: Jaroslav Kysela <[email protected]>
Cc: Takashi Iwai <[email protected]>
Cc: [email protected]
Cc: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Stephen Boyd <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2019-08-02 12:12:31 +01:00
Geert Uytterhoeven 501e94b52a ASoC: Add missing newline at end of file
"git diff" says:

    \ No newline at end of file

after modifying the files.

Signed-off-by: Geert Uytterhoeven <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2019-06-17 16:18:13 +01:00
YueHaibing 52194513ba ASoC: mediatek: Make some symbols static
Fix sparse warnings:

sound/soc/mediatek/common/mtk-btcvsd.c:410:5: warning: symbol 'mtk_btcvsd_write_to_bt' was not declared. Should it be static?
sound/soc/mediatek/common/mtk-btcvsd.c:698:9: warning: symbol 'mtk_btcvsd_snd_read' was not declared. Should it be static?
sound/soc/mediatek/common/mtk-btcvsd.c:779:9: warning: symbol 'mtk_btcvsd_snd_write' was not declared. Should it be static?

Reported-by: Hulk Robot <[email protected]>
Signed-off-by: YueHaibing <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2019-06-04 15:11:04 +01:00
Jiaxin Yu e355d3de19 ASoC: Mediatek: MT8183: fix compile error
mtk_regmap_update_bits() has been changed from four
parameters to five parameters.

Fixes: 1628fc3f47 ("ASoC: Mediatek: MT8183: add memory interface data align")

Signed-off-by: Jiaxin Yu <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2019-05-21 19:58:20 +01:00
Shunli Wang 1628fc3f47 ASoC: Mediatek: add memory interface data align
This supports two data align settings. One is S32_LE and
other is S24_LE.

Signed-off-by: Shunli Wang <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2019-05-16 11:13:14 +01:00
Mark Brown 93f38ef6a4 Merge branch 'asoc-5.1' into asoc-5.2 2019-04-26 11:02:03 +01:00
KaiChieh Chuang 780f202f2b ASoC: mediatek: btcvsd fix irq mask
disable = 1
enable = 0
prevent AP wake up, when not AP BTSCO scenario

Signed-off-by: KaiChieh Chuang <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2019-04-26 10:48:37 +01:00
Pi-Hsun Shih c683964153 ASoC: mediatek: Reduce repititive code on mtk_regmap_update_bits.
Change the signature of mtk_regmap_update_bits to also take a shift, and
warn when reg >= 0 but shift < 0. This reduce the code repetition
on the calling side, and prevent future UBSAN warning when some of the
xxx_shift and xxx_reg are both set to -1.

Signed-off-by: Pi-Hsun Shih <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2019-03-19 12:51:20 +00:00
Pi-Hsun Shih ed1666f686 ASoC: mediatek: Fix UBSAN warning.
In sound/soc/mediatek/common/mtk-afe-fe-dai.c, when xxx_reg is -1, it's
a no-op to call mtk_regmap_update_bits, but since both xxx_reg and
xxx_shift are set to -1, the (1 << xxx_shift) in the argument would
trigger a UBSAN warning.

Fix the warning by setting those xxx_shift to 0 instead.

Note that since the code explicitly checks .mono_shift >= 0 and
.fs_shift >= 0 before using them in '<<' operator, those two members are
not set to 0.

Signed-off-by: Pi-Hsun Shih <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2019-03-19 12:51:13 +00:00
Mark Brown 22d91ed32b Merge tag 'v5.1-rc1' into asoc-5.1
Linux 5.1-rc1
2019-03-18 11:14:51 +00:00
KaiChieh Chuang f060f46f09 ASoC: mediatek: btcvsd add loopback
add direct loopback path from rx to tx

Signed-off-by: KaiChieh Chuang <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2019-02-28 14:18:26 +00:00
Takashi Iwai 70395a96bd Merge tag 'asoc-v5.1-2' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next
ASoC: More changes for v5.1

Another batch of changes for ASoC, no big core changes - it's mainly
small fixes and improvements for individual drivers.

 - A big refresh and cleanup of the Samsung drivers, fixing a number of
   issues which allow the driver to be used with a wider range of
   userspaces.
 - Fixes for the Intel drivers to make them more standard so less likely
   to get bitten by core issues.
 - New driver for Cirrus Logic CS35L26.
2019-02-28 13:30:55 +01:00
KaiChieh Chuang fc23af99e4 ASoC: mediatek: btcvsd fix rx stream assign
fix tx/rx stream assign wrong direction

Signed-off-by: KaiChieh Chuang <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2019-02-12 14:12:59 +00:00
KaiChieh Chuang 49ff8cfb17 ASoC: mediatek: use %pOFn instead of device_node.name
In preparation to remove the node name pointer from struct device_node,
convert printf users to use the %pOFn format specifier.

Signed-off-by: KaiChieh Chuang <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2019-02-11 16:01:48 +00:00
Takashi Iwai d02cac152c Merge tag 'asoc-v5.1' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next
ASoC: Updates for v5.1

Lots and lots of new drivers so far, a highlight being the MediaTek
BTCVSD which is a driver for a Bluetooth radio chip - the first such
driver we've had upstream.  Hopefully we will soon also see a baseband
with an upstream driver!

 - Support for only powering up channels that are actively being used.
 - Quite a few improvements to simplify the generic card drivers,
   especially the merge of the SCU cards into the main generic drivers.
 - Lots of fixes for probing on Intel systems, trying to rationalize
   things to look more standard from a framework point of view.
 - New drivers for Asahi Kasei Microdevices AK4497, Cirrus Logic CS4341,
   Google ChromeOS embedded controllers, Ingenic JZ4725B, MediaTek
   BTCVSD, MT8183 and MT6358, NXP MICFIL, Rockchip RK3328, Spreadtrum
   DMA controllers, Qualcomm WCD9335, Xilinx S/PDIF and PCM formatters.
2019-02-08 14:20:32 +01:00
Takashi Iwai 15486e63e7 ASoC: mediatek: Drop superfluous PCM preallocation error checks
snd_pcm_lib_preallocate_pages() and co always succeed, so the error
check is simply redundant.  Drop it.

Reviewed-by: Jaroslav Kysela <[email protected]>
Acked-by: Mark Brown <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
2019-02-06 18:29:11 +01:00
Colin Ian King 766cc4965a ASoC: mediatek: btcvsd: fix spelling mistake "offest" -> "offset"
There is a spelling mistake in a dev_warn message. Fix this.

Signed-off-by: Colin Ian King <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2019-02-04 17:12:03 +01:00
KaiChieh Chuang 4bd8597dc3 ASoC: mediatek: add btcvsd driver
The driver function for transferring/receiving
BT encoded data to/from BT firmware.

Signed-off-by: KaiChieh Chuang <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2019-02-02 15:59:27 +00:00
KaiChieh Chuang f11c5db770 ASoC: mediatek: sub dai use list_head
use list_head for sub_dais,
since original sub_dais array is sparsely occupied

Signed-off-by: KaiChieh Chuang <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2018-06-29 13:31:52 +01:00
Arnd Bergmann 39f56b757c ASoC: mediatek: export mtk-afe symbols as needed
The new mt6797-afe driver uses some functions in a common file, which
works for a built-in driver but fails for a loadable module:

ERROR: "mtk_afe_pcm_free" [sound/soc/mediatek/mt6797/snd-soc-mt6797-afe.ko] undefined!
ERROR: "mtk_afe_add_sub_dai_control" [sound/soc/mediatek/mt6797/snd-soc-mt6797-afe.ko] undefined!
ERROR: "mtk_afe_pcm_new" [sound/soc/mediatek/mt6797/snd-soc-mt6797-afe.ko] undefined!
ERROR: "mtk_afe_combine_sub_dai" [sound/soc/mediatek/mt6797/snd-soc-mt6797-afe.ko] undefined!
ERROR: "mtk_afe_pcm_ops" [sound/soc/mediatek/mt6797/snd-soc-mt6797-afe.ko] undefined!

This exports the five symbols above for modules.

Fixes: b3c702f56b ("ASoC: mt6797: combine DAI to register component")
Signed-off-by: Arnd Bergmann <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2018-05-31 11:24:48 +01:00
KaiChieh Chuang b3c702f56b ASoC: mt6797: combine DAI to register component
Signed-off-by: KaiChieh Chuang <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2018-05-25 18:34:48 +01:00
KaiChieh Chuang 13be427e5d ASoC: mediatek: add sub dai to mtk_base_afe
In MediaTek SoC chip we have multiple DAI,
such as I2S, ADDA, PCM, etc.

Organize each DAI in to one sub dai,
with its dai driver, controls, widgets, routes.

add mtk_afe_combine_sub_dai() to combine
dai driver from each DAI.

add mtk_afe_add_sub_dai_control() to register
the control, widget, routes to component.

Signed-off-by: KaiChieh Chuang <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2018-05-25 18:34:46 +01:00
Kai Chieh Chuang 9a67d11e34 ASoC: mediatek: avoid using snd_soc_platform
avoid using snd_soc_platform, which is removed after 4.18

Signed-off-by: KaiChieh Chuang <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2018-05-02 05:52:14 +09:00
Kai Chieh Chuang 58edf3255c ASoC: mediatek: preallocate pages use platform device
preallocate pages should use platform device,
since we set dma mask for platform device.

Signed-off-by: KaiChieh Chuang <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2018-04-27 11:58:23 +01:00
Ryder Lee 3a280ed132 ASoC: mediatek: switch to SPDX license tag
Add SPDX identifiers to all remaining files in sound/soc/mediatek/

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2018-04-26 15:09:36 +01:00
Ryder Lee ab7b4ee986 ASoC: mediatek: Add MTK_STREAM_NUM to mtk-base-afe.h
Add MTK_STREAM_NUM to common header and modify related stuff so that
the other SoCs can reuse it.

Signed-off-by: Ryder Lee <[email protected]>
Reviewed-by: Garlic Tseng <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2018-04-26 15:08:58 +01:00
Ryder Lee e4b31b816c ASoC: mediatek: use snd_soc_dai_get_drvdata() to get the private data
Reduce the boilerplate code to retrieve the private data.
No functional change intended.

Signed-off-by: Ryder Lee <[email protected]>
Reviewed-by: Garlic Tseng <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2018-04-25 19:05:43 +01:00
Kuninori Morimoto f1b5bf0736 ASoC: mt2701/mt8173: replace platform to component
Now platform can be replaced to component, let's do it.

Signed-off-by: Kuninori Morimoto <[email protected]>
Tested-by: Garlic Tseng <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2018-02-12 11:45:38 +00:00
Baoyou Xie 22e766146a ASoC: mediatek: mark symbols static where possible
We get 2 warnings about global functions without a declaration
in the ASoC mediatek module when building with W=1:

sound/soc/mediatek/common/mtk-afe-fe-dai.c:26:5: warning: no previous prototype for 'mtk_regmap_update_bits' [-Wmissing-prototypes]
 int mtk_regmap_update_bits(struct regmap *map, int reg, unsigned int mask,
         ^
sound/soc/mediatek/common/mtk-afe-fe-dai.c:34:5: warning: no previous prototype for 'mtk_regmap_write' [-Wmissing-prototypes]
 int mtk_regmap_write(struct regmap *map, int reg, unsigned int val)

In fact, all of those functions are only used in the file in which
they are declared and don't need a declaration, but can be made static.

so this patch marks it 'static'.

Signed-off-by: Baoyou Xie <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2016-08-11 15:02:28 +01:00
Garlic Tseng 6b1e19d91d ASoC: mediatek: let mt8173 use mediatek common structure
Modify mt8173 driver implementation to use common structure.

Signed-off-by: Garlic Tseng <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2016-06-29 20:11:09 +01:00
Garlic Tseng 283b612429 ASoC: mediatek: implement mediatek common structure
implement mediatek basic structure, include common private data,
afe fe dai operator and afe platform driver.

Signed-off-by: Garlic Tseng <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2016-06-29 20:11:09 +01:00