linux-2.6-microblaze.git
5 years agoMAINTAINERS: add ASoC maintainers for sound dt-bindings
Clément Péron [Sat, 17 Nov 2018 12:14:52 +0000 (13:14 +0100)]
MAINTAINERS: add ASoC maintainers for sound dt-bindings

Sound dt-bindings are applied by ASoC maintainers and should be
submit to ASoC list in addition to the devicetree list.

Hence, add this information into the MAINTAINERS file.

Signed-off-by: Clément Péron <peron.clem@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: rt5663: Fix error handling of regulator_set_load
Cheng-Yi Chiang [Fri, 16 Nov 2018 09:28:56 +0000 (17:28 +0800)]
ASoC: rt5663: Fix error handling of regulator_set_load

The default implementation of regulator_set_load returns
REGULATOR_MODE_NORMAL, which is positive.  [This was a bug which is
being fixed but the change is valid anyway -- bronie]

rt5663_i2c_probe should only do error handling when return value of
regulator_set_load is negative.
In this case, rt5663_i2c_probe should return error.

Also, consolidate err_irq into err_enable.

Fix the missing goto for temporary regmap and rt5663->regmap.

Signed-off-by: Cheng-Yi Chiang <cychiang@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: amd: fix spelling mistake "Inavlid" -> "Invalid"
Colin Ian King [Fri, 16 Nov 2018 13:39:43 +0000 (13:39 +0000)]
ASoC: amd: fix spelling mistake "Inavlid" -> "Invalid"

There is a spelling mistake in a dev_err message. Fix this.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: qcom: clean up indentation, remove extraneous tab
Colin Ian King [Fri, 16 Nov 2018 15:06:36 +0000 (15:06 +0000)]
ASoC: qcom: clean up indentation, remove extraneous tab

The return statement is indented too much by one level, fix this by
removing the extraneous tab.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: arizona: fix indentation issue with return statement
Colin Ian King [Fri, 16 Nov 2018 15:06:35 +0000 (15:06 +0000)]
ASoC: arizona: fix indentation issue with return statement

The return statement is indented incorrectly. Fix this by adding in
the missing tab.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: tlv320dac33: clean up indentation, remove extraneous tab
Colin Ian King [Fri, 16 Nov 2018 15:06:34 +0000 (15:06 +0000)]
ASoC: tlv320dac33: clean up indentation, remove extraneous tab

The goto statement is indented too much by one level, fix this by
removing the extraneous tab.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: tlv320aic31xx: asihpi: clean up indentation, remove extraneous tab
Colin Ian King [Fri, 16 Nov 2018 15:06:33 +0000 (15:06 +0000)]
ASoC: tlv320aic31xx: asihpi: clean up indentation, remove extraneous tab

The return statement is indented too much by one level, fix this by
removing an extraneous tab.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: Convert a few more users to using %pOFn instead of device_node.name
Rob Herring [Fri, 16 Nov 2018 21:43:49 +0000 (15:43 -0600)]
ASoC: Convert a few more users to using %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.

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: Olivier Moysan <olivier.moysan@st.com>
Cc: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Cc: Alexandre Torgue <alexandre.torgue@st.com>
Cc: alsa-devel@alsa-project.org
Cc: linux-stm32@st-md-mailman.stormreply.com
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: rt5663: Add documentation for power supply support
Cheng-Yi Chiang [Fri, 16 Nov 2018 02:12:43 +0000 (10:12 +0800)]
ASoC: rt5663: Add documentation for power supply support

rt5663 codec driver will support setting CPVDD and AVDD power supply
from device tree.

Signed-off-by: Cheng-Yi Chiang <cychiang@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: Add documentation for pcm3060 property out-single-ended
Kirill Marinushkin [Thu, 15 Nov 2018 07:12:53 +0000 (08:12 +0100)]
ASoC: Add documentation for pcm3060 property out-single-ended

Output of pcm3060 codec may be configured as single-ended or differential

Signed-off-by: Kirill Marinushkin <kmarinushkin@birdec.tech>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: rt5663: Add regulator support
Cheng-Yi Chiang [Thu, 15 Nov 2018 04:13:34 +0000 (12:13 +0800)]
ASoC: rt5663: Add regulator support

Add regulator support to turn on cpvdd and avdd in probe.
If a regulator is not given from device tree, a dummy regulator will be
used.

Signed-off-by: Cheng-Yi Chiang <cychiang@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: ak4118: Add support for AK4118 S/PDIF transceiver
Adrien Charruel [Wed, 14 Nov 2018 12:16:41 +0000 (13:16 +0100)]
ASoC: ak4118: Add support for AK4118 S/PDIF transceiver

The AK4118A is a digital audio transceiver supporting 8 input channels
at 192kHz and with 24bits resolution.
It converts the S/PDIF signal to I2S format and is configurable over I2C.

This driver introduce a minimal support of the AK4118, like selecting the
input channel, reading input frequency and detecting some errors.

Datasheet is available here:
https://www.akm.com/akm/en/file/datasheet/AK4118AEQ.pdf

Signed-off-by: Adrien Charruel <adrien.charruel@devialet.com>
Signed-off-by: Clément Péron <peron.clem@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: dt-bindings: add bindings for AK4118 transceiver
Clément Péron [Wed, 14 Nov 2018 12:16:42 +0000 (13:16 +0100)]
ASoC: dt-bindings: add bindings for AK4118 transceiver

Document the bindings for AK4118 S/PDIF transceiver

Signed-off-by: Clément Péron <peron.clem@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: pcm186x: Fix device reset-registers trigger value
Andreas Dannenberg [Thu, 15 Nov 2018 17:01:31 +0000 (11:01 -0600)]
ASoC: pcm186x: Fix device reset-registers trigger value

According to the current device datasheet (TI Lit # SLAS831D, revised
March 2018) the value written to the device's PAGE register to trigger
a complete register reset should be 0xfe, not 0xff. So go ahead and
update to the correct value.

Reported-by: Stephane Le Provost <stephane.leprovost@mediatek.com>
Tested-by: Stephane Le Provost <stephane.leprovost@mediatek.com>
Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
Acked-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
5 years agoASoC: amd: remove set but not used variable 'dma_buffer'
YueHaibing [Thu, 15 Nov 2018 01:56:35 +0000 (01:56 +0000)]
ASoC: amd: remove set but not used variable 'dma_buffer'

Fixes gcc '-Wunused-but-set-variable' warning:

sound/soc/amd/raven/acp3x-pcm-dma.c: In function 'acp3x_dma_hw_params':
sound/soc/amd/raven/acp3x-pcm-dma.c:333:25: warning:
 variable 'dma_buffer' set but not used [-Wunused-but-set-variable]

It never used since introduction in commit
8de1b5ed0337 ("ASoC: amd: add acp3x system resume pm op")

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: amd: Switch to SPDX identifier
Vijendar Mukunda [Thu, 15 Nov 2018 16:13:50 +0000 (21:43 +0530)]
ASoC: amd: Switch to SPDX identifier

Adopt the SPDX license identifier headers to ease license
compliance management.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Vijendar Mukunda <vijendar.mukunda@amd.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: amd: Fixed build errors
Vijendar Mukunda [Thu, 15 Nov 2018 16:13:49 +0000 (21:43 +0530)]
ASoC: amd: Fixed build errors

