Commit Graph

12067 Commits

Author SHA1 Message Date
Bard Liao 7ba6e4ef76 ASoC: rt298: correct index default value
Some of the default value on rt298_index_def are incorrect. Change
them to the correct value.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-16 15:21:13 +01:00
Kuninori Morimoto 4362495734 ASoC: rsnd: Announce for removing Gen1 SRU support
Gen1 SRU support was created for preparation of Gen2 SRC support,
but no-one is using this feature (sampling rate convert) on Gen1.
BockW had used SRU before, but it was pass through mode.
This means it is same as SSI. And BockW "platform base" code was
removed from upstream code. It is now supported via DT, but it doesn't
use SRU. More detail, r8a7778.dtsi has "rcar_sound,src" entry, but
no-one is using this feature today. SRU probing has no relation to this
removing. This means there is no effect for DT compatibility, no issues
on upstream kernel.

Gen2 SRC was created from Gen1 SRU, these are similar but not same IP.
Keeping Gen1 SRU in current driver is a little bit difficult,
and no-one is using it today. Gen1 sound is still supported via SSI.
Gen1 SRU support will be removed in the next kernel version.
This patch announces it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-14 10:11:10 +01:00
Takashi Iwai 3c69ea4440 Merge branch 'for-linus' into for-next 2015-10-13 11:37:06 +02:00
Bard Liao a5fe58fd28 ASoC: rt298: set register non-volatile by default
It is not necessary to set registers volatile. So, return false
for default case of rt298_volatile_register.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-12 18:02:03 +01:00
Masanari Iida 4272975a34 ASoC: sh: Fit typo in Kconfig
s/SUR/SRU/g

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-12 16:58:31 +01:00
Jeeja KP 01bb84b500 ASoC: Intel: Skylake: power down all link in suspend
This ensures that the link is not requesting any clock and the
PLL can turn off. The link is powered when controller is brought
out of reset.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-09 11:19:01 +01:00
Jeeja KP 84c9e2836a ASoC: Intel: Skylake: Correct the runtime handler behaviour
On runtime pm resume, we need to download the firmware, also on
suspend we need to ensure all the interrupts from controller and
DSP are disabled.

Also since we download the firmware on resume, we don't need to do
so on init, so remove that bit

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-09 11:19:00 +01:00
Jeeja KP def656fe22 ASoC: Intel: Skylake: Verify the status bit before handling interrupt
Like we have in legacy mode HDA driver, we need to check the
status bit and handle interrupt only when it is not zero or all
bits set.  We typically see the status as all 1's when controller
resumes from suspend, So add the check here as well and don't
handle for these cases.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-09 11:18:59 +01:00
Jeeja KP 6ea8ba33e6 ASoC: Intel: Skylake: Check CPA bit in DSP core power down
Skylake driver will set the SPA bit to 0 to turn off the DSP core.
Driver will poll the Current Power Active (CPA) bit to match the
Set Power Active (SPA) bit value. When CPA bit matches the value
of SPA bit, the achieved power state has reached.

In case of DSP power down, register that was polled is SPA
instead of CPA. This patch corrects the register to be polled
in case of DSP power down.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-09 11:18:58 +01:00
Sudip Mukherjee dc542fb417 ASoC: rt5645: fix build warning
We were getting build warning about "Section mismatch".
dmi_platform_intel_broadwell is being referenced from the probe function
rt5645_i2c_probe(), but dmi_platform_intel_broadwell was marked with
__initdata.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Reviewed-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-08 16:15:00 +01:00
Sjoerd Simons f874b80e15 ASoC: rockchip: Add rockchip SPDIF transceiver driver
Add a driver for the SPDIF transceiver available on RK3066, RK3188 and
RK3288. Heavily based on the rockchip i2s driver.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-08 16:12:01 +01:00
Fang, Yang A b3681308cc ASoC: nau8825: add acpi match ID
This patch adds the acpi match ID for nau8825 codec

Signed-off-by: Fang, Yang A <yang.a.fang@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-08 14:38:42 +01:00
Vinod Koul 3373f71683 ASoC: Intel: Skylake: Modify the log level
dev_info is too noisy for tplg wiget loading, so move it to
debug level

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-08 09:46:22 +01:00
Mark Brown e4fc141d2a Merge remote-tracking branches 'asoc/fix/tlv320aic3x' and 'asoc/fix/wm8962' into asoc-linus 2015-10-07 16:07:50 +01:00
Mark Brown 1e2fa4cfdb Merge remote-tracking branches 'asoc/fix/db1200', 'asoc/fix/dwc', 'asoc/fix/imx-ssi', 'asoc/fix/maintainers', 'asoc/fix/rt5645', 'asoc/fix/sgtl5000' and 'asoc/fix/tas2552' into asoc-linus 2015-10-07 16:07:16 +01:00
Jeeja KP 87b2bdf022 ASoC: Intel: Skylake: Initialize NHLT table
Load and Initialize Non HDA Link Table in Skylake driver
to get platform configuration.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-07 16:04:17 +01:00
Jeeja KP 2a29b200c6 ASoC: Intel: Skylake: Add DSP support and enable it
If processing pipe capability is supported, add DSP support.
Adds initialization/free/suspend/resume DSP functionality.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-07 16:04:16 +01:00
Jeeja KP b663a8c5c9 ASoC: Intel: Skylake: Initialize and load DSP controls
Initialize and creates DSP controls if processing pipe capability
is supported by HW. Updates the dma_id, hw_params to module param
to be used when DSP module has to be configured.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-07 16:04:15 +01:00
Vinod Koul 3af36706ff ASoC: Intel: Skylake: Add topology core init and handlers
The SKL driver does not code DSP topology in driver. It uses the
newly added ASoC topology core to parse the topology information
(controls, widgets and map) from topology binary.
Each topology element passed private data which contains
information that driver used to identify the module instance
within firmware and send IPCs for that module to DSP firmware
along with parameters.
This patch adds init routine to invoke topology load and callback
for topology creation.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-07 16:04:14 +01:00
Vinod Koul cfb0a87383 ASoC: Intel: Skylake: Add FE and BE hw_params handling
For FE and BE, the PCM parameters come from FE and BE hw_params
values passed. For a FE we convert the FE params to DSP expected
module format and pass to DSP. For a BE we need to find the
gateway settings (i2s/PDM) to be applied. These are queried from
NHLT table and applied.

Further for BE based on direction the settings are applied as
either source or destination parameters.

