Intel SST driver allocates lots of pages at suspend for saving the
firmware states, and this may occasionally lead to the allocation
error due to the high order, ending up with the suspend failure.
Use kvzalloc() so that it can fall back to vmalloc() gracefully.
Signed-off-by: Takashi Iwai <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Add new machine driver, tested with Weibu F3C MiniPC.
Based heavily on code provided by David Yang @ Everest, and other
machine drivers in the same directory.
Signed-off-by: David Yang <[email protected]>
[[email protected]: cleanups and modernization]
Signed-off-by: Daniel Drake <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
In commit 9a075265c6 ("ASoC: Intel: sst: Remove unused function
sst_restore_shim64()"), we deleted the sst_restore_shim64() since it
was never used. ...but a quick look at the code shows that we should
also be able to remove the sst_save_shim64() function and the
structure members we were storing data in.
Once we delete sst_save_shim64() there are no longer any users of the
'sst_shim_regs64' structure. That means we can delete it completely
and also avoid allocating memory for it. This saves a whopping 136
bytes of devm allocated memory. We also get the nice benefit of
avoiding an error path in the init code.
Note that the saving code that we're removing (and the comments
talking about how important it is to do the save) has been around
since commit 336cfbb05e ("ASoC: Intel: mrfld- add ACPI module").
Signed-off-by: Douglas Anderson <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
Acked-by: Vinod Koul <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
sst_acpi_mach has a quirk field to handle board specific quirks.
Patch moves quirk call to sst_acpi_find_machine() instead of calling
it in respective driver
Signed-off-by: Naveen M <[email protected]>
Signed-off-by: Subhransu S. Prusty <[email protected]>
Acked-by: Vinod Koul <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
C99 style struct initialization helps in readability as well as
initialization of variables not specified as NULL.
Patch modifies all atom machine data.
Suggested-by: Takashi Iwai <[email protected]>
Signed-off-by: Naveen M <[email protected]>
Signed-off-by: Vinod Koul <[email protected]>
Acked-by: Vinod Koul <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Looks like the function has never been used since it was added by commit
b0d94acd63 ("ASoC: Intel: mrfld - add shim save restore"). Removing it
fixes the following warning when building with clang:
sound/soc/intel/atom/sst/sst.c:360:20: error: unused function
'sst_restore_shim64' [-Werror,-Wunused-function]
Signed-off-by: Matthias Kaehlcke <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Trivial fix to spelling mistake in dev_err message. Also replace "fail"
with "failure".
Signed-off-by: Colin Ian King <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
A driver for Intel SST driver for old atom platform includes a variable
which has no external linkage. These functions should have static
qualifier.
This commit adds the qualifier to localize the variable. This issue is
detected by sparse:
sst.c:261:1: warning: symbol 'dev_attr_firmware_version' was not declared. Should it be static?
Cc: Sebastien Guiriec <[email protected]>
Cc: Vinod Koul <[email protected]>
Signed-off-by: Takashi Sakamoto <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
There are multiple skews of the same Lenovo audio hardware
based on the Realtek RT5670 codec.
Manufacturer: LENOVO
Product Name: 20C1CTO1WW
Version: ThinkPad 10
Manufacturer: LENOVO
Product Name: 20C3001VHH
Version: ThinkPad 10
Manufacturer: LENOVO
Product Name: 20C10024GE
Version: ThinkPad Tablet B
Manufacturer: LENOVO
Product Name: 20359
Version: Lenovo Miix 2 10
For all these devices, the same quirk is used to force
the machine driver to be based on RT5670 instead of RT5640
as indicated by the BIOS.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=96691
Tested-by: Nicole Faerber <[email protected]>
Tested-by: Viacheslav Ostroukh <[email protected]>
Signed-off-by: Pierre-Louis Bossart <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Intel SST driver spews an info message "FW Versoin xxxx" at each time
the device gets initialized. Since it's triggered at each PM (or even
runtime PM), it appears so ofetn, and rather becomes annoying than
useful.
This patch suppresses the superfluous messages by checking the
currently loaded FW version with the previously loaded one.
Signed-off-by: Takashi Iwai <[email protected]>
Acked-by: Vinod Koul <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Make sure this machine driver is only used if enabled explicitly
and if there is no information found in the SSDT.
Signed-off-by: Pierre-Louis Bossart <[email protected]>
Acked-by: Vinod Koul <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Add entries in HID table and reference to bytcht_da7213 driver
Signed-off-by: Pierre-Louis Bossart <[email protected]>
Acked-by: Vinod Koul <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Use ACPI ID 10EC3270 to load machine driver for cht-bsw-rt5645
and add reference to 3270 to use the rt5645 mode
Tested on Asus T100HA
Signed-off-by: Pierre-Louis Bossart <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
the BIOS reports this codec as RT5640 but it's a rt5670. Use the
quirk mechanism to use the cht_bsw_rt5672 machine driver
Signed-off-by: Pierre-Louis Bossart <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Use machine driver initially defined for CherryTrail
Signed-off-by: Pierre-Louis Bossart <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Add machine entry for HP X2 Pavilion 10-p100.
This notebook contains rt5640 codec, but with ACPI ID "10EC3276".
Signed-off-by: Alexandrov Stansilav <[email protected]>
Signed-off-by: Pierre-Louis Bossart <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
The current frame sync polarity definitions are inconsistent in the
Atom/DPCM driver, fix to align with regular ASoC definitions and
update code in platform and machine drivers for RT5640 and RT5651.
Signed-off-by: Pierre-Louis Bossart <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Most of the devices are using stereo speakers so media_loop1 and
sprot_loop default mode should be stereo.
As per default all the routing UCM configuration doesn't enable Post
processing loops it is not impacting curent configurations.
Signed-off-by: Sebastien Guiriec <[email protected]>
Acked-by: Vinod Koul <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Rename SND_SST_MFLD_PLATFORM to SND_SST_ATOM_HIFI2_PLATFORM to make it clear
that is not only about Medfield platform.
The new name is derived from Intel Atom and HiFi2. HiFi2 is the DSP version,
it's public information for Intel *Field/*Trail parts, see
https://www.alsa-project.org/main/index.php/Firmware. By combining HiFi2 with
Atom we get a unique non-ambiguous description of the core+DSP hardware for
Intel Medfield through Intel Cherrytrail.
Suggested-by: Pierre-Louis Bossart <[email protected]>
Acked-by: Vinod Koul <[email protected]>
Acked-by: Liam Girdwood <[email protected]>
Signed-off-by: Andy Shevchenko <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
In sst_media_close(), 'ret_val' is initialized and assigned as return value
of stream ops close but never used. So remove it.
ound/soc/intel/atom/sst-mfld-platform-pcm.c: In function ‘sst_media_close’:
sound/soc/intel/atom/sst-mfld-platform-pcm.c:360:6: warning: variable ‘ret_val’ set but not used [-Wunused-but-set-variable]
int ret_val = 0, str_id;
Signed-off-by: Vinod Koul <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
In process_fw_async_msg(), a variable 'msg_high' is initialized but
not used. So remove it.
sound/soc/intel/atom/sst/sst_ipc.c: In function ‘process_fw_async_msg’:
sound/soc/intel/atom/sst/sst_ipc.c:263:24: warning: variable ‘msg_high’ set but not used [-Wunused-but-set-variable]
union ipc_header_high msg_high;
Signed-off-by: Vinod Koul <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
In sst_free_stream(), a variable 'ops' is initialized but
not used. So remove it.
sound/soc/intel/atom/sst/sst_stream.c: In function ‘sst_free_stream’:
sound/soc/intel/atom/sst/sst_stream.c:397:24: warning: variable ‘ops’ set but not used [-Wunused-but-set-variable]
struct intel_sst_ops *ops;
Signed-off-by: Vinod Koul <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
After the boot of the SST FW the firmware version is send back
to the driver. This patch is saving the FW version inside the
driver.
Signed-off-by: Sebastien Guiriec <[email protected]>
Acked-by: Vinod Koul <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
This patch is adding a sysfs entry in order to be able to get
access to SST FW version.
Signed-off-by: Sebastien Guiriec <[email protected]>
Acked-by: Vinod Koul <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Add the missing ACPI ID 10EC5672 for Cherry Trail, which bounds with
cht-bsw-rt5672 driver. This combination was found on Dell Wyse 3040.
Signed-off-by: Takashi Iwai <[email protected]>
Acked-by: Vinod Koul <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Intel sst driver spews lots of kernel messages in INFO level;
typically, it gives a kernel message at each time it allocates or
frees a stream, or at each time when a stream is started or stopped.
This will piles up quickly, and it's almost useless for normal users,
so let's hide them to KERN_DEBUG level.
Signed-off-by: Takashi Iwai <[email protected]>
Acked-by: Vinod Koul <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
This patch is adding debug information related to SST FW version.
Signed-off-by: Sebastien Guiriec <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
The second declaration of status is shadowing the status of a higher
scope. This uninitialized status results in garbage being returned
by the !x86_match_cpu(cpu_ids) || !iosf_mbi_available() return exit
path. Fix this by removing the extraneous second declaration of
status.
Signed-off-by: Colin Ian King <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Trival fix, some dev_err/deb_dbg messages are missing a \n, so add it.
Signed-off-by: Colin Ian King <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Check for snd_pcm_ops structures that are only stored in the ops field of a
snd_soc_platform_driver structure or passed as the third argument to
snd_pcm_set_ops. The corresponding field or parameter is declared const,
so snd_pcm_ops structures that have this property can be declared as const
also.
The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct snd_pcm_ops i@p = { ... };
@ok1@
identifier r.i;
struct snd_soc_platform_driver e;
position p;
@@
e.ops = &i@p;
@ok2@
identifier r.i;
expression e1, e2;
position p;
@@
snd_pcm_set_ops(e1, e2, &i@p)
@bad@
position p != {r.p,ok1.p,ok2.p};
identifier r.i;
struct snd_pcm_ops e;
@@
e@i@p
@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
struct snd_pcm_ops i = { ... };
// </smpl>
Signed-off-by: Julia Lawall <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
trivial fix to spelling mistake in dev_err message and replace "cant"
with "can't"
Signed-off-by: Colin Ian King <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
In sst_prepare_and_post_msg(), when a response is received in "block",
the following code gets executed:
*data = kzalloc(block->size, GFP_KERNEL);
memcpy(data, (void *) block->data, block->size);
The memcpy() call overwrites the content of the *data pointer instead of
filling the newly-allocated memory (which pointer is hold by *data).
Fix this by merging kzalloc+memcpy into a single kmemdup() call.
Thanks Joe Perches for suggesting using kmemdup()
Fixes: 60dc8dbacb ("ASoC: Intel: sst: Add some helper functions")
Signed-off-by: Nicolas Iooss <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Cc: [email protected]
If a stream is being dropped, the period_elapsed received then after
need not be processed. Processing of the period_elapsed message causes
a time out in drop stream response processing. This patch adds a condition
to skip period_elapsed message processing if the stream is in INIT state.
Signed-off-by: Harsha Priya <[email protected]>
Signed-off-by: Naveen M <[email protected]>
Acked-by: Vinod Koul <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
trivial fix to spelling mistake in dev_err message and reformat code
to avoid being over 80 chars wide per line
Signed-off-by: Colin Ian King <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
spurious __initconst copy/pasted from other drivers
Signed-off-by: Pierre-Louis Bossart <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Existing code used SSP2, make selection of SSP id
dependent on port name. This is required when the
machine driver uses non-default settings
Signed-off-by: Pierre-Louis Bossart <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
The Atom DPCM driver only allowed for the SSP2 interface, add
definitions for modem/SSP0.
These definitions might be used to route audio to a codec
connected to SSP0 (instead of a modem in traditional usages),
but there is a restriction to 2ch I2S. SSP2 is capable of
handling up to 4 slot TDM.
Signed-off-by: Pierre-Louis Bossart <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
BYT-CR needs special handling to deal with BIOS issues.
For some reason the IPC interrupt index is also modified from
the Baytrail-T reference.
Use PUNIT BIOS config bits to infer platform details.
Assume regular Baytrail configs if status is incorrect or
CONFIG_IOSF_MBI is not enabled.
SSP0 routing issues are solved without dedicated firmware
in following patches
Tested on Asus T100TA and T100TAF.
Signed-off-by: Pierre-Louis Bossart <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Sparse rightly warns:
sound/soc/intel/atom/sst/sst_acpi.c:353:22: warning: symbol 'cht_quirk' was not declared. Should it be static?
So statify this
Signed-off-by: Vinod Koul <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Now we correctly error an attempt to execute an unsupported operation.
Signed-off-by: Alan Cox <[email protected]>
Signed-off-by: Vinod Koul <[email protected]>
Signed-off-by: Mark Brown <[email protected]>