Fixed build errors.
- Implicit declaration of pci_enable_msi() & pci_disable_msi()
api's for openrisc architecture.
- type defaults to 'int' in declaration of 'module_pci_driver'

Enabled build for x86 architecture.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Vijendar Mukunda <vijendar.mukunda@amd.com>
Tested-by: Ravulapati Vishnu vardhan Rao <Vishnuvardhanrao.Ravulapati@amd.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: nau8822: convert to SPDX identifiers
David Lin [Thu, 15 Nov 2018 09:49:13 +0000 (17:49 +0800)]
ASoC: nau8822: convert to SPDX identifiers

This patch fixes typo in the comment.

Signed-off-by: David Lin <CTLIN0@nuvoton.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: nau8822: convert to SPDX identifiers
David Lin [Thu, 15 Nov 2018 09:14:47 +0000 (17:14 +0800)]
ASoC: nau8822: convert to SPDX identifiers

This patch updates license to SPDX-License-Identifier
instead of verbose license text.

Signed-off-by: David Lin <CTLIN0@nuvoton.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: dapm: Recalculate audio map forcely when card instantiated
Tzung-Bi Shih [Wed, 14 Nov 2018 09:06:13 +0000 (17:06 +0800)]
ASoC: dapm: Recalculate audio map forcely when card instantiated

Audio map are possible in wrong state before card->instantiated has
been set to true.  Imaging the following examples:

time 1: at the beginning

  in:-1    in:-1    in:-1    in:-1
 out:-1   out:-1   out:-1   out:-1
 SIGGEN        A        B      Spk

time 2: after someone called snd_soc_dapm_new_widgets()
(e.g. create_fill_widget_route_map() in sound/soc/codecs/hdac_hdmi.c)

   in:1     in:0     in:0     in:0
  out:0    out:0    out:0    out:1
 SIGGEN        A        B      Spk

time 3: routes added

   in:1     in:0     in:0     in:0
  out:0    out:0    out:0    out:1
 SIGGEN -----> A -----> B ---> Spk

In the end, the path should be powered on but it did not.  At time 3,
"in" of SIGGEN and "out" of Spk did not propagate to their neighbors
because snd_soc_dapm_add_path() will not invalidate the paths if
the card has not instantiated (i.e. card->instantiated is false).
To correct the state of audio map, recalculate the whole map forcely.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: omap-abe-twl6040: Fix missing audio card caused by deferred probing
Peter Ujfalusi [Wed, 14 Nov 2018 12:58:20 +0000 (14:58 +0200)]
ASoC: omap-abe-twl6040: Fix missing audio card caused by deferred probing

The machine driver fails to probe in next-20181113 with:

[    2.539093] omap-abe-twl6040 sound: ASoC: CODEC DAI twl6040-legacy not registered
[    2.546630] omap-abe-twl6040 sound: devm_snd_soc_register_card() failed: -517
...
[    3.693206] omap-abe-twl6040 sound: ASoC: Both platform name/of_node are set for TWL6040
[    3.701446] omap-abe-twl6040 sound: ASoC: failed to init link TWL6040
[    3.708007] omap-abe-twl6040 sound: devm_snd_soc_register_card() failed: -22
[    3.715148] omap-abe-twl6040: probe of sound failed with error -22

Bisect pointed to a merge commit:
first bad commit: [0f688ab20a540aafa984c5dbd68a71debebf4d7f] Merge remote-tracking branch 'net-next/master'

and a diff between a working kernel does not reveal anything which would
explain the change in behavior.

Further investigation showed that on the second try of loading fails
because the dai_link->platform is no longer NULL and it might be pointing
to uninitialized memory.

The fix is to move the snd_soc_dai_link and snd_soc_card inside of the
abe_twl6040 struct, which is dynamically allocated every time the driver
probes.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: amd: fix memory leak of i2s_data on error return
Colin Ian King [Wed, 14 Nov 2018 21:31:48 +0000 (21:31 +0000)]
ASoC: amd: fix memory leak of i2s_data on error return

Currently when snd_pcm_hw_constraint_integer fails there is
a memory leak of i2s_data on the error return path. Fix this by
kfree'ing i2s_data before returning.

Detected by CoverityScan, CID#1475479 ("Resource leak")

Fixes: 0b87d6bcd648 ("ASoC: amd: add acp3x pcm driver dma ops")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: pcm3060: Add DT property for single-ended output
Kirill Marinushkin [Mon, 12 Nov 2018 07:08:33 +0000 (08:08 +0100)]
ASoC: pcm3060: Add DT property for single-ended output

DAC output may be differential (default) or single-ended.

Signed-off-by: Kirill Marinushkin <kmarinushkin@birdec.tech>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: pcm3060: Rename output widgets
Kirill Marinushkin [Mon, 12 Nov 2018 07:08:34 +0000 (08:08 +0100)]
ASoC: pcm3060: Rename output widgets

In the initial commit [1], I added differential output of the codec as
separate `+` and `-` widgets:

OUTL+
OUTR+
OUTL-
OUTR-

Later, in the commit [2], I added a device tree property to configure the
output as single-ended or differential. Having this property, the `+` and
`-` separation in widgets seems for me confusing. There are no functional
benefits in such separation, so I find reasonable to get rid of it:

OUTL
OUTR

The new naming is more friendly for sound cards, and is better aligned with
other codec drivers in kernel.

Renaming the output widgets now should not be a problem from the backwards-
compatibility perspective, as the driver for PCM3060 is added into the
mainline very recently, and did not yet appear in any releases.

