Commit graph

214 commits

Author SHA1 Message Date
Tzung-Bi Shih
08145535a8
ASoC: mediatek: mt8183: support machine driver with max98357b
Supports machine driver with max98357b
("mt8183-mt6358-ts3a227-max98357b").

The key difference from max98357a: max98357b needs to use left
justified format.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200720012559.906088-4-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-22 14:02:02 +01:00
Tzung-Bi Shih
767ee388ab
ASoC: mediatek: mt8183: support left justified format for I2S
MT8183 audio platform supports EIAJ and I2S formats.  The code fixed to
use I2S format in the past.

Supports EIAJ mode via set_fmt ops and preserves to use I2S format as
the default format intentionally.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200720012559.906088-2-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-22 14:02:00 +01:00
Tzung-Bi Shih
e25f8afd88
ASoC: mediatek: mt8183-da7219: support HDMI jack reporting
Supports HDMI jack reporting.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200710052505.3664118-7-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-10 15:57:55 +01:00
Tzung-Bi Shih
5bdbe97711
ASoC: mediatek: mt8183-da7219: use hdmi-codec
Adds DAI link to use hdmi-codec.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200710052505.3664118-6-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-10 15:57:54 +01:00
Tzung-Bi Shih
88abbf627a
ASoC: mediatek: mt8183: support HDMI jack reporting
Supports HDMI jack reporting.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200710052505.3664118-4-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-10 15:57:52 +01:00
Tzung-Bi Shih
f2024dc55f
ASoC: mediatek: mt8183: use hdmi-codec
Adds DAI link to use hdmi-codec.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200710052505.3664118-3-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-10 15:57:52 +01:00
Tzung-Bi Shih
9e30251fb2
ASoC: mediatek: mt8183-da7219: support machine driver with rt1015
Supports machine driver with rt1015 ("mt8183-da7219-rt1015").  Embeds in
existing mt8183-da7219-max98357.c because they share most of the code.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200709122445.1584497-6-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-09 20:34:36 +01:00
Tzung-Bi Shih
e5d4bdffc8
ASoC: mediatek: mt8183-da7219: extract codec and DAI names
Extracts codec and DAI names of DA7219.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200709122445.1584497-4-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-09 20:34:34 +01:00
Tzung-Bi Shih
cbafb2cc5f
ASoC: mediatek: mt8183-da7219: remove forward declaration of headset_init
In headset_init(), it can access card by component->card.  Removes the
forward declaration.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200709122445.1584497-3-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-09 20:34:34 +01:00
Tzung-Bi Shih
31add0d56e
ASoC: mediatek: mt8183-da7219: sort header inclusions in alphabetical
Sorts header inclusions in alphabetical.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200709122445.1584497-2-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-09 20:34:33 +01:00
Tzung-Bi Shih
f4fb4fef49
ASoC: mediatek: mt8183: support machine driver with rt1015
Supports machine driver with rt1015 ("mt8183-mt6358-ts3a227-rt1015").
Embeds in existing mt8183-mt6358-ts3a227-max98357.c because they share
most of the code.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200708113233.3994206-4-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-08 16:29:40 +01:00
Tzung-Bi Shih
4dae01c2e5
ASoC: mediatek: mt8183: sort header inclusions in alphabetical
Sorts header inclusions in alphabetical.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200708113233.3994206-2-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-08 16:29:39 +01:00
Tzung-Bi Shih
b1647f9f4f
ASoC: mediatek: mt8183-da7219: set playback and capture constraints
Sets playback and capture constraints to S16_LE, stereo, 48kHz.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200623055130.159718-1-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-23 12:54:10 +01:00
Kuninori Morimoto
7995981bcf
ASoC: mediatek: use snd_soc_xxx_active()
We have snd_soc_dai/dai_stream/component_active() macro
This patch uses it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87r1vm58ik.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-18 16:15:11 +01:00
Mark Brown
132a0eb032
Merge branch 'for-5.7' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-5.8 2020-05-12 16:12:47 +01:00
Tzung-Bi Shih
d9a2d100c9
ASoC: mediatek: mt8183-da7219: set headset button maps
Sets headset button maps.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200511044000.86161-1-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-11 12:24:58 +01:00
Tzung-Bi Shih
fe94462519
ASoC: mediatek: mt8183: fix error handling of platform_get_irq()
platform_get_irq() returns negative value on error instead of 0.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200507015442.191336-1-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-07 12:51:30 +01:00
Tang Bin
adb6996807
ASoC: mediatek: Fix error handling
If the function platform_get_irq() failed, the negative value
returned will not be detected here. So fix error handling in
mt6797_afe_pcm_dev_probe(). And when get irq failed, the function
platform_get_irq() logs an error message, so remove redundant
message here.

Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
Link: https://lore.kernel.org/r/20200506143009.13368-1-tangbin@cmss.chinamobile.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-06 17:21:22 +01:00
Kuninori Morimoto
c8ac82127c
ASoC: mediatek: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointer
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/87o8snir6s.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-27 14:44:40 +00:00
Kuninori Morimoto
c865452023
ASoC: mediatek: use for_each_rtd_codecs/cpus_dai() macro
This patch switch to use plural form macro.

	- for_each_rtd_codec_dai()
	+ for_each_rtd_codec_dais()

	- for_each_rtd_codec_dai_rollback()
	+ for_each_rtd_codec_dais_rollback()

	- for_each_rtd_cpu_dai()
	+ for_each_rtd_cpu_dais()

	- for_each_rtd_cpu_dai_rollback()
	+ for_each_rtd_cpu_dais_rollback()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/87zhcqgohd.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-10 13:35:21 +00:00
