Stefan Binding
00f87ec74c
ALSA: hda: cs35l41: Add Amp Name based on channel and index
...
This will be used to identify ALSA controls and firmware.
The Amp Name will be a channel identifier (L or R), and an
index, which identifies which amp for that channel.
Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com >
Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com >
Link: https://lore.kernel.org/r/20220509214703.4482-10-vitalyr@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de >
2022-05-16 09:55:39 +02:00
Stefan Binding
de8cab7b38
ALSA: hda: cs35l41: Enable GPIO2 Interrupt for CLSA0100 laptops
...
CLSA0100 Laptop does not contain configuration inside ACPI,
instead the hardware configuration needs to be hardcoded.
Hardcode GPIO2 Interrupt in the driver for CSLA0100.
Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com >
Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com >
Link: https://lore.kernel.org/r/20220509214703.4482-6-vitalyr@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de >
2022-05-16 09:52:28 +02:00
Stefan Binding
aa4a38af97
ALSA: hda: cs35l41: Add Support for Interrupts
...
The CS35L41 can produce interrupts on error.
When the interrupts occur, the driver will report
the error, but errors will only be fixed after playback
finishes.
Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com >
Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com >
Link: https://lore.kernel.org/r/20220509214703.4482-5-vitalyr@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de >
2022-05-16 09:51:21 +02:00
Stefan Binding
14e42ceec8
ALSA: hda: cs35l41: Remove Set Channel Map api from binding
...
This API was required for CLSA0100 laptop, which did not
have correct properties inside ACPI. The required values
are now hardcoded inside the driver so this is no longer
needed.
Without this api, there CLSA0100 can now use the generic
cs35l41 fixup, like the other laptops.
All other laptops will read the Speaker Position from
ACPI and set the channel map from within the driver.
Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com >
Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com >
Link: https://lore.kernel.org/r/20220509214703.4482-4-vitalyr@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de >
2022-05-16 09:51:00 +02:00
Stefan Binding
775d667539
ALSA: hda: cs35l41: Set Speaker Position for CLSA0100 Laptop
...
This laptop does not contain required properties inside ACPI,
instead the values are be hardcoded inside the driver.
Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com >
Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com >
Link: https://lore.kernel.org/r/20220509214703.4482-3-vitalyr@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de >
2022-05-16 09:50:31 +02:00
Lucas Tanure
5577dd2329
ALSA: hda: cs35l41: Move external boost handling to lib for ASoC use
...
To add support for external boost for ASoC move the HDA external
boost implementation to the shared lib.
Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com >
Link: https://lore.kernel.org/r/20220413083728.10730-15-tanureal@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de >
2022-04-13 10:42:34 +02:00
Lucas Tanure
734b965e67
ALSA: hda: cs35l41: Handle all external boost setups the same way
...
External boost enables sequences for devices with or without GPIO1 as
VSPK switch are the same if devices are put in safe mode from reset.
As a previous patch put all external boost devices into safe mode
from reset, all external boost devices can be handled in the same way
for stream open and close.
The only difference is that devices without an VSPK switch can not be
put in reset and devices with it can be put into reset if a
configuration is applied.
The function cs35l41_hda_safe_reset is created to handle the safe reset
of the chip, and as systems without VSPK switch are not supported
anymore, only the CS35L41 HDA driver should check its return.
Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com >
Link: https://lore.kernel.org/r/20220413083728.10730-14-tanureal@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de >
2022-04-13 10:42:34 +02:00
Lucas Tanure
b50a999798
ALSA: hda: cs35l41: Reorganize log for playback actions
...
For each case, only log the last regmap access, so it doesn't get
overwritten, and as all regmap access should show the same issues
logging the last one should be enough.
Change to dev_err to log this error.
Also, differentiate between a regmap access failure and invalid
playback action.
Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com >
Link: https://lore.kernel.org/r/20220413083728.10730-13-tanureal@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de >
2022-04-13 10:42:34 +02:00
Lucas Tanure
fabcf7f12b
ALSA: hda: cs35l41: Remove cs35l41_hda_reg_sequence struct
...
Remove cs35l41_hd_reg_sequence as it adds a layer of flexibility not needed.
As cs35l41_hda_(start/stop)_bst is a single register, it can be replaced by
regmap_update_bits with usleep_range to wait for the same 3000us that
reg_sequence had.
Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com >
Link: https://lore.kernel.org/r/20220413083728.10730-12-tanureal@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de >
2022-04-13 10:42:34 +02:00
Lucas Tanure
5fdb68a761
ALSA: hda: cs35l41: Move boost config to initialization code
...
Having CS35L41_PWR_CTRL2 on cs35l41_hda_config overwrites the boost
configuration for internal boost.
So move it to the initialization part and use regmap_update_bits to
only change the correct bits.
Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com >
Link: https://lore.kernel.org/r/20220413083728.10730-11-tanureal@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de >
2022-04-13 10:42:34 +02:00
Lucas Tanure
f29db0892b
ALSA: hda: cs35l41: Mute the device before shutdown
...
Mute the device before shutdown to avoid pops and clicks for all types
of boost.
Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com >
Link: https://lore.kernel.org/r/20220413083728.10730-9-tanureal@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de >
2022-04-13 10:42:33 +02:00
Lucas Tanure
f04bb4cae1
ALSA: hda: cs35l41: Put the device into safe mode for external boost
...
To facilitate the configuration of external boost devices, put all
devices, with or without VSPK switch, into safe mode from the start.
That allows the following parts of the driver to handle all external
boost devices in the same way.
Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com >
Link: https://lore.kernel.org/r/20220413083728.10730-8-tanureal@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de >
2022-04-13 10:42:33 +02:00
Lucas Tanure
b8388a1aba
ALSA: hda: cs35l41: Add Boost type flag
...
Replace vspk_always_on by a enum that better characterizes the boost
type, as there is 3 types of boost hardware.
And with the new boost type other parts of the driver can better handle
the configuration of the chip.
Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com >
Link: https://lore.kernel.org/r/20220413083728.10730-7-tanureal@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de >
2022-04-13 10:42:33 +02:00
Lucas Tanure
0256949baa
ALSA: hda: cs35l41: Always configure the DAI
...
The dai configuration is always the same and should always configured
during the opening the stream.
Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com >
Link: https://lore.kernel.org/r/20220413083728.10730-6-tanureal@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de >
2022-04-13 10:42:33 +02:00
Lucas Tanure
1e616a9c46
ALSA: hda: cs35l41: Fix I2S params comments
...
Fix clock and slot size comments
Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com >
Link: https://lore.kernel.org/r/20220413083728.10730-5-tanureal@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de >
2022-04-13 10:42:33 +02:00
Lucas Tanure
fcad8950a5
ALSA: cs35l41: Move cs35l41_gpio_config to shared lib
...
ASoC and HDA can use a single function to configure the chip gpios.
Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com >
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com >
Link: https://lore.kernel.org/r/20220413083728.10730-4-tanureal@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de >
2022-04-13 10:42:33 +02:00
Lucas Tanure
2603c974b4
ALSA: cs35l41: Check hw_config before using it
...
The driver can receive an empty hw_config, so mark as valid if
successfully read from device tree/ACPI or set by the driver itself.
Platforms not marked with a valid hw config will not be supported.
Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com >
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com >
Link: https://lore.kernel.org/r/20220413083728.10730-3-tanureal@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de >
2022-04-13 10:42:32 +02:00
Lucas Tanure
f7f207375d
ALSA: cs35l41: Unify hardware configuration
...
Both ASoC and HDA require to configure the GPIOs and Boost, so
create a single shared struct for hardware configuration.
Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com >
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com >
Link: https://lore.kernel.org/r/20220413083728.10730-2-tanureal@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de >
2022-04-13 10:42:32 +02:00
Uwe Kleine-König
85c25662d1
ALSA: hda: cs35l41: Make cs35l41_hda_remove() return void
...
Up to now cs35l41_hda_remove() returns zero unconditionally. Make it
return void instead which makes it easier to see in the callers that
there is no error to handle.
Also the return value of i2c and spi remove callbacks is ignored anyway.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de >
Reviewed-by: Lucas Tanure <tanureal@opensource.cirrus.com >
Link: https://lore.kernel.org/r/20220117220055.120955-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Takashi Iwai <tiwai@suse.de >
2022-01-18 14:08:05 +01:00
Lucas Tanure
8c286a0f97
ALSA: hda: cs35l41: Tidyup code
...
Clean up and simplify cs35l41_hda_bind function
Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com >
Link: https://lore.kernel.org/r/20220117160830.709403-6-tanureal@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de >
2022-01-18 14:07:16 +01:00
Lucas Tanure
a025df02ce
ALSA: hda: cs35l41: Make use of the helper function dev_err_probe()
...
When possible use dev_err_probe help to properly deal with the
PROBE_DEFER error, the benefit is that DEFER issue will be logged
in the devices_deferred debugfs file.
Using dev_err_probe() can reduce code size, and the error value
gets printed.
Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com >
Link: https://lore.kernel.org/r/20220117160830.709403-5-tanureal@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de >
2022-01-18 14:07:15 +01:00
Lucas Tanure
cd8abf7d04
ALSA: hda: cs35l41: Add missing default cases
...
Add switch default cases at gpio pins configs
Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com >
Link: https://lore.kernel.org/r/20220117160830.709403-4-tanureal@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de >
2022-01-18 14:07:15 +01:00
Lucas Tanure
77dc3a6ee2
ALSA: hda: cs35l41: Move cs35l41* calls to its own symbol namespace
...
Create own namespace and avoid polluting the global namespace
Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com >
Link: https://lore.kernel.org/r/20220117160830.709403-3-tanureal@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de >
2022-01-18 14:07:14 +01:00
Charles Keepax
6e4320d8ec
ALSA: hda: cs35l41: Add calls to newly added test key function
...
The test key now needs to be manually held when calling
cs35l41_register_errata_patch, after patch:
Add the missing function calls to this driver.
Fixes: f517ba4924 ("ASoC: cs35l41: Add support for hibernate memory retention mode")
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com >
Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com >
Link: https://lore.kernel.org/r/20220117160830.709403-2-tanureal@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de >
2022-01-18 14:07:13 +01:00
Charles Keepax
2cb52046d1
ALSA: hda: cs35l41: Avoid overwriting register patch
...
regmap_register_patch can't be used to apply the probe sequence as a
patch is already registers with the regmap by
cs35l41_register_errata_patch and only a single patch can be attached to
a single regmap. The driver doesn't currently rely on a cache sync to
re-apply this probe sequence so simply switch it to a multi write.
Fixes: 7b2f3eb492 ("ALSA: hda: cs35l41: Add support for CS35L41 in HDA systems")
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com >
Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com >
Link: https://lore.kernel.org/r/20220117160830.709403-1-tanureal@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de >
2022-01-18 14:07:12 +01:00
Dan Carpenter
10b1a5a99c
ALSA: hda: cs35l41: fix double free on error in probe()
...
If we encounter an error after the kfree(acpi_hw_cfg); then the goto
err; will result in a double free.
Fixes: 7b2f3eb492 ("ALSA: hda: cs35l41: Add support for CS35L41 in HDA systems")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com >
Link: https://lore.kernel.org/r/20220111072232.GG11243@kili
Signed-off-by: Takashi Iwai <tiwai@suse.de >
2022-01-11 16:57:24 +01:00
Lucas Tanure
7b2f3eb492
ALSA: hda: cs35l41: Add support for CS35L41 in HDA systems
...
Add support for CS35L41 using a new separated driver
that can be used in all upcoming designs
Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com >
Link: https://lore.kernel.org/r/20211217115708.882525-8-tanureal@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de >
2022-01-05 17:08:16 +01:00