Skip to content

Odroid-M2: Fix USB-C port in OTG mode#9633

Merged
igorpecovnik merged 1 commit intoarmbian:mainfrom
mlegenovic:main
Apr 5, 2026
Merged

Odroid-M2: Fix USB-C port in OTG mode#9633
igorpecovnik merged 1 commit intoarmbian:mainfrom
mlegenovic:main

Conversation

@mlegenovic
Copy link
Copy Markdown
Contributor

@mlegenovic mlegenovic commented Apr 4, 2026

Description

Currently, USB-C port is dead on Odroid-M2 board. Port is configured in OTG mode. Changing dr_mode in DTS to "host" makes USB port working, but then it cannot act anymore as "device". Analysis has shown that the role switching is not working properly.

This PR fixes the role switching, and it adds missing pd-revision property.

How Has This Been Tested?

Before this fix USB-C port was dead. After this fix all connected devices are detected and powered on:

  • USB-C data stick
  • Xbox controller
  • Keyboard
  • External SSD driver (runs with SuperSpeed, ~420 MB/s)

Also when connected to a PC (role "device") communication works. I have only tested "Linux to Linux" communication:

  • After connecting cable, run sudo modprobe g_serial on Odroid-M2
  • In dmesg output on both devices (PC and Odroid-M2) there should be a message
  • From PC send message with echo "Hello" | sudo tee /dev/ttyACM0
  • On Odroid-M2 run sudo cat /dev/ttyGS0 to receive the message

Role switching works automatically, verified with sudo cat /sys/kernel/debug/usb/fc000000.usb/mode while changing connected devices.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My changes generate no new warnings

Summary by CodeRabbit

Bug Fixes

  • Enhanced USB-C OTG mode on Odroid-M2 devices (kernel 6.18 & 7.0) by adding Power Delivery revision support and adjusting power role negotiation for improved device compatibility.

Signed-off-by: Milivoje Legenovic <m.legenovic@gmail.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 4, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: bcc81815-469b-40a4-a4c0-4467b03d9436

📥 Commits

Reviewing files that changed from the base of the PR and between ee43699 and 29a73ab.

📒 Files selected for processing (2)
  • patch/kernel/archive/rockchip64-6.18/board-odroidm2-fix-usbc-in-otg-mode.patch
  • patch/kernel/archive/rockchip64-7.0/board-odroidm2-fix-usbc-in-otg-mode.patch

📝 Walkthrough

Walkthrough

Two kernel patch files for Rockchip64 (versions 6.18 and 7.0) update the Odroid-M2 device tree configuration to support USB-C OTG mode. Both patches add USB Power Delivery revision declaration and change the Type-C connector's power role negotiation setting from source to sink mode.

Changes

Cohort / File(s) Summary
Odroid-M2 USB-C OTG Configuration
patch/kernel/archive/rockchip64-6.18/board-odroidm2-fix-usbc-in-otg-mode.patch, patch/kernel/archive/rockchip64-7.0/board-odroidm2-fix-usbc-in-otg-mode.patch
Added pd-revision property (PD Rev 2.0) to usbc0 connector node and changed try-power-role from "source" to "sink" in the RK3588S Odroid-M2 device tree for both kernel versions.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 Whiskers twitch with glee,
USB-C finds harmony,
Power roles now agree—
OTG mode flows free!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically identifies the primary change: fixing USB-C port OTG mode behavior on the Odroid-M2 board through device tree configuration adjustments.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 and usage tips.

@github-actions github-actions bot added size/medium PR with more then 50 and less then 250 lines 05 Milestone: Second quarter release Needs review Seeking for review Hardware Hardware related like kernel, U-Boot, ... Patches Patches related to kernel, U-Boot, ... labels Apr 4, 2026
@github-actions github-actions bot added the Ready to merge Reviewed, tested and ready for merge label Apr 5, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 5, 2026

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

@github-actions github-actions bot removed the Needs review Seeking for review label Apr 5, 2026
@igorpecovnik igorpecovnik merged commit 28862c7 into armbian:main Apr 5, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

05 Milestone: Second 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/medium PR with more then 50 and less then 250 lines

Development

Successfully merging this pull request may close these issues.

3 participants