Kuninori Morimoto
56f1003f65
ASoC: mediatek: mt8183-da7219-max98357: use for_each_rtd_codec_dai() macro
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/87h7znjcag.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-02-19 17:12:18 +00:00
Tzung-Bi Shih
c77b8317ee
ASoC: mediatek: mt8183-da7219: use SND_SOC_DAPM_PINCTRL in TDM out
Uses SND_SOC_DAPM_PINCTRL in TDM out to simplify code.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200219170951.2.I7ed16ef57d9e0bcafc37e766142f68cbad5b54c6@changeid
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-02-19 16:02:44 +00:00
Tzung-Bi Shih
ff0035e4c2
ASoC: mediatek: mt8183-da7219: apply some refactors
1. Moves headset jack to card-specific storage.
2. Removes trailing blank line.
3. Moves card registration to the end of probe.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200213112003.4.Ia542007f51d3de753a9e0a83135ee074581dbf71@changeid
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-02-13 12:36:50 +00:00
Tzung-Bi Shih
195a643171
ASoC: mediatek: mt8183-da7219: support TDM out and 8ch I2S out
Supports TDM out and 8ch I2S out.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200213112003.3.I30f0b8c87d5ec2a0e5f1b0fabf0a8ccef374f5ea@changeid
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-02-13 12:36:50 +00:00
Tzung-Bi Shih
8726ee6148
ASoC: mediatek: mt8183-da7219: pull TDM GPIO pins down when probed
1. Switch TDM GPIO pins according to playback on or off.
2. Pull TDM GPIO pins down when probed to avoid current leakage.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200213112003.2.I1d568b0c99742c6e755d051aadfd52e4be3cc0a5@changeid
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-02-13 12:36:49 +00:00
Tzung-Bi Shih
ec7ba9e150
ASoC: mediatek: mt8183-da7219: change supported formats of DL2 and UL1
DL2 and UL1 are for BTSCO.  Provides only 16-bit, mono, 8kHz and
16kHz to userspace.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200213112003.1.Ie5aedb9d34ebfc7f05ceb382bfe346c45331cd63@changeid
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-02-13 12:36:48 +00:00
Tzung-Bi Shih
514de1c935
ASoC: mediatek: mt8183-da7219: add speaker switch
Da7219 and max98357a share the same I2S lines.  When writing audio data
to the I2S, both codecs generate sound.

Da7219 already has a separate control "Headphone Switch".  Adds a new
control "Speakers Switch" for turning on/off max98357a.  Userspace
program can decide to turn on/off which codecs by different use cases.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200212124608.2.I5fa3fdca69dbb5d3dd5031c939b9b24095065a94@changeid
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-02-12 19:44:34 +00:00
Tzung-Bi Shih
c8b60c6d93
ASoC: mediatek: mt8173-rt5650: support HDMI jack reporting
Uses hdmi-codec to support HDMI jack reporting.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200206102509.3.I253f51edff62df1d88005de12ba601aa029b1e99@changeid
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-02-11 11:47:57 +00:00
Kuninori Morimoto
7ec6b43125
ASoC: mediatek: move .suspend/.resume to component
There is no big difference at implementation for .suspend/.resume
between DAI driver and Component driver.
But because some driver is using DAI version, thus ALSA SoC needs
to keep supporting it, hence, framework becoming verbose.
If we can switch all DAI driver .suspend/.resume to Component driver,
we can remove verbose code from ALSA SoC.

