56 Commits

Author SHA1 Message Date
Alexander Winkowski
70b361709c ASoC: Add support for atoll platform
Change-Id: Ie00e2131eed67240ae4f94e6a40b28dda9f67640
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
2024-08-21 01:17:19 +02:00
Alexander Winkowski
5da0e2b310 Revert "soc: pinctrl-lpi: Initialise at late_initcall"
This reverts commit ea5aa7a3fe.

The issue has been fixed properly in Idafc26a739df1831d04ea2fde4625e8f9ca1a0ae

Change-Id: I8275c11660af6cd03907970dea020897b66ceaa3
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
2024-08-21 01:17:19 +02:00
Angelo G. Del Regno
36412f493c 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-08-21 01:17:19 +02:00
Vignesh Kulothungan
9a5c46b851 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-08-21 01:17:19 +02:00
Andrzej Perczak
b8a8592453 ASoC: bolero-cdc: Fix unitialized rwsem usage
Change-Id: I2bf6f64d34eb082521c92c0b6c22b904d5f73302
Signed-off-by: Andrzej Perczak <linux@andrzejperczak.com>
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
2024-08-21 01:16:54 +02:00
Meng Wang
ebc42fa574 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-02-24 10:04:15 +01:00
Laxminath Kasam
85ecaa18b0 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-02-24 09:19:49 +01:00
Laxminath Kasam
376c585830 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-02-24 09:19:49 +01:00
Laxminath Kasam
daabac664a 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-02-24 09:19:49 +01:00
Soumya Managoli
c29fdf762c 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-02-24 09:19:16 +01:00
chematelegram
40f3cd0d6e Merge tag 'LA.UM.9.1.r1-14900-SMxxx0.QSSI14.0' of https://git.codelinaro.org/clo/la/platform/vendor/opensource/audio-kernel into udc
"LA.UM.9.1.r1-14900-SMxxx0.QSSI14.0"
2023-12-02 01:53:05 +01:00
Soumya Managoli
dfb1b1d6f2 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-02 01:11:59 +01:00
Shalini Manjunatha
24cbab58a2 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-02 01:11:13 +01:00
Soumya Managoli
c3d1fee1d5 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-02 01:10:49 +01:00
Karthikeyan Mani
4674678e05 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-02 01:10:12 +01:00
Shalini Manjunatha
860fe11c5e 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-02 00:56:34 +01:00
Soumya Managoli
f4efe1fb1f 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-02 00:55:26 +01:00
chematelegram
b92524bf0e Merge tag 'LA.UM.9.1.r1-14600-SMxxx0.QSSI14.0' of https://git.codelinaro.org/clo/la/platform/vendor/opensource/audio-kernel into tiramisu
"LA.UM.9.1.r1-14600-SMxxx0.QSSI14.0"
2023-11-03 09:10:45 +01:00
chematelegram
77cc07340c Merge tag 'LA.UM.9.1.r1-13900-SMxxx0.QSSI13.0' of https://git.codelinaro.org/clo/la/platform/vendor/opensource/audio-kernel into pyro
"LA.UM.9.1.r1-13900-SMxxx0.QSSI13.0"
2023-09-27 00:54:12 +02:00
chematelegram
90ff638f38 Merge tag 'LA.UM.9.1.r1-13700-SMxxx0.QSSI13.0' of https://git.codelinaro.org/clo/la/platform/vendor/opensource/audio-kernel into tiramisu
"LA.UM.9.1.r1-13700-SMxxx0.QSSI13.0"
2023-07-23 07:17:11 +00:00
Soumya Managoli
d424362258 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.

Change-Id: I7753cc6db394704dbb959477150141d42b836bef
Signed-off-by: Soumya Managoli <quic_c_smanag@quicinc.com>
2023-06-10 21:01:41 +00:00
Panchajanya1999
bfcc3d3ba7 techpack/codecs: AAC: Hardcode max_bitrate to 384k
Our DSP is supposed to support this.