[1] commit 6ee47d4a8dac ("ASoC: pcm3060: Add codec driver")
[2] commit a78c62de00d5 ("ASoC: pcm3060: Add DT property for single-ended
    output")

Signed-off-by: Kirill Marinushkin <kmarinushkin@birdec.tech>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: stm32: sai: fix invalid use of sizeof in stm32_sai_add_mclk_provider()
Wei Yongjun [Sat, 27 Oct 2018 02:19:59 +0000 (02:19 +0000)]
ASoC: stm32: sai: fix invalid use of sizeof in stm32_sai_add_mclk_provider()

sizeof() when applied to a pointer typed expression gives the
size of the pointer, not that of the pointed data.

Fixes: 8307b2afd386 ("ASoC: stm32: sai: set sai as mclk clock provider")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: qcom: Set dai_link id to each dai_link
Rohit kumar [Thu, 8 Nov 2018 13:41:40 +0000 (19:11 +0530)]
ASoC: qcom: Set dai_link id to each dai_link

Frontend dai_link id is used for closing ADM sessions.
During concurrent usecase when one session is closed,
it closes other ADM session associated with other usecase
too. Dai_link->id should always point to Frontend dai id.
Set cpu_dai id as dai_link id to fix the issue.

Signed-off-by: Rohit kumar <rohitkr@codeaurora.org>
Acked-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: sun8i-codec: add missing route for ADC
Vasily Khoruzhick [Fri, 9 Nov 2018 04:24:19 +0000 (20:24 -0800)]
ASoC: sun8i-codec: add missing route for ADC

sun8i-codec misses a route from ADC to AIF1 Slot 0 ADC. Add it
to the driver to avoid adding it to every dts.

Fixes: eda85d1fee05d ("ASoC: sun8i-codec: Add ADC support for a33")
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: amd: enable acp3x drivers build
Vijendar Mukunda [Mon, 12 Nov 2018 05:35:02 +0000 (11:05 +0530)]
ASoC: amd: enable acp3x drivers build

ACP3x drivers can be built by selecting necessary kernel config option.
The patch enables build support of the same.

Signed-off-by: Maruthi Bayyavarapu <maruthi.bayyavarapu@amd.com>
Tested-by: Ravulapati Vishnu vardhan Rao <Vishnuvardhanrao.Ravulapati@amd.com>
Signed-off-by: Vijendar Mukunda <vijendar.mukunda@amd.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: amd: add acp3x system resume pm op
Vijendar Mukunda [Mon, 12 Nov 2018 05:35:01 +0000 (11:05 +0530)]
ASoC: amd: add acp3x system resume pm op

When system wide suspend happens, ACP will be powered off.
When system resumes, all the runtime configuration data for
ACP needs to be programmed again.
Added 'resume'pm call back to ACP pm ops.

Signed-off-by: Maruthi Bayyavarapu <maruthi.bayyavarapu@amd.com>
Tested-by: Ravulapati Vishnu vardhan Rao <Vishnuvardhanrao.Ravulapati@amd.com>
Signed-off-by: Vijendar Mukunda <vijendar.mukunda@amd.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: amd: add acp3x runtime pm ops
Vijendar Mukunda [Mon, 12 Nov 2018 05:35:00 +0000 (11:05 +0530)]
ASoC: amd: add acp3x runtime pm ops

Added runtime PM operations for ACP3x PCM platform device.

Signed-off-by: Maruthi Bayyavarapu <maruthi.bayyavarapu@amd.com>
Tested-by: Ravulapati Vishnu vardhan Rao <Vishnuvardhanrao.Ravulapati@amd.com>
Signed-off-by: Vijendar Mukunda <vijendar.mukunda@amd.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: amd: add acp3x tdm mode support
Vijendar Mukunda [Mon, 12 Nov 2018 05:34:59 +0000 (11:04 +0530)]
ASoC: amd: add acp3x tdm mode support

ACP3x I2S (CPU DAI) can act in normal I2S and TDM modes.
Added support for TDM mode.
Desired mode can be selected from ASoC machine driver.

Signed-off-by: Maruthi Bayyavarapu <maruthi.bayyavarapu@amd.com>
Tested-by: Ravulapati Vishnu vardhan Rao <Vishnuvardhanrao.Ravulapati@amd.com>
Signed-off-by: Vijendar Mukunda <vijendar.mukunda@amd.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: amd: add acp3x i2s ops
Vijendar Mukunda [Mon, 12 Nov 2018 05:34:58 +0000 (11:04 +0530)]
ASoC: amd: add acp3x i2s ops

ACP3x has a i2s controller block for playback and capture.
This patch adds ACP3x i2s DAI operations.

Signed-off-by: Maruthi Bayyavarapu <maruthi.bayyavarapu@amd.com>
Tested-by: Ravulapati Vishnu vardhan Rao <Vishnuvardhanrao.Ravulapati@amd.com>
Signed-off-by: Vijendar Mukunda <vijendar.mukunda@amd.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: amd: add acp3x pcm driver dma ops
Vijendar Mukunda [Mon, 12 Nov 2018 05:34:57 +0000 (11:04 +0530)]
ASoC: amd: add acp3x pcm driver dma ops

ACP3x has a DMA controller to access system memory.
This controller transfers data from/to system memory
to/from the ACP internal FIFO.
The patch adds PCM driver DMA operations.

Signed-off-by: Maruthi Bayyavarapu <maruthi.bayyavarapu@amd.com>
Tested-by: Ravulapati Vishnu vardhan Rao <Vishnuvardhanrao.Ravulapati@amd.com>
Signed-off-by: Vijendar Mukunda <vijendar.mukunda@amd.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: amd: Interrupt handler changes for ACP3x DMA driver
Vijendar Mukunda [Mon, 12 Nov 2018 05:34:56 +0000 (11:04 +0530)]
ASoC: amd: Interrupt handler changes for ACP3x DMA driver

Whenever audio data equal to the I2S FIFO watermark level are
produced/consumed, interrupt is generated.
Acknowledge the interrupt.

Signed-off-by: Maruthi Bayyavarapu <maruthi.bayyavarapu@amd.com>
Tested-by: Ravulapati Vishnu vardhan Rao <Vishnuvardhanrao.Ravulapati@amd.com>
Signed-off-by: Vijendar Mukunda <vijendar.mukunda@amd.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: amd: add ACP3x PCM platform driver
Vijendar Mukunda [Mon, 12 Nov 2018 05:34:55 +0000 (11:04 +0530)]
ASoC: amd: add ACP3x PCM platform driver

PCM platform driver binds to the platform device created by ACP3x PCI
device. PCM driver registers ALSA DMA and CPU DAI components with ASoC
framework.

Signed-off-by: Maruthi Bayyavarapu <maruthi.bayyavarapu@amd.com>
Tested-by: Ravulapati Vishnu vardhan Rao <Vishnuvardhanrao.Ravulapati@amd.com>
Signed-off-by: Vijendar Mukunda <vijendar.mukunda@amd.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: amd: create ACP3x PCM platform device
Vijendar Mukunda [Mon, 12 Nov 2018 05:34:54 +0000 (11:04 +0530)]
ASoC: amd: create ACP3x PCM platform device

ACP 3x IP has I2S controller device as one of IP blocks.
Create a platform device for it, so that the PCM platform driver
can be bound to this device. Pass PCI resources like MMIO, irq
to the platform device.

Signed-off-by: Maruthi Bayyavarapu <maruthi.bayyavarapu@amd.com>
Tested-by: Ravulapati Vishnu vardhan Rao <vishnuvardhanrao.ravulapati@amd.com>
Signed-off-by: Vijendar Mukunda <vijendar.mukunda@amd.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: AMD: add ACP3.0 PCI driver
Maruthi Srinivas Bayyavarapu [Mon, 12 Nov 2018 05:34:53 +0000 (11:04 +0530)]
ASoC: AMD: add ACP3.0 PCI driver

ACP 3.0 is a PCI audio device. This patch adds PCI driver to bind
to this device and get PCI resources.

Signed-off-by: Maruthi Bayyavarapu <maruthi.bayyavarapu@amd.com>
Signed-off-by: Sanju R Mehta <sanju.mehta@amd.com>
Tested-by: Ravulapati Vishnu vardhan Rao <Vishnuvardhanrao.Ravulapati@amd.com>
Signed-off-by: Vijendar Mukunda <vijendar.mukunda@amd.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: AMD: add ACP 3.x IP register header
Maruthi Srinivas Bayyavarapu [Mon, 12 Nov 2018 05:34:52 +0000 (11:04 +0530)]
ASoC: AMD: add ACP 3.x IP register header

ACP 3.x is a new audio block in raven. Added register header
of the same.

Signed-off-by: Maruthi Bayyavarapu <maruthi.bayyavarapu@amd.com>
Signed-off-by: Vijendar Mukunda <vijendar.mukunda@amd.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: Intel: Power down links before turning off display audio power
Pierre-Louis Bossart [Fri, 9 Nov 2018 19:39:23 +0000 (13:39 -0600)]
ASoC: Intel: Power down links before turning off display audio power

On certain platforms, Display HDMI HDA codec was not going to sleep state
after the use when links are powered down after turning off the display
power. As per the HW recommendation, links are powered down before turning
off the display power to ensure that the codec goes to sleep state.

This patch was updated from an earlier version submitted upstream [1]
which conflicted with the changes merged for HDaudio codec support
with the Intel DSP.

[1] https://patchwork.kernel.org/patch/10540213/

Signed-off-by: Sriram Periyasamy <sriramx.periyasamy@intel.com>
Signed-off-by: Sanyog Kale <sanyog.r.kale@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: Intel: hdac_hdmi: add Icelake support
Bard liao [Sat, 10 Nov 2018 21:18:46 +0000 (05:18 +0800)]
ASoC: Intel: hdac_hdmi: add Icelake support

Add Icelake device id. Also, Icelake's pin2port mapping table is
complicated. So we use a mapping table to do the pin2port mapping.

Signed-off-by: Bard liao <bard.liao@intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: wm_adsp: Factor out common init code
Richard Fitzgerald [Mon, 12 Nov 2018 13:36:39 +0000 (13:36 +0000)]
ASoC: wm_adsp: Factor out common init code

Factor out the duplicated initialization statements from
wm_adsp1_init() and wm_adsp2_init() into new function
wm_adsp_common_init().

The entire content of wm_adsp1_init() is the common code
but it is convenient to retain this exported function
to hide what we currently treat as common init (which might
change in the future) and also make clear the difference
between an ADSP1 entry point and common code.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: wm_adsp: Fix dma-unsafe read of scratch registers
Richard Fitzgerald [Mon, 12 Nov 2018 13:36:38 +0000 (13:36 +0000)]
ASoC: wm_adsp: Fix dma-unsafe read of scratch registers

Stack memory isn't DMA-safe so it isn't safe to use either
regmap_raw_read or regmap_bulk_read to read into stack memory.

The two functions to read the scratch registers were using
stack memory and regmap_raw_read. It's not worth allocating
memory just for this trivial read, and it isn't time-critical.
A simple regmap_read for each register is sufficient.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: rockchip: add missing slave_config setting for I2S
Katsuhiro Suzuki [Sat, 10 Nov 2018 15:18:44 +0000 (00:18 +0900)]
ASoC: rockchip: add missing slave_config setting for I2S

This patch adds missing prepare_sleve_config that is needed for
setup the DMA slave channel for I2S.

Signed-off-by: Katsuhiro Suzuki <katsuhiro@katsuster.net>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: omap-mcbsp: No need to initialize max_xx_thres when it is not used
Peter Ujfalusi [Thu, 8 Nov 2018 07:30:00 +0000 (09:30 +0200)]
ASoC: omap-mcbsp: No need to initialize max_xx_thres when it is not used

Initializing to -EINVAL is not correct as the variables are unsigned and
if buffer_size is 0 then they are not used anyway.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Tested-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: omap-mcbsp: Remove redundant check for mcbsp->pdata
Peter Ujfalusi [Thu, 8 Nov 2018 07:29:59 +0000 (09:29 +0200)]
ASoC: omap-mcbsp: Remove redundant check for mcbsp->pdata

The driver will not probe if the pdata is not provided or created.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Tested-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: omap-mcbsp: Re-arrange files for core McBSP and Sidetone function split
Peter Ujfalusi [Thu, 8 Nov 2018 07:29:58 +0000 (09:29 +0200)]
ASoC: omap-mcbsp: Re-arrange files for core McBSP and Sidetone function split

The mcbsp.c was copied a while back from arch/arm/plat-omap/mcbsp.c and it
contained a mix of McBSP and McBSP sidetone functions.

Create new file structure with the following split:
omap-mcbsp.c - McBSP related functions
omap-mcbsp-st.c - McBSP sidetone functionality
omap-mcbsp-priv.h - Private header for internal use
omap-mcbsp.h - Header for user drivers

I have tried to do the code move with minimal code change, cleanup patches
can be based on the new structure.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Tested-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: omap-mcbsp: Move out the FIFO check from set_threshold and get_delay
Peter Ujfalusi [Thu, 8 Nov 2018 07:29:57 +0000 (09:29 +0200)]
ASoC: omap-mcbsp: Move out the FIFO check from set_threshold and get_delay

Check if the McBSP have FIFO in the omap_mcbsp_set_threshold() and
omap_mcbsp_dai_delay() delay function to skip calling the lower layer if
it is not needed.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Tested-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: omap-mcbsp: Simplify the mcbsp_start/_stop function parameters
Peter Ujfalusi [Thu, 8 Nov 2018 07:29:56 +0000 (09:29 +0200)]
ASoC: omap-mcbsp: Simplify the mcbsp_start/_stop function parameters

We either start/stop TX or RX, never both. Move the tx/rx direction
selection within the functions.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Tested-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: omap-mcbsp: Clean up the interrupt handlers
Peter Ujfalusi [Thu, 8 Nov 2018 07:29:55 +0000 (09:29 +0200)]
ASoC: omap-mcbsp: Clean up the interrupt handlers

The parameter name of dev_id is leftover from the old times when we passed
numeric ID as data for the interrupt handlers.

The mcbsp_rx and mcbsp_tx is misleading as they are pointers to the mcbsp
struct.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Tested-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: omap-mcbsp: Skip dma_data.maxburst initialization
Peter Ujfalusi [Thu, 8 Nov 2018 07:29:54 +0000 (09:29 +0200)]
ASoC: omap-mcbsp: Skip dma_data.maxburst initialization

It is configured runtime so no need to initialize it.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Tested-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: omap-mcbsp: Clean up dma_data addr initialization code
Peter Ujfalusi [Thu, 8 Nov 2018 07:29:53 +0000 (09:29 +0200)]
ASoC: omap-mcbsp: Clean up dma_data addr initialization code

Make the omap_mcbsp_dma_reg_params() a bit more intuitive to read for the
first glance by using SNDRV_PCM_STREAM_PLAYBACK/CAPTURE and to group the
outermost if case by stream direction.

While there, fix the outdated comment for the function.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Tested-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: rsnd: use ring buffer for rsnd_mod_name()
Kuninori Morimoto [Fri, 9 Nov 2018 04:15:46 +0000 (04:15 +0000)]
ASoC: rsnd: use ring buffer for rsnd_mod_name()

commit c0ea089dbad4 ("ASoC: rsnd: rsnd_mod_name() handles both name and
ID") merged "name" and "ID" on rsnd_mod_name() to handle sub-ID
(= for CTU/BUSIF).
Then, it decided to share static char to avoid pointless memory.
But, it doesn't work correctry in below case, because last called
name will be used.

dev_xxx(dev, "%s is connected to %s\n",
rsnd_mod_name(mod_a),  /* ssiu[00] */
rsnd_mod_name(mod_b)); /* ssi[0]   */
->
rcar_sound ec500000.sound: ssi[0] is connected to ssi[0]
                           ~~~~~~                 ~~~~~~
We still don't want to have pointless memory, so let's use ring buffer.
16byte x 5 is very enough for this purpose.

dev_xxx(dev, "%s is connected to %s\n",
rsnd_mod_name(mod_a),  /* ssiu[00] */
rsnd_mod_name(mod_b)); /* ssi[0]   */
->
rcar_sound ec500000.sound: ssiu[00] is connected to ssi[0]
                           ~~~~~~~~                 ~~~~~~
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: sun8i-codec: fix crash on module removal
Vasily Khoruzhick [Fri, 9 Nov 2018 04:31:35 +0000 (20:31 -0800)]
ASoC: sun8i-codec: fix crash on module removal

drvdata is actually sun8i_codec, not snd_soc_card, so it crashes
when calling snd_soc_card_get_drvdata().

Drop card and scodec vars anyway since we don't need to
disable/unprepare clocks - it's already done by calling
runtime_suspend()

Drop clk_disable_unprepare() calls for the same reason.

Fixes: 36c684936fae7 ("ASoC: Add sun8i digital audio codec")
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: fsl_ssi: Change to use DEFINE_SHOW_ATTRIBUTE macro
Yangtao Li [Mon, 5 Nov 2018 14:37:30 +0000 (09:37 -0500)]
ASoC: fsl_ssi: Change to use DEFINE_SHOW_ATTRIBUTE macro

Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: rsnd: add TDM Split mode support
Kuninori Morimoto [Tue, 6 Nov 2018 05:21:46 +0000 (05:21 +0000)]
ASoC: rsnd: add TDM Split mode support

This patch adds TDM Split mode support. rsnd driver is assuming
audio-graph-scu-card is used for Sound Card.

This is very simple sample DT settings to use it.

sound_card: sound {
compatible = "audio-graph-scu-card";
...
convert-channels = <8>; /* TDM Split */

dais = <&rsnd_port0     /* playback ch1/ch2 */
&rsnd_port1     /* playback ch3/ch4 */
&rsnd_port2     /* playback ch5/ch6 */
&rsnd_port3     /* playback ch7/ch8 */
>;
};

audio-codec {
...
port {
codec_0: endpoint@1 {
remote-endpoint = <&rsnd_ep0>;
};
codec_1: endpoint@2 {
remote-endpoint = <&rsnd_ep1>;
};
codec_2: endpoint@3 {
remote-endpoint = <&rsnd_ep2>;
};
codec_3: endpoint@4 {
remote-endpoint = <&rsnd_ep3>;
};
};
};

&rcar_sound {
...
ports {
rsnd_port0: port@0 {
rsnd_ep0: endpoint {
remote-endpoint = <&codec_0>;
...
playback = <&ssiu30 &ssi3>;
};
};
rsnd_port1: port@1 {
rsnd_ep1: endpoint {
remote-endpoint = <&codec_1>;
...
playback = <&ssiu31 &ssi3>;
};
};
rsnd_port2: port@2 {
rsnd_ep2: endpoint {
remote-endpoint = <&codec_2>;
...
playback = <&ssiu32 &ssi3>;
};
};
rsnd_port3: port@3 {
rsnd_ep3: endpoint {
remote-endpoint = <&codec_3>;
...
playback = <&ssiu33 &ssi3>;
};
};
};
};

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: rsnd: add TDM Split mode support for Document
Kuninori Morimoto [Tue, 6 Nov 2018 05:21:22 +0000 (05:21 +0000)]
ASoC: rsnd: add TDM Split mode support for Document

This patch adds TDM Split mode support. rsnd driver is assuming
audio-graph-scu-card is used for Sound Card.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: rsnd: add SSIU BUSIF support
Kuninori Morimoto [Tue, 6 Nov 2018 05:21:08 +0000 (05:21 +0000)]
ASoC: rsnd: add SSIU BUSIF support

Gen2 has BUSIF0-3, Gen3 has BUSIF0-7 on some SSIU.
Current driver is assuming it is using BUSIF0 as default.
Thus, SSI is attaching SSIU (with BUSIF0) by using rsnd_ssiu_attach().
But, TDM split mode also needs other BUSIF to use it.
This patch adds missing SSIU BUSIFx support.

BUSIF is handled by SSIU instead of SSI anymore.
Thus, its settings no longer needed on SSI node on DT.
This patch removes its settings from Document, but driver is still
keeping compatibility. Thus, old DT style is still working.
But, to avoid confusing, it doesn't indicate old compatibility things on
Document. New SoC should have SSIU on DT from this patch.

1) old style DT is still supported (= no rcar_sound,ssiu node on DT)
2) If ssiu is not indicated on playback/capture,
   BUSIF0 will be used as default
