Commit Graph

34 Commits

Author SHA1 Message Date
David Frey
1c96a2f67c
regmap: split up regmap_config.use_single_rw
Split regmap_config.use_single_rw into use_single_read and
use_single_write. This change enables drivers of devices which only
support bulk operations in one direction to use the regmap_bulk_*()
functions for both directions and have their bulk operation split into
single operations only when necessary.

Update all struct regmap_config instances where use_single_rw==true to
instead set both use_single_read and use_single_write. No attempt was
made to evaluate whether it is possible to set only one of
use_single_read or use_single_write.

Signed-off-by: David Frey <dpfrey@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-07 13:03:55 +01:00
Bard Liao
20ebbd2f89
ASoC: rt5665: remove rt5668 support
Remove rt5668 support from rt5665 codec driver since rt5668 will
not go into mass production.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-02-12 11:48:26 +00:00
Kuninori Morimoto
fab70c273d
ASoC: rt5665: replace codec to component
Now we can replace Codec to Component. Let's do it.

Note:
	xxx_codec_xxx()		->	xxx_component_xxx()
	.idle_bias_off = 1	->	.idle_bias_on = 0
	.ignore_pmdown_time = 0	->	.use_pmdown_time = 1
	-			->	.endianness = 1
	-			->	.non_legacy_dai_naming = 1

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-02-12 09:46:34 +00:00
Mark Brown
55eafeb5cd Merge remote-tracking branches 'asoc/topic/rt5665', 'asoc/topic/rt5670', 'asoc/topic/rt5677' and 'asoc/topic/samsung' into asoc-next 2017-09-01 12:13:03 +01:00
Mark Brown
6329b1bb4e Linux 4.13-rc6
-----BEGIN PGP SIGNATURE-----
 
 iQEcBAABAgAGBQJZmfubAAoJEHm+PkMAQRiGXb8H/jwRZuCz1qo/JNklzrMl33yE
 zU7QCdDDO0I9Uic6DKcOifo2w/cn1fOCWCqAyJyrFddBLvWFsfBoh+7AOoOy5oV5
 xnVwenhIMWiz+/4EUxWdNgXEREG4Gfk7FymiKyqA4XwJuBYoEd51CoaUTBbLQTMR
 g8ZnqgJQrSuqMp4HBLQEXGjYvCJmz0VoTKbZ0U1s++sQxv8g4q7PlU2Y5z55lRXp
 1P/juRoOTccpZcijhs/Y6g9GbuIi/rgcZR8ZpcSsN3zPJtAwx+LxOXgBnTcwhDbi
 O/o2mQ4hZUMMKVOA6K1lHKsCPVacfwcouL7SU/SgBxvYXVTPjWWt9kMlTZxzohE=
 =Wkg4
 -----END PGP SIGNATURE-----

Merge tag 'v4.13-rc6' into asoc-msm8916

Linux 4.13-rc6
2017-08-21 19:32:58 +01:00
Bhumika Goyal
a180ba45b1 ASoC: codecs: add const to snd_soc_codec_driver structures
Declare snd_soc_codec_driver structures as const as they are only passed
as an argument to the function snd_soc_register_codec. This argument is
of type const, so declare the structures with this property as const.
In file codecs/sn95031.c, snd_soc_codec_driver structure is also used in
a copy operation along with getting passed to snd_soc_register_codec.
So, it can be made const too.
Done using Coccinelle:

@match disable optional_qualifier@
identifier s;
position p;
@@
static struct snd_soc_codec_driver s@p={...};

@good1@
identifier match.s;
position p;
@@
snd_soc_register_codec(...,&s@p,...)

@bad@
identifier match.s;
position p!={match.p,good1.p};
@@
s@p

