Skip to content

rockchip64: RG Vita Pro drivers - address CodeRabbit review comments from #10321 - #10376

Merged
igorpecovnik merged 4 commits into
armbian:mainfrom
crackerjacques:rg-vita-pro-driver-fixes
Aug 9, 2026
Merged

rockchip64: RG Vita Pro drivers - address CodeRabbit review comments from #10321#10376
igorpecovnik merged 4 commits into
armbian:mainfrom
crackerjacques:rg-vita-pro-driver-fixes

Conversation

@crackerjacques

@crackerjacques crackerjacques commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #10321: addresses the CodeRabbit findings on the Anbernic RG Vita Pro
driver patches that were left unaddressed at merge. Four independent, low-risk
fixes, each applied to both rockchip64-7.1 and rockchip64-7.2:

  • rocknix generic-dsi panel — honor the configured ready delay. load_globals()
    parsed ctx->delays.ready but the msleep() using it was commented out, so the
    panel-description ready delay was ignored.
  • spi-mcu-joypaddepends on LEDS_CLASS_MULTICOLOR. The driver calls
    devm_led_classdev_multicolor_register() unconditionally, but the old
    depends on LEDS_CLASS_MULTICOLOR || LEDS_CLASS_MULTICOLOR=n allowed building it
    with the multicolor LED class disabled, which fails to link.
  • sgm41542 — return PTR_ERR(sgm->charger) instead of -EINVAL on
    IS_ERR(), so -EPROBE_DEFER from devm_power_supply_register() is preserved.
  • cw221x — fix the dead zero-assignment on the firmware-mismatch path: the error
    branch set cw_bat->cw_current = 0 but a later unconditional
    cw_bat->cw_current = cw_current overwrote it with the stale unscaled value, so the
    reported current was never actually zeroed.

The remaining CodeRabbit comments on these drivers are either intentional
(rmi4 -EPROBE_DEFER for the TDDI touch IC startup) or hardware limitations
(the MCU exposes a single global LED brightness level, not per-ring), so they are
left as-is.

Testing

Built rockchip64 edge (7.1) and bleedingedge (7.2-rc6).

Summary by CodeRabbit

  • New Features
    • Added support for configurable generic MIPI-DSI display panels, including display modes, orientation, backlight, power sequencing, and initialization.
    • Added SPI MCU joypad support with analog controls and multicolor RGB LED functionality.
    • Added battery monitoring for CW2215/CW2217/CW2218 fuel gauges, including capacity, temperature, current, cycle count, and health reporting.
    • Added SGM41542 single-cell charger support with charging controls, battery status, fault reporting, and USB OTG power output.

crackerjacques added 4 commits August 9, 2026 13:22
load_globals() parsed ctx->delays.ready but the msleep() using it was commented out, so the panel-description ready delay was ignored. Apply it before marking the panel prepared.

Signed-off-by: crackerjacques <jack@supremeoverlordjabs.co>
The driver calls devm_led_classdev_multicolor_register() unconditionally, but the Kconfig (depends on LEDS_CLASS_MULTICOLOR || LEDS_CLASS_MULTICOLOR=n) allowed building it with the multicolor LED class disabled, which fails to link. Depend on LEDS_CLASS_MULTICOLOR.

Signed-off-by: crackerjacques <jack@supremeoverlordjabs.co>
devm_power_supply_register() can return -EPROBE_DEFER; returning -EINVAL on IS_ERR() dropped that and broke deferred probe. Return PTR_ERR(sgm->charger).

Signed-off-by: crackerjacques <jack@supremeoverlordjabs.co>
… path

The firmware-mismatch branch set cw_bat->cw_current = 0, but the unconditional cw_bat->cw_current = cw_current a few lines later overwrote it with the stale unscaled value, so the error path never zeroed the reported current. Zero the local cw_current instead.

Signed-off-by: crackerjacques <jack@supremeoverlordjabs.co>
@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The patch set updates Rockchip64 7.1 and 7.2 kernel support. It enables the panel ready delay, integrates the SPI MCU joypad, corrects CW221x fallback current handling, and propagates SGM41542 registration errors.

Changes

Rockchip64 driver updates

Layer / File(s) Summary
Panel ready-delay handling
patch/kernel/archive/rockchip64-7.1/general-drm-panel-add-rocknix-generic-dsi.patch, patch/kernel/archive/rockchip64-7.2/general-drm-panel-add-rocknix-generic-dsi.patch
The panel preparation sequence now applies the configured ready delay before marking the panel prepared.
SPI MCU joypad integration
patch/kernel/archive/rockchip64-7.1/general-input-add-spi-mcu-joypad-01-options.patch, patch/kernel/archive/rockchip64-7.2/general-input-add-spi-mcu-joypad-01-options.patch
The joystick configuration requires multicolor LED support and the 7.2 patch adds Kconfig and Makefile wiring for the driver components.
CW221x current fallback
patch/kernel/archive/rockchip64-7.1/general-power-supply-add-cw221x.patch, patch/kernel/archive/rockchip64-7.2/general-power-supply-add-cw221x.patch
Unsupported firmware detection now produces a zero current value through the common state assignment.
SGM41542 error propagation
patch/kernel/archive/rockchip64-7.1/general-power-supply-add-sgm41542.patch, patch/kernel/archive/rockchip64-7.2/general-power-supply-add-sgm41542.patch
Power-supply registration failures now return the underlying PTR_ERR value instead of -EINVAL.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested labels: BSP, Framework

Suggested reviewers: igorpecovnik, rpardini, iav

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the rockchip64 RG Vita Pro driver fixes and their purpose as follow-up CodeRabbit review changes.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added 08 Milestone: Third quarter release Needs review Seeking for review Hardware Hardware related like kernel, U-Boot, ... Patches Patches related to kernel, U-Boot, ... size/small PR with less then 50 lines labels Aug 9, 2026
@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

✅ This PR has been reviewed and approved — all set for merge!

@github-actions github-actions Bot added Ready to merge Reviewed, tested and ready for merge and removed Needs review Seeking for review labels Aug 9, 2026
@igorpecovnik
igorpecovnik merged commit 9915867 into armbian:main Aug 9, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

08 Milestone: Third quarter release Hardware Hardware related like kernel, U-Boot, ... Patches Patches related to kernel, U-Boot, ... Ready to merge Reviewed, tested and ready for merge size/small PR with less then 50 lines

Development

Successfully merging this pull request may close these issues.

3 participants