playback = <&ssi3>; /* ssiu30 will be selected */
3) you can select own ssiu
playback = <&ssi32 &ssi3>; /* ssiu32 will be selected */

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: rsnd: add SSIU BUSIF support for Document
Kuninori Morimoto [Tue, 6 Nov 2018 05:20:56 +0000 (05:20 +0000)]
ASoC: rsnd: add SSIU BUSIF support for Document

Gen2 has BUSIF0-3, Gen3 has BUSIF0-7 on some SSIU.
Current driver is assuming it is using BUSIF0 as default.
Thus, SSI is attaching SSIU (with BUSIF0) by using rsnd_ssiu_attach().
But, TDM split mode also needs other BUSIF to use it.
This patch adds missing SSIU BUSIFx support.

BUSIF is handled by SSIU instead of SSI anymore.
Thus, its settings no longer needed on SSI node on DT.
This patch removes its settings from Document, but driver is still
keeping compatibility. Thus, old DT style is still working.
But, to avoid confusing, it doesn't indicate old compatibility things on
Document. New SoC should have SSIU on DT from this patch.

1) old style DT is still supported (= no rcar_sound,ssiu node on DT)
2) If ssiu is not indicated on playback/capture,
   BUSIF0 will be used as default
playback = <&ssi3>; /* ssiu30 will be selected */
3) you can select own ssiu
playback = <&ssi32 &ssi3>; /* ssiu32 will be selected */

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: rsnd: tidyup Document for DT binding
Kuninori Morimoto [Tue, 6 Nov 2018 05:20:25 +0000 (05:20 +0000)]
ASoC: rsnd: tidyup Document for DT binding