Driver is getting its private data via dai->dev.
But dai->dev and component->dev are same dev, thus, we can convert
these. For same reason, we can convert dai->active to
component->active if necessary.

This patch moves DAI driver .suspend/.resume to Component driver

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/877e1nym4e.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-21 17:03:54 +00:00
Kuninori Morimoto
2d27a4cf19
ASoC: mediatek: mt8183-da7219-max98357: use snd_soc_dai_link_component for codec_conf
We can use snd_soc_dai_link_component to specify codec_conf.
Let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87a77x59j6.wl-kuninori.morimoto.gx@renesas.com
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-12-16 12:02:32 +00:00
Kuninori Morimoto
fe71bf9aaf
ASoC: mediatek: mt8173-rt5650-rt5676: use snd_soc_dai_link_component for codec_conf
We can use snd_soc_dai_link_component to specify codec_conf.
Let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87blsd59jb.wl-kuninori.morimoto.gx@renesas.com
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-12-16 12:02:27 +00:00
Kuninori Morimoto
e90c2a3bc1
ASoC: mediatek: mt8173-rt5650-rt5514: use snd_soc_dai_link_component for codec_conf
We can use snd_soc_dai_link_component to specify codec_conf.
Let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87d0ct59jg.wl-kuninori.morimoto.gx@renesas.com
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-12-16 12:02:22 +00:00
Takashi Iwai
bf523463d8
ASoC: mediatek: Use managed buffer allocation
Clean up the drivers with the new managed buffer allocation API.
The superfluous snd_pcm_lib_malloc_pages() and
snd_pcm_lib_free_pages() calls are dropped, as well as the superfluous
snd_pcm_lib_preallocate_free_for_all() call.  As of the result,
hw_free and pcm_destruct ops became empty and got removed.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20191211172019.23206-1-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-12-12 15:41:13 +00:00
Takashi Iwai
a1b175b082
ASoC: mediatek: Drop superfluous ioctl PCM ops
ASoC PCM core deals the empty ioctl field now as default.
Let's kill the redundant lines.

Cc: Matthias Brugger <matthias.bgg@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20191210145406.21419-10-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-12-11 15:57:37 +00:00
Eason Yen
df799b9502
ASoC: mediatek: common: refine hw_params and hw_prepare
Refine mtk_afe_fe_hw_params and mtk_afe_fe_prepare by
these helpers.
- mtk_memif_set_enable
- mtk_memif_set_disable
- mtk_memif_set_addr
- mtk_memif_set_channel
- mtk_memif_set_rate
- mtk_memif_set_rate_substream
- mtk_memif_set_format
- mtk_memif_set_pbuf_size

Signed-off-by: Eason Yen <eason.yen@mediatek.com>
Link: https://lore.kernel.org/r/1573814926-15805-3-git-send-email-eason.yen@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-12-09 18:33:34 +00:00
Eason Yen
9cdf85a19b
ASoC: mediatek: common: add some helpers to control mtk_memif
1. Add the following helper in mtk-afe-fe-dai to control
to control mtk_memif
- mtk_memif_set_enable
- mtk_memif_set_disable
- mtk_memif_set_addr
- mtk_memif_set_channel
- mtk_memif_set_rate
- mtk_memif_set_rate_substream
- mtk_memif_set_format
- mtk_memif_set_pbuf_size

2.extend mtk_base_memif_data struct for new platform

