Takashi Iwai
69b638e8d4
ASoC: max98390: Convert to SYSTEM_SLEEP_PM_OPS()
...
Use the newer SYSTEM_SLEEP_PM_OPS() macro instead of
SET_SYSTEM_SLEEP_PM_OPS() together with pm_ptr(), which allows us
dropping superfluous CONFIG_PM_SLEEP ifdefs.
This optimizes slightly when CONFIG_PM is disabled, too.
Signed-off-by: Takashi Iwai <tiwai@suse.de >
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com >
Link: https://patch.msgid.link/20250317095603.20073-23-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org >
2025-03-17 10:14:06 +00:00
Andy Shevchenko
d52378dda7
ASoC: codecs: Remove unused of_gpio.h
...
of_gpio.h is deprecated and subject to remove. The drivers in question
don't use it, simply remove the unused header.
Reviewed-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com >
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com >
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Link: https://lore.kernel.org/r/20240605221446.2624964-2-andriy.shevchenko@linux.intel.com
Acked-by: Heiko Stuebner <heiko@sntech.de >
Signed-off-by: Mark Brown <broonie@kernel.org >
2024-06-10 12:48:36 +01:00
Uwe Kleine-König
ba2a2c378a
ASoC: codecs: Drop explicit initialization of struct i2c_device_id::driver_data to 0
...
These drivers don't use the driver_data member of struct i2c_device_id,
so don't explicitly initialize this member.
This prepares putting driver_data in an anonymous union which requires
either no initialization or named designators. But it's also a nice
cleanup on its own.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de >
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com >
Link: https://lore.kernel.org/r/20240502074722.1103986-2-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org >
2024-05-03 11:08:06 +09:00
Uwe Kleine-König
9abcd24002
ASoC: Switch i2c drivers back to use .probe()
...
After commit b8a1a4cd5a ("i2c: Provide a temporary .probe_new()
call-back type"), all drivers being converted to .probe_new() and then
03c835f498 ("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
2023-05-08 08:48:49 +09:00
Peter Ujfalusi
9dd28b467c
ASoC: max98390: Fix dsm calibration reading
...
With the change introduced by 6ac246105b , 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: 6ac246105b ("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 >
2022-09-19 15:08:07 +01:00
Steve Lee
6ac246105b
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 >
2022-09-08 11:39:42 +01:00
Charles Keepax
d2d3219ebe
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 >
2022-06-27 13:17:02 +01:00
Randy Dunlap
aa7407f807
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: 397ff02496 ("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 >
2022-06-06 12:38:36 +01:00
Steve Lee
397ff02496
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 >
2022-04-21 15:52:56 +01:00
Stephen Kitt
fead49e33b
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 >
2022-04-11 19:18:12 +01:00
Mark Brown
c536d745ad
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 >
2022-02-28 13:34:08 +00:00
Wolfram Sang
0f9a84b20f
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 >
2021-09-20 15:46:40 +01:00
Steve Lee
a10facb752
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 >
2021-08-09 16:06:48 +01:00
Steve Lee
e5870bd0e4
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 >
2021-04-06 17:13:28 +01:00
Dan Carpenter
3cea33b6f2
ASoC: max98390: Fix error codes in max98390_dsm_init()
...
These error paths return success but they should return -EINVAL.
Fixes: 97ed3e509e ("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 >
2020-12-09 12:12:58 +00:00
Mark Brown
3d026a8a59
Merge series "ASoC: meson: tdm fixes" from Jerome Brunet <jbrunet@baylibre.com>:
...
This patcheset is collection of fixes for the TDM input and output the
axg audio architecture. Its fixes:
- slave mode format setting
- g12 and sm1 skew offset
- tdm clock inversion
- standard daifmt props names which don't require a specific prefix
Jerome Brunet (4):
ASoC: meson: axg-tdm-interface: fix link fmt setup
ASoC: meson: axg-tdmin: fix g12a skew
ASoC: meson: axg-tdm-formatters: fix sclk inversion
ASoC: meson: cards: remove DT_PREFIX for standard daifmt properties
sound/soc/meson/axg-tdm-formatter.c | 11 ++++++-----
sound/soc/meson/axg-tdm-formatter.h | 1 -
sound/soc/meson/axg-tdm-interface.c | 26 +++++++++++++++++---------
sound/soc/meson/axg-tdmin.c | 16 +++++++++++++++-
sound/soc/meson/axg-tdmout.c | 3 ---
sound/soc/meson/meson-card-utils.c | 2 +-
6 files changed, 39 insertions(+), 20 deletions(-)
--
2.25.4
2020-07-30 21:00:36 +01:00
Steve Lee
aa78570568
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 >
2020-07-24 15:22:33 +01:00
Steve Lee
dc5fb6d2e8
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 >
2020-07-24 14:24:14 +01:00
Pierre-Louis Bossart
ce7ed845eb
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 >
2020-07-09 21:56:49 +01:00
Steve Lee
9ba4af79c9
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 >
2020-06-15 20:58:40 +01:00
Steve Lee
4008b29eb4
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 >
2020-06-11 15:39:30 +01:00
Steve Lee
97ed3e509e
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 >
2020-06-04 15:04:30 +01:00
Takashi Iwai
678916ec54
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: a6e3f4f34c ("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 >
2020-06-04 14:42:31 +01:00
Steve Lee
a6e3f4f34c
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 >
2020-05-25 15:31:08 +01:00