Graf commitů

29 Commity

Autor SHA1 Zpráva Datum
Xiaoyu Ye
6d8bda3545 asoc: msm-lsm-client: reset app type configs at msm_lsm_close
Currently lsm client driver doesn't reset app type configs at
the end of a session, which causes the previous lsm session's
acdb_dev_id to be cached and reused in the new lsm sessions.
Fix this by resetting app type configs at msm_lsm_close to set
acdb_dev_id to 0.

Change-Id: I2c51201291beb1d4baa4d57c0d5c1ef9777a85ed
Signed-off-by: Xiaoyu Ye <benyxy@codeaurora.org>
2019-06-18 13:06:32 -07:00
qctecmdr
b3fb4d1162 Merge "asoc: msm-lsm-client: Initialize started flag in open" 2019-06-17 20:48:21 -07:00
qctecmdr
34b7d3b2fd Merge "ASoC: hide bind/unbind in sysfs" 2019-05-21 20:33:23 -07:00
Xiaojun Sang
53cd13a1ab ASoC: hide bind/unbind in sysfs
Exposure of driver bind/unbind to userspace via sysfs may
lead to unexpected behavior.
Hide bind and unbind by driver attribute.

Change-Id: I20d6ee653bcc16af15d6368664aaf240c6645cd0
Signed-off-by: Xiaojun Sang <xsang@codeaurora.org>
2019-05-17 15:00:33 +08:00
Xiaoyu Ye
845b66f42a asoc: msm-lsm-client: add support for shared buffer DAM module
A new module called DAM is introduced to achieve common shared
memory for SVA use cases in LPI. Add new mixer control interface
to provide support for STHAL to configure the data that LSM gets
from AFE to be either processed or unprocessed.

Change-Id: I8556413257c6a2aee4739bcd89ffd130805af0c5
Signed-off-by: Xiaoyu Ye <benyxy@codeaurora.org>
2019-05-10 09:42:27 -07:00
Chaithanya Krishna Bacharaju
9b0637b6bc asoc: msm-lsm-client: Initialize started flag in open
Initialize started flag in open instead of prepare since reset
happens in close. This will also help stop already active LSM
sessions even if prepare was called in between.

Change-Id: Iad47f9459ceddefd582840313901d95d338e1147
Signed-off-by: Chaithanya Krishna Bacharaju <chaithan@codeaurora.org>
2019-05-06 22:57:47 -07:00
Kunlei Zhang
16e535969b lsm: check payload size validity before using it as array index
Payload size validity is not checked before using it in array index.
Check payload size to avoid out-of-boundary memory.

Change-Id: Ic0b06bb331fc1753ff7543bb218ab12d6a4a3ca8
Signed-off-by: Kunlei Zhang <kunleiz@codeaurora.org>
2019-04-14 20:21:24 -07:00
Chaithanya Krishna Bacharaju
52bb6616c1 asoc: msm-lsm-client: stop lab during lsm close
Buffering is not stopped during lsm close due to
which lab buffers can be queued during teardown of
session. This leads to read being issued even after session
close. Stop lab during close to avoid this. Use correct
return value to indicate errors during lsm start and stop.

Change-Id: I52fa33cebaa3ee6ae60eb2a60bb1e833f2a9d0d6
Signed-off-by: Chaithanya Krishna Bacharaju <chaithan@codeaurora.org>
2019-03-12 22:02:10 -07:00
Dhananjay Kumar
1bf124f9d9 asoc: msm-lsm-client: fix error logging for set session data failure
Error logging from set session data is not reflecting actual reason of failure.
Update error logging for this failure with correct info.

Change-Id: I5009a8b17128f0093e16f75c0e212a9bfb1f1a2e
Signed-off-by: Dhananjay Kumar <dhakumar@codeaurora.org>
2019-02-20 18:56:00 +08:00
Meng Wang
43bbb87652 asoc: Update file header to GPL-2.0-only
Update file header to GPL-2.0-only.

Change-Id: Ic1542a3209a5fe73c937a5b36491ede4a451936d
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2018-12-10 14:49:34 +08:00
Meng Wang
ee084a068e ASoC: Change platform driver to component driver
snd_soc_platform_driver is removed in kernel-4.19.
Update snd_soc_platform_driver to snd_soc_component_driver.