Change-Id: Ib93ee2ec1b0c1a2fd1269f64d5f133db65d1b4a0
Suggested-by: Steve Kondik <shade@chemlab.org>
Signed-off-by: Panchajanya1999 <panchajanya@azure-dev.live>
2023-05-31 21:08:56 +00:00
Adam W. Willis
421427430e 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-11-29 22:09:21 +00:00
Joel Gómez
f0c7610736 techpack: audio: wcd_cpe: fix more enum conversion warnings
../techpack/audio/asoc/codecs/wcd_cpe_services.c:1349: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);
                   ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

Signed-off-by: Joel Gómez <nahuelgomez329@gmail.com>
2022-10-08 23:44:52 +00:00
Artem Borisov
1034138169 techpack: codecs: wcd_cpe: Fix enum conversion warnings
Change-Id: I0fe6b10f55b5243d55e4c18c8f44d5bb123bd865
2022-10-08 23:44:52 +00:00
Fiqri Ardyansyah
188d8bfd24 treewide: Fix error cause a function declaration is deprecated
Fixes warns on clang 15.0.0:

../techpack/data/drivers/rmnet/perf/rmnet_perf_opt.c:715:27: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
rmnet_perf_free_hash_table()
                          ^
                           void
  CC      net/bluetooth/hci_conn.o
  CC      drivers/base/attribute_container.o
1 error generated.

../drivers/staging/qcacld-3.0/../qca-wifi-host-cmn/target_if/core/src/target_if_main.c:91:40: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
struct target_if_ctx *target_if_get_ctx()
                                       ^
                                        void
1 error generated.
  CC      drivers/staging/qcacld-3.0/../qca-wifi-host-cmn/umac/dfs/core/src/misc/dfs_nol.o
make[4]: *** [../scripts/Makefile.build:364: drivers/staging/qcacld-3.0/../qca-wifi-host-cmn/target_if/core/src/target_if_main.o] Error 1
make[4]: *** Waiting for unfinished jobs....
../drivers/staging/qcacld-3.0/../qca-wifi-host-cmn/hif/src/ce/ce_service_legacy.c:1320:34: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
struct ce_ops *ce_services_legacy()
                                 ^
                                  void
1 error generated.

Signed-off-by: Fiqri Ardyansyah <fiqri15072019@gmail.com>
Signed-off-by: Pranav Temkar <pranavtemkar@gmail.com>
2022-10-08 23:44:52 +00:00
EcrosoftXiao
496090e185 Merge tag '56c032bd04fdfcb4ee8a9a4fd9480abed4d6f839' into HEAD
"LA.UM.9.1.r1-11500-SMxxx0.0"
2022-01-22 19:29:37 +08:00
Sultan Alsawaf
243b1e9dab 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>
2021-07-13 13:37:03 +00:00
Sultan Alsawaf
f914bb02cc ASoC: dsp: msm-dts-srs-tm-config: Fix trivial unguarded pr_debug()
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
2021-07-13 13:37:02 +00:00
Sultan Alsawaf
541bf3cfb6 ASoC: msm-pcm-routing-v2: Fix non-blocking if-statement warning
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
2021-07-13 13:36:21 +00:00
EcrosoftXiao
938ec06987 Merge tag '5df489730261cb5510c6580e1798f8c6c490dd7b' into eleven
"LA.UM.9.1.r1-09600-SMxxx0.0"
2021-05-04 17:03:56 +08:00
EcrosoftXiao
55a1a28fb1 Merge tag 'a72946f9a1de52fadef6902442e6dc861f45aa0c' into HEAD
"LA.UM.9.1.r1-09200-SMxxx0.0"
2021-04-11 14:33:31 +08:00
EcrosoftXiao
1dd294571c Merge tag 'c58176bac41113662f56243a330ba16272004a42' into HEAD
"LA.UM.9.1.r1-09200-SMxxx0.0"
2021-04-11 14:33:08 +08:00
EcrosoftXiao
8e9ba53d30 Merge tag '3b4022f9747f6d8ffa8a11bdef0f5c7313bd1090' into HEAD
"LA.UM.9.1.r1-09100-SMxxx0.0"
2021-03-05 20:18:20 +08:00
Danny Lin
ec87cd8806 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>
2021-01-27 22:42:18 +08:00
Evasi0n Xiao
dda5dc740b techpack: audio: fix mismerge 2021-01-27 16:33:22 +08:00
Sultan Alsawaf
5b8c6da303 qos: Replace cpumasks with atomic bitwise operations
This is expensive and unneeded, especially since the qos functions are
hot code paths. Mose of the cpumask functions use the bitmap API, which
is also more expensive than just doing some simple operations on a word.

