From: Arsenii Pashchenko <ulijg308@gmail.com>
To: pkshih@realtek.com
Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
Arsenii Pashchenko <ulijg308@gmail.com>
Subject: [PATCH 0/4] wifi: rtw88: rtw8822c: refactor DAC IQ calibration to s32
Date: Wed, 12 Aug 2026 21:45:42 +0700 [thread overview]
Message-ID: <cover.1786545572.git.ulijg308@gmail.com> (raw)
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
next reply other threads:[~2026-08-12 14:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-12 14:45 Arsenii Pashchenko [this message]
2026-08-12 14:45 ` [PATCH 1/4] wifi: rtw88: rtw8822c: convert DAC IQ buffers and signatures to s32 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1786545572.git.ulijg308@gmail.com \
--to=ulijg308@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=pkshih@realtek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox