Commit graph

246 commits

Author SHA1 Message Date
Mark Brown
ddaa1ed52c
Merge some cs42l42 patches into asoc-5.15 2021-08-06 01:46:24 +01:00
Takashi Iwai
f2553d4678
ASoC: amd: vangogh: Drop superfluous mmap callback
The mmap callback of vangogh driver just calls the default mmap
handler, and it's superfluous, as the PCM core would call it if not
set.  Let's drop the superfluous mmap callback.

Fixes: 361414dc1f ("ASoC: amd: add vangogh i2s dma driver pm ops")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20210804075223.9823-1-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-04 13:20:14 +01:00
Takashi Iwai
8b5d95313b
ASoC: amd: Fix reference to PCM buffer address
PCM buffers might be allocated dynamically when the buffer
preallocation failed or a larger buffer is requested, and it's not
guaranteed that substream->dma_buffer points to the actually used
buffer.  The driver needs to refer to substream->runtime->dma_addr
instead for the buffer address.

Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20210731084331.32225-1-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-02 12:14:00 +01:00
Takashi Iwai
f211f5f606
ASoC: amd: Drop superfluous mmap callbacks
All ASoC AMD drivers just call the standard mmap handler, hence those
are superfluous.  Let's drop them.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20210728141843.17685-1-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-30 16:04:36 +01:00
Dan Carpenter
37108ef45a
ASoC: amd: fix an IS_ERR() vs NULL bug in probe
The devm_ioremap() function returns NULL on error, it doesn't return
error pointers.