These helpers here allow the format to be calculated and queried
as per firmware format.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-07 15:30:16 +01:00
Vinod Koul d93f8e550f ASoC: Intel: Skylake: add DSP platform widget event handlers
The Skylake driver topology model tries to model the firmware
rule for pipeline and module creation.
The creation rule is:
 - Create Pipe
 - Add modules to Pipe
 - Connect the modules (bind)
 - Start the pipes

Similarly destroy rule is:
 - Stop the pipe
 - Disconnect it (unbind)
 - Delete the pipe

In driver we use Mixer, as there will always be ONE mixer in a
pipeline to model a pipe. The modules in pipe are modelled as PGA
widgets.  The DAPM sequencing rules (mixer and then PGA) are used
to create the sequence DSP expects as depicted above, and then
widget handlers for PMU and PMD events help in that.

This patch adds widget event handlers for PRE/POST PMU and
PRE/POST PMD event for mixer and pga modules.  These event
handlers invoke pipeline creation, destroy, module creation,
module bind, unbind and pipeline bind unbind

Event handler sequencing is implement to target the DSP FW
sequence expectations to enable path from source to sink pipe for
Playback/Capture.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Hardik T Shah <hardik.t.shah@intel.com>
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-07 15:30:15 +01:00
Jeeja KP f7590d4f15 ASoC: Intel: Skylake: Add module configuration helpers
To configure a module, driver needs to send input and output PCM
params for a module in DSP. The FE PCM params come from hw_params
ie from user, for a BE they also come from hw_params but from
BE-link fixups.
So based on PCM params required driver has to find a converter
module (src/updown/format) and then do the conversion and
calculate PCM params in these pipelines In this patch we add the
helper modules which allow driver to do these calculations.

Signed-off-by: Hardik T Shah <hardik.t.shah@intel.com>
Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-07 15:30:15 +01:00
Jeeja KP e4e2d2f452 ASoC: Intel: Skylake: Add pipe and modules handlers
SKL driver needs to instantiate pipelines and modules in the DSP.
The topology in the DSP is modelled as DAPM graph with a PGA
representing a module instance and mixer representing a pipeline
for a group of modules along with the mixer itself.