Since we're operating with a CPU count that can fit within a word,
replace the expensive cpumask operations with plain bitwise operations
wherever possible to make the pm_qos framework more efficient.

Change-Id: Ida5f08d5c1e25aa790d814153f1c7fe7a5dd9850
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: UtsavBalar1231 <utsavbalar1231@gmail.com>
2021-01-27 15:21:06 +08:00
UtsavBalar1231
e662502b53 techpack: audio: dsp: Fix -Wundef warning
* Use proper if guard so that compiler won't spam dumb warning

Change-Id: I6becfab82a6f15a2d6177af307b3fa3da4e7b4e3
Signed-off-by: UtsavBalar1231 <utsavbalar1231@gmail.com>
2021-01-27 15:02:21 +08:00
Sultan Alsawaf
65e831c295 techpack: Fix uninitialized header usage
When the cmi header is filled, it isn't zeroed out; it's updated, so the
previous value it contains is retained as part of a bitmask. This
constitutes uninitialized usage of the cmi header struct.

Fix it by zeroing out the header with a memset, as is done elsewhere in
this driver.

This fixes the following warnings:
sound/soc/codecs/wcd_cpe_core.c: In function 'wcd_cpe_lab_ch_setup':
include/sound/cpe_cmi.h:173:18: error: 'lab_eob.hdr_info' may be used uninitialized in this function [-Werror=maybe-uninitialized]

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
[yaro: cpe_lab_enable fix is in place in 4.14 techpack]
Signed-off-by: Yaroslav Furman <yaro330@gmail.com>
2020-11-21 19:35:01 +08:00
Yaroslav Furman
a92de89ce3 teckpack: codecs: Use scnprintf() for robustness
Reasoning explained here 06236821ae

Also fixes this warning:
../techpack/audio/asoc/codecs/wcd-clsh.c:73:9: warning: ‘snprintf’ argument 4 overlaps destination object ‘buf’ [-Wrestrict]
   73 |   cnt = snprintf(buf, buflen - cnt - 1, "%s%s%s", buf,
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   74 |           buf[0] == '\0' ? "[" : "|",
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~
   75 |           states[i]);
      |