@depends on !bad disable optional_qualifier@
identifier match.s;
@@
static
+const
struct snd_soc_codec_driver s={...};

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-08-10 16:10:50 +01:00
Bard Liao
7e5824c934 ASoC: rt5665: fix wrong register for bclk ratio control
The register of setting back ratio should be RT5665_ADDA_CLK_2
instead of RT5665_ADDA_CLK_1.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-08-01 12:32:09 +01:00
Arvind Yadav
abfedab116 ASoC: rt5665: constify acpi_device_id.
acpi_device_id are not supposed to change at runtime. All functions
working with acpi_device_id provided by <acpi/acpi_bus.h> work with
const acpi_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-07-24 16:34:53 +01:00
Bard Liao
b833786b69 ASoC: rt5665: add MONOVOL Playback Volume control
MONOVOL Playback Volume is a playback volume control on "MONOVOL MIX".

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-07-24 13:06:14 +01:00
Bard Liao
8bfa426845 ASoC: rt5665: add clock sync control for master mode
We can sleect the i2s clock source for each i2s bus in master mode.
The choice is depended on the HW design and the use case.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-07-20 13:21:31 +01:00
Bard Liao
01dfb1ec15 ASoC: rt5665: add clcok control for master mode
Add i2s clock control for codec master mode.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-07-20 13:21:28 +01:00
Bard Liao
fa05899c12 ASoC: rt5665: force using PLL if MCLK is not suitable
Idealy PLL will be set in machine driver if MCLK doesn't meet the
requirement of codec. To let the codec driver be more general, we
can use a common PLL setting once sysclk/pll doesn't set properly
in machine driver.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-07-17 15:24:55 +01:00
Bard Liao
b059ca720e ASoC: rt5665: calibration should be done before jack detection
We will set some volatile registers in jack detection function. But
those volatile registers will be clear in rt5665_calibrate function
because we set cache bypass and reset codec in rt5665_calibrate function.
This patch add a flag to make sure that rt5665_calibrate is done
before starting jack detection.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-06-30 12:36:38 +01:00
Wei Yongjun
18fe786976 ASoC: rt5665: make local symbol rt5665_i2c_driver static
Fixes the following sparse warnings:

sound/soc/codecs/rt5665.c:4928:19: warning:
symbol 'rt5665_i2c_driver' was not declared. Should it be static?

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-17 10:31:22 +01:00
Geert Uytterhoeven
b98ae9ad55 ASoC: rt5665: Fix uninitialized warning in rt5665_i2s_pin_event()
With gcc 4.1.2:

    sound/soc/codecs/rt5665.c: In function ‘rt5665_i2s_pin_event’:
    sound/soc/codecs/rt5665.c:2610: warning: ‘mask1’ may be used uninitialized in this function
    sound/soc/codecs/rt5665.c:2610: warning: ‘val2’ may be used uninitialized in this function
    sound/soc/codecs/rt5665.c:2610: warning: ‘val1’ may be used uninitialized in this function

The first one is currently a false positive, as rt5665_i2s_pin_event()
is never called with snd_soc_dapm_widget.shift set to a value not
handled by the switch() statement.  But that may change, so
preinitialize mask1 to fix this, like is already done for mask2.

The last two are false-positives, the compiler is just not smart enough
to notice the mask and val variables are always used together.

Fixes: 9b5d3865b3 ("ASoC: rt5665: set i2s pin share configuration")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-17 10:11:45 +01:00
Bard Liao
30b7d88de0 ASoC: rt5665: add ADC STO2 ASRC support
"ADC Stereo2 Filter" is with ASRC supported.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-14 19:14:52 +09:00
Arnd Bergmann
27a655c4bd ASoC: rt5665: fix gcc-7 warning
gcc-7 warns that there is a duplicate 'const' specifier in some
variables that are declared using the SOC_ENUM_SINGLE_DECL macro:

sound/soc/codecs/rt5665.c:915:14: error: duplicate 'const' declaration specifier [-Werror=duplicate-decl-specifier]
 static const SOC_ENUM_SINGLE_DECL(rt5665_if1_1_01_adc_enum,
sound/soc/codecs/rt5665.c:918:14: error: duplicate 'const' declaration specifier [-Werror=duplicate-decl-specifier]
 static const SOC_ENUM_SINGLE_DECL(rt5665_if1_1_23_adc_enum,
sound/soc/codecs/rt5665.c:921:14: error: duplicate 'const' declaration specifier [-Werror=duplicate-decl-specifier]
 static const SOC_ENUM_SINGLE_DECL(rt5665_if1_1_45_adc_enum,
sound/soc/codecs/rt5665.c:924:14: error: duplicate 'const' declaration specifier [-Werror=duplicate-decl-specifier]
 static const SOC_ENUM_SINGLE_DECL(rt5665_if1_1_67_adc_enum,
...

This removes one to fix the 68 warnings in this file

Fixes: 33ada14a26 ("ASoC: add rt5665 codec driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-14 18:37:01 +09:00
Mark Brown
cce9b271e5 Merge remote-tracking branch 'asoc/topic/rt5665' into asoc-next 2017-04-30 22:15:43 +09:00
Bard Liao
97c415a6f6 ASoC: rt5665: move rt5665_set_jack_detect to .set_jack
Now, we can use .set_jack callback function on codec level. So we
don't need export rt5665_set_jack_detect.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-11 17:05:20 +01:00
Bard Liao
17febfa607 ASoC: rt5665: fix wrong pre div reg of IF2 and IF3
The pre divider control register of IF1 and IF2/3 are different.
The driver used the same register for all interfaces which was a
mistake.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-20 11:25:23 +00:00
Bard Liao
83749abaaf ASoC: rt5665: fix wrong shift rt5665_if2_1_adc_in_enum
The shift is RT5665_IF2_1_ADC_IN_SFT not RT5665_IF3_ADC_IN_SFT.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-20 11:25:05 +00:00
Bard Liao
9b5d3865b3 ASoC: rt5665: set i2s pin share configuration
I2S2 and I2S3 are share pins. We need to configure it when i2s is
active and disable it when i2s is inactive. To disable i2s pins
means to set them as gpio.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-16 14:08:04 +00:00
Bard Liao
28d2ca39be ASoC: rt5665: move set_sysclk to codec level
Move set_sysclk to codec level and people can use it at both
codec and dai level.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-13 16:56:13 +00:00
Bard Liao
ccd00d5911 ASoC: rt5665: move set_pll to codec level
Move set_pll function to codec level and people can use it at both
codec and dai level. Also, lower case "source" to keep it consistent.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-13 16:56:12 +00:00
Bard Liao
39841944c6 ASoC: rt5665: enhance jack type detection function
Use manual mode for jack detection function to increase accuracy.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-08 13:48:03 +01:00
Bard Liao
948059ddf9 ASoC: rt5665: enable TDM if more than 2 channels
TDM is necessary for more than 2 channels. And there is no control bit
to specify which slots are using. Machine driver will not need to call
snd_soc_dai_set_tdm_slot if we do it in rt5665_hw_params.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-08 13:47:53 +01:00
Bard Liao
246126b0a4 ASoC: rt5665: increase button detection accuracy
Use sar adc for button detection to increase accuracy.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-08 13:47:52 +01:00
Bard Liao
09b50c3703 ASoC: rt5665: CLKDET is also a power of ASRC
We need to power on CLKDET to use ASRC function.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-08 13:45:14 +01:00
Bard Liao
8f365313be ASoC: rt5665: Vref3 is necessary for Mono Amp
Vref3 is necessary for Mono Amp. So add it to dapm routes

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-08 13:45:14 +01:00
Bard Liao
593dd5d9fb ASoC: rt5665: increase LDO level
Too low LDO level will cause a few functions unstable.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-08 13:45:13 +01:00
Bard Liao
f1994a9c09 ASoC: rt5665: fix getting wrong work handler container
We got rt5665 private data from wrong work. It will result in kernel
panic.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
2017-03-08 13:44:10 +01:00
Axel Lin
f2826c1fe5 ASoC: rt5665: Use devm_gpio_request_one()
Simplify the code a bit.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-11-16 16:27:29 +00:00
Axel Lin
0c95666f0d ASoC: rt5665: Fix missing mutex_unlock in rt5665_calibrate
Reported-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-11-16 16:27:29 +00:00
Bard Liao
33ada14a26 ASoC: add rt5665 codec driver
This is the initial codec driver for rt5665.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-11-14 11:37:57 +00:00