Takashi Iwai
113d29a944
ASoC: max98927: 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-27-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org >
2025-03-17 10:14:09 +00: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
Linus Walleij
ce22caa4a1
ASoC: max98927: Drop pointless includes
...
This driver is already using solely GPIO descriptors and
do not need to include the legacy headers <linux/gpio.h>
or <linux/of_gpio.h>. Drop them.
Signed-off-by: Linus Walleij <linus.walleij@linaro.org >
Link: https://lore.kernel.org/r/20230911-descriptors-asoc-max-v2-7-b9d793fb768e@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org >
2023-09-11 12:50:10 +01:00
Krzysztof Kozlowski
38b288ab45
ASoC: codecs: max9892x: Reformat to coding style
...
Reformat the code to match Linuxn coding style: re-indent continued
lines and stop too-early line wrapping, drop unneeded {} brackets. No
functional impact.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org >
Link: https://lore.kernel.org/r/20230730201826.70453-3-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org >
2023-08-07 14:41:04 +01:00
Krzysztof Kozlowski
ddef7518e7
ASoC: codecs: max9892x: Unify interleave mode OF property
...
MAX98926 and MAX98927 are quite similar and use the same bindings,
although drivers were not implementing them in the same way:
MAX98926 has boolean "interleave-mode" but MAX98927 has uint32
"interleave_mode". Unify them under maxim,interleave-mode, already used
in other Maxim device.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org >
Link: https://lore.kernel.org/r/20230730201826.70453-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org >
2023-08-07 14:41:03 +01: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
Uwe Kleine-König
ed5c2f5fd1
i2c: Make remove callback return void
...
The value returned by an i2c driver's remove function is mostly ignored.
(Only an error message is printed if the value is non-zero that the
error is ignored.)
So change the prototype of the remove function to return no value. This
way driver authors are not tempted to assume that passing an error to
the upper layer is a good idea. All drivers are adapted accordingly.
There is no intended change of behaviour, all callbacks were prepared to
return 0 before.
Reviewed-by: Peter Senna Tschudin <peter.senna@gmail.com >
Reviewed-by: Jeremy Kerr <jk@codeconstruct.com.au >
Reviewed-by: Benjamin Mugnier <benjamin.mugnier@foss.st.com >
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com >
Reviewed-by: Crt Mori <cmo@melexis.com >
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com >
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Acked-by: Marek Behún <kabel@kernel.org > # for leds-turris-omnia
Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Reviewed-by: Petr Machata <petrm@nvidia.com > # for mlxsw
Reviewed-by: Maximilian Luz <luzmaximilian@gmail.com > # for surface3_power
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com > # for bmc150-accel-i2c + kxcjk-1013
Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl > # for media/* + staging/media/*
Acked-by: Miguel Ojeda <ojeda@kernel.org > # for auxdisplay/ht16k33 + auxdisplay/lcd2s
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com > # for versaclock5
Reviewed-by: Ajay Gupta <ajayg@nvidia.com > # for ucsi_ccg
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com > # for iio
Acked-by: Peter Rosin <peda@axentia.se > # for i2c-mux-*, max9860
Acked-by: Adrien Grassein <adrien.grassein@gmail.com > # for lontium-lt8912b
Reviewed-by: Jean Delvare <jdelvare@suse.de > # for hwmon, i2c-core and i2c/muxes
Acked-by: Corey Minyard <cminyard@mvista.com > # for IPMI
Reviewed-by: Vladimir Oltean <olteanv@gmail.com >
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com >
Acked-by: Sebastian Reichel <sebastian.reichel@collabora.com > # for drivers/power
Acked-by: Krzysztof Hałasa <khalasa@piap.pl >
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de >
Signed-off-by: Wolfram Sang <wsa@kernel.org >
2022-08-16 12:46:26 +02: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
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
677c90bac3
ASoC: max98927: Use modern ASoC DAI format terminology
...
As part of moving to remove the old style defines for the bus clocks update
the max98927 driver to use more modern terminology for clocking.
Signed-off-by: Mark Brown <broonie@kernel.org >
Link: https://lore.kernel.org/r/20220222234026.712070-10-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org >
2022-02-28 13:34:15 +00:00
Randy Dunlap
bb45f689fa
ASoC: max98927: add missing header file
...
Add a header file that provides the missing function prototypes
and macro to fix these build errors (seen on arch/alpha/):
../sound/soc/codecs/max98927.c: In function 'max98927_i2c_probe':
../sound/soc/codecs/max98927.c:902:19: error: implicit declaration of function 'devm_gpiod_get_optional'; did you mean 'devm_regulator_get_optional'? [-Werror=implicit-function-declaration]
902 | = devm_gpiod_get_optional(&i2c->dev, "reset", GPIOD_OUT_HIGH);
| ^~~~~~~~~~~~~~~~~~~~~~~
../sound/soc/codecs/max98927.c:902:63: error: 'GPIOD_OUT_HIGH' undeclared (first use in this function); did you mean 'GPIOF_INIT_HIGH'?
902 | = devm_gpiod_get_optional(&i2c->dev, "reset", GPIOD_OUT_HIGH);
| ^~~~~~~~~~~~~~
../sound/soc/codecs/max98927.c:909:17: error: implicit declaration of function 'gpiod_set_value_cansleep'; did you mean 'gpio_set_value_cansleep'? [-Werror=implicit-function-declaration]
909 | gpiod_set_value_cansleep(max98927->reset_gpio, 0);
| ^~~~~~~~~~~~~~~~~~~~~~~~
Fixes: 4d67dc1998 ("ASoC: max98927: Handle reset gpio when probing i2c")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org >
Reported-by: kernel test robot <lkp@intel.com >
Cc: Alejandro Tafalla <atafalla@dnyon.com >
Cc: Mark Brown <broonie@kernel.org >
Cc: Liam Girdwood <lgirdwood@gmail.com >
Cc: Takashi Iwai <tiwai@suse.com >
Cc: alsa-devel@alsa-project.org
Link: https://lore.kernel.org/r/20220129080259.19964-1-rdunlap@infradead.org
Signed-off-by: Mark Brown <broonie@kernel.org >
2022-01-31 13:19:06 +00:00
Alejandro Tafalla
4d67dc1998
ASoC: max98927: Handle reset gpio when probing i2c
...
The max98927 codec on some devices requires pulling a reset gpio before
responding to any i2c command. This commit adds support for it through
an optional reset-gpios property.
Signed-off-by: Alejandro Tafalla <atafalla@dnyon.com >
Link: https://lore.kernel.org/r/d74b12a79ae9ca728d5d9e64c55b3e59e8c0e509.1633572679.git.atafalla@dnyon.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2021-10-07 15:45:18 +01:00
Thomas Gleixner
2874c5fd28
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152
...
Based on 1 normalized pattern(s):
this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license as published by
the free software foundation either version 2 of the license or at
your option any later version
extracted by the scancode license scanner the SPDX license identifier
GPL-2.0-or-later
has been chosen to replace the boilerplate/reference in 3029 file(s).
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
Reviewed-by: Allison Randal <allison@lohutok.net >
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190527070032.746973796@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2019-05-30 11:26:32 -07:00
Pierre-Louis Bossart
091cd877d8
ASoC: max98927: fix boolean assignments
...
Reported by Coccinelle:
sound/soc/codecs/max98927.c:508:2-20: WARNING: Assignment of bool to 0/1
sound/soc/codecs/max98927.c:889:3-28: WARNING: Assignment of bool to 0/1
sound/soc/codecs/max98927.c:891:3-28: WARNING: Assignment of bool to 0/1
sound/soc/codecs/max98927.c:893:2-27: WARNING: Assignment of bool to 0/1
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Signed-off-by: Mark Brown <broonie@kernel.org >
2019-01-07 16:52:28 +00:00
Kuninori Morimoto
ec4bf5acbb
ASoC: max98927: 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 <kuninori.morimoto.gx@renesas.com >
Signed-off-by: Mark Brown <broonie@kernel.org >
2018-02-12 09:49:52 +00:00
Kuninori Morimoto
68fea7cd3f
ASoC: don't use codec hw_write on max98927
...
max98927 driver is using codec hw_write/control_data,
but it is redundant code. This patch cleanup these
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com >
Signed-off-by: Mark Brown <broonie@kernel.org >
2017-11-27 18:48:22 +00:00
Ryan Lee
d4a8bce81c
ASoC: max98927: Added max98927_dai_tdm_slot function
...
Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com >
Signed-off-by: Mark Brown <broonie@kernel.org >
2017-09-25 12:48:14 -07:00
Ryan Lee
4eee20246c
ASoC: max98927: Added support for DSP_A and DSP_B format
...
Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com >
Signed-off-by: Mark Brown <broonie@kernel.org >
2017-09-25 12:48:14 -07:00
Mark Brown
af796e3b2c
Merge remote-tracking branches 'asoc/topic/kirkwood', 'asoc/topic/max9867', 'asoc/topic/max98926' and 'asoc/topic/max98927' into asoc-next
2017-09-01 12:12:44 +01:00
Ryan Lee
dea1105017
ASoC: max98927: Changed device property read function
...
Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com >
Signed-off-by: Mark Brown <broonie@kernel.org >
2017-08-31 12:46:08 +01:00
Ryan Lee
607f7777bf
ASoC: max98927: Modified DAPM widget and map to enable/disable VI sense path
...
Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com >
Signed-off-by: Mark Brown <broonie@kernel.org >
2017-08-31 12:46:08 +01:00
Ryan Lee
f81991ddd0
ASoC: max98927: Added PM suspend and resume function
...
Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com >
Signed-off-by: Mark Brown <broonie@kernel.org >
2017-08-31 12:45:08 +01:00
Ryan Lee
848844b87a
ASoC: max98927: Modified chip default register values
...
Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com >
Signed-off-by: Mark Brown <broonie@kernel.org >
2017-08-31 12:45:07 +01:00
Ryan Lee
01c6f1b5c8
ASoC: max98927: Added missing \n to end of dev_err messages
...
Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com >
Signed-off-by: Mark Brown <broonie@kernel.org >
2017-08-31 12:45:07 +01:00
Ryan Lee
9c1743ebe0
ASoC: max98927: Updated volatile register list
...
Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com >
Signed-off-by: Mark Brown <broonie@kernel.org >
2017-08-31 12:45:07 +01:00
Kuninori Morimoto
a7e1149b64
ASoC: remove cache_bypass from snd_soc_codec
...
snd_soc_codec .cache_bypass related operation code has been removed.
Let's remove remaining code.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com >
Signed-off-by: Mark Brown <broonie@kernel.org >
2017-07-26 12:29:52 +01:00
Ryan Lee
7c0c200071
ASoC: Add support for Maxim Integrated MAX98927 Amplifier
...
Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com >
Signed-off-by: Mark Brown <broonie@kernel.org >
2017-04-06 19:25:57 +01:00