It has duplicated DT example code on Document.
This patch tidyup these.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: rsnd: handle DPCM converted rate/chan under core
Kuninori Morimoto [Tue, 6 Nov 2018 05:20:10 +0000 (05:20 +0000)]
ASoC: rsnd: handle DPCM converted rate/chan under core

converted rate/chan are handled each rated module, but
it will be used other module too.
For examle, converted channel is currently used for CTU,
but, it will be used for TDM Split mode, too.

This patch move/merge SRC/CTU hw_param under core.c
and handles converted rate/chan under rsnd_dai_stream.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: rsnd: move HDMI information from ssi.c to core.c
Kuninori Morimoto [Tue, 6 Nov 2018 05:19:48 +0000 (05:19 +0000)]
ASoC: rsnd: move HDMI information from ssi.c to core.c

Current driver is supporting HDMI output, and its information
are handled under ssi.c. But, it is stream information.
Let's move it from ssi.c to core.c.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: rsnd: use defined io_playback/io_capture
Kuninori Morimoto [Tue, 6 Nov 2018 05:19:33 +0000 (05:19 +0000)]
ASoC: rsnd: use defined io_playback/io_capture

rdai->playback/rdai->capture are defined as io_playback/io_capture
on __rsnd_dai_probe(). Let's use it instead of original one.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: rsnd: rename rsnd_runtime_is_ssi_xxx()
Kuninori Morimoto [Tue, 6 Nov 2018 05:19:19 +0000 (05:19 +0000)]
ASoC: rsnd: rename rsnd_runtime_is_ssi_xxx()