Signed-off-by: Eason Yen <eason.yen@mediatek.com>
Link: https://lore.kernel.org/r/1573814926-15805-2-git-send-email-eason.yen@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-12-09 18:33:25 +00:00
Mao Wenan
ef5dee551e
ASoC: mediatek: Check SND_SOC_CROS_EC_CODEC dependency
If SND_SOC_MT8183_MT6358_TS3A227E_MAX98357A=y,
below errors can be seen:
sound/soc/codecs/cros_ec_codec.o: In function `send_ec_host_command':
cros_ec_codec.c:(.text+0x534): undefined reference to `cros_ec_cmd_xfer_status'
cros_ec_codec.c:(.text+0x101c): undefined reference to `cros_ec_get_host_event'

This is because it will select SND_SOC_CROS_EC_CODEC
after commit 2cc3cd5fdc ("ASoC: mediatek: mt8183: support WoV"),
but SND_SOC_CROS_EC_CODEC depends on CROS_EC.

Fixes: 2cc3cd5fdc ("ASoC: mediatek: mt8183: support WoV")
Signed-off-by: Mao Wenan <maowenan@huawei.com>
Link: https://lore.kernel.org/r/20191023063103.44941-1-maowenan@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-23 17:45:34 +01:00
Tzung-Bi Shih
2cc3cd5fdc
ASoC: mediatek: mt8183: support WoV
Add DAI link and pin muxing for wake on voice.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20191019143504.4.Ibf012d0cd8679d846213606dc5f426aea1ff590a@changeid
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-21 13:52:49 +01:00
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 <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87k19n90du.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
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 <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87lfu390dz.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-08 13:47:59 +01:00
Jiaxin Yu
9e985503ee
ASoC: mt8183: fix audio playback slowly after playback during bootup
Before regmap_reinit_cache we must reset audio regs as default values.
So we use reset controller unit(toprgu) to reset audio hw.

Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com>
Reviewed-by: Yingjoe Chen <yingjoe.chen@mediatek.com>
Link: https://lore.kernel.org/r/1569580317-21181-5-git-send-email-jiaxin.yu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-08 13:39:45 +01:00
Mark Brown
bb83178611
Merge branch 'asoc-5.4' into asoc-next 2019-09-09 14:55:20 +01:00
Tzung-Bi Shih
e5b3ae3e8c
ASoC: mediatek: mt8183: fix space issues
Fix space issues:
- No space before ';'.
- No trailing blank line.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20190830074240.195166-5-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-30 13:02:33 +01:00
Tzung-Bi Shih
fc347483b8
ASoC: mediatek: mt8183: remove forward declaration of headset_init
The forward declaration of mt8183_mt6358_ts3a227_max98357_headset_init
is for cyclic dependency between card, headset_dev, and headset_init.

It used to be:
- card depends on headset_dev
- headset_dev depends on headset_init
- headset_init depends on card

Commit a962a809e5 ("ASoC: mediatek: mt8183: make headset codec
optional") removed the cyclic dependency.

Thus, it is safe to remove the forward declaration.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20190830074240.195166-4-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-30 13:02:24 +01:00
Tzung-Bi Shih
95d779b4b8
ASoC: mediatek: mt8183: move headset jack to card-specific storage
Move headset jack descriptor from module global scope to card-specific
storage to make its ownership more explicit.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20190830074240.195166-3-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-30 13:02:16 +01:00
Tzung-Bi Shih
96ed769833
ASoC: mediatek: mt8183: move private structure
Move private structure to the beginning of file to declare earlier
so that most functions can see it.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20190830074240.195166-2-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-30 13:02:07 +01:00
Jiaxin Yu
2c650fd5a5
ASoC: mediatek: mt8183: fix tdm out data is valid on rising edge
This patch correct tdm out bck inverse register to AUDIO_TOP_CON3[3].

Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com>
Link: https://lore.kernel.org/r/1566621445-26989-4-git-send-email-jiaxin.yu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-28 11:50:33 +01:00
Jiaxin Yu
8e58c521bc
ASoC: mediatek: mt8183: tdm hw support tdm out and 8ch i2s out
This patch refined tdm driver code, and allow tdm hw to support two
configurations in machine driver to output tdm signal or i2s signal.

Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com>
Link: https://lore.kernel.org/r/1566621445-26989-3-git-send-email-jiaxin.yu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-28 11:50:25 +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 <jiaxin.yu@mediatek.com>
Link: https://lore.kernel.org/r/1566622726-27113-1-git-send-email-jiaxin.yu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-27 20:38:59 +01:00
Tzung-Bi Shih
3cdc3c9fd9
ASoC: mediatek: mt8183: remove unused DAPM-related variables
Remove unused variable mt8183_mt6358_ts3a227_max98357_dapm_widgets and
mt8183_mt6358_ts3a227_max98357_dapm_routes.  They are accidentially
included when rebasing commits.

Fixes: 6191cbde5f ("ASoC: mediatek: mt8183: switch tdm pins gpio function when playback on or off")
Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20190826032642.27324-1-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-27 19:21:46 +01:00