Skip to content

rkr7.2: clk: rk808: fix platform_device_id names for the clkout cells + regulator, rtc, pwrkey cells - #518

Merged
nyanmisaka merged 2 commits into
armbian:rk-6.1-rkr7.2from
rpardini:nyanmisaka-rk-6.1-rkr7.2-fixes-batch1
Aug 8, 2026
Merged

rkr7.2: clk: rk808: fix platform_device_id names for the clkout cells + regulator, rtc, pwrkey cells#518
nyanmisaka merged 2 commits into
armbian:rk-6.1-rkr7.2from
rpardini:nyanmisaka-rk-6.1-rkr7.2-fixes-batch1

Conversation

@rpardini

@rpardini rpardini commented Aug 7, 2026

Copy link
Copy Markdown
Member

Few things that hadn't landed on previous rkr, plus a fix for essentially every RK809/RK817 board with an SDIO WiFi module lost WiFi in rkr7.2


clk: rk808: fix platform_device_id names for the clkout cells

Commit ea9b5ac ("mfd: rk8xx: add multi-PMIC coexistence support for
rk8xx series") renamed the per-variant MFD cells and gave each child driver
a platform_device_id table to match on. The clkout table got the suffix
wrong: it lists "rk805-clk", "rk817-clk", ... while rk808.c registers the
platform devices as "rk805-clkout", "rk817-clkout", ...

No entry matches a real device, and the driver name does not save it either.
platform_match() returns as soon as a driver has an id_table:

    if (pdrv->id_table)
        return platform_match_id(pdrv->id_table, pdev) != NULL;

    /* fall-back to driver name match */
    return (strcmp(pdev->name, drv->name) == 0);

so introducing the table also stopped "rk808-clkout" from matching the
driver's own name, which is how it used to bind. rk808_clkout_probe()
therefore never runs on any variant, RK808 included, and the PMIC registers
no clock provider at all.

Every consumer of <&rk8xx 1> then gets -EPROBE_DEFER forever. On boards with
an SDIO WiFi module that means mmc-pwrseq-simple never probes, so the SDIO
host never gets a pwrseq and never enumerates the card:

  [WLAN_RFKILL]: wlan_platdata_parse_dt: The ref_wifi_clk not found !
  platform sdio-pwrseq: deferred probe pending
  dwmmc_rockchip fe000000.mmc: <re-probed indefinitely, no mmc host>

Before that commit there was no id_table and every variant used the
"rk808-clkout" cell name, so all of them bound via the driver name. That is
why this only shows up now.

Fix the table to use the device names rk808.c actually creates. RK801 has no
clkout cell, so it is intentionally absent.


mfd: rk8xx: fix platform_device_id names for the regulator, rtc and pwrkey cells

Same class of bug as the clkout table: the id tables added by ea9b5ac
("mfd: rk8xx: add multi-PMIC coexistence support for rk8xx series") list
device names that rk808.c never creates, while omitting names it does.

RK809 shares the rk817s[] cell array with RK817 (see the RK809_ID/RK817_ID
fallthrough in rk808_probe()), so the platform devices are called
"rk817-regulator", "rk817-rtc" and "rk817-pwrkey". There is no such thing as
an "rk809-*" device, making those three entries permanently dead. Conversely
"rk808-regulator" and "rk808-rtc" are created by rk808s[] but are in no
table, and "rk801-pwrkey" is created by rk801s[] but is in no table.

This is not cosmetic. platform_match() returns as soon as a driver has an
id_table:

    if (pdrv->id_table)
        return platform_match_id(pdrv->id_table, pdev) != NULL;

    /* fall-back to driver name match */
    return (strcmp(pdev->name, drv->name) == 0);

so once these tables exist the drv->name fallback is unreachable, and a
device missing from the table binds to nothing at all. RK808 boards
therefore come up with no regulators and no RTC, and RK801 boards with no
power key.

Replace the impossible rk809-* entries with the names that are actually
missing. rk801-regulator needs no entry: it is handled by its own driver in
drivers/regulator/rk801-regulator.c, which has no id_table and so still
matches by name.


Assisted-by: Claude Opus 5

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 712a8577-8ee5-449c-acf3-71b333e75b37

📥 Commits

Reviewing files that changed from the base of the PR and between 0b72b75 and c433f91.

📒 Files selected for processing (4)
  • drivers/clk/clk-rk808.c
  • drivers/input/misc/rk805-pwrkey.c
  • drivers/regulator/rk808-regulator.c
  • drivers/rtc/rtc-rk808.c
🚧 Files skipped from review as they are similar to previous changes (1)
  • drivers/clk/clk-rk808.c

Walkthrough

The change updates RK8xx platform device ID tables. The clock driver uses *-clkout identifiers and adds rk808-clkout. The power-key driver adds rk801-pwrkey. The regulator and RTC drivers use rk808-regulator and rk808-rtc instead of their RK809 identifiers.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Suggested reviewers: amazingfate

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the platform_device_id fixes for clkout, regulator, RTC, and power-key cells.
Description check ✅ Passed The description explains the device-name mismatches, their effects, and the fixes covered by the changeset.
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.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
arch/arm64/boot/dts/rockchip/rk3568-mixtile-edge2.dts (1)

537-538: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Document rockchip,clk-32k-always-on in the RK809 binding.

drivers/clk/clk-rk808.c consumes this property to mark rk808-clkout2 as critical, but the RK809 bindings only define clock-output-names and do not define it. Add a boolean property definition before relying on it in this and the existing rk3576s-rk809-tablet-v10 node.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@arch/arm64/boot/dts/rockchip/rk3568-mixtile-edge2.dts` around lines 537 -
538, Add the boolean rockchip,clk-32k-always-on property definition to the RK809
binding schema, alongside the existing clock-output-names definition, so both
rk3568-mixtile-edge2 and rk3576s-rk809-tablet-v10 nodes are formally supported.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@drivers/auxdisplay/lcd-vk2c21.c`:
- Around line 434-441: Update brightness_show to acquire d->lock before reading
d->brightness, copy the protected value to a local variable, then release the
lock before formatting the sysfs response. Use the local value for both the
default comparison and numeric output, preserving the existing output format.

---

Nitpick comments:
In `@arch/arm64/boot/dts/rockchip/rk3568-mixtile-edge2.dts`:
- Around line 537-538: Add the boolean rockchip,clk-32k-always-on property
definition to the RK809 binding schema, alongside the existing
clock-output-names definition, so both rk3568-mixtile-edge2 and
rk3576s-rk809-tablet-v10 nodes are formally supported.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b1bafa44-8899-4860-b8d2-41eaab7fb82c

📥 Commits

Reviewing files that changed from the base of the PR and between 0b72b75 and ef9f004.

📒 Files selected for processing (4)
  • arch/arm64/boot/dts/rockchip/rk3568-mixtile-edge2.dts
  • arch/arm64/boot/dts/rockchip/rk3588-recomputer-rk3588-devkit.dts
  • drivers/auxdisplay/lcd-vk2c21.c
  • drivers/clk/clk-rk808.c

Comment thread drivers/auxdisplay/lcd-vk2c21.c Outdated
Comment thread drivers/clk/clk-rk808.c
rpardini and others added 2 commits August 7, 2026 21:40
Commit ea9b5ac ("mfd: rk8xx: add multi-PMIC coexistence support for
rk8xx series") renamed the per-variant MFD cells and gave each child driver
a platform_device_id table to match on. The clkout table got the suffix
wrong: it lists "rk805-clk", "rk817-clk", ... while rk808.c registers the
platform devices as "rk805-clkout", "rk817-clkout", ...

No entry matches a real device, and the driver name does not save it either.
platform_match() returns as soon as a driver has an id_table:

	if (pdrv->id_table)
		return platform_match_id(pdrv->id_table, pdev) != NULL;

	/* fall-back to driver name match */
	return (strcmp(pdev->name, drv->name) == 0);

so introducing the table also stopped "rk808-clkout" from matching the
driver's own name, which is how it used to bind. rk808_clkout_probe()
therefore never runs on any variant, RK808 included, and the PMIC registers
no clock provider at all.

Every consumer of <&rk8xx 1> then gets -EPROBE_DEFER forever. On boards with
an SDIO WiFi module that means mmc-pwrseq-simple never probes, so the SDIO
host never gets a pwrseq and never enumerates the card:

  [WLAN_RFKILL]: wlan_platdata_parse_dt: The ref_wifi_clk not found !
  platform sdio-pwrseq: deferred probe pending
  dwmmc_rockchip fe000000.mmc: <re-probed indefinitely, no mmc host>

Before that commit there was no id_table and every variant used the
"rk808-clkout" cell name, so all of them bound via the driver name. That is
why this only shows up now.

Fix the table to use the device names rk808.c actually creates. RK801 has no
clkout cell, so it is intentionally absent.

Signed-off-by: Ricardo Pardini <ricardo@pardini.net>
Assisted-By: Claude Opus 5 <noreply@anthropic.com>
…wrkey cells

Same class of bug as the clkout table: the id tables added by ea9b5ac
("mfd: rk8xx: add multi-PMIC coexistence support for rk8xx series") list
device names that rk808.c never creates, while omitting names it does.

RK809 shares the rk817s[] cell array with RK817 (see the RK809_ID/RK817_ID
fallthrough in rk808_probe()), so the platform devices are called
"rk817-regulator", "rk817-rtc" and "rk817-pwrkey". There is no such thing as
an "rk809-*" device, making those three entries permanently dead. Conversely
"rk808-regulator" and "rk808-rtc" are created by rk808s[] but are in no
table, and "rk801-pwrkey" is created by rk801s[] but is in no table.

This is not cosmetic. platform_match() returns as soon as a driver has an
id_table:

	if (pdrv->id_table)
		return platform_match_id(pdrv->id_table, pdev) != NULL;

	/* fall-back to driver name match */
	return (strcmp(pdev->name, drv->name) == 0);

so once these tables exist the drv->name fallback is unreachable, and a
device missing from the table binds to nothing at all. RK808 boards
therefore come up with no regulators and no RTC, and RK801 boards with no
power key.

Replace the impossible rk809-* entries with the names that are actually
missing. rk801-regulator needs no entry: it is handled by its own driver in
drivers/regulator/rk801-regulator.c, which has no id_table and so still
matches by name.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@rpardini
rpardini force-pushed the nyanmisaka-rk-6.1-rkr7.2-fixes-batch1 branch from ef9f004 to c433f91 Compare August 7, 2026 19:41
@rpardini rpardini changed the title rkr7.2: batch of fixes (mainly clk: rk808: fix platform_device_id names for the clkout cells) rkr7.2: clk: rk808: fix platform_device_id names for the clkout cells + regulator, rtc, pwrkey cells Aug 7, 2026
@rpardini

rpardini commented Aug 7, 2026

Copy link
Copy Markdown
Member Author

Added pwrkey/rtc/regulator cell fixes, dropped unrelated board-level patches.

@coderabbitai re-review

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

@rpardini I will re-review the updated changes in #518.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@nyanmisaka
nyanmisaka merged commit 57b1edc into armbian:rk-6.1-rkr7.2 Aug 8, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants