The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH 0/4] wifi: rtw88: rtw8822c: refactor DAC IQ calibration to s32
@ 2026-08-12 14:45 Arsenii Pashchenko
  2026-08-12 14:45 ` [PATCH 1/4] wifi: rtw88: rtw8822c: convert DAC IQ buffers and signatures " Arsenii Pashchenko
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Arsenii Pashchenko @ 2026-08-12 14:45 UTC (permalink / raw)
  To: pkshih; +Cc: linux-wireless, linux-kernel, Arsenii Pashchenko

This series refactors the Digital-to-Analog Converter (DAC) IQ 
calibration routines in the rtw8822c driver. 

The original code heavily relies on unsigned 32-bit math mapped over
a 10-bit circular hardware register scale centered around 0x200. This 
introduces complex nested boundary checks, custom bubble sort rules,
and custom min/max tracking helpers.

By migrating the temporary stack arrays and signatures to signed s32
and utilizing the kernel's sign_extend32() API, the coordination system 
is linearized. This allows the removal of internal custom helpers and 
collapses unsigned wrap-around logic into standard linear operations.

The series is broken down as follows:
Patch 1: Prepares signatures and stack buffers, converting types to s32.
Patch 2: Introduces sign_extend32() and simplifies the validation window.
Patch 3: Replaces custom bubble sort with the kernel's native sort().
Patch 4: Eliminates minmax_cmp, streamlining search and offset loops.

AI Disclosure:
An AI assistant was used for source code analysis and conceptual 
consultation regarding the signed math transformation. All code 
modifications, final implementations, and refactoring steps were 
written, reviewed, and verified manually by the author.

Testing:
- Every patch in the series was verified with scripts/checkpatch.pl 
  and yielded 0 errors and 0 warnings.
- Each patch was sequentially built (bisected and compiled) to ensure 
  there are no compiler warnings, pointer type mismatches, or broken 
  builds at any intermediate step.

Arsenii Pashchenko (4):
  wifi: rtw88: rtw8822c: convert DAC IQ buffers and signatures to s32
  wifi: rtw88: rtw8822c: use sign_extend32 for DAC IQ validation
  wifi: rtw88: rtw8822c: switch to the kernel's sort() library
  wifi: rtw88: rtw8822c: simplify amplitude search and offset via s32

 drivers/net/wireless/realtek/rtw88/rtw8822c.c | 146 ++++++------------
 1 file changed, 43 insertions(+), 103 deletions(-)

-- 
2.55.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-08-12 14:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-12 14:45 [PATCH 0/4] wifi: rtw88: rtw8822c: refactor DAC IQ calibration to s32 Arsenii Pashchenko
2026-08-12 14:45 ` [PATCH 1/4] wifi: rtw88: rtw8822c: convert DAC IQ buffers and signatures " Arsenii Pashchenko
2026-08-12 14:45 ` [PATCH 2/4] wifi: rtw88: rtw8822c: use sign_extend32 for DAC IQ validation Arsenii Pashchenko
2026-08-12 14:45 ` [PATCH 3/4] wifi: rtw88: rtw8822c: switch to the kernel's sort() library Arsenii Pashchenko
2026-08-12 14:45 ` [PATCH 4/4] wifi: rtw88: rtw8822c: simplify amplitude search and offset via s32 Arsenii Pashchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox