Commit graph

63 commits

Author SHA1 Message Date
Mark Brown
428157c1e8 Merge remote-tracking branches 'asoc/topic/tas2552', 'asoc/topic/tas5086', 'asoc/topic/tegra', 'asoc/topic/tlv' and 'asoc/topic/topology' into asoc-next 2015-08-30 15:57:34 +01:00
Mark Brown
a8f1d97bfa Merge remote-tracking branches 'asoc/topic/rt298', 'asoc/topic/rt5640', 'asoc/topic/rt5651' and 'asoc/topic/rt5670' into asoc-next 2015-08-30 15:56:27 +01:00
Mark Brown
532161e6cc Merge remote-tracking branches 'asoc/topic/rcar', 'asoc/topic/reg-default', 'asoc/topic/rl6231', 'asoc/topic/rockchip' and 'asoc/topic/rt286' into asoc-next 2015-08-30 15:55:54 +01:00
Mark Brown
28becbd59c Merge remote-tracking branch 'asoc/topic/ssm4567' into asoc-next 2015-08-30 15:52:16 +01:00
John Lin
9b850ca4f1 ASoC: rt5640: fix line out no sound issue
The power for line out was not turned on when line out is enabled.
So we add "LOUT amp" widget to turn on the power for line out.

Signed-off-by: John Lin <john.lin@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
2015-08-11 19:00:42 +01:00
Lars-Peter Clausen
8295822dac ASoC: rt5640: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE
DECLARE_TLV_DB_RANGE() has the advantage over using TLV_DB_RANGE_HEAD()
that it automatically calculates the number of items in the TLV and is
hence less prone to manual error.

Generate using the following coccinelle script

// <smpl>
@@
declarer name DECLARE_TLV_DB_RANGE;
identifier tlv;
constant x;
@@
-unsigned int tlv[] = {
-	TLV_DB_RANGE_HEAD(x),
+DECLARE_TLV_DB_RANGE(tlv,
	...
-};
+);
// </smpl>

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-05 13:23:15 +01:00
Oder Chiou
00a6d6e50f ASoC: Add function "rl6231_get_pre_div" to correct the dmic clock calculation
Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-05 10:42:35 +01:00
Nariman Poushin
8019ff6cfc regmap: Use reg_sequence for multi_reg_write / register_patch
Separate the functionality using sequences of register writes from the
functions that take register defaults. This change renames the arguments
in order to support the extension of reg_sequence to take an optional
delay to be applied after any given register in a sequence is written.
This avoids adding an int to all register defaults, which could
substantially increase memory usage for regmaps with large default tables.

This also updates all the clients of multi_reg_write/register_patch.

Signed-off-by: Nariman Poushin <nariman@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-16 22:02:55 +01:00
Krzysztof Kozlowski
1c07a4de5b ASoC: drivers: Drop owner assignment from i2c_driver
i2c_driver does not need to set an owner because i2c_register_driver()
will set it.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-15 12:50:43 +01:00
Jarkko Nikula
818454d1ab ASoC: rt5640: Prefix hexadecimal ID register value with 0x in error print
Make it obvious that unexpected value read from ID register is printed in
hexadecimal.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-06 20:29:57 +01:00
Mark Brown
71d8c2d783 Merge remote-tracking branches 'asoc/topic/qcom', 'asoc/topic/rcar', 'asoc/topic/rt286' and 'asoc/topic/rt5640' into asoc-next 2015-06-22 10:24:33 +01:00
Mathias Krause
b895dc2c47 ASoC: rt5640: Constify ACPI device ids and register defaults
Constify the ACPI device ID array and the register map, no need to have
them writable at runtime. Also drop the unneeded RT5640_INIT_REG_LEN
define.

Signed-off-by: Mathias Krause <minipli@googlemail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-15 11:17:14 +01:00
Lars-Peter Clausen
76aad74bdd ASoC: rt5640: Replace direct snd_soc_codec dapm field access
The dapm field of the snd_soc_codec struct is eventually going to be
removed, in preparation for this replace all manual access to
codec->dapm.bias_level with snd_soc_codec_get_bias_level() and replace all
other manual access to codec->dapm with snd_soc_codec_get_dapm().

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-05-20 11:18:32 +01:00
Lars-Peter Clausen
f4bf8d770b ASoC: Move bias level update to the core
All drivers have the same line at the end of the set_bias_level callback to
update the bias_level state. Move this update into
snd_soc_dapm_force_bias_level() and remove them from the drivers.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-27 21:34:45 +01:00
Lars-Peter Clausen
bd1204cb51 ASoC: Route all bias level updates through the core
Use the new snd_soc_codec_force_bias_level() helper function to invoke the
bias_level callback of a driver instead of calling the callback by hand.
Currently the effect of this is the same, but having all bias level updates
go through a central place will allow us to move more of the bias level
management into the DAPM core.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-27 21:34:45 +01:00
Mark Brown
7a869e108e Merge remote-tracking branch 'asoc/topic/w-codec' into asoc-next 2015-02-04 20:57:06 +00:00
Jarkko Nikula
3463667aa1 ASoC: rt5640: Add RT5642 ACPI ID for Intel Baytrail
Asus T100TAF uses ACPI ID "10EC5642" for its audio codec. I suppose it is
updated ACPI ID for the RT5642 codec since some earlier platforms are using
"10EC5640" with the RT5642 too.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-26 19:17:03 +00:00
Lars-Peter Clausen
bb1cd608b1 ASoC: rt5640: Replace w->codec snd_soc_dapm_to_codec(w->dapm)
The codec field of the snd_soc_widget struct is eventually going to be
removed, use snd_soc_dapm_to_codec(w->dapm) instead.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-15 11:57:06 +00:00
Mark Brown
57b027f697 Merge remote-tracking branches 'asoc/topic/fsl-easi', 'asoc/topic/fsl-sai', 'asoc/topic/fsl-ssi' and 'asoc/topic/intel' into asoc-next 2014-10-06 12:48:59 +01:00
Jarkko Nikula
cd69dc8868 ASoC: rt5640: Add function for enabling DMIC from ACPI probed machine
There is no code enabling DMIC clock in systems that don't provide platform
data for rt5640 after commit 71d97a7943 ("ASoC: rt5640: Use the platform
data for DMIC settings").

I think it's worth to keep this static DMIC clock and alternative data pin
setting during probe time. For making possible to use DMIC from ACPI probed
machine (prior ACPI 5.1 with _DSD) this patch moves DMIC configuration to
new exported rt5640_dmic_enable() that machine drivers can call.

Please note, this patch moves DMIC configuration from i2c probe to codec
probe in case platform data for rt5640 is set.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Cc: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-10-01 17:03:24 +01:00
Jarkko Nikula
f4821e8e8e ASoC: rt5640: Do not allow regmap to use bulk read-write operations
Debugging showed Realtek RT5642 doesn't support autoincrementing writes so
driver should set the use_single_rw flag for regmap.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Cc: stable@vger.kernel.org
2014-08-27 13:00:26 +01:00
Axel Lin
1657caf5d8 ASoC: rt5640: Remove unneeded goto in rt5640_i2c_probe
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-06-21 11:31:06 +01:00
Mark Brown
770b65c3da Merge remote-tracking branches 'asoc/topic/rl6231' and 'asoc/topic/rt5677' into asoc-next 2014-06-03 10:39:55 +01:00
Oder Chiou
d92950e755 ASoC: rt5640: Add the function "get_clk_info" to RL6231 shared support
The patch adds the function "get_clk_info" to RL6231 shared support.

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-06-01 20:04:30 +01:00
Oder Chiou
71c7a2d675 ASoC: rt5640: Add the function of the PLL clock calculation to RL6231 shared support
The patch adds the function of the PLL clock calculation to RL6231 shared
support.

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-06-01 20:04:30 +01:00
Oder Chiou
49ef7925c2 ASoC: rt5640: Add RL6231 class device shared support for RT5640, RT5645 and RT5651
The patch adds the RL6231 class device shared support for RT5640, RT5645 and
RT5651. The function of the DMIC clock calculation can be shared by RL6231
shared support.

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-06-01 20:04:30 +01:00
Mark Brown
6f821c6449 Merge remote-tracking branches 'asoc/topic/nuc900', 'asoc/topic/omap', 'asoc/topic/pxa', 'asoc/topic/rcar', 'asoc/topic/rt5640' and 'asoc/topic/rt5645' into asoc-next 2014-05-22 00:23:57 +01:00
Mark Brown
6630f30ed5 Merge remote-tracking branches 'asoc/topic/headers', 'asoc/topic/intel', 'asoc/topic/jz4740', 'asoc/topic/max98090', 'asoc/topic/max98095', 'asoc/topic/mc13783' and 'asoc/topic/multicodec' into asoc-next 2014-05-22 00:23:54 +01:00
Bard Liao
57f174f47e ASoC: rt5640: add default case for unexpected ID
We may read an unexpected value when detemining which codec is attached.
In that case, either a unsupported codec is attached or something wrong
with I2C. The driver will not work properly on both cases. So we return
an error for that.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-12 22:09:30 +01:00
Oder Chiou
33fcec2920 ASoC: rt5640: Add the rt5639 support to the OF match table
The patch adds the rt5639 support to the OF match table.

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-28 10:08:09 +01:00
Bard Liao
8bfc6d2d1b ASoC: rt5640: Add minimal support for RT5642
We have been using rt5640.c codec driver with RT5642 codec chip before commit
022d21f004 ("ASoC: rt5640: add rt5639 support"). That commits starts using
device ID reading in reset register for adding device specific controls and
routes runtime.

Now since device ID appears to be different between RT5640 and RT5642 the
driver doesn't add those controls and routes that are valid also on RT5642.

Fix this by adding a device ID found by debugging and minimal code for
supporting RT5642.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-22 12:52:08 +01:00
Lars-Peter Clausen
712fb1c27d ASoC: rt5640: Replace usage deprecated MUX/ENUM macros
SND_SOC_DAPM_VALUE_MUX and SOC_DAPM_VALUE_ENUM are deprecated and merely an
alias for SND_SOC_DAPM_MUX and SOC_DAPM_ENUM. Replace the deprecated macros so
we can eventually remove their definition.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-14 20:40:05 +01:00
Sachin Kamat
affb74ad29 ASoC: rt5640: Include of.h
of_match_ptr is defined in of.h. Include it explicitly.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-14 20:35:13 +01:00
Oder Chiou
b0c2784697 ASoC: rt5640: Add the string "rt5639" to the list of I2C device IDs
The patch adds the string "rt5639" to the list of I2C device IDs.

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-14 17:27:42 +01:00
Oder Chiou
022d21f004 ASoC: rt5640: add rt5639 support
This patch adds the rt5639 support

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-14 17:27:42 +01:00
Oder Chiou
09caf30054 ASoC: rt5640: Change the setting method of idle_bias_off
The patch moves the idle_bias_off setting to struct "soc_codec_dev_rt5640".

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-14 17:27:42 +01:00
Oder Chiou
3441e52429 ASoC: rt5640: Remove the unnecessary parentheses
The patch removes the unnecessary parentheses.

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-14 17:27:41 +01:00
Oder Chiou
acf04e639b ASoC: rt5640: Remove the unused or incorrect setting of clock source
The patch removes the unused or incorrect setting of clock source.

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-14 17:27:41 +01:00
Oder Chiou
218a3f9638 ASoC: rt5640: Rename the function of clock checking
In order to identify clearly, the patch renames the function
"check_sysclk1_source" to "is_sys_clk_from_pll".

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-14 17:27:41 +01:00
Oder Chiou
2f2a714c1b ASoC: rt5640: Remove the pre-allocated size of reg_default
In order to prevent the redundant memory usage, the pre-allocated size of
reg_default should be remove.

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-14 17:27:41 +01:00
Oder Chiou
71d97a7943 ASoC: rt5640: Use the platform data for DMIC settings
The patch uses the platform data for DMIC settings.

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-14 17:27:41 +01:00
Oder Chiou
9bccae733b ASoC: rt5640: Correct the judgement of data length
The patch corrects the judgement of data length.

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-14 17:27:40 +01:00
Oder Chiou
4c9185be5e ASoC: rt5640: Move cache sync() to resume()
The patch fixes the defect in case of resume which doesn't sync the cache.

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-14 17:27:40 +01:00
Stephen Warren
03a620d8fa ASoC: rt5640: add an of_match table
Add a device tree match table. This serves to make the driver's support
of device tree more explicit. Perhaps the fallback for DT matching to
using the i2c_device_id table will go away one day, since it fails in
face of devices from different vendors with the same name.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-31 18:27:14 +01:00
Mark Brown
f928badf5e Merge remote-tracking branch 'asoc/topic/codecs' into asoc-next 2014-03-23 14:00:47 +00:00
Lars-Peter Clausen
ab64246cf8 ASoC: codecs: Replace instances of rtd->codec with dai->codec
With CODEC to CODEC links rtd->codec does not necessarily point to the driver's
CODEC. CODEC drivers should always use dai->codec and never even look at the PCM
runtime.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Acked-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-18 12:47:49 +00:00
Mark Brown
2620954d64 Merge remote-tracking branch 'asoc/topic/io' into asoc-next 2014-03-13 14:19:21 +00:00
Mark Brown
b8f861586c Merge remote-tracking branch 'asoc/topic/enum' into asoc-next 2014-03-12 23:03:59 +00:00
Xiubo Li
5d6be5aa6b ASoC: codec: Simplify ASoC probe code.
For some CODEC drivers like who act as the MFDs children are ignored
by this patch.

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-11 09:59:05 +00:00
Takashi Iwai
4c03cb6f86 ASoC: rt5640: Remove superfluous const
As SOC_ENUM_SINGLE_DECL() itself contains const modifier now, we can
reduce const from its users.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-20 10:43:24 +09:00