Fixes: e550339ee6 ("ASoC: amd: add vangogh i2s controller driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20210727081756.GA19121@kili
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-27 13:14:53 +01:00
Mario Limonciello
718693352d
ASoC: amd: Use dev_probe_err helper
Replace the pattern of check for err to match -EPROBE_DEFER and only
output errors to use the dev_err_probe helper instead.

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/20210722132731.13264-2-mario.limonciello@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-23 14:52:50 +01:00
Mario Limonciello
af7dc6f194
ASoC: amd: Don't show messages about deferred probing by default
Nearly every boot with a Lenovo P14s is showing
acp_pdm_mach acp_pdm_mach.0: snd_soc_register_card(acp) failed: -517

This isn't useful to a user, especially as probing will run again.
Use the dev_err_probe helper to hide the deferrerd probing messages.

CC: markpearson@lenovo.com
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/20210722132731.13264-1-mario.limonciello@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-23 14:52:49 +01:00
Vijendar Mukunda
5434d0dc56
ASoC: amd: enable stop_dma_first flag for cz_dai_7219_98357 dai link
DMA driver stop sequence should be invoked first before invoking I2S
controller driver stop sequence for Stoneyridge platform.

Enable stop_dma_first flag for cz_dai_7219_98357 dai link structure.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20210722130328.23796-1-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-22 16:02:20 +01:00
Vijendar Mukunda
08413fca62
ASoC: amd: enable vangogh acp5x driver build
Vangogh ACP5x drivers can be built by selecting necessary
kernel config option.
The patch enables build support of the same.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20210721180430.11571-13-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-22 12:45:44 +01:00
Vijendar Mukunda
361414dc1f
ASoC: amd: add vangogh i2s dma driver pm ops
Add Vangogh i2s dma driver pm ops

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20210721180430.11571-12-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-22 12:45:43 +01:00
Vijendar Mukunda
b0a37ac678
ASoC: amd: add vangogh pci driver pm ops
Add Vangogh acp pci driver pm ops.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20210721180430.11571-11-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-22 12:45:42 +01:00
Vijendar Mukunda
b80556addd
ASoC: amd: add vangogh i2s dai driver ops
Add Vangogh i2s dai driver ops.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20210721180430.11571-10-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-22 12:45:41 +01:00
Vijendar Mukunda
e550339ee6
ASoC: amd: add vangogh i2s controller driver
Add Vangogh I2S controller driver to support two I2S controller
instances.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20210721180430.11571-9-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-22 12:45:39 +01:00
Vijendar Mukunda
cab396d8b2
ASoC: amd: add ACP5x pcm dma driver ops
This patch adds ACP5x PCM driver DMA operations.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20210721180430.11571-8-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-22 12:45:38 +01:00
Vijendar Mukunda
fc2c8067c7
ASoC: amd: irq handler changes for ACP5x PCM dma driver
Whenever audio data equal to the I2S FIFO watermark level are
produced/consumed, interrupt is generated.
Acknowledge the interrupt.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20210721180430.11571-7-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-22 12:45:37 +01:00
Vijendar Mukunda
77f61444e4
ASoC: amd: add ACP5x PCM platform driver
PCM platform driver binds to the platform device created by
ACP5x PCI device. PCM driver registers ALSA DMA components
with ASoC framework.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20210721180430.11571-6-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-22 12:45:36 +01:00
Vijendar Mukunda
603f2dedcc
ASoC: amd: create acp5x platform devices
ACP5.x IP has multiple I2S controllers and DMA controller.
Create platform devices for I2S HS controller instance, I2S SP controller
instance and DMA controller.
Pass PCI resources like MMIO, irq to these platform devices.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20210721180430.11571-5-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-22 12:45:35 +01:00
Vijendar Mukunda
5d9ee88a10
ASoc: amd: add acp5x init/de-init functions
Add Vangogh ACP PCI driver init/deinit functions.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20210721180430.11571-4-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-22 12:45:34 +01:00
Vijendar Mukunda
4a7151c968
ASoC: amd: add Vangogh ACP PCI driver
ACP is a PCI audio device.
This patch adds PCI driver to bind to this device and get
PCI resources.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20210721180430.11571-3-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-22 12:45:33 +01:00
Vijendar Mukunda
7bf060d0d5
ASoC: amd: add Vangogh ACP5x IP register header
Add register header for ACP5x IP in Vangogh platform.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20210721180430.11571-2-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-22 12:45:32 +01:00
Mario Limonciello
d00f541a49
ASoC: amd: renoir: Run hibernation callbacks
The registers need to be re-initialized after hibernation or
microphone may be non-functional.

BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=213793
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/20210721183603.747-2-mario.limonciello@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-22 12:40:01 +01:00
Vijendar Mukunda
7883490cba
ASoC: amd: reverse stop sequence for stoneyridge platform
For Stoneyridge platform, it is required to invoke DMA driver stop
first rather than invoking DWC I2S controller stop.

Enable dai_link structure stop_dma_fist flag to reverse the stop
sequence.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20210716123015.15697-2-vijendar.mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-16 13:54:59 +01:00
Gu Shengxian
f7c4fe9cff
ASoC: amd: fix spelling mistakes
Fix some spelling mistakes as follows:
descritor ==> descriptor
descriptore ==> descriptor
contiguos ==> contiguous
initiailize ==> initialize
descriptiors ==> descriptor

Signed-off-by: Gu Shengxian <gushengxian@yulong.com>
Link: https://lore.kernel.org/r/20210706064207.672491-1-gushengxian507419@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-11 23:48:40 +01:00
Jiapeng Chong
2fa74b31bb
ASoC: amd: renoir: Remove redundant assignment to pdm_ctrl and pdm_enable and pdm_dma_enable
Variable pdm_ctrl and pdm_enable and pdm_dma_enable are set to '0x00',
but they are overwritten later on, so these are redundant assignments
that can be removed.

Clean up the following clang-analyzer warning:

sound/soc/amd/renoir/acp3x-pdm-dma.c:148:2: warning: Value stored to
'pdm_dma_enable' is never read [clang-analyzer-deadcode.DeadStores].

sound/soc/amd/renoir/acp3x-pdm-dma.c:147:2: warning: Value stored to
'pdm_enable' is never read [clang-analyzer-deadcode.DeadStores].

sound/soc/amd/renoir/acp3x-pdm-dma.c:80:2: warning: Value stored to
'pdm_ctrl' is never read [clang-analyzer-deadcode.DeadStores].

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Link: https://lore.kernel.org/r/1620298590-29749-1-git-send-email-jiapeng.chong@linux.alibaba.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-10 13:05:32 +01:00
Mark Brown
3f0d23e849
Merge existing fixes from asoc/for-5.13 2021-05-10 13:00:42 +01:00
Vijendar Mukunda
6879e8e759
ASoC: amd: fix for pcm_read() error
Below phython script throwing pcm_read() error.

import subprocess

p = subprocess.Popen(["aplay -t raw -D plughw:1,0 /dev/zero"], shell=True)
subprocess.call(["arecord -Dhw:1,0 --dump-hw-params"], shell=True)
subprocess.call(["arecord -Dhw:1,0 -fdat -d1 /dev/null"], shell=True)
p.kill()

Handling ACP global external interrupt enable register
causing this issue.
This register got updated wrongly when there is active
stream causing interrupts disabled for active stream.
Refactored code to handle enabling and disabling external interrupts.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/1619555017-29858-1-git-send-email-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-28 16:34:55 +01:00
Mark Brown
ffc9841d52
Merge remote-tracking branch 'asoc/for-5.13' into asoc-next 2021-04-23 19:01:02 +01:00
Vijendar Mukunda
1300c7037f
ASoC: amd: drop S24_LE format support
AMD I2S Controller doesn't support S24_LE format.
Remove S24_LE format support from ACP DMA driver
and CPU DAI Driver.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/1618993402-10354-1-git-send-email-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-21 15:49:48 +01:00
Vijendar Mukunda
26e33ed9f1
ASoC: amd: Add support for ALC1015P codec in acp3x machine driver
Add ALC1015p codec support for acp3x machine driver.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/1617886984-9500-1-git-send-email-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-09 20:03:10 +01:00
Ye Bin
4150cc7306
ASoC: amd: renoir: acp3x-pdm-dma: constify static struct snd_soc_dai_ops
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/20210408062658.803724-1-yebin10@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-09 13:39:53 +01:00
Ye Bin
3e075e8428
ASoC: amd: raven: acp3x-i2s: Constify static struct snd_soc_dai_ops
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/20210408062651.803413-1-yebin10@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-09 13:39:43 +01:00
Pierre-Louis Bossart
2711a2d993
ASoC: amd: renoir: acp3x-pdm-dma: remove unnecessary assignments
cppcheck warning:

sound/soc/amd/renoir/acp3x-pdm-dma.c:132:17: style: Variable
'pdm_dma_enable' is assigned a value that is never
used. [unreadVariable]
 pdm_dma_enable = 0x00;
                ^
sound/soc/amd/renoir/acp3x-pdm-dma.c:156:18: style: Variable
'pdm_dma_enable' is assigned a value that is never
used. [unreadVariable]
  pdm_dma_enable = 0x00;
                 ^

indeed those values are never used because the timeout is reset.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210326215927.936377-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-31 18:03:14 +01:00
Vijendar Mukunda
d463cead11
ASoC: amd: fix acpi dependency kernel warning
Fix ACPI dependency kernel warning produced by powerpc
allyesconfig.

sound/soc/amd/acp-da7219-max98357a.c:684:28: warning:
'cz_rt5682_card' defined but not used [-Wunused-variable]

sound/soc/amd/acp-da7219-max98357a.c:671:28: warning: 'cz_card'
defined but not used [-Wunused-variable]

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/1616777074-5151-2-git-send-email-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-29 17:28:15 +01:00
Vijendar Mukunda
23f23db29a
ASoC: amd: update spdx license for acp machine driver
update SPDX license for acp machine driver.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/1616777074-5151-1-git-send-email-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-29 17:28:14 +01:00
Vijendar Mukunda
7e71b48f9e
ASoC: amd: Add support for RT5682 codec in machine driver
Add support for RT5682 codec in machine driver.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/1616118056-5506-1-git-send-email-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-22 12:32:20 +00:00
Pierre-Louis Bossart
7655e32685
ASoC: amd: renoir: remove invalid kernel-doc comment
make W=1 warning:

sound/soc/amd/renoir/rn-pci-acp3x.c:24: warning: wrong kernel-doc
identifier on line:
 * dmic_acpi_check = -1 - Use ACPI/DMI method to detect the DMIC
   hardware presence at runtime

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210302205926.49063-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-10 13:10:41 +00:00
Mark Brown
2927e6d398
Merge branch 'asoc-5.11' into asoc-5.12 2021-02-05 15:01:21 +00:00
Jaroslav Kysela
40caffd66c
ASoC: AMD Renoir - refine DMI entries for some Lenovo products
Apparently, the DMI board name LNVNB161216 is also used also
for products with the digital microphones connected to the AMD's
audio bridge. Refine the DMI table - use product name identifiers
extracted from https://bugzilla.redhat.com/show_bug.cgi?id=1892115 .

The report for Lenovo Yoga Slim 7 14ARE05 (82A2) is in buglink.

BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=211299
Cc: <stable@kernel.org>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Cc: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210120144211.817937-1-perex@perex.cz
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-20 16:46:46 +00:00
Tzung-Bi Shih
81a6320da7
ASoC: rt1015: remove bclk_ratio
bclk_ratio is unused.  Removes bclk_ratio and .set_bclk_ratio callback.

Removes snd_soc_dai_set_bclk_ratio() in a few machine drivers which are
obviously using rt1015.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20201224101854.3024823-1-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-05 14:34:18 +00:00
Jaroslav Kysela
1f092d1c88
ASoC: AMD Renoir - add DMI entry for Lenovo ThinkPad X395
The ThinkPad X395 latop does not have the internal digital
microphone connected to the AMD's ACP bridge, but it's advertised
via BIOS. The internal microphone is connected to the HDA codec.

Use DMI to block the microphone PCM device for this platform.

BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1892115
Cc: <stable@kernel.org>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20201227164109.269973-1-perex@perex.cz
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-28 14:22:44 +00:00
Ravulapati Vishnu vardhan rao
a523e1538f
ASoC: amd: Replacing MSI with Legacy IRQ model
When we try to play and capture simultaneously we see that
interrupts are genrated but our handler is not being acknowledged,
After investigating further more in detail on this issue we found
that IRQ delivery via MSI from the ACP IP is unreliable and so sometimes
interrupt generated will not be acknowledged so MSI model shouldn't be used
and using legacy IRQs will resolve interrupt handling issue.

This patch replaces MSI interrupt handling with legacy IRQ model.

Issue can be reproduced easily by running below python script:

import subprocess
import time
import threading

def do2():
  cmd = 'aplay -f dat -D hw:2,1 /dev/zero -d 1'
    subprocess.call(cmd, stdin=subprocess.PIPE,
			stderr=subprocess.PIPE, shell=True)
    print('Play Done')

def run():
	for i in range(1000):
		do2()

def do(i):
    cmd = 'arecord -f dat -D hw:2,2 /dev/null -d 1'
    subprocess.call(cmd, stdout=subprocess.PIPE,
			stderr=subprocess.PIPE, shell=True)
    print(datetime.datetime.now(), i)

t = threading.Thread(target=run)
t.start()
for i in range(1000):
	do(i)

t.join()

After applying this patch issue is resolved.

Signed-off-by: Ravulapati Vishnu vardhan rao <Vishnuvardhanrao.Ravulapati@amd.com>
Link: https://lore.kernel.org/r/20201222115929.11222-1-Vishnuvardhanrao.Ravulapati@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-28 14:22:27 +00:00
Jaroslav Kysela
275565997a
ASoC: AMD Renoir - add DMI entry for Lenovo ThinkPad E14 Gen 2
The ThinkPad E14 Gen 2 latop does not have the internal digital
microphone connected to the AMD's ACP bridge, but it's advertised
via BIOS. The internal microphone is connected to the HDA codec.

Use DMI to block the microphone PCM device for this platform.

Reported-by: Eliot Blennerhassett <eliot@blennerhassett.gen.nz>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20201227164037.269893-1-perex@perex.cz
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-28 14:20:43 +00:00
Mark Brown
460aa020f5
Merge remote-tracking branch 'asoc/for-5.11' into asoc-next 2020-12-11 17:48:04 +00:00
Jaroslav Kysela
718c406e1f
ASoC: AMD Renoir - add DMI table to avoid the ACP mic probe (broken BIOS)
Users reported that some Lenovo AMD platforms do not have ACP microphone,
but the BIOS advertises it via ACPI.

This patch create a simple DMI table, where those machines with the broken
BIOS can be added. The DMI description for Lenovo IdeaPad 5 and
IdeaPad Flex 5 devices are added there.

Also describe the dmic_acpi_check kernel module parameter in a more
understandable way.

Cc: <stable@kernel.org>
Cc: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Cc: Mark Brown <broonie@kernel.org>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20201208171200.2737620-1-perex@perex.cz
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-09 14:45:58 +00:00
Jaroslav Kysela
55d8e6a85b
ASoC: AMD Raven/Renoir - fix the PCI probe (PCI revision)
The Raven and Renoir ACP can be distinguished by the PCI revision.
Let's do the check very early, otherwise the wrong probe code
can be run.

Link: https://lore.kernel.org/alsa-devel/2e4587f8-f602-cf23-4845-fd27a32b1cfc@amd.com/
Cc: <stable@kernel.org>
Cc: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Cc: Mark Brown <broonie@kernel.org>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20201208181233.2745726-1-perex@perex.cz
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-09 12:12:59 +00:00
Chuhong Yuan
95d3befbc5
ASoC: amd: change clk_get() to devm_clk_get() and add missed checks
cz_da7219_init() does not check the return values of clk_get(),
while da7219_clk_enable() calls clk_set_rate() to dereference
the pointers.
Add checks to fix the problems.
Also, change clk_get() to devm_clk_get() to avoid data leak after
failures.

Fixes: bb24a31ed5 ("ASoC: AMD: Configure wclk and bclk of master codec")
Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Link: https://lore.kernel.org/r/20201204063610.513556-1-hslester96@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-08 17:06:36 +00:00
Mark Brown
e5879d9882
Merge branch 'for-5.10' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-5.11 2020-11-30 16:05:07 +00:00
Takashi Iwai
ab5893fdc0
ASoC: amd: Return -ENODEV for non-existing ACPI call
AMD Renoir driver tries to identify the presence of DMIC by evaluating
ACPI _WOV entry, and it returns -EINVAL when the ACPI call failed.
This ended up an error message like
  snd_rn_pci_acp3x: probe of 0000:04:00.5 failed with error -22
although the system is correctly set up.

For avoiding such a superfluous error message, change the return value
to -ENODEV.  Then the driver core just skips to the next one without
complaining.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20201127143200.16272-3-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-30 12:52:46 +00:00
Takashi Iwai
2509bb342e
ASoC: amd: Downgrade print level for invalid ACP mode
The acp3x raven driver skips the probing when the given device isn't
connected with I2S.  This skip behavior itself is fine, but the driver
also emits an error message "Invalid ACP audio mode" with KERN_ERR.
This isn't nice since it appears on the boot screen even if a boot
splash is running, although this itself is no real error.

Downgrade the print level to KERN_INFO so that this message won't
appear on the console unnecessarily.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20201127143200.16272-2-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-30 12:52:45 +00:00
Vijendar Mukunda
efb38304c5
ASoC: amd: support other audio modes for raven
ACP supports different audio configurations other than I2S.
This patch will fix acp driver probe failure for other audio
configurations.

Tested-by: Prike Liang <Prike.Liang@amd.com>
Reviewed-by: Prike Liang <Prike.Liang@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/1603476441-3506-1-git-send-email-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-10-26 18:37:06 +00:00