Here we start adding building block for handling these. We add
resource checks (memory/compute) for pipelines, find the modules
in a pipeline, init modules in a pipe and lastly bind/unbind
modules in a pipe These will be used by pipe event handlers in
subsequent patches

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-07 15:30:15 +01:00
Adam Thomson 6e7c444318 ASoC: da7213: Add support to handle mclk data provided to driver
Driver now can make use of mclk data, if provided, to set, enable
and disable the clock source. As part of this, the choice to
enable clock squaring is dealt with as part of dai_sysclk() call
rather than as platform data.

Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-07 15:11:34 +01:00
Adam Thomson e90996a3ea ASoC: da7213: Add DT support to codec driver
This patch adds support for DT bindings in the codec driver.
As part of this support, the mclk data can now be provided and
used to control the mclk during codec operation.

Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-07 15:11:34 +01:00
Geert Uytterhoeven dcc448e619 ASoC: rsnd: Remove obsolete platform data support
Since commit 3d7608e4c1 ("ARM: shmobile: bockw: remove legacy
board file and config"), Renesas R-Car SoCs are only supported in
generic DT-only ARM multi-platform builds.  The driver doesn't need to
use platform data anymore, hence remove platform data configuration.

Move <sound/rcar_snd.h> to sound/soc/sh/rcar/, as it's no longer needed
by platform code.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-07 12:19:51 +01:00
Adam Thomson ba856fbd60 ASoC: da7219: Improve error checking of mclk enable/disable
Should only try to enable/disable the provided mclk, during bias
level changes, if it's not NULL. Also return value of
clk_prepare_enable() should be checked and dealt with accordingly.

Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-07 12:15:22 +01:00
Adam Thomson b7ebd78d1d ASoC: da7219: Use of_match_ptr() when assigning match table
Use of_match_ptr() to handle non-DT kernel scenario where match
table should be NULL.

Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-07 12:15:22 +01:00
Maxime Ripard c570b82c5e ASoC: sun4i-codec: Remove the routing property
Most of the boards have their headphone jack directly connected to the
matching pins of the SoCs. Since most of the time we will have the same
routing path, it makes no sense to put that in the DTS, since it will only
be some useless duplication there.

It also fixes the following warning messages that were seen so far, on
boards where we were using the bindings in the documentation example.

sun4i-codec 1c22c00.codec: ASoC: no sink widget found for Headphone Jack
sun4i-codec 1c22c00.codec: ASoC: Failed to add route HP Left -> direct -> Headphone Jack
sun4i-codec 1c22c00.codec: ASoC: no sink widget found for Headphone Jack
sun4i-codec 1c22c00.codec: ASoC: Failed to add route HP Right -> direct -> Headphone Jack

Reported-by: Priit Laes <plaes@plaes.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-07 12:13:42 +01:00
kbuild test robot cc91ef0fd4 ASoC: nau8825: fix platform_no_drv_owner.cocci warnings
sound/soc/codecs/nau8825.c:1096:3-8: No need to set .owner here. The core will do it.

 Remove .owner field if calls are used which set it automatically

Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci

CC: Anatol Pomozov <anatol.pomozov@gmail.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-07 11:36:39 +01:00
Anatol Pomozov 34ca27f34f ASoC: nau8825: Add driver for headset chip Nuvoton 8825
Sponsored-by: Google Chromium project
Signed-off-by: Anatol Pomozov <anatol.pomozov@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-07 11:36:38 +01:00
Andy Shevchenko b5e5a4549c ASoC: Intel: use dw_dmac autoconfiguration
Instead of hardconding a platform data for dw_dmac let's use it's own
autoconfiguration feature. Thus, remove hardcoded values.

Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Cc: Mark Brown <broonie@kernel.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-07 11:24:49 +01:00
Axel Lin dc6d84c69c ASoC: rt286: Fix run time error while modifying const data
Make a copy of memory for index_cache rather than directly use the
rt286_index_def to avoid run time error.

Fixes: c418a84a8c ("ASoC: Constify reg_default tables")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-07 10:46:49 +01:00
Axel Lin d46183efe3 ASoC: ad193x-spi: Fixup ad193x_spi_id table
AD1939 is missed from the table, so add it.
AD1936 and AD1937 are controlled by I2C interface, so remove them.

Fixes: e5224f58e3 ("ASoC: ad193x: add support to ad1934")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-07 10:42:54 +01:00
Andreas Dannenberg e2600460bc ASoC: tas2552: fix dBscale-min declaration
The minimum volume level for the TAS2552 (control register value 0x00)
is -7dB however the driver declares it as -0.07dB.

Running amixer before the patch reports:
dBscale-min=-0.07dB,step=1.00dB,mute=0

Running amixer with the patch applied reports:
dBscale-min=-7.00dB,step=1.00dB,mute=0

Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
2015-10-06 11:53:46 +01:00
Sjoerd Simons 698d0b59f3 ASoC: rockchip: namespace rockchip i2s module name
Change the rockchip i2s object name (and thus module name) from the
rather generic snd-soc-i2s to the more specific snd-soc-rockchip-i2s

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-06 11:52:47 +01:00
Cyrille Pitchen e5224f58e3 ASoC: ad193x: add support to ad1934
The AD1934 codec has no ADC feature. Hence it register mapping is slightly
different from the register mapping of other members of the AD193x family.

Some ASoC controls and widgets are related to the DAC feature so are not
relevant in the case of an AD1934 codec.

Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-05 17:42:49 +01:00
Zidan Wang c64c60763b ASoC: fsl_esai: Add driver suspend and resume to support MEGA Fast
For i.MX6 SoloX, there is a mode of the SoC to shutdown all power source of
modules during system suspend and resume procedure. Thus, ESAI needs to save
all the values of registers before the system suspend and restore them after
the system resume.

Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-05 17:26:19 +01:00
Zidan Wang 05cf237972 ASoC: fsl_ssi: Add driver suspend and resume to support MEGA Fast
For i.MX6 SoloX, there is a mode of the SoC to shutdown all power
source of modules during system suspend and resume procedure. Thus,
SSI needs to save all the values of registers before the system
suspend and restore them after the system resume.

The register SFCSR is volatile, but some bits in it need to be
recovered after suspend/resume.

Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-05 17:26:18 +01:00
Zidan Wang f9f4fa61aa ASoC: fsl_spdif: Add driver suspend and resume to support MEGA Fast
For i.MX6 SoloX, there is a mode of the SoC to shutdown all power source of
modules during system suspend and resume procedure. Thus, SPDIF needs to save
all the values of registers before the system suspend and restore them after
the system resume.

The SRPC register should be volatile, LOCK bit is set by the hardware.

Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-05 17:26:17 +01:00
Zidan Wang 1fde5e83a1 ASoC: fsl_sai: Add driver suspend and resume to support MEGA Fast
For i.MX6 SoloX, there is a mode of the SoC to shutdown all power source of
modules during system suspend and resume procedure. Thus, SAI needs to save
all the values of registers before the system suspend and restore them after
the system resume.

Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-05 17:26:16 +01:00
Zidan Wang 43ac946922 ASoC: imx-spdif: add snd_soc_pm_ops for spdif machine driver
Add snd_soc_pm_ops in machine driver to make the trigger suspend/resume
be called in suspend/resume.

Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-05 17:25:45 +01:00
Maruthi Srinivas Bayyavarapu 1d957d862a ASoC: dwc: support dw i2s in slave mode
dw i2s controller can work in slave mode, codec being master.
dw i2s is made to support master/slave operation, by reading dwc
register.

Signed-off-by: Maruthi Bayyavarapu <maruthi.bayyavarapu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-05 16:31:43 +01:00
Adam Thomson 4e929134eb ASoC: da7219: Improve error handling for regulator supplies
Currently if bulk_enable() of supplies fails, the code still goes on
to try and put the device into active state, and set expected IO
voltage of the device. This doesn't really make sense so code now
returns on bulk_enable() failure, with an error message. Also,
to help with debug, failure to get supplies also provides an error
message.

Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-05 15:59:16 +01:00
Oder Chiou a2c026cfec ASoC: rt5645: Prevent the weird sound of the headphone while rebooting
The patch adds the codec reset setting in the shutdown function to prevent
the weird sound of the headphone happened by rebooting.

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-05 15:27:16 +01:00
Viresh Kumar 621a5f7ad9 debugfs: Pass bool pointer to debugfs_create_bool()
Its a bit odd that debugfs_create_bool() takes 'u32 *' as an argument,
when all it needs is a boolean pointer.

It would be better to update this API to make it accept 'bool *'
instead, as that will make it more consistent and often more convenient.
Over that bool takes just a byte.

That required updates to all user sites as well, in the same commit
updating the API. regmap core was also using
debugfs_{read|write}_file_bool(), directly and variable types were
updated for that to be bool as well.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Mark Brown <broonie@kernel.org>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-04 11:36:07 +01:00
Ben Zhang fbe039bb08 ASoC: rt5645: Allow 4 channel recording on AIF1
The codec supports 4 channel recording with TDM on AIF1.
This patch modifies the DAI capability to allow it.

Signed-off-by: Ben Zhang <benzh@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-02 18:13:06 +01:00
Adam Thomson 6d817c0e9f ASoC: codecs: Add da7219 codec driver
This adds support for the DA7219 audio codec with built-in advanced
accessory detect features.

Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-02 18:11:27 +01:00
yitian 924eb47512 ASoC: dwc: fix dma stop transferring issue
Designware I2S uses tx empty and rx available signals as the DMA
handshaking signals. during music playing, if XRUN occurs,
i2s_stop() function will be executed and both tx and rx irq are
masked, when music continues to be played, i2s_start() is executed
but both tx and rx irq are not unmasked which cause I2S stop
sending DMA handshaking signal to DMA controller, and it finally
causes music playing will be stopped once XRUN occurs for the first
time.

[On list discussion suggests this may be partly a race condition on slow
systems -- broonie]

Signed-off-by: Yitian Bu <yitian.bu@tangramtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-02 18:05:51 +01:00
Vedang Patel 5b2688a59a ASoC: topology: ABI - Add PCM Support and bump ABI version to 4
The struct snd_soc_tplg_pcm_dai is renamed to snd_soc_tplg_pcm.
This struct will now be used to handle data related to PCMs
(FE DAI & DAI links). It's not for BE, because BE DAI mappings will be
provided by ACPI/FDT data.

Remove the unused struct snd_soc_tplg_pcm_cfg_caps. We are using
snd_soc_tplg_stream and snd_soc_stream_caps instead.

Bump ABI version to 4.

Signed-off-by: Vedang Patel <vedang.patel@intel.com>
Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-02 17:59:48 +01:00
Richard Fitzgerald 6ebbce0a6e ASoC: wm8998: Initial WM8998 codec driver
Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-02 17:51:34 +01:00
Richard Fitzgerald 50e6168f27 ASoC: arizona: add defines for single-input gain control
Adds convenience defines for declaring a gain control that
has an input mux. These blocks are functionally equivalent to
the existing mixer blocks but can only have a single input
active at once.

Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-02 17:51:33 +01:00
Yitian Bu 4873867e5f ASoC: dwc: correct irq clear method
from Designware I2S datasheet, tx/rx XRUN irq is cleared by
reading register TOR/ROR, rather than by writing into them.

Signed-off-by: Yitian Bu <yitian.bu@tangramtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
2015-10-02 11:44:04 +01:00
Rick Mann 2d1180e369 ASoC: tlv320aic3x: Prevent writing reserved registers on tlv320aic3104 CODECs
The current code writes a set of registers that are reserved on the
tlc320aic3104. The change skips those registers for that IC.

Signed-off-by: Rick Mann <rmann@latencyzero.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-01 11:15:45 +01:00
Oder Chiou 8c1a9d6323 ASoC: rt5645: Correct the naming and setting of ADC Boost Volume Control
Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-01 11:13:04 +01:00
Oder Chiou e29fd55d8d ASoC: rt5645: Add the control of ClassD modulator Speaker Gain Ratio
Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-01 11:12:45 +01:00
Daniel Mack 58ceb57ec1 ASoC: pxa: pxa-pcm-lib: switch over to snd-soc-dmaengine-pcm
This patch removes the old PXA DMA API usage and switches over to
generic functions provided by snd-soc-dmaengine-pcm.

More cleanups may be done on top of this, and some function stubs can
now be removed completetly. However, the intention here was to keep
the transition as small as possible.

This was tested on the mioa701 pxa27x board.

Signed-off-by: Daniel Mack <zonque@gmail.com>
[trivial change from mmp-dma to pxa-dma]
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-30 23:21:16 +01:00
Mark Brown 5c0e869357 ASoC: Fixes for v4.3
A disappointingly large set of fixes, though none of them very big and
 very widely spread over many different drivers.  Nothing especially
 stands out, it's mostly all device specific and relatively minor.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJWBEMrAAoJECTWi3JdVIfQOqIH/jsO0wdDz683ZpUd0K3OQlss
 gia5/e0pS4IOaQY4ECZSydC/wf+fGs0ZHlLWXqSzJ33abCUUZlfL4f/3kQwhIrgD
 Tb4aFLQoTRglZIqsgEm91Mqpk9gFUxhhqRBhI77iw11SOG1uWdokkYISG0ljnR5p
 HFVxmqiSubvKdtydTOWR446Gxrk97c8HjzoBOXvQ87hKKyos7oJi4OcYD6HDVNr9
 hrPkHS/05anaLbehZr82jmL+yMDsQl7QMjk1ljRkuufDUB07HogM1FHb5zkecC9u
 eqDy5SOSJY4XFINDpxqt/5nqDaKgPcbEpfCH+ajfeY0e3d8rVVnPurrz/H4ElUM=
 =KbEn
 -----END PGP SIGNATURE-----

Merge tag 'asoc-fix-v4.3-rc2' into asoc-pxa

ASoC: Fixes for v4.3

A disappointingly large set of fixes, though none of them very big and
very widely spread over many different drivers.  Nothing especially
stands out, it's mostly all device specific and relatively minor.
2015-09-30 23:21:11 +01:00
Gianluca Renzi e256da84a0 ASoC: sgtl5000: fix wrong register MIC_BIAS_VOLTAGE setup on probe
Signed-off-by: Gianluca Renzi <gianlucarenzi@eurekelettronica.it>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
2015-09-30 19:44:03 +01:00
Maxime Ripard debb972487 ASoC: sun4i-codec: Remove redundant SND_PCM_RATE_KNOT
The SND_PCM_RATE_KNOT covers all the rate settings, even though some that
we don't support, while we also list all the rate we support. Simply remove
it.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-30 19:41:14 +01:00
Maxime Ripard 98a4b665bc ASoC: sun4i-codec: pass through clk_set_rate error
The current code, disregarding the clk_set_rate error code, was always
returning -EINVAL. Fix that and return the code in order to have more clue
about what's going on.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-30 19:41:14 +01:00
Jiada Wang 57622aef86 ASoC: wm8962: balance pm_runtime_enable
pm_runtime_enable is called in probe to enable runtime PM
for wm8962 codec, but pm_runtime_disable isn't called in remove
callback, nor is called in error path if probe fails after runtime
PM is enabled, this causes unbalanced pm_runtime_enable.

This patch Adds pm_runtime_disable in remove callback and error path,
to balance pm_runtime_enable.

Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-30 19:10:58 +01:00
Benoît Thébaudeau b7b01d345b ASoC: imx-ssi: Fix DAI hardware signal inversions
SND_SOC_DAIFMT_{IB|NB}_{IF|NF} are defined as inverting or not BCLK or
FRM relatively to what is standard for the specified DAI hardware audio
format. Consequently, the absolute polarities of these signals cannot be
derived only from these settings as this driver did. The format has to
be taken into account too.

This fixes inverted left/right channels in I²S mode.

Signed-off-by: Benoît Thébaudeau <benoit@wsystem.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-29 17:28:33 +01:00
Gianluca Renzi fb97d75b03 ASoC: sgtl5000: fix error message output for MicBias voltage
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
Cc: alsa-devel@alsa-project.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Gianluca Renzi <gianlucarenzi@eurekelettronica.it>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-29 17:06:22 +01:00
Lars-Peter Clausen e74679b38c ASoC: db1200: Fix DAI link format for db1300 and db1550
Commit b4508d0f95 ("ASoC: db1200: Use static DAI format setup") switched
the db1200 driver over to using static DAI format setup instead of a
callback function. But the commit only added the dai_fmt field to one of
the three DAI links in the driver. This breaks audio on db1300 and db1550.

Add the two missing dai_fmt settings to fix the issue.

Fixes: b4508d0f95 ("ASoC: db1200: Use static DAI format setup")
Reported-by: Manuel Lauss <manuel.lauss@gmail.com>
Tested-by: Manuel Lauss <manuel.lauss@gmail.com>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
2015-09-25 09:31:09 -07:00
Axel Lin 0f7e177406 ASoC: rl6347a: Clean up unneeded inclusion of header files
Also move the include of sound/hda_verbs.h to rl6347a.h because it is used
in rl6347a.h.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-24 10:30:47 -07:00
Mark Brown 4922e7a1b7 Merge remote-tracking branch 'asoc/topic/ux500' into asoc-next 2015-09-23 11:01:30 -07:00
Mark Brown 727e53a12f Merge remote-tracking branches 'asoc/topic/sh', 'asoc/topic/simple', 'asoc/topic/spear', 'asoc/topic/sunxi' and 'asoc/topic/tlv320aic3x' into asoc-next 2015-09-23 11:01:27 -07:00
Mark Brown e32efed3ea Merge remote-tracking branches 'asoc/topic/pxa', 'asoc/topic/qcom', 'asoc/topic/rcar' and 'asoc/topic/rockchip' into asoc-next 2015-09-23 11:01:25 -07:00
Mark Brown 9abbe73e7d Merge remote-tracking branches 'asoc/topic/jz4740', 'asoc/topic/kirkwood', 'asoc/topic/mtk', 'asoc/topic/multi' and 'asoc/topic/mxs' into asoc-next 2015-09-23 11:01:22 -07:00
Mark Brown f7b93159ab Merge remote-tracking branches 'asoc/topic/blackfin', 'asoc/topic/davinci', 'asoc/topic/fsl', 'asoc/topic/hdmi' and 'asoc/topic/intel' into asoc-next 2015-09-23 11:01:19 -07:00
Mark Brown 97e15d9a8b Merge remote-tracking branches 'asoc/topic/ak4613', 'asoc/topic/ak4642', 'asoc/topic/arizona', 'asoc/topic/atmel' and 'asoc/topic/au1x' into asoc-next 2015-09-23 11:01:16 -07:00
Mark Brown f950aa96d1 Merge remote-tracking branch 'asoc/topic/rt5645' into asoc-next 2015-09-23 11:01:15 -07:00
Mark Brown ed14ee0eea Merge remote-tracking branches 'asoc/fix/wm8960' and 'asoc/fix/wm8962' into asoc-linus 2015-09-23 11:01:12 -07:00
Mark Brown d86a2fe4dc Merge remote-tracking branches 'asoc/fix/mtk', 'asoc/fix/psc', 'asoc/fix/pxa', 'asoc/fix/spear', 'asoc/fix/sti' and 'asoc/fix/wm0010' into asoc-linus 2015-09-23 11:01:08 -07:00
Mark Brown 312e0bce7f Merge remote-tracking branches 'asoc/fix/davinci', 'asoc/fix/doc', 'asoc/fix/fsl-card', 'asoc/fix/fsl-ssi', 'asoc/fix/intel' and 'asoc/fix/maintainers' into asoc-linus 2015-09-23 11:01:03 -07:00
Mark Brown fcffa0dbb6 Merge remote-tracking branch 'asoc/fix/rt5645' into asoc-linus 2015-09-23 11:01:02 -07:00
Mark Brown 5ee84ba8c7 Merge remote-tracking branch 'asoc/fix/dapm' into asoc-linus 2015-09-23 11:01:00 -07:00
Oder Chiou fce97b4d70 ASoC: rt5645: Prevent the pop sound in case of playback and the jack is plugging
Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-23 10:59:13 -07:00
Oder Chiou 4f4794124e ASoC: rt5645: Increase the delay time to remove the pop sound
Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-23 10:59:10 -07:00
Oder Chiou 21cb13e72b ASoC: rt5645: Use the type SOC_DAPM_SINGLE_AUTODISABLE to prevent the weird sound in runtime of power up
Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-23 10:59:07 -07:00
Oder Chiou de3f8fdf73 ASoC: rt5645: Remove the repeated definitions
Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-23 10:57:52 -07:00
Robert Jarzmik 8811191fdf ASoC: pxa: pxa2xx-ac97: fix dma requestor lines
PCM receive and transmit DMA requestor lines were reverted, breaking the
PCM playback interface for PXA platforms using the sound/soc/ variant
instead of the sound/arm variant.

The commit below shows the inversion in the requestor lines.

Fixes: d65a14587a ("ASoC: pxa: use snd_dmaengine_dai_dma_data")
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
2015-09-22 14:12:46 -07:00
John Lin 917536aeb8 ASoC: rt5645: Add jd_invert for Broadwell
Broadwell can not triger the IRQ falling and rising simultaneously,
so it can not detect jack-in and jack-out simultaneously.
We add a flag "jd_invert" to platform data. If this flag is set,
codec IRQ will be set to invert that forces IRQ as pulse when jack-in
and jack-out.

Signed-off-by: John Lin <john.lin@realtek.com>
Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-22 09:46:33 -07:00
John Lin e9159e7577 ASoC: rt5645: Add dmi for Broadwell
Add DMI data for Buddy project.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: John Lin <john.lin@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-22 09:46:32 -07:00
Mark Brown c44506997c Merge branch 'fix/rt5645' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-rt5645 2015-09-22 09:45:46 -07:00
Adam Thomson 5b64c173cd ASoC: fsl_ssi: Fix checking of dai format for AC97 mode
Current code incorrectly treats dai format for AC97 as bit mask
whereas it's actually an integer value. This causes DAI formats
other than AC97 (e.g. DSP_B) to trigger AC97 related code,
which is incorrect and breaks functionality. This patch fixes
the code to correctly compare values to determine AC97 or not.

Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Acked-by: Timur Tabi <timur@tabi.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-19 11:07:42 -07:00
Ricard Wanderlof cde79035c6 ASoC: Handle multiple codecs with split playback / capture
Add the capability to use multiple codecs on the same DAI linke where
one codec is used for playback and another one is used for capture.

Tested on a setup using an SSM2518 for playback and an ICS43432 I2S MEMS
microphone for capture.

No verification is made that the playback and capture codec setups are
compatible in terms of number of TDM slots (where applicable).

Signed-off-by: Ricard Wanderlof <ricardw@axis.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-19 10:58:04 -07:00
Jyri Sarha 9529138276 ASoC: hdmi: Remove obsolete dummy HDMI codec
The hdmi stub codec has not been used since refactoring of OMAP HDMI
audio support.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-19 10:44:39 -07:00
Jeeja KP 5b97c0f18a ASoC: Intel: Skylake: Remove unused CPU dais
We need to create CPU DAI for each endpoint instance. For this we
should have one DMIC DAI, one HDA DAI and SSP DAI.  Thus, DMIC23,
HDA-SPK/AMIC was not required so this patch removes them

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-19 09:27:52 -07:00
Sudip Mukherjee f072f91aa7 ASoC: wm0010: fix error path
Fix the error path so that we can free the allocated memory on the error
path instead of releasing them individually on each error.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-19 08:40:55 -07:00
Sudip Mukherjee 2ace47be5a ASoC: wm0010: fix memory leak
We have requested for the firmware but we have missed releasing it both
on success and on error path.
While checking the code it turned out that the requested firmware is not
even used. More over the same firmware is being loaded by
wm0010_stage2_load().

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-19 08:40:50 -07:00
Zidan Wang 8524bb0c7a ASoC: wm8960: correct the max register value of mic boost pga
the max register value of mic boost pga should be 3.

Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-19 07:51:09 -07:00
Zidan Wang ee92cfb030 ASoC: wm8962: remove 64k sample rate support
wm8962 can't support 64k sample rate. When playing a 64KHz wave file,
'Unsupported rate 64000Hz' will be prompted.

Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-19 07:50:23 -07:00
Axel Lin 9d70594760 ASoC: rockchip: Fix missing CLKDEV_LOOKUP dependency
Make SND_SOC_ROCKCHIP_MAX98090 and SND_SOC_ROCKCHIP_RT5645 depend on
CLKDEV_LOOKUP to fix below build warning:

warning: (SND_SOC_ROCKCHIP_MAX98090 && SND_SOC_ROCKCHIP_RT5645) selects
SND_SOC_ROCKCHIP_I2S which has unmet direct dependencies (SOUND && !M68K &&
!UML && SND && SND_SOC && CLKDEV_LOOKUP && SND_SOC_ROCKCHIP)

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-19 07:47:57 -07:00
Kuninori Morimoto e3a4d958d7 ASoC: ak4613: add Digital Playback Volume support
For L/ROUT1 to L/ROUT6

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-19 07:41:15 -07:00
Peter Ujfalusi ab1fffe3a7 ASoC: davinci-mcasp: Fix devm_kasprintf format string
The '\n' at the end of the format string is not needed. It adds an extra
line break when doing
cat /proc/interrupts

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-18 16:22:07 +01:00
Kuninori Morimoto b075706284 ASoC: add ak4613 support
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-17 12:33:08 +01:00
kbuild test robot 31f4f0c640 ASoC: sunxi: fix platform_no_drv_owner.cocci warnings
sound/soc/sunxi/sun4i-codec.c:708:3-8: No need to set .owner here. The core will do it.

 Remove .owner field if calls are used which set it automatically

Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci

CC: Emilio López <emilio@elopez.com.ar>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-17 11:38:03 +01:00
Jyri Sarha 14a998be08 ASoC: davinci-mcasp: Get rid of bclk_lrclk_ratio in private data
The slot_width is for essentially same thing. Instead of storing
bclk_lrclk_ratio, just store the slot_width. Comments has been updated
accordingly and some variable names changed to more descriptive.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-17 11:37:27 +01:00
Julia Lawall 8985729578 ASoC: qcom: change PTR_ERR argument
Apply PTR_ERR to the value that was recently assigned.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression x,y;
@@

if (IS_ERR(x) || ...) {
  ... when any
      when != IS_ERR(...)
(
   PTR_ERR(x)
|
*  PTR_ERR(y)
)
  ... when any
}
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-17 11:36:19 +01:00
Jyri Sarha 6c84e5917f ASoC: soc-core: Fix sparse warning in be32_to_cpup() call
Store return value of of_get_property() to a pointer of __be32 type as
device tree has big endian type. This fixes a sparse warning couple of
lines later when be32_to_cpup() is used to convert from big endian to
cpu endian.

The whole conversion is not really necessary, as we are only checking
if the value is zero or not, but I wanted to add it to remind in the
future that the data has to be converted before use. Compiler should
optimize the unnecessary operations away.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-17 11:36:05 +01:00
Charles Keepax ccaadda319 ASoC: wm5110: Add additional analogue input enable for early revs
Earlier revisions of the wm5110/8280 silicon require a slightly more
complex procedure to enable analogue inputs. This patch adds this into
the driver.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-17 11:35:02 +01:00
Charles Keepax 002b083b8d ASoC: arizona: Add utility function to check if an input is analog
We will occasionally require to take different action based on if an
input is analog or digital so add a helper function to return if an
input is analog.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-16 21:00:03 +01:00
Charles Keepax bee261b896 ASoC: arizona: Add default cases for event switches
Since the addition of the WILL_PMU / WILL_PMD several of the switches in
arizona.c no longer cover all cases or have a default case. Whilst this
isn't causing any problems in the interests of robustness add default
cases.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-16 21:00:03 +01:00
Robert Jarzmik 3c8f7710c1 ASoC: fix broken pxa SoC support
The previous fix of pxa library support, which was introduced to fix the
library dependency, broke the previous SoC behavior, where a machine
code binding pxa2xx-ac97 with a coded relied on :
 - sound/soc/pxa/pxa2xx-ac97.c
 - sound/soc/codecs/XXX.c

For example, the mioa701_wm9713.c machine code is currently broken. The
"select ARM" statement wrongly selects the soc/arm/pxa2xx-ac97 for
compilation, as per an unfortunate fate SND_PXA2XX_AC97 is both declared
in sound/arm/Kconfig and sound/soc/pxa/Kconfig.

Fix this by ensuring that SND_PXA2XX_SOC correctly triggers the correct
pxa2xx-ac97 compilation.

Fixes: 846172dfe3 ("ASoC: fix SND_PXA2XX_LIB Kconfig warning")
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-16 20:58:27 +01:00
Kuninori Morimoto 462c30bc8b ASoC: rsnd: fixup clkout_name[] index error for single AUDIO_CLKOUT SoC
2a46db4a3("ASoC: rsnd: add AUDIO_CLKOUT support") added AUDIO_CLKOUT
support for ADG. But single AUDIO_CLKOUT needs clkout_name[CLKOUT],
not clkout_name[i]. Kernel will have NULL pointer access without this
patch.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-16 20:40:39 +01:00
Kuninori Morimoto 544637bf3f ASoC: ak4642: exchange macro name to avoid redefinition
71a0138ab("ASoC: ak4642: enable to use MCKO as fixed rate output
pin on DT") added new FS() macro, but x86 already has it in
arch/x86/include/uapi/asm/ptrace-abi.h
This patch exchange FS() to FSs() to avoid redefinition warning

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-16 20:40:27 +01:00
Kuninori Morimoto e2f8445176 ASoC: rsnd: SND_SOC_RCAR depends on COMMON_CLK
2a46db4a3("ASoC: rsnd: add AUDIO_CLKOUT support") uses
of_clk_add_provider() which is requesting struct clk_onecell_data.
But it is COMMON_CLK feature. SND_SOC_RCAR depends on COMMON_CLK

This patch also solved compile error of 7486d80f7("ASoC: rsnd: remove
unneeded sh_clk header")

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-16 20:40:02 +01:00
Emilio López 45fb6b6f2a ASoC: sunxi: add support for the on-chip codec on early Allwinner SoCs
The sun4i, sun5i and sun7i SoC families have a built-in codec, capable
of both audio capture and playback.

While this is called a codec by Allwinner, it really is an in-SoC
combination of a codec and a DAI, with its own DAC/ADC and amplifiers
in a single memory-mapped controller.

The capture part has been left out for now, and will be added eventually.

Signed-off-by: Emilio López <emilio@elopez.com.ar>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-16 20:18:45 +01:00
Sudip Mukherjee 2fc171e69e ASoC: Intel: remove unused function
The function get_current_pipe_id() was not being used.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-16 18:30:47 +01:00
Jyri Sarha 6131084a0b ASoC: simple-card: Add tdm slot mask support to simple-card
Adds DT binding for explicitly choosing a tdm mask for DAI and uses it
in simple-card. The API for snd_soc_of_parse_tdm_slot() has also been
changed.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-16 18:00:30 +01:00
Jyri Sarha dd55ff8346 ASoC: davinci-mcasp: Add set_tdm_slots() support
Implements set_tdm_slot() callback for mcasp. Channel constraints are
updated according to the configured tdm mask and slots each time
set_tdm_slot() is called. The special case when slot width is set to
zero is allowed and it means that slot width is the same as the sample
width.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-16 17:59:15 +01:00
Jyri Sarha 3e8f5263bd ASoC: tlv320aic3x: Improve tdm support
Before this patch the set_tdm_slots() callback did not store the value
of slot width anywhere. The tdm support only worked if selected slot
width was equal to the sample width. With this patch all sample widths
that fit into the slot width are supported. There unused bits are
filled unnecessarily in the capture direction, but the other end of
the i2s bus should be able to ignore them.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-16 17:58:56 +01:00
Axel Lin 03d3964c51 ASoC: SPEAr: Make SND_SPEAR_SOC select SND_SOC_GENERIC_DMAENGINE_PCM
devm_snd_dmaengine_pcm_register() is guarded by
CONFIG_SND_SOC_GENERIC_DMAENGINE_PCM.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-16 17:46:11 +01:00
Mark Brown df5c79e982 Merge branch 'fix/rt5645' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-fix-rt5645 2015-09-14 19:53:39 +01:00
Kuninori Morimoto 2a46db4a37 ASoC: rsnd: add AUDIO_CLKOUT support
Renesas sound has AUDIO_CLKOUT (in Gen1/Gen2) AUDIO_CLKOUT1/2/3 (in Gen3)
This patch support these patches as clock provider.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14 19:47:32 +01:00
Kuninori Morimoto 248e88c2fb ASoC: rsnd: adg: ignore undefined clock error
undefined clock is not error. Accept such case. And this is prepare
for clock out support in the same time.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14 19:47:32 +01:00
Kuninori Morimoto 3af6c3ac91 ASoC: rsnd: tidyup ADG debug message for clock selection
It didn't have "\n", and indicated different data

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14 19:47:32 +01:00
Kuninori Morimoto eae6fff4f1 ASoC: rsnd: tidyup ADG clock calculate method
Current ADG clock calculation needs ADG and SSI settings.
Thus, SSI side clock request function depends on ADG settings.
After reconsideration,  we can close this method inside ADG.
This function uses new method. And it becomes preparation for
AUDIO_CLKOUT support.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14 19:47:32 +01:00
Kuninori Morimoto 5c6901d98b ASoC: rsnd: ADG initial setup on rsnd_adg_ssi_clk_init()
ADG is special IP since it doesn't have MSTP. And now, ADG has common
mod base register access. We can now setup ADG initial setting when
probe timing. It is needed if sound card is based on AUIDO_CLK which
is used as Master clock.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14 19:47:31 +01:00
Kuninori Morimoto f1df122907 ASoC: rsnd: add common mod confirm method
Renesas sound has SSI/SRC/DVC/MIX/ADG modules, and these have original
register mapping. Thus this driver is using regmap field, and each module
is using it based on each module ID.

Sometimes, each module needs other module to controlling. but current each
function is using just "mod" as parameter name. This is confusable.
For example, if SSI0 and SRC2 are connected, and if SRC module function
has bug of module access, and if it needs to control connected SSI,
SRC function will access to SSI2 (It should access to SSI0, but it uses
SRC's ID 2). This is easy to happen in current driver style.

To avoid this kind of confusable trouble, this patch adds module confirm
macro for debug purpose.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14 19:47:31 +01:00
Kuninori Morimoto 1665a9e5e2 ASoC: rsnd: ADG uses mod base common method
Renesas sound has ADG IP, but it is special device.
(It is clock generater, and it doesn't need MSTP)
Thus, ADG didn't use mod base common method on rsnd driver.
But it can be confusable point. Let's use common method

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14 19:47:31 +01:00
Kuninori Morimoto b76e218ae5 ASoC: rsnd: add rsnd_mod_get() macro and use it
Renesas sound driver has SSI/SRC/DVC/CTU/MIX, and these are controlled
as modules. And these module are member of each modules's private data.
It used own method to get module pointer, but Let's use common method

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14 19:47:31 +01:00
Kuninori Morimoto ac37a45b0b ASoC: rsnd: Add Gen3 initial support
Renesas sound Gen3 is updated version of Gen2. We need to update
driver for it, but basically it should works as Gen2 compatible.
This is initial support for Gen3. Gen3 specific feature will be
incrementally added in the future

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14 19:47:31 +01:00
Kuninori Morimoto 7486d80f7d ASoC: rsnd: remove unneeded sh_clk header
sh_clk header is not needed, and it will create confusion.
Let's remove it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14 19:47:29 +01:00
Kuninori Morimoto b9bfe9d5f7 ASoC: rsnd: rename rsnd_src_pcm_new() to rsnd_src_pcm_new_gen2()
rsnd_src_pcm_new() is used only from Gen2. make it clear in function name,
and remove unneeded Gen1 check.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14 19:47:28 +01:00
Kuninori Morimoto c25f20e1de ASoC: rsnd: tidyup rsnd_dma_to_xxx() position
rsnd_dma_to_xxx() macro should exist in same place

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14 19:47:28 +01:00
Kuninori Morimoto 171a0138ab ASoC: ak4642: enable to use MCKO as fixed rate output pin on DT
ak4642 chip can output clock via MCKO pin as audio reference clock.
This patch supports it on DT

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14 19:41:38 +01:00
Kuninori Morimoto 2719a752b6 ASoC: ak4642: use *dev on ak4642_i2c_probe()
Let's replace &i2c->dev to dev

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14 19:41:38 +01:00
Jyri Sarha 295c3405a8 ASoC: davinci-mcasp: Set .symmetric_rates = 1 in snd_soc_dai_driver
The TX and RX direction share the same bit clock and frame sync, so
the samplerate must be the same to both directions.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14 19:40:08 +01:00
Luis de Bethencourt c81740e005 ASoC: ux500: Fix module autoload for OF platform driver
This platform driver has a OF device ID table but the OF module
alias information is not created so module autoloading won't work.

Signed-off-by: Luis de Bethencourt <luis@debethencourt.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14 18:47:20 +01:00
Luis de Bethencourt cfa7a38c75 ASoC: mop500: Fix module autoload for OF platform driver
This platform driver has a OF device ID table but the OF module
alias information is not created so module autoloading won't work.

Signed-off-by: Luis de Bethencourt <luis@debethencourt.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14 18:47:20 +01:00
Luis de Bethencourt baafd373e9 ASoC: pxa: Fix module autoload for OF platform drivers
These platform drivers have a OF device ID table but the OF module
alias information is not created so module autoloading won't work.

Signed-off-by: Luis de Bethencourt <luis@debethencourt.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14 18:46:58 +01:00
Luis de Bethencourt 30953a8047 ASoC: kirkwood: Fix module autoload for OF platform driver
This platform driver has a OF device ID table but the OF module
alias information is not created so module autoloading won't work.

Signed-off-by: Luis de Bethencourt <luis@debethencourt.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14 18:46:28 +01:00
Luis de Bethencourt 27fcf913f6 ASoC: jz4740: Fix module autoload for OF platform driver
This platform driver has a OF device ID table but the OF module
alias information is not created so module autoloading won't work.

Signed-off-by: Luis de Bethencourt <luis@debethencourt.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14 18:46:14 +01:00
Luis de Bethencourt c759241fe2 ASoC: fsl_sai: Fix module autoload for OF platform driver
This platform driver has a OF device ID table but the OF module
alias information is not created so module autoloading won't work.

Signed-off-by: Luis de Bethencourt <luis@debethencourt.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14 18:44:51 +01:00
Luis de Bethencourt 5226f2340c ASoC: fsl-asoc-card: Fix module autoload for OF platform driver
This platform driver has a OF device ID table but the OF module
alias information is not created so module autoloading won't work.

Signed-off-by: Luis de Bethencourt <luis@debethencourt.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14 18:44:51 +01:00
Luis de Bethencourt aab7826f59 ASoC: atmel_wm8904: Fix module autoload for OF platform driver
This platform driver has a OF device ID table but the OF module
alias information is not created so module autoloading won't work.

Signed-off-by: Luis de Bethencourt <luis@debethencourt.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14 18:42:10 +01:00
Axel Lin 9ed747641b ASoC: intel: broadwell: Convert to devm_snd_soc_register_card
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14 18:39:23 +01:00
Axel Lin 1ff68f5590 ASoC: sh: siu_dai: Convert to use resource managed APIs
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14 18:39:05 +01:00
Axel Lin 921e54680a ASoC: au1x: psc-i2s: Fix unused variable 'ret' warning
Fix below build warning:
sound/soc/au1x/psc-i2s.c: In function 'au1xpsc_i2s_drvprobe':
sound/soc/au1x/psc-i2s.c:299:6: warning: unused variable 'ret' [-Wunused-variable]

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Manuel Lauss <manuel.lauss@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14 18:38:40 +01:00
Axel Lin 42617869bf ASoC: SPEAr: Make SND_SPEAR_SOC select SND_SOC_GENERIC_DMAENGINE_PCM
devm_snd_dmaengine_pcm_register() is guarded by
CONFIG_SND_SOC_GENERIC_DMAENGINE_PCM.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14 18:37:25 +01:00
Axel Lin 2fd7076a43 ASoC: pxa: Convert to devm_snd_soc_register_card
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14 18:33:41 +01:00
Axel Lin 5b73de19fd ASoC: mxs-sgtl5000: Convert to devm_snd_soc_register_card
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14 18:33:17 +01:00
Axel Lin 76b0d1f5e7 ASoC: blackfin: Convert to devm_snd_soc_register_card
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14 18:32:58 +01:00
Axel Lin 2342cafe22 ASoC: au1x: Convert to devm_snd_soc_register_card
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14 18:28:24 +01:00
Koro Chen e4fba9b5be ASoC: mediatek: Increase periods_min in capture
In capture, there is chance that hw_ptr reported at IRQ is
a little smaller than period_size due to internal AFE buffer.
In the case of ping-pong buffer:

|xxxxxxxxxxxxxxxxxxxxxxxxxxxx--|-----------------------------|
                            hw_ptr < period_size

This available buffer will not be read since its size is smaller than
avail_min (which is period_size by default), and read thread continues
to sleep. If the next hw_ptr is just a little larger than buffer_size,
overrun occurs. One more period can hold the possible unread buffer.

Signed-off-by: Koro Chen <koro.chen@mediatek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14 18:13:54 +01:00
Peter Ujfalusi 723831927e ASoC: davinci-mcasp: Revise the FIFO threshold calculation
The FIFO threshold for McASP should be <=[tx/rx]numevt so the initial value
for the refining should meet this requirement as well.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14 17:29:41 +01:00
Zidan Wang 7e90f9b2b5 ASoC: wm8960: correct gain value for input PGA and add microphone PGA
The input PGAs have a gain range from -17.25dB to +30dB in 0.75dB steps.

The boost stage can provide additional gain. For line inputs, -12dB to
+6dB gain is available on the boost mixer. For micphone inputs, it can
provide up to +29dB additional gain from the microphone PGA.

Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-11 13:39:15 +01:00