Signed-off-by: Yaroslav Furman <yaro330@gmail.com>
2020-11-21 19:35:01 +08:00
Yaroslav Furman
92e1cab265 techpack: q6asm: stfu
Signed-off-by: Yaroslav Furman <yaro330@gmail.com>
2020-11-21 19:35:00 +08:00
Yaroslav Furman
d302dd90b8 techpack: shut the fuck up
Signed-off-by: Yaroslav Furman <yaro330@gmail.com>
2020-11-21 19:35:00 +08:00
Yaroslav Furman
fcb5e46148 techpack: silence some more debugging
Signed-off-by: Yaroslav Furman <yaro330@gmail.com>
2020-11-21 19:35:00 +08:00
Yaroslav Furman
54fe27bc81 techpack: shut the fuck up
Shut the fuck up
You're a fucking cunt
Shut the fuck up
You're a stupid cunt, suck my dick
Shut the fuck up
Stop being a fucking cunt
Shut the fuck up
Nobody even wants you here
What?
I just want to let you know, you're a stupid fucking cunt
Go ahead and run your mouth, pussy, I don't give a fuck
You're a stupid piece of shit, you're a stupid fucking bitch
Get the fuck up off my dick, get the fuck up off my dick, like
Please end your fucking life, please end your fucking life
I really gotta emphasise, no one cares if you're alive
You're a fucking penis-hole, grab a dick and eat it whole
I need to know if you were dropped when you were just a fetus though
You're so fucking ugly and your face is fucking foul, jeez
You're so fucking loud, can you shut your fucking mouth, can you
Shut the fuck up
You're a fucking cunt
Shut the fuck up
You're a stupid cunt, suck my dick
Shut the fuck up
Stop being a fucking cunt
Shut the fuck up
Nobody even wants you here
Yeah
Close your fucking mouth, you're just really fucking dense
If you hate me, why you talking? You don't make no fucking sense
Got a sad life, sad life, go to fucking hell
Are you stupid or disabled, man, I can't fucking tell
Meh
You're a fucking dumb shit, you don't even run shit
Get the fuck up out of my face and go to hell and eat a dick
Come and catch these hands, boy
Come and match these bands, boy
I'm not crazy, I just do it all because I can, boy
I hope you fucking die in a high-speed car crash
I hope you fucking fall head-first and get your neck cracked
I hope you have some beautiful children that die from cancer
I hope you catch Zika when your wife gets pregnant
I hope you win the lottery and die the next day
And your daughter has to see you getting lowered in your grave
Like, uh, ooh- that was a little dark
I'm sorry. Tha-that was a little dark. Very poor taste
Shut the fuck up
I shouldn't have said that
You're a fucking cunt
Actually, no, I should have
Shut the fuck up
Actually, I didn't say enough
You're a stupid cunt, suck my dick
Shut the fuck up
Stop being a fucking cunt
Shut the fuck up
Nobody even wants you here

Signed-off-by: Yaroslav Furman <yaro330@gmail.com>
2020-11-21 19:34:59 +08:00
Park Ju Hyung
5f5eb1b42a techpack: build rmnet extensions
Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
Signed-off-by: UtsavBalar1231 <utsavbalar1231@gmail.com>
2020-11-21 19:34:58 +08:00
Carlos Ayrton Lopez Arroyo
c77b0a8b25 techpack: build inline
Signed-off-by: Carlos Ayrton Lopez Arroyo <15030201@itcelaya.edu.mx>
2020-11-21 19:34:24 +08:00
GuaiYiHu
2a7ef170d7 ASoC: Avoid spk_id_get duplicate defination
Change-Id: I03e0e05434d3998e921acdfc1b36d2916a3dcd67
Signed-off-by: UtsavBalar1231 <utsavbalar1231@gmail.com>
2020-11-21 19:34:03 +08:00
Danny Lin
2c79d27381 techpack: audio: Remove build timestamp injection
This causes parts of the audio module to be rebuilt during every
incremental build, even if there are no changes:

  CC      techpack/audio/ipc/apr.o - due to command line change
  CC      techpack/audio/ipc/apr_v2.o - due to command line change
  CC      techpack/audio/ipc/apr_tal_rpmsg.o - due to command line change
  CC      techpack/audio/ipc/wcd-dsp-glink.o - due to command line change

We're only experiencing this issue in techpack/audio/ipc at the moment,
but kill the timestamp injection in all the audio components to
eliminate the possibility of encountering this issue again in the
future. This is harmless since the injected BUILD_TIMESTAMP macro is
never used.

Change-Id: I35b588a2a902438b2c79ebbac31453f2e528bbbe
Signed-off-by: Danny Lin <danny@kdrag0n.dev>
2020-11-21 19:33:38 +08:00
Alin Jerpelea
85058a1b45 sound: wcd_cpe_core: fix unitialised variable
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
Signed-off-by: Yaroslav Furman <yaro330@gmail.com>
2020-11-21 19:33:38 +08:00
Albert I
0e5c29ffe5 techpack/audio: Kill debugging prints
These insane amount of debug flags added by Xiaomi in production kernel
is just horrible.

Signed-off-by: Albert I <kras@raphielgang.org>
Signed-off-by: UtsavisGreat <utsavbalar1231@gmail.com>
2020-11-21 19:33:37 +08:00