Current rsnd driver has rsnd_runtime_is_ssi_xxx() functions,
but it is not only related to SSI, thus, it is misunderstandable.
This patch renames it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: rsnd: remove endpoint bidirectional check
Kuninori Morimoto [Tue, 6 Nov 2018 05:18:58 +0000 (05:18 +0000)]
ASoC: rsnd: remove endpoint bidirectional check

DTC commit df536831d02c ("checks: add graph binding checks")
is checking endpoint bidirectional, and it is upstreamed to linux by
commit 50aafd60898a ("scripts/dtc: Update to upstream version
v1.4.6-21-g84e414b0b5bc").
Let's remove own bidirectional check

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: audio-graph-scu-card: remove error check which never happen
Kuninori Morimoto [Tue, 6 Nov 2018 04:36:55 +0000 (04:36 +0000)]
ASoC: audio-graph-scu-card: remove error check which never happen

Current driver is checking situation that can not happen.
This patch removes over-kill check

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: audio-graph-scu-card: remove endpoint bidirectional check
Kuninori Morimoto [Tue, 6 Nov 2018 04:36:41 +0000 (04:36 +0000)]
ASoC: audio-graph-scu-card: remove endpoint bidirectional check

DTC commit df536831d02c ("checks: add graph binding checks")
is checking endpoint bidirectional, and it is upstreamed to linux by
commit 50aafd60898a ("scripts/dtc: Update to upstream version
v1.4.6-21-g84e414b0b5bc").
Let's remove own bidirectional check

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: audio-graph-card: remove endpoint bidirectional check
Kuninori Morimoto [Tue, 6 Nov 2018 04:36:27 +0000 (04:36 +0000)]
ASoC: audio-graph-card: remove endpoint bidirectional check

DTC commit df536831d02c ("checks: add graph binding checks")
is checking endpoint bidirectional, and it is upstreamed to linux by
commit 50aafd60898a ("scripts/dtc: Update to upstream version
v1.4.6-21-g84e414b0b5bc").
Let's remove own bidirectional check

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: Intel: common: add quirk for APL RVP boards
Pierre-Louis Bossart [Thu, 1 Nov 2018 21:34:54 +0000 (16:34 -0500)]
ASoC: Intel: common: add quirk for APL RVP boards

For some reason the RVP/LeafHill SSDT exposes an INT34C3 ID which is
used on other boards to point to the TDF8532 amplifier. Yay BIOS.

Add a DMI-quirk to ignore this ID and check for other valid machine
driver descriptors.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: Intel: common: add SOF information for APL RVP
Bard liao [Thu, 1 Nov 2018 21:34:53 +0000 (16:34 -0500)]
ASoC: Intel: common: add SOF information for APL RVP

Add firmware/topology information for APL RVP

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Bard liao <bard.liao@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: Intel: remove GFP_ATOMIC, use GFP_KERNEL
Pierre-Louis Bossart [Thu, 1 Nov 2018 21:34:52 +0000 (16:34 -0500)]
ASoC: Intel: remove GFP_ATOMIC, use GFP_KERNEL

GFP_ATOMIC is not required on any Intel drivers, use GFP_KERNEL
instead. A first cleanup was merged in April but missed a number
occurrences and new ones were added by copy/paste inertia.

While we are at it, make checkpatch happy with a sizeof(*msg)

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: Intel: boards: fix Skylake typo
Pierre-Louis Bossart [Thu, 1 Nov 2018 21:34:51 +0000 (16:34 -0500)]
ASoC: Intel: boards: fix Skylake typo

s/skylaye/skylake

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: Intel: use standard interface for Atom machine drivers
Pierre-Louis Bossart [Thu, 1 Nov 2018 21:34:50 +0000 (16:34 -0500)]
ASoC: Intel: use standard interface for Atom machine drivers

Don't rely on internal Atom/SST-specific data structures, use
generic interface to let other drivers use the same machine drivers
as is, e.g. SOF to support BYT-CR devices

Tested-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: Intel: use standard interface for Hdaudio machine driver
Pierre-Louis Bossart [Thu, 1 Nov 2018 21:34:49 +0000 (16:34 -0500)]
ASoC: Intel: use standard interface for Hdaudio machine driver

Don't rely on internal Skylake-specific data structures, use
generic interface to let other drivers use the same machine driver
as is, e.g. SOF to support HDaudio codecs and HDMI outputs.

Tested on LeafHill CRB board, no regression seen with this change.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: acpi: define common interface for machine driver configuration
Pierre-Louis Bossart [Thu, 1 Nov 2018 21:34:48 +0000 (16:34 -0500)]
ASoC: acpi: define common interface for machine driver configuration

The machine drivers may need information provided by the platform
driver.  Currently the information is passed using pdata specific to
each plaform driver. This prevents other drivers, such as SOF, from
reusing machine drivers directly.

Add a new structure which contains the required fields.

This proposal requires a bit more work on the platform side but this
generic interface helps reuse code directly.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: pxa: change ac97 dependencies
Arnd Bergmann [Fri, 2 Nov 2018 11:20:39 +0000 (12:20 +0100)]
ASoC: pxa: change ac97 dependencies

Enabling both the old AC97_BUS code and the new AC97_BUS_COMPAT causes
problems because both modules provide an exported snd_ac97_reset()
function.

I had tried to fix the problem of having both coexist earlier, but
my patch only prevented them from being built-in. This is because
of a special Kconfig feature that lets a symbol have a dependency
on another one being disabled, but still allow both to be loadable
modules.

Changing the dependency to =n avoids that problem, now we can only
build the new driver if the old one is completely disabled.

If we could figure out a way to let rename one of the reset
functions and have each driver link to exactly the old or
the compat code, that would also work, but I could not find if
that's possible.

Fixes: bec5ecdf41d4 ("ASoC: pxa: avoid AC97_BUS build warning")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: omap: Remove unused machine driver for AM3517-evm
Peter Ujfalusi [Mon, 5 Nov 2018 13:10:11 +0000 (15:10 +0200)]
ASoC: omap: Remove unused machine driver for AM3517-evm

The audio support is done via simple-audio-card via DT, the custom driver
is no longer needed.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: pcm3168a: remove read-only status register from snd_kcontrol_new
Kuninori Morimoto [Tue, 6 Nov 2018 04:33:02 +0000 (04:33 +0000)]
ASoC: pcm3168a: remove read-only status register from snd_kcontrol_new

"DACn Zero Flag" and "ADCn Overflow Flag" are read-only status
register. These information are needed for driver not for user.
Let's remove these from snd_kcontrol_new.

There is no detail explanation for these register on
datasheet, but, judging from its behavior, it seems these register
needs clock to read. Otherwise, I2C returns error.
Therefor, amixer command will be failed under non working timing.

Without this patch, user often fail amixer command.
This patch is tested on R-Car H3 ulcb-kf board, SSI3/4 TDM sound.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: ak5558: Remove redundant snd_soc_component_read32 calls
Axel Lin [Tue, 6 Nov 2018 09:39:19 +0000 (17:39 +0800)]
ASoC: ak5558: Remove redundant snd_soc_component_read32 calls

snd_soc_component_update_bits() will only update the mask bits,
so remove the redundant snd_soc_component_read32().

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: qdsp6: q6afe-dai: Fix the dai widgets
Srinivas Kandagatla [Tue, 6 Nov 2018 11:38:57 +0000 (11:38 +0000)]
ASoC: qdsp6: q6afe-dai: Fix the dai widgets

For some reason the dapm widgets are incorrectly defined from the start,
Not sure how we ended up with such thing. Fix them now!

Without this fix the backend dais are always powered up even if there
is no active stream.

Reported-by: Jimmy Cheng-Yi Chiang <cychiang@google.com>
Reported-by: Rohit kumar <rohitkr@codeaurora.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: qdsp6: q6asm-dai: Only add routing once.
Srinivas Kandagatla [Tue, 6 Nov 2018 11:38:56 +0000 (11:38 +0000)]
ASoC: qdsp6: q6asm-dai: Only add routing once.

q6asm routing gets added multiple times as part of dai probe.
Move this to q6routing routes which has those widgets defined, this also
fixes the issue where these are added each time at dai probe.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: qdsp6: q6afe: Fix wrong MI2S SD line mask
Rohit kumar [Thu, 1 Nov 2018 11:51:07 +0000 (17:21 +0530)]
ASoC: qdsp6: q6afe: Fix wrong MI2S SD line mask

SD line mask for MI2S starts from BIT 0 instead of BIT 1.
Fix all bit mask for MI2S SD lines.

Signed-off-by: Rohit kumar <rohitkr@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: intel: cht_bsw_max98090_ti: Add quirk for boards using pmc_plt_clk_0
Hans de Goede [Wed, 31 Oct 2018 14:22:25 +0000 (15:22 +0100)]
ASoC: intel: cht_bsw_max98090_ti: Add quirk for boards using pmc_plt_clk_0

Some boards such as the Swanky model Chromebooks use pmc_plt_clk_0 for the
mclk instead of pmc_plt_clk_3.

This commit adds a DMI based quirk for this.

This fixing audio no longer working on these devices after
commit 648e921888ad ("clk: x86: Stop marking clocks as CLK_IS_CRITICAL")
that commit fixes us unnecessary keeping unused clocks on, but in case
of the Swanky that was breaking audio support since we were not using
the right clock in the cht_bsw_max98090_ti machine driver.

Cc: stable@vger.kernel.org
Fixes: 648e921888ad ("clk: x86: Stop marking clocks as CLK_IS_CRITICAL")
Reported-and-tested-by: Dean Wallace <duffydack73@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: rsnd: rsnd_mod_name() handles both name and ID
Kuninori Morimoto [Tue, 30 Oct 2018 07:47:50 +0000 (07:47 +0000)]
ASoC: rsnd: rsnd_mod_name() handles both name and ID

Current rsnd driver is using "%s[%d]" for mod name and ID,
but, this ID portion might confusable.
For example currently, CTU ID is 0 to 7, but using 00 to 13
(= 00, 01, 02, 03, 10, 11, 12, 13) is very best matching to datasheet.

In the future, we will support BUSIFn, but it will be more complicated
numbering. To avoid future confusable code, this patch modify
rsnd_mod_name() to return understandable name.

To avoid using pointless memory, it uses static char and snprintf,
thus, rsnd_mod_name() user should use it immediately, and shouldn't keep
its pointer.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: rsnd: add .get_id/.get_id_sub
Kuninori Morimoto [Tue, 30 Oct 2018 07:47:18 +0000 (07:47 +0000)]
ASoC: rsnd: add .get_id/.get_id_sub

ID for CTU and SSIU are confusable.
1 CTU has 4 sub nodes. This means, CTU0 has CTU01 - CTU03, CTU1 has
CTU10 - CTU13. SSIU is more confusable. Gen2 SSIU has BUSIF0-3, Gen3
SSIU has BUSIF0-7, but not for all SSIU.
In rsnd driver, each mod drivers are assuming rsnd_mod_id() returns
main device ID (In CTU case CTU0-1, SSIU case SSIU0-9), not serial
number.
This patch adds new .id/.id_sub to handling more detail ID.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: rsnd: move .get_status under rsnd_mod_ops
Kuninori Morimoto [Tue, 30 Oct 2018 07:46:05 +0000 (07:46 +0000)]
ASoC: rsnd: move .get_status under rsnd_mod_ops

Each mod needs to have .get_status, but current driver is handling it
under rsnd_mod, instead of rsnd_mod_ops.
It is not any make sence. This patch moves it to rsnd_mod_ops, and
tidyup its parameter order to align to other callback functions.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: pcm3168a: cleanup hw_constraint for LEFT_J/I2S
Kuninori Morimoto [Tue, 30 Oct 2018 07:31:40 +0000 (07:31 +0000)]
ASoC: pcm3168a: cleanup hw_constraint for LEFT_J/I2S

hw constraint for LEFT_J/I2S are same, but had duplicated code.
This code cleanup these.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: omap-mcbsp: On OMAP1 and OMAP2420 only 16bit format is supported
Peter Ujfalusi [Thu, 25 Oct 2018 13:48:24 +0000 (16:48 +0300)]
ASoC: omap-mcbsp: On OMAP1 and OMAP2420 only 16bit format is supported

For samples sizes of 20/24/32 bit the DRR2/DXR2 registers must be used to
receive or transmit the most significant part of the 32bit sample.
We can not trick the system by using the DRR2/DXR2 register offset and use
32bit element size since these (and other McBSP) registers are 16bit ones.

We would need support for port_window in cyclic mode from the sDMA driver,
but it is not straight forward as we would need to have the sDMA frame to
cover the 32bit (DRR2+DRR1/DXR2+DXR1), but the frames must cover the ALSA
period to be able to receive periodic interrupts.

Since the 32bit samples are not working (DMA timeout), just remove it in
case we have McBSP with reg_size of 2.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: AMD: constify regulator_desc structure
Julia Lawall [Sun, 28 Oct 2018 05:56:08 +0000 (06:56 +0100)]
ASoC: AMD: constify regulator_desc structure

The regulator_desc structure can be const as it is only passed as the
second argument of devm_regulator_register and the corresponding
parameter is declared as const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: codecs: constify snd_soc_dai_ops structures
Julia Lawall [Sat, 27 Oct 2018 13:34:44 +0000 (15:34 +0200)]
ASoC: codecs: constify snd_soc_dai_ops structures

The snd_soc_dai_ops structures are only stored in the ops field of a
snd_soc_dai_driver structure, so make the snd_soc_dai_ops structures
const as well.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: qdsp6: q6afe-dai: constify snd_soc_dai_ops structures
Julia Lawall [Sat, 27 Oct 2018 13:34:43 +0000 (15:34 +0200)]
ASoC: qdsp6: q6afe-dai: constify snd_soc_dai_ops structures

The snd_soc_dai_ops structures are only stored in the ops field of a
snd_soc_dai_driver structure, so make the snd_soc_dai_ops structures
const as well.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: nau8825: remove unnecessary unlikely()
Yangtao Li [Sun, 4 Nov 2018 12:55:29 +0000 (07:55 -0500)]
ASoC: nau8825: remove unnecessary unlikely()

WARN_ON() already contains an unlikely(), so it's not necessary to use
unlikely.

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: Intel: mrfld: fix uninitialized variable access
Arnd Bergmann [Sat, 3 Nov 2018 21:21:22 +0000 (22:21 +0100)]
ASoC: Intel: mrfld: fix uninitialized variable access

Randconfig testing revealed a very old bug, with gcc-8:

sound/soc/intel/atom/sst/sst_loader.c: In function 'sst_load_fw':
sound/soc/intel/atom/sst/sst_loader.c:357:5: error: 'fw' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  if (fw == NULL) {
     ^
sound/soc/intel/atom/sst/sst_loader.c:354:25: note: 'fw' was declared here
  const struct firmware *fw;

We must check the return code of request_firmware() before we look at the
pointer result that may be uninitialized when the function fails.

Fixes: 9012c9544eea ("ASoC: Intel: mrfld - Add DSP load and management")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: wm97xx: fix uninitialized regmap pointer problem
Arnd Bergmann [Fri, 2 Nov 2018 15:18:21 +0000 (16:18 +0100)]
ASoC: wm97xx: fix uninitialized regmap pointer problem

gcc notices that without either the ac97 bus or the pdata, we never
initialize the regmap pointer, which leads to an uninitialized variable
access:

sound/soc/codecs/wm9712.c: In function 'wm9712_soc_probe':
sound/soc/codecs/wm9712.c:666:2: error: 'regmap' may be used uninitialized in this function [-Werror=maybe-uninitialized]

Since that configuration is invalid, it's better to return an error
here. I tried to avoid adding complexity to the conditions, and turned
the #ifdef into a regular if(IS_ENABLED()) check for readability.
This in turn requires moving some header file declarations out of
an #ifdef.

The same code is used in three drivers, all of which I'm changing
the same way.

Fixes: 2ed1a8e0ce8d ("ASoC: wm9712: add ac97 new bus support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: smd845: constify snd_soc_ops structure
Julia Lawall [Fri, 2 Nov 2018 15:00:18 +0000 (16:00 +0100)]
ASoC: smd845: constify snd_soc_ops structure

The snd_soc_ops structure can be const as it is only stored in the
ops field of a snd_soc_dai_link structure and this field is const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: stm32: sai: fix less than zero comparison on unsigned int
Colin Ian King [Wed, 31 Oct 2018 19:31:43 +0000 (19:31 +0000)]
ASoC: stm32: sai: fix less than zero comparison on unsigned int

Currently, the comparison of div < 0 is always false because div is
an unsigned int. Fix this by making div an int.

Detected by CoverityScan, CID#1475309 ("Unsigned compared against 0")

Fixes: 8307b2afd386 "(ASoC: stm32: sai: set sai as mclk clock provider")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: sunxi: rename SND_SUNXI_ADDA_PR_REGMAP to SND_SUN8I_ADDA_PR_REGMAP
Vasily Khoruzhick [Sat, 3 Nov 2018 04:26:51 +0000 (21:26 -0700)]
ASoC: sunxi: rename SND_SUNXI_ADDA_PR_REGMAP to SND_SUN8I_ADDA_PR_REGMAP

SND_SUN50I_CODEC_ANALOG selects SND_SUNXI_ADDA_PR_REGMAP which is leftover
of renaming SND_SUNXI_ADDA_PR_REGMAP to SND_SUN8I_ADDA_PR_REGMAP. Replace
it with SND_SUN8I_ADDA_PR_REGMAP to fix possible link errors for some
configurations:

sound/soc/sunxi/sun50i-codec-analog.o: In function `sun50i_codec_analog_probe':
sun50i-codec-analog.c:(.text+0x62): undefined reference to `sun8i_adda_pr_regmap_init'

Fixes: 42371f327df0 ("ASoC: sunxi: Add new driver for Allwinner A64 codec's analog path controls")
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoLinux 4.20-rc1
Linus Torvalds [Sun, 4 Nov 2018 23:37:52 +0000 (15:37 -0800)]
Linux 4.20-rc1

5 years agoMerge tag 'tags/upstream-4.20-rc1' of git://git.infradead.org/linux-ubifs
Linus Torvalds [Sun, 4 Nov 2018 22:46:04 +0000 (14:46 -0800)]
Merge tag 'tags/upstream-4.20-rc1' of git://git.infradead.org/linux-ubifs

Pull UBIFS updates from Richard Weinberger:

 - Full filesystem authentication feature, UBIFS is now able to have the
   whole filesystem structure authenticated plus user data encrypted and
   authenticated.

 - Minor cleanups

* tag 'tags/upstream-4.20-rc1' of git://git.infradead.org/linux-ubifs: (26 commits)
  ubifs: Remove unneeded semicolon
  Documentation: ubifs: Add authentication whitepaper
  ubifs: Enable authentication support
  ubifs: Do not update inode size in-place in authenticated mode
  ubifs: Add hashes and HMACs to default filesystem
  ubifs: authentication: Authenticate super block node
  ubifs: Create hash for default LPT
  ubfis: authentication: Authenticate master node
  ubifs: authentication: Authenticate LPT
  ubifs: Authenticate replayed journal
  ubifs: Add auth nodes to garbage collector journal head
  ubifs: Add authentication nodes to journal
  ubifs: authentication: Add hashes to index nodes
  ubifs: Add hashes to the tree node cache
  ubifs: Create functions to embed a HMAC in a node
  ubifs: Add helper functions for authentication support
  ubifs: Add separate functions to init/crc a node
  ubifs: Format changes for authentication support
  ubifs: Store read superblock node
  ubifs: Drop write_node
  ...

5 years agoMerge tag 'nfs-for-4.20-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs
Linus Torvalds [Sun, 4 Nov 2018 16:20:09 +0000 (08:20 -0800)]
Merge tag 'nfs-for-4.20-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs

Pull NFS client bugfixes from Trond Myklebust:
 "Highlights include:

  Bugfix:
   - Fix build issues on architectures that don't provide 64-bit cmpxchg

  Cleanups:
   - Fix a spelling mistake"

* tag 'nfs-for-4.20-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs:
  NFS: fix spelling mistake, EACCESS -> EACCES
  SUNRPC: Use atomic(64)_t for seq_send(64)

5 years agoMerge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 4 Nov 2018 16:15:15 +0000 (08:15 -0800)]
Merge branch 'timers-urgent-for-linus' of git://git./linux/kernel/git/tip/tip

Pull more timer updates from Thomas Gleixner:
 "A set of commits for the new C-SKY architecture timers"

* 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  dt-bindings: timer: gx6605s SOC timer
  clocksource/drivers/c-sky: Add gx6605s SOC system timer
  dt-bindings: timer: C-SKY Multi-processor timer
  clocksource/drivers/c-sky: Add C-SKY SMP timer