Change-Id: I434b6fd173d1f4365a610d9164342d5d04d6c5bc
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2018-12-08 03:15:41 -08:00
Meng Wang
c7b180ec7c asoc: Avoid usage of variable length array
chmap in msm_lsm_check_and_set_lab_controls, data in
wcd9xxx_i2c_write_device and irq_level in wcd9xxx_irq_init
are Variable Length Array (VLA). VLAs are considered unfit
when it comes to security, performance, code quality and so
on. Hence, allocate the memory dynamically.

Change-Id: I52f33e61f857a00774eb26dc1d6372f2ed3d425c
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2018-12-06 23:52:08 -08:00
Meng Wang
61af6849e9 ASoC: switch audio drivers to SPDX identifier
Switch audio drivers to SPDX identifier on msm-4.19.

Change-Id: Ic3f0230a516db251b8d81e8a7e73dbc04d66fe1b
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2018-12-07 15:47:32 +08:00
Dhananjay Kumar
4867dc18a8 asoc: msm-lsm-client: Update lsm client driver to prevent buffer overrun
ADSP, userspace and LSM client driver, all these three layer are maintaining
independent buffers and rewrite them irrespective of the buffer being read
successfully by their client or not.
Before switching to real-time capture, history buffers cached can be returned
with minimal delay and may lead to overrun in a module if buffering in the
module is not sufficient to store all those data generated almost instantaneously.
LSM driver having buffer size smaller than history buffer duration is hitting
this issue and resulting in buffer overrun for even a small delay from userspace
in start of capture processing thread.
Prevent this issue by synchronising read and write in LSM driver to make
sure the driver waits for read from userspace before writing the same buffer again.

Change-Id: I2710b484a7ef03e8314c7ba05bf729893aecb890
Signed-off-by: Dhananjay Kumar <dhakumar@codeaurora.org>
2018-11-02 19:54:00 +05:30
Mangesh Kunchamwar
1603e0d72b asoc: compilation fix for qcs403
Fix compilation issue with qcs403 variant compilation

Change-Id: Iae877e1a1c3c81edd9c26c9bb143216e2d3550d6
Signed-off-by: Mangesh Kunchamwar <mangeshk@codeaurora.org>
2018-07-11 19:19:18 +05:30
Linux Build Service Account
b73517def0 Merge "asoc: fix lsm_event_handler function type" 2018-07-09 08:32:03 -07:00
Dhananjay Kumar
66ae4136f5 lsm: miscellaneous fixes for multi-stage adsp VA
Fix compilation warnings from multi-stage VA code changes.
Correct sound model param size value to avoid failure from
second stage sound model registration.

Change-Id: I7f589f0ddece167233b61236b3e5b6585927f62d
Signed-off-by: Dhananjay Kumar <dhakumar@codeaurora.org>
2018-07-07 01:36:05 +05:30
Dhananjay Kumar
ce6ec5fcf2 lsm: add support for ADSP multi stage VA
Enhance APIs to get instance id and stage info from userspace,
required for multi-stage Voice Activation in ADSP.

Change-Id: Ie39a3d002a56fb8df0c241089a50d55ef700a538
Signed-off-by: Dhananjay Kumar <dhakumar@codeaurora.org>
2018-06-27 23:39:17 +05:30
Bhalchandra Gajare
74cc9e08b5 lsm_client: add support to perform channel mixing
With pre-processing applied, it is possible that the processed
number of channels could be different than the number of channels
that voice wakeup can run with. In such cases, the channel mixer
should be setup to downmix the channel. For voice wakeup to detect
keywords properly, preprocessed channels cannot be mixed hence
the channel mixer is always setup with unity co-efficients or 0
to either select or drop the channel. In this case the channel mixer
acts more like an channel selector.

Change-Id: I79b578b56ad5484e27f433404a5371540618a2ae
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
2018-06-19 18:46:23 -07:00
Bhalchandra Gajare
6ee5b50fd4 msm-lsm-client: decouple input and output hardware parameters
With multichannel voice activation support in LSM, it could be possible
that the input media format/hw_params to LSM would be different than
the output media format/hw_params. This change decouples the input
and output hw_params for LSM. The output hw_params are obtained through
ALSA pcm_hw_params operation, whereas the input hw_params are obtained
though the LSM_SET_INPUT_HW_PARAMS ioctl to LSM.

At the same time, the below parameter IDs are added to send the channel
information to LSM service:
	- LSM_PARAM_ID_MEDIA_FMT_V2
	- LSM_PARAM_ID_LAB_OUTPUT_CHANNEL_CONFIG

Change-Id: Ie53a087b0ec54e83c4eba93a0828f9bdd6cc147d
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
2018-06-19 15:10:18 -07:00
Sami Tolvanen
6572b9d0e5 asoc: fix lsm_event_handler function type
Bug: 79254874
Bug: 67506682
Change-Id: I520634c3b55580004c38174bcf10513cf5f4fd3f
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
2018-06-14 13:15:19 -07:00
Xiaoyu Ye
97f76efc86 asoc: msm-lsm-client: add __user attribute for IOCTL
Add __user attribute for msm_lsm_ioctl's input parameter
"*arg" to explicitly identify it as user space pointer.

Change-Id: I33e8a23cdef9eee9a55b77bb017716ccf2ba5f81
Signed-off-by: Xiaoyu Ye <benyxy@codeaurora.org>
2018-06-12 15:50:01 -07:00
Xiaoyu Ye
f0ec686d3b asoc: msm-lsm-client: add support for ADSP Generic Detection Event
ADSP detection engine module can raise Generic Detection Event to
provide variable payload data based on the information requested by
userspace. Adding new API/interface to provide support for Generic
Detection Event in LSM drivers.

Change-Id: Id5541f959ecdcf862dcfa1de1c1a1b3a796f260c
Signed-off-by: Xiaoyu Ye <benyxy@codeaurora.org>
2018-05-22 23:36:37 -07:00
Xiaoyu Ye
7e2bf00784 asoc: fix error handling logic to avoid potential deadlock
IOCTL command "SNDRV_LSM_EVENT_STATUS_V3_32" in msm_lsm_ioctl_compat
has an incorrect error handling logic which can cause mutex deadlock.
Change this logic to avoid potential mutex deadlock.

Change-Id: I19b3509b5d40cff555536e4615132ea8c477d451
Signed-off-by: Xiaoyu Ye <benyxy@codeaurora.org>
2018-05-08 14:37:10 -07:00
Meng Wang
ac147b705e ASoC: update snd_pcm_ops copy interface in platform drivers
snd_pcm_ops copy interface used by msm platform drivers is replaced
with copy_user in msm-4.14. Unit of two input variables is changed
from frame count to byte.
Update all the related msm platform drivers to adapt to this change.

Change-Id: Icecd0454c7a80e5ee90407c64aaf1ca76d2d9815
Signed-off-by: Meng Wang <mwang@codeaurora.org>
2018-02-03 08:36:32 +08:00
Asish Bhattacharya
5faacb3a7e ASoC: allow drivers to compile both static and dynamic
Based on where the code is synced the driver should allow
both static and dynamic linked compilation.
Also remove __exit for modules loaded from another common
init/exit functions.

Change-Id: Ib58f152002aba3af4446f9bbd9b82c279212bd0a
Signed-off-by: Asish Bhattacharya <asishb@codeaurora.org>
2017-12-07 19:57:27 +05:30
Laxminath Kasam
8b1366a648 Audio: DLKM support for all audio modules
Switch to DLKM for all audio kernel modules.

Change-Id: I6a96023a21f655f873531af9ace81f2b01eb0f58
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2017-11-02 13:42:09 +05:30
Laxminath Kasam
38070be30b audio-lnx: Add latest snapshot for audio drivers.
Propagate the changes based on latest snapshot
for audio kernel source tree at below cutoff of
kernel msm-4.9 -

(aed56b2df75 - "drm/msm/sde: update te vsync enable sequence change")

Change-Id: I7ed5102146986b81e5cb9ca55432360b3549b60c
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2017-08-24 03:53:42 -07:00
Laxminath Kasam
605b42f92c audio-lnx: Rename folders to new flat structure.
Kernel audio drivers can be categorised into below folders.
asoc - ALSA based drivers,
asoc/codecs - codec drivers,
ipc - APR IPC communication drivers,
dsp - DSP low level drivers/Audio ION/ADSP Loader,
dsp/codecs - Native encoders and decoders,
soc - SoC based drivers(pinctrl/regmap/soundwire)

Restructure drivers to above folder format.
Include directories also follow above format.

Change-Id: I8fa0857baaacd47db126fb5c1f1f5ed7e886dbc0
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2017-08-18 16:56:12 -06:00