History log of /linux-master/sound/soc/codecs/max98390.c
Revision Date Author Comments
# 9abcd240 25-Apr-2023 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

ASoC: Switch i2c drivers back to use .probe()

After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new()
call-back type"), all drivers being converted to .probe_new() and then
03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert
back to (the new) .probe() to be able to eventually drop .probe_new() from
struct i2c_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de
Link: https://lore.kernel.org/r/20230425095716.331419-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org


# 9dd28b46 16-Sep-2022 Peter Ujfalusi <peter.ujfalusi@linux.intel.com>

ASoC: max98390: Fix dsm calibration reading

With the change introduced by 6ac246105b4f, the calibration can only be
done after the codec probe (but questionable if it is working since
203A_AMP_EN is 0) or when the codec is powered up for audio use, in other
cases "AMP is not ready to run calibration" is printed.

This changes how this worked before the patch: the codec was force powered
on for the duration of the calibration readout, then shut down.
So, if a calibration was asked when the codec was active, it would have
powered it down?

To correct the calibration logic: check if the codec is powered on and if
it is not then enable it, do the readout and put it back to disabled.
Do this while keeping the dapm locked to avoid interfering with normal
operation via DAPM.

Fixes: 6ac246105b4f ("ASoC: max98390: Remove unnecessary amp on/off conrtol")
Reported-by: Fred Oh <fred.oh@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20220916111349.4433-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 6ac24610 08-Sep-2022 Steve Lee <steve.lee.analog@gmail.com>

ASoC: max98390: Remove unnecessary amp on/off conrtol

The Amp is already control in userspace before trigger calibrate function.
Remove unnecessary control in calibrate function and
add condition to check calibration is ready.

Signed-off-by: Steve Lee <steve.lee.analog@gmail.com>
Link: https://lore.kernel.org/r/20220908060359.13606-1-steve.lee.analog@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# d2d3219e 23-Jun-2022 Charles Keepax <ckeepax@opensource.cirrus.com>

ASoC: max*: Remove now redundant non_legacy_dai_naming flag

The ASoC core has now been changed to default to the non-legacy DAI
naming, as such drivers using the new scheme no longer need to specify
the non_legacy_dai_naming flag.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220623125250.2355471-53-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# aa7407f8 05-Jun-2022 Randy Dunlap <rdunlap@infradead.org>

ASoC: max98390: use linux/gpio/consumer.h to fix build

Change the header file to fix build errors in max98390.c:

../sound/soc/codecs/max98390.c: In function 'max98390_i2c_probe':
../sound/soc/codecs/max98390.c:1076:22: error: implicit declaration of function 'devm_gpiod_get_optional'; did you mean 'devm_regulator_get_optional'? [-Werror=implicit-function-declaration]
1076 | reset_gpio = devm_gpiod_get_optional(&i2c->dev,
../sound/soc/codecs/max98390.c:1077:55: error: 'GPIOD_OUT_HIGH' undeclared (first use in this function); did you mean 'GPIOF_INIT_HIGH'?
1077 | "reset", GPIOD_OUT_HIGH);
../sound/soc/codecs/max98390.c:1077:55: note: each undeclared identifier is reported only once for each function it appears in
../sound/soc/codecs/max98390.c:1083:17: error: implicit declaration of function 'gpiod_set_value_cansleep'; did you mean 'gpio_set_value_cansleep'? [-Werror=implicit-function-declaration]
1083 | gpiod_set_value_cansleep(reset_gpio, 0);

Fixes: 397ff0249606 ("ASoC: max98390: Add reset gpio control")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reported-by: kernel test robot <lkp@intel.com>
Cc: Steve Lee <steve.lee.analog@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: alsa-devel@alsa-project.org
Link: https://lore.kernel.org/r/20220605163123.23537-1-rdunlap@infradead.org
Signed-off-by: Mark Brown <broonie@kernel.org>


# 397ff024 19-Apr-2022 Steve Lee <steve.lee.analog@gmail.com>

ASoC: max98390: Add reset gpio control

Add reset gpio control to support RESET PIN connected to gpio.

Signed-off-by: Steve Lee <steve.lee.analog@gmail.com>
Acked-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20220420044900.2989-1-steve.lee.analog@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# fead49e3 05-Apr-2022 Stephen Kitt <steve@sk2.org>

ASoC: max9*: use simple i2c probe function

The i2c probe functions here don't use the id information provided in
their second argument, so the single-parameter i2c probe function
("probe_new") can be used instead.

This avoids scanning the identifier tables during probes.

Signed-off-by: Stephen Kitt <steve@sk2.org>
Link: https://lore.kernel.org/r/20220405165836.2165310-6-steve@sk2.org
Signed-off-by: Mark Brown <broonie@kernel.org>


# c536d745 22-Feb-2022 Mark Brown <broonie@kernel.org>

ASoC: max98390: Use modern ASoC DAI format terminology

As part of moving to remove the old style defines for the bus clocks update
the max98390 driver to use more modern terminology for clocking.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20220222234026.712070-4-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>


# 0f9a84b2 18-Sep-2021 Wolfram Sang <wsa+renesas@sang-engineering.com>

ASoC: codecs: max98390: simplify getting the adapter of a client

