77 Commits

Author SHA1 Message Date
Alexander Winkowski
61bb4e5a02 Revert "soc: pinctrl-lpi: Initialise at late_initcall"
This reverts commit ea5aa7a3fe5143774b2d3944f4f932d610ae23d7.

The issue has been fixed properly in Idafc26a739df1831d04ea2fde4625e8f9ca1a0ae

Change-Id: I8275c11660af6cd03907970dea020897b66ceaa3
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
2024-07-10 19:07:22 +02:00
Angelo G. Del Regno
7e65aee9b4 dsp: audio_notifier: Defer external notifier registration if not inited
If the driver is not yet initialized, return EPROBE_DEFER to the
external driver trying to register a notification, so that we
don't miss any.

Change-Id: Idafc26a739df1831d04ea2fde4625e8f9ca1a0ae
2024-07-10 19:07:22 +02:00
Vignesh Kulothungan
595f3a75d1 soc: add check condition before enabling irq
Enable interrupt request only when the interrupt is
in disabled state.

Change-Id: I67795bf0ee344661e02b0fec3181cd7980d56652
Signed-off-by: Vignesh Kulothungan <vigneshk@codeaurora.org>
2024-07-10 19:07:22 +02:00
freak07
a1dc15c37b techpack/audio: Use power efficient workingqueues
Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
2024-06-25 20:07:23 +00:00
Meng Wang
b4f315c300 asoc: codec: update SOC_SINGLE_SX_TLV to SOC_SINGLE_S8_TLV
Update SOC_SINGLE_SX_TLV to SOC_SINGLE_S8_TLV to make codec
driver compatiable with upstream driver.

Change-Id: I4061b015d715978f3b294ad630f53b64bf66c2b7
Signed-off-by: Meng Wang <mengw@codeaurora.org>
[dereference23: Backport to msm-4.14]
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
2024-03-28 16:23:43 +00:00
Shalini Manjunatha
ee45895ae7 ASoC: msm-pcm-q6-v2: Add dsp buf check
Fix is to add check for this ADSP returned buf offset + size,
if it is within the available buf size range

Change-Id: I400cc4f5c07164f0a9b405ebea144ea0ae4b6cf2
Signed-off-by: Shalini Manjunatha <quic_c_shalma@quicinc.com>
2024-03-28 16:23:43 +00:00
Laxminath Kasam
07422e8ef1 asoc: Update copy_to_user to requested buffer size
Avoid copy to user more than requested buffer size
to avoid memory corruption.

Change-Id: Ibf1607f777a358ebd16fd8b8728809afda34eba7
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2024-03-28 16:23:43 +00:00
Laxminath Kasam
9bb773d63b asoc: msm-pcm-q6-v2: Update memset for period size
tinycap test can attempt with different size to
read from driver and need to avoid access more
than period size.

Change-Id: Ifa4ddfb086bd83aa981da62e88da3a9395f5aabc
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2024-03-28 16:23:43 +00:00
Laxminath Kasam
24306b93ee asoc: Reset the buffer if size is partial or zero
Sometimes during device switch in recording,
observe size 0 is return from DSP due to EOS
handling. For ALSA pcm_read to unblock, buffer
appl_ptr is elapsed without actually updating
the buffer. And userspace copies the stale
data(old buffer) causing issue sometimes.
Reset the buffer for that period_size in
such cases instead of transfer stale data.

Change-Id: I0d3ac133a8d95fad0710586e3e947410a41c9c5a
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2024-03-28 16:23:43 +00:00
Soumya Managoli
a7ad63be04 ASoC: msm-pcm-q6-v2: Add dsp buf check
Current logic copies user buf size of data
from the avail dsp buf at a given offset.
If this offset returned from DSP in READ_DONE event
goes out of bounds or is corrupted, then it can lead to
out of bounds DSP buffer access, resulting in memory fault.
Fix is to add check for this buf offset, if it is within
the buf size range.

