Commit Graph
22 Commits
Author SHA1 Message Date
Yong Zhi e44f3d49f9 ASoC: max98373: replace gpio_request with devm_gpio_request
Use devm_gpio_request() to automatic unroll when fails and avoid
resource leaks at error paths.

Signed-off-by: Yong Zhi <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2019-11-05 18:52:41 +00:00
Sathyanarayana Nujella 4bb41984bf ASoC: max98373: check for device node before parsing
Below Oops is caused in a system which uses ACPI instead of device node:

of_get_named_gpiod_flags: can't parse 'maxim,reset-gpio' property of node '(null)[0]'
BUG: kernel NULL pointer dereference, address: 0000000000000010

This patch avoids NULL pointer deferencing by adding a check before parsing
and initializes to make reset-gpio pin as invalid.

Signed-off-by: Sathyanarayana Nujella <[email protected]>
Signed-off-by: Jairaj Arava <[email protected]>
Link: https://lore.kernel.org/r/1569702150-11976-1-git-send-email-sathyanarayana.nujella@intel.com
Signed-off-by: Mark Brown <[email protected]>
2019-10-01 12:45:33 +01:00
Mark Brown dd28d54c24 Merge branch 'asoc-5.3' into asoc-5.4 2019-08-20 18:28:43 +01:00
Mark Brown 7c0767643f ASoC: max98373: Remove executable bits
Signed-off-by: Mark Brown <[email protected]>
2019-08-06 11:15:06 +01:00
fengchunguo b9da500bde ASoC: max98373: add 88200 and 96000 sampling rate support
88200 and 96000 sampling rate was not enabled on driver, so can't be played.

The error information:
max98373 3-0031:rate 96000 not supported
max98373 3-0031:ASoC: can't set max98373-aif1 hw params: -22

Signed-off-by: fengchunguo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2019-07-31 12:02:05 +01:00
fengchunguo 96cd3b97bf ASoC: max98383: fix i2c probe failure
Added reset_gpio configuration for i2c probe successfully.
If not,i2c address can't be found rightly.

Error information:
max98373 3-0031: Failed to read: 0x21FF

Fixed:
[3.761299@3] max98373 3-0031: MAX98373 revisionID: 0x43
[3.828911@3] asoc-aml-card auge_sound: max98373-aif1 <-> TDM-B mapping ok

Signed-off-by: fengchunguo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2019-07-22 13:26:15 +01:00
Pierre-Louis Bossart 7c3727ba7d ASoC: max98383: fix boolean assignments to true/false
Reported by Coccinelle:

sound/soc/codecs/max98373.c:411:2-20: WARNING: Assignment of bool to 0/1
sound/soc/codecs/max98373.c:922:2-27: WARNING: Assignment of bool to 0/1
sound/soc/codecs/max98373.c:924:2-27: WARNING: Assignment of bool to 0/1

Signed-off-by: Pierre-Louis Bossart <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2019-01-07 16:51:17 +00:00
Ryan Lee 20f2ab247d ASoC: max98373: Added max98373_reset for stable amp reset
This patch added max98373_reset function to avoid amp software reset failure and code duplication.
Reset verification step has been added for stable amp reset and it repeats verification maximum 3 times when it is failed.
Chip revision ID is available when the amp is in the idle state which means software reset is completed well.
Additional 10ms delay was added for every retrial and maximum 30ms delay can be applied.

Signed-off-by: Ryan Lee <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2018-12-04 16:29:49 +00:00
Ryan Lee a23f5dc844 ASoC: max98373: Sort DHT Rot Pnt Volume in reverse order
Signed-off-by: Ryan Lee <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2018-10-11 15:37:39 +01:00
Ryan Lee d34c8f37c7 ASoC: max98373: Sort max98373_bde_gain_tlv in reverse order
Signed-off-by: Ryan Lee <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2018-10-11 15:37:38 +01:00
Ryan Lee 6c3beeca42 ASoC: max98373: Sort BDE Limiter Thresh Volume in reverse order
Signed-off-by: Ryan Lee <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2018-10-11 15:37:38 +01:00
Ryan Lee 4cbbc91609 ASoC: max98373: Sort Digital Volume in reverse order
Signed-off-by: Ryan Lee <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2018-10-11 15:37:36 +01:00
Grant Grundler 3004136b90 ASoC: max98373: usleep_range() needs include/delay.h
Commit ca917f9fe1 added use of usleep_range() but not
the corresponding "include <linux/delay.h>". The result is
with Chrome OS won't build because warnings are forced
to be errors:
mnt/host/source/src/third_party/kernel/v4.4/sound/soc/codecs/max98373.c:734:2: error: implicit declaration of function 'usleep_range' [-Werror,-Wimplicit-function-declaration]
        usleep_range(10000, 11000);
        ^

Including delay.h "fixes" this.

Signed-off-by: Grant Grundler <[email protected]>
Reviewed-by: Benson Leung <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2018-09-07 17:04:10 +01:00
Ryan Lee ca917f9fe1 ASoC: max98373: Added 10ms sleep after amp software reset
Signed-off-by: Ryan Lee <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2018-08-28 20:02:01 +01:00
Ryan Lee 0d22825255 ASoC: max98373: Added speaker FS gain cotnrol register to volatile.
Signed-off-by: Ryan Lee <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2018-08-16 12:09:58 +01:00
Ryan Lee 0717edbdfe ASoC: max98373: Added software reset register to readable registers
Signed-off-by: Ryan Lee <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2018-08-08 10:54:03 +01:00
Kuninori Morimoto 41572b5455 ASoC: max98373: 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 = 0	->	.idle_bias_on = 1
	.ignore_pmdown_time = 0	->	.use_pmdown_time = 1
	-			->	.endianness = 1
	-			->	.non_legacy_dai_naming = 1

Signed-off-by: Kuninori Morimoto <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2018-02-12 09:50:09 +00:00
Ryan Lee 180cad3c58 ASoC: max98373 Changed SPDX header in C++ comments style
Signed-off-by: Ryan Lee <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2018-01-22 12:23:45 +00:00
Ryan Lee b6158323bb ASoC: max98373: Modified control names for TLV controls
Signed-off-by: Ryan Lee <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2018-01-10 10:26:37 +00:00
Ryan Lee 3831a5b87f ASoC: max98373: Added TDM off if parameters are all zeroes
Signed-off-by: Ryan Lee <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2018-01-10 10:26:23 +00:00
Ryan Lee e1053262cf ASoC: max98373: Added missing blank lines
Signed-off-by: Ryan Lee <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2018-01-10 10:25:53 +00:00
Ryan Lee 2f3d24a135 ASoC: max98373: Added Amplifier Driver
Signed-off-by: Ryan Lee <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2018-01-04 17:17:06 +00:00