We have a dedicated pointer for that, so use it. Much easier to read and
less computation involved.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20210918213553.14514-2-wsa+renesas@sang-engineering.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# a10facb7 09-Aug-2021 Steve Lee <steves.lee@maximintegrated.com>

ASoC: max98390: Add support change dsm param name

In case of using different type of speaker, support
using different dsm parameter bin file for each amp connected.

Signed-off-by: Steve Lee <steves.lee@maximintegrated.com>
Link: https://lore.kernel.org/r/20210809142140.9293-1-steves.lee@maximintegrated.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# e5870bd0 05-Apr-2021 Steve Lee <steves.lee@maximintegrated.com>

ASoC: max98390: Add support for tx slot configuration.

Update voltage/current tx slot configuration support.

Signed-off-by: Steve Lee <steves.lee@maximintegrated.com>
Link: https://lore.kernel.org/r/20210405143801.29770-1-steves.lee@maximintegrated.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 3cea33b6 08-Dec-2020 Dan Carpenter <dan.carpenter@oracle.com>

ASoC: max98390: Fix error codes in max98390_dsm_init()

These error paths return success but they should return -EINVAL.

Fixes: 97ed3e509ee6 ("ASoC: max98390: Fix potential crash during param fw loading")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/X9B0uz4svyNTqeMb@mwanda
Signed-off-by: Mark Brown <broonie@kernel.org>


# aa785705 24-Jul-2020 Steve Lee <steves.lee@maximintegrated.com>

ASoC: max98390: Update dsm init sequence and condition.

Modify dsm_init sequence and dsm param bin check condition.
- Move dsm_init() to after amp init setting to
make sure dsm init is last setting.
- dsm param bin check condition changed for extended register setting.

Signed-off-by: Steve Lee <steves.lee@maximintegrated.com>
Link: https://lore.kernel.org/r/20200724060149.19261-1-steves.lee@maximintegrated.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# dc5fb6d2 24-Jul-2020 Steve Lee <steves.lee@maximintegrated.com>

ASoC: max98390: Fix dac event dapm mixer.

Global EN register guide to off before AMP_EN register
when amp disable sequence.
- remove AMP_EN control before max98390_dac_event call

Signed-off-by: Steve Lee <steves.lee@maximintegrated.com>
Link: https://lore.kernel.org/r/20200724060058.19201-1-steves.lee@maximintegrated.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# ce7ed845 07-Jul-2020 Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

ASoC: codecs: max98390: fix 'defined but not used' warning

Fix W=1 warning and removed unused table. In this case this a
duplicate of

static const struct of_device_id max98390_of_match[] = {
{ .compatible = "maxim,max98390", },
{}
};
MODULE_DEVICE_TABLE(of, max98390_of_match);

already used in the rest of the code.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200707190612.97799-13-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 9ba4af79 11-Jun-2020 Steve Lee <steves.lee@maximintegrated.com>

ASoC: max98390: Add Amp init common setting func.

Add amp common init function to gather common init setting and finaize.
- add max98390_init_regs func
- move amp setting to max98390_init_regs func.
- removed unneceary setting and finalize common register values.

Signed-off-by: Steve Lee <steves.lee@maximintegrated.com>
Link: https://lore.kernel.org/r/20200611094718.18371-1-steves.lee@maximintegrated.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 4008b29e 11-Jun-2020 Steve Lee <steves.lee@maximintegrated.com>

ASoC: max98390: Update regmap readable reg and volatile

Update max98390_readable_register and max98390_volatile_reg

Signed-off-by: Steve Lee <steves.lee@maximintegrated.com>
Link: https://lore.kernel.org/r/20200611094800.18422-1-steves.lee@maximintegrated.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 97ed3e50 03-Jun-2020 Steve Lee <steves.lee@maximintegrated.com>

ASoC: max98390: Fix potential crash during param fw loading

malformed firmware file can cause out-of-bound access and crash
during dsm_param bin loading.
- add MIN/MAX param size to avoid out-of-bound access.
- read start addr and size of param and check bound.
- add condition that fw->size > param_size + _PAYLOAD_OFFSET
to confirm enough data.

Signed-off-by: Steve Lee <steves.lee@maximintegrated.com>
Link: https://lore.kernel.org/r/20200604054731.21140-1-steves.lee@maximintegrated.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 678916ec 02-Jun-2020 Takashi Iwai <tiwai@suse.de>

ASoC: max98390: Fix incorrect printf qualifier

This patch addresses a compile warning:
sound/soc/codecs/max98390.c:781:3: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 4 has type ‘size_t {aka const unsigned int}’ [-Wformat=]

Fixes: a6e3f4f34cdb ("ASoC: max98390: Added Amplifier Driver")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20200602164453.29925-1-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>


# a6e3f4f3 17-May-2020 Steve Lee <steves.lee@maximintegrated.com>

ASoC: max98390: Added Amplifier Driver

This is the initial amplifier driver for max98390.

Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Steve Lee <steves.lee@maximintegrated.com>
Link: https://lore.kernel.org/r/20200518005038.21074-1-steves.lee@maximintegrated.com
Signed-off-by: Mark Brown <broonie@kernel.org>