Original-Change-Id: I7753cc6db394704dbb959477150141d42b836bef
Signed-off-by: Soumya Managoli <quic_c_smanag@quicinc.com>
Change-Id: I5c945b6570ccd348659b2e8ee889368e7f4f6f80
2024-03-28 16:23:43 +00:00
siimsek
df8543b3c5 ASoC: wcd_cpe: Fix enum-conversion warnings
techpack/audio/asoc/codecs/wcd_cpe_services.c:658:17: error: implicit
conversion from enumeration type 'enum cpe_svc_result' to different
enumeration type 'enum cmi_api_result' [-Werror,-Wenum-conversion]
        notif.result = result;
                     ~ ^~~~~~
techpack/audio/asoc/codecs/wcd_cpe_services.c:1350:8: error: implicit
conversion from enumeration type 'enum cpe_svc_result' to different
enumeration type 'enum cpe_process_result' [-Werror,-Wenum-conversion]
                rc = cpe_send_msg_to_inbox(t_info, 0, m);
                   ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 errors generated.

Change-Id: Ib9fce60017066e9c96e79195d7dba9ffb9177148
2024-03-28 16:23:42 +00:00
Shalini Manjunatha
450da686a6 ASoC: msm-pcm-q6-v2: Add dsp buf check
Fix is to add check for this ADSP returned buf offset + size,
if it is within the available buf size range

Change-Id: I400cc4f5c07164f0a9b405ebea144ea0ae4b6cf2
Signed-off-by: Shalini Manjunatha <quic_c_shalma@quicinc.com>
2024-01-14 06:29:22 +00:00
Laxminath Kasam
cd894c4400 asoc: Update copy_to_user to requested buffer size
Avoid copy to user more than requested buffer size
to avoid memory corruption.

Change-Id: Ibf1607f777a358ebd16fd8b8728809afda34eba7
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2024-01-14 06:29:12 +00:00
Laxminath Kasam
195a37fc8f asoc: msm-pcm-q6-v2: Update memset for period size
tinycap test can attempt with different size to
read from driver and need to avoid access more
than period size.

Change-Id: Ifa4ddfb086bd83aa981da62e88da3a9395f5aabc
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2024-01-14 06:28:47 +00:00
Laxminath Kasam
4782b0006c asoc: Reset the buffer if size is partial or zero
Sometimes during device switch in recording,
observe size 0 is return from DSP due to EOS
handling. For ALSA pcm_read to unblock, buffer
appl_ptr is elapsed without actually updating
the buffer. And userspace copies the stale
data(old buffer) causing issue sometimes.
Reset the buffer for that period_size in
such cases instead of transfer stale data.

Change-Id: I0d3ac133a8d95fad0710586e3e947410a41c9c5a
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2024-01-14 06:28:37 +00:00
Soumya Managoli
3a9d4aa85f ASoC: msm-pcm-q6-v2: Add dsp buf check
Current logic copies user buf size of data
from the avail dsp buf at a given offset.
If this offset returned from DSP in READ_DONE event
goes out of bounds or is corrupted, then it can lead to
out of bounds DSP buffer access, resulting in memory fault.
Fix is to add check for this buf offset, if it is within
the buf size range.

Original-Change-Id: I7753cc6db394704dbb959477150141d42b836bef
Signed-off-by: Soumya Managoli <quic_c_smanag@quicinc.com>
Change-Id: I5c945b6570ccd348659b2e8ee889368e7f4f6f80
2024-01-14 06:28:15 +00:00
Soumya Managoli
e0d77a4477 ASoC: msm-pcm-host-voice: Address buffer overflow in hpcm copy
Add check for the max hpcm_buf_node size before copy to avoid
buffer out of bounds issue.

Change-Id: Id647888430ce302359a857ef54d321bee99889bf
Signed-off-by: Soumya Managoli <quic_c_smanag@quicinc.com>
2023-12-19 16:26:22 +00:00
Shalini Manjunatha
94360a3022 BACKPORT: dsp: afe: check for param size before copying
Check for the proper param size before copying,
to avoid buffer overflow.

Original-Change-Id: I70c52e6ab76f528ea3714784ab9013b070839c40
Signed-off-by: Shalini Manjunatha <quic_c_shalma@quicinc.com>
Change-Id: Ic7fa9b3dd047d8eeba3cea02b99d6bc5b9df8daf
2023-12-19 16:26:22 +00:00
Soumya Managoli
6da0a90fa3 dsp: q6adm: Resolve mem corruption in adm cb
Conversion of negative "num_modules" var value
will result in max possible unsigned int value
and hence can cause mem corruption when accessed.

Resolve this by assigning the same data type
to "num_modules" var as used in the calling fn.

Original-Change-Id: I4c9d7215b9c7345637e1eb3a1992a41fef71c5cb
Signed-off-by: Soumya Managoli <quic_c_smanag@quicinc.com>
Change-Id: I55fd3ea6bf214e3852c58f8dcae9ada4723fa7d8
2023-12-19 16:26:22 +00:00
Karthikeyan Mani
103be9ad1d dsp: afe: check for payload size before payload access
Check if payload data is big enough before accessing
the data in it.

Change-Id: I939f205a8cebf6ef4859f81fae5429bca013d540
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
2023-12-19 16:26:21 +00:00
Shalini Manjunatha
0f4012fd58 BACKPORT: dsp: afe: check for param size before copying
Check for the proper param size before copying,
to avoid buffer overflow.

Change-Id: I70c52e6ab76f528ea3714784ab9013b070839c40
Signed-off-by: Shalini Manjunatha <quic_c_shalma@quicinc.com>
2023-12-19 16:26:21 +00:00
Soumya Managoli
ff44623447 dsp: q6adm: Resolve mem corruption in adm cb
Conversion of negative "num_modules" var value
will result in max possible unsigned int value
and hence can cause mem corruption when accessed.

Resolve this by assigning the same data type
to "num_modules" var as used in the calling fn.

Change-Id: I4c9d7215b9c7345637e1eb3a1992a41fef71c5cb
Signed-off-by: Soumya Managoli <quic_c_smanag@quicinc.com>
2023-12-19 16:26:21 +00:00
kibria5
ed8bed08ef Merge tag 'LA.UM.9.1.r1-14900-SMxxx0.QSSI14.0' of https://git.codelinaro.org/clo/la/platform/vendor/opensource/audio-kernel.git
"LA.UM.9.1.r1-14900-SMxxx0.QSSI14.0"
2023-12-06 17:51:36 +00:00
kibria5
39c452c666 Merge tag 'LA.UM.9.1.r1-14600-SMxxx0.QSSI14.0' of https://git.codelinaro.org/clo/la/platform/vendor/opensource/audio-kernel.git
"LA.UM.9.1.r1-14600-SMxxx0.QSSI14.0"
2023-11-08 23:33:15 +06:00
freak07
5ded3fdd4e techpack: use power efficient workingqueues
(cherry picked from commit 75ed04dc1f7e7da565e41b7190fb44f078c5b4d6)
(cherry picked from commit a23fc1d9e2a6166dde561c6e5cf8f1e09e0a5c0c)
(cherry picked from commit efed5ad0c48e83e66b4be7f33147aa192e47e498)
(cherry picked from commit 8a55be718c836abf6d4bc5a1233e982374fd3316)
(cherry picked from commit b6c2999fdb6f3d71385d1a1edf839ff14e4bc0d7)
(cherry picked from commit 34715e51bf1fd10b6fec2e581524b20286fb46c4)
(cherry picked from commit 5fec4357e73939eb0a6252f7848480d8bf624fe6)
(cherry picked from commit 7d6be584cf1ea2879fd8ef21178766b06be13fe8)
(cherry picked from commit 8b0aa1ebc13c6ccd9a250bdf5004d64da2f089aa)
(cherry picked from commit 1485ebd685e6d2af1b45ab43297b9d32ee0aacc2)
(cherry picked from commit 089735f8cf8b4808bc52901da2b337b733983f4c)
(cherry picked from commit 7a65bfba52cf301b3394ed85f4ff4cc14ef0446f)
2023-11-08 22:27:17 +06:00
freak07
90ddce87bf techpack: use more power efficient workingqueues
(cherry picked from commit ca17239efeca7b58d286989e17381a57b6174111)
(cherry picked from commit c9c2c5291e9ddb47720dd211ef584c84a73774ee)
(cherry picked from commit c04791f3fcad54d81e76cce4f4f7a565660e94bd)
(cherry picked from commit 01d7d6fd40d4899770a5786b8a0683dc976fcc13)
(cherry picked from commit c84794133685b0feb98a557e9d377746e7e0a05f)
(cherry picked from commit 562ca2c99dab1fcaf7316d285395dbf3dc681dc7)
(cherry picked from commit 7956f56b1d6675dfb8db1328f7a4f16fe2d926be)
(cherry picked from commit acea29dd2ce6a33904829fd821ef8754bf56b70a)
(cherry picked from commit cdf2ba1f7426eca51e692d4e57f5b009fff55c9a)
2023-11-08 22:27:17 +06:00
kibria5
a6baaa99ea Merge tag 'LA.UM.9.1.r1-13900-SMxxx0.QSSI13.0' https://git.codelinaro.org/clo/la/platform/vendor/opensource/audio-kernel.git
"LA.UM.9.1.r1-13900-SMxxx0.QSSI13.0"
2023-09-07 00:22:21 +05:30
kibria 5
f5ccda0262 Fix error for inline with clang 17.0.3 2023-08-10 05:45:12 +00:00
kibria 5
f72dc78000 Merge tag 'LA.UM.9.1.r1-13700-SMxxx0.QSSI13.0'of https://git.codelinaro.org/clo/la/platform/vendor/opensource/audio-kernel.git
"LA.UM.9.1.r1-13700-SMxxx0.QSSI13.0"
2023-08-05 05:20:40 +00:00
rooghz720
38657dc2e1 techpack/audio: increase mic gain to 5%
biar tidak conge yagesyaa

Signed-off-by: rooghz720 <RooGhz720@gmail.com>
2023-08-04 21:36:26 +00:00
Andrzej Perczak
a23e23f3f3 techpack: bolero-cdc: Fix unitialized rwsem usage
Change-Id: I2bf6f64d34eb082521c92c0b6c22b904d5f73302
Signed-off-by: Andrzej Perczak <linux@andrzejperczak.com>
[dereference23: Extend to audio-kernel 4.0]
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2023-08-04 21:36:26 +00:00
Danny Lin
82e30e7338 techpack: ASoC: sm8150: Split sa8155 driver into separate config option
There's no need to compile the sa8155 driver when targeting sm8150
mobile devices.

Signed-off-by: Danny Lin <danny@kdrag0n.dev>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2023-03-14 14:02:57 +00:00
Soumya Managoli
fb93bfbf0e ASoC: Fix overflow error in routing driver
The reg in soc_dapm_mux is 32-bit. The BE DAI ID passed
as shift(to be operated on the reg) may be more than 31,
which may cause overflow.
Set reg field to SND_SOC_NOPM to avoid any DAPM operation
while passing BE IDs in shift_l field and hence avoid overflow.

Change-Id: Ibbbca04c61b7c56eb4c5a7485a4e93dc28a09709
Signed-off-by: Soumya Managoli <smanag@codeaurora.org>
[dereference23: Forward port to 4.14]
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
2022-10-18 09:33:13 +05:30
Sultan Alsawaf
b6d2112afd ASoC: msm-pcm-routing-v2: Fix non-blocking if-statement warning
Change-Id: Ia33743c8770dbb3cffe52aa1b57faa3267f37d8f
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
[dereference23: Extend to audio-kernel 4.0]
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
2022-10-18 09:32:27 +05:30
Sultan Alsawaf
acbd596489 ASoC: dsp: msm-dts-srs-tm-config: Fix trivial unguarded pr_debug()
Change-Id: If2b6b67afafddc749557a2230582fbacd1c85c26
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
[dereference23: Extend to audio-kernel 4.0]
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
2022-10-18 09:32:27 +05:30
Sultan Alsawaf
26aa11e30f ASoC: dsp: amrwb_in: Fix AUDIO_GET_AMRWB_ENC_CONFIG ioctl
The non-blocking if-statement here causes the AUDIO_GET_AMRWB_ENC_CONFIG
ioctl to always return -EFAULT, even upon success. Fix it by correctly
guarding the -EFAULT return value.

Change-Id: Ia3a7247f5febb21d3b654c0ed29e81135e732c79
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
[dereference23: Extend to audio-kernel 4.0]
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
2022-10-18 09:32:27 +05:30
Joker-V2
c4ab6afe19 Merge tag 'LA.UM.9.1.r1-12600-SMxxx0.QSSI12.0' of https://git.codelinaro.org/clo/la/platform/vendor/opensource/audio-kernel into thirteen
"LA.UM.9.1.r1-12600-SMxxx0.QSSI12.0"

 By Sandhya Mutha Naga Venkata (1) and Shazmaan Ali (1)
 Via Gerrit - the friendly Code Review server (2) and Linux Build Service Account (1)

* tag 'LA.UM.9.1.r1-12600-SMxxx0.QSSI12.0' of https://git.codelinaro.org/clo/la/platform/vendor/opensource/audio-kernel:
  asoc: codecs: Add nullptr check
  asoc: codecs: Add nullptr check
2022-09-30 06:43:07 +05:30
Francisco Franco
bf7bc86925 techpack/audio: bolero: Add sound control
- This patch only adds sound control for headphones gain, mic gain

Co-authored-by: Joel Gómez <nahuelgomez329@gmail.com>
Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
Signed-off-by: Simarpreet Singh <simar@linux.com>
Signed-off-by: Joel Gómez <nahuelgomez329@gmail.com>
Signed-off-by: Cyber Knight <cyberknight755@gmail.com>
2022-08-11 12:01:28 +05:30
Yaroslav Furman
6c9969eddb drivers: remove a few loggers
Signed-off-by: Yaroslav Furman <yaro330@gmail.com>
2022-06-23 11:15:25 +05:30
Adam W. Willis
e697699d83 treewide: Don't warn about IPC logging failures
Seeing as we shut this down intentionally, I don't see why we need
to be alerted it's failure, repeatedly, and from multiple drivers.

Signed-off-by: Adam W. Willis <return.of.octobot@gmail.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2022-06-23 11:12:26 +05:30
Adam W. Willis
cd5ca20dfa treewide: Don't warn about debugfs init failure if disabled
Silence loggers directly where possible in order to avoid
extraneous guarding. Additionally, clean up npu_debugfs.

Signed-off-by: Adam W. Willis <return.of.octobot@gmail.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2022-06-23 11:12:09 +05:30
Jebaitedneko
c33ee5bd4a techpack: audio: remove qos requests for sm6150
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2022-06-23 11:11:00 +05:30
Jebaitedneko
b6ef8fc8e4 techpack: codecs: wcd_cpe_core: fix fortification
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2022-06-23 11:10:42 +05:30
Sultan Alsawaf
4214b97a85 ASoC: dsp: amrwb_in: Fix AUDIO_GET_AMRWB_ENC_CONFIG ioctl
The non-blocking if-statement here causes the AUDIO_GET_AMRWB_ENC_CONFIG
ioctl to always return -EFAULT, even upon success. Fix it by correctly
guarding the -EFAULT return value.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2022-06-23 11:09:59 +05:30
Pranav Vashi
fb321106d0 techpack: audio: Update routing for mic2
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Change-Id: I6be49728f85f3b713891647b8e9e595fb54ac47b
2022-06-23 11:07:11 +05:30
Pranav Vashi
369c39b74b techpack: asoc: Add supported formats for all cases
* Fixes call recording when switched to Multimedia9.

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2022-06-23 11:06:26 +05:30
Sultan Alsawaf
b9b5d97f4d ASoC: dsp: msm-dts-srs-tm-config: Fix trivial unguarded pr_debug()
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2022-06-23 11:03:37 +05:30
Sultan Alsawaf
92c7f3dc44 ASoC: dsp: q6afe: Fix uninitialized th_vi_v_vali variable usage
The on-stack th_vi_v_vali struct is not fully initialized by
afe_get_sp_th_vi_v_vali_data(), leaving members of the th_vi_v_vali
struct used despite not being initialized. Fix it by zeroing out the
memory in afe_get_sp_th_vi_v_vali_data().

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2022-06-23 11:03:37 +05:30
Sultan Alsawaf
31e27f165e ASoC: dsp: voice_mhi: Fix uninitialized variable usage
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2022-06-23 11:03:37 +05:30
Sultan Alsawaf
76ae044d6b ASoC: codecs: Fix uninitialized variable usage
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2022-06-23 11:03:37 +05:30