aboutsummaryrefslogtreecommitdiffstats
path: root/package/kernel/ath10k-ct
diff options
context:
space:
mode:
Diffstat (limited to 'package/kernel/ath10k-ct')
-rw-r--r--package/kernel/ath10k-ct/patches/130-ath10k-read-qcom-coexist-support-as-a-u32.patch60
1 files changed, 60 insertions, 0 deletions
diff --git a/package/kernel/ath10k-ct/patches/130-ath10k-read-qcom-coexist-support-as-a-u32.patch b/package/kernel/ath10k-ct/patches/130-ath10k-read-qcom-coexist-support-as-a-u32.patch
new file mode 100644
index 0000000000..c835a33f49
--- /dev/null
+++ b/package/kernel/ath10k-ct/patches/130-ath10k-read-qcom-coexist-support-as-a-u32.patch
@@ -0,0 +1,60 @@
+From 630df9786fdaeb78c21f1e28c9b70ac83a1b482c Mon Sep 17 00:00:00 2001
+From: Vincent Tremblay <vincent@vtremblay.dev>
+Date: Sat, 31 Dec 2022 09:24:00 -0500
+Subject: [PATCH] ath10k: read qcom,coexist-support as a u32
+
+Read qcom,coexist-support as a u32 instead of a u8
+
+When we set the property to <1> in the DT (as specified in the doc),
+"of_property_read_u8" read 0 instead of 1. This is because of the data format.
+
+By default <1> is written with 32 bits.
+The problem is that the driver is trying to read a u8.
+
+The difference can be visualized using hexdump in a running device:
+Default 32 bits output:
+=======================
+0000000 0000 0100
+0000004
+
+8 bits output:
+==============
+0000000 0001
+0000001
+
+By changing "of_property_read_u8" by "of_property_read_u32", the driver
+is aligned with the documentation and is able to read the value without
+modifying the DT.
+
+The other solution would be to force the value in the DT to be saved as
+an 8 bits value (qcom,coexist-support = /bits/ 8 <1>),
+which is against the doc and less intuitive.
+
+Validation:
+===========
+The patch was tested on a real device and we can see in the debug logs
+that the feature is properly initialized:
+
+[ 109.102097] ath10k_ahb a000000.wifi: boot coex_support 1 coex_gpio_pin 52
+
+Signed-off-by: Vincent Tremblay <vincent@vtremblay.dev>
+
+--- a/ath10k-5.15/core.c
++++ b/ath10k-5.15/core.c
+@@ -2798,14 +2798,14 @@ done:
+ static void ath10k_core_fetch_btcoex_dt(struct ath10k *ar)
+ {
+ struct device_node *node;
+- u8 coex_support = 0;
++ u32 coex_support = 0;
+ int ret;
+
+ node = ar->dev->of_node;
+ if (!node)
+ goto out;
+
+- ret = of_property_read_u8(node, "qcom,coexist-support", &coex_support);
++ ret = of_property_read_u32(node, "qcom,coexist-support", &coex_support);
+ if (ret) {
+ ar->coex_support = true;
+ goto out;
ef='#n236'>236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394