Skip to content

Tab5 ST7121 variant + fixes - #605

Merged
KenVanHoeylandt merged 4 commits into
TactilityProject:mainfrom
Shadowtrance:tab5-new-variant2
Aug 1, 2026
Merged

Tab5 ST7121 variant + fixes#605
KenVanHoeylandt merged 4 commits into
TactilityProject:mainfrom
Shadowtrance:tab5-new-variant2

Conversation

@Shadowtrance

@Shadowtrance Shadowtrance commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Added the newest variant to the tab5, St7121.
Fixed variant detection reliability
Fixed tab5 camera WHO_AM_I failing sometimes - moved reset to the driver rather than gpio hog
Fixed tab5 keyboard live rotation on boot and after stopping/starting lvgl

Summary by CodeRabbit

  • New Features
    • Added support for the latest M5Stack Tab5 V3 hardware and its ST7121 display.
    • Improved display and touch-controller detection across Tab5 variants.
    • Added automatic keyboard accessory attach and detach detection, including reconnection handling and rotation updates.
    • Added configurable camera reset handling.
  • Bug Fixes
    • Improved firmware probing reliability by retrying unreadable or unknown display versions.
    • Improved initialization error handling for display, touch, and camera components.
  • Documentation
    • Added documentation and licensing information for the new display driver.

Added the newest variant to the tab5, St7121.
Fixed variant detection reliability
Fixed tab5 camera WHO_AM_I failing sometimes
Fixed tab5 keyboard live rotation on boot and after stopping/starting lvgl
@coderabbitai

coderabbitai Bot commented Jul 31, 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: 7bed3935-61b5-43f4-ac53-8ad86ee6e310

📥 Commits

Reviewing files that changed from the base of the PR and between fefc4c6 and c7258de.

📒 Files selected for processing (2)
  • Devices/m5stack-tab5/Source/devices/tab5_keyboard.cpp
  • Devices/m5stack-tab5/Source/devices/tab5_keyboard_attach_detect.cpp
🚧 Files skipped from review as they are similar to previous changes (2)
  • Devices/m5stack-tab5/Source/devices/tab5_keyboard.cpp
  • Devices/m5stack-tab5/Source/devices/tab5_keyboard_attach_detect.cpp

📝 Walkthrough

Walkthrough

Added an ST7121 MIPI-DSI driver and integrated it with Tab5 V3 detection and display initialization. Shared ST7123 touch setup now serves V2 and V3 devices. SC2356 startup can pulse a configured reset GPIO. Keyboard attachment detection now runs through a periodic timer with reinitialization and LVGL rotation handling.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 45.24% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main ST7121 variant support and related fixes in the changeset.
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
🧪 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: 3

🧹 Nitpick comments (1)
Drivers/sc2356-module/source/sc2356.cpp (1)

91-92: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Preserve pin_reset.flags on descriptor acquisition.

The binding accepts a generic struct GpioPinSpec, including GPIO_FLAG_ACTIVE_LOW, but sc2356.cpp calls gpio_descriptor_acquire with the configured value overwritten by GPIO_FLAG_DIRECTION_OUTPUT | GPIO_FLAG_ACTIVE_LOW. If a device tree intentionally needs active.high reset polarity, it is ignored; either merge the spec flags with GPIO_FLAG_DIRECTION_OUTPUT, or change the binding to an explicit controller-plus-pin with an active-low-only API.

Source: MCP tools


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a02211b0-53e9-42e7-bd62-33110d50798a

📥 Commits

Reviewing files that changed from the base of the PR and between 94deee8 and fb601f2.

📒 Files selected for processing (29)
  • Devices/m5stack-tab5/CMakeLists.txt
  • Devices/m5stack-tab5/Source/devices/detect.cpp
  • Devices/m5stack-tab5/Source/devices/detect.h
  • Devices/m5stack-tab5/Source/devices/devices_v2.cpp
  • Devices/m5stack-tab5/Source/devices/devices_v2_v3_touch.cpp
  • Devices/m5stack-tab5/Source/devices/devices_v2_v3_touch.h
  • Devices/m5stack-tab5/Source/devices/devices_v3.cpp
  • Devices/m5stack-tab5/Source/devices/devices_v3.h
  • Devices/m5stack-tab5/Source/devices/display_detect.cpp
  • Devices/m5stack-tab5/Source/devices/tab5_keyboard.cpp
  • Devices/m5stack-tab5/devicetree.yaml
  • Devices/m5stack-tab5/m5stack,tab5.dts
  • Drivers/sc2356-module/bindings/smartsens,sc2356.yaml
  • Drivers/sc2356-module/include/drivers/sc2356.h
  • Drivers/sc2356-module/source/sc2356.cpp
  • Drivers/st7121-module/CMakeLists.txt
  • Drivers/st7121-module/LICENSE-Apache-2.0.md
  • Drivers/st7121-module/README.md
  • Drivers/st7121-module/bindings/sitronix,st7121.yaml
  • Drivers/st7121-module/devicetree.yaml
  • Drivers/st7121-module/include/bindings/st7121.h
  • Drivers/st7121-module/include/drivers/st7121.h
  • Drivers/st7121-module/include/st7121_module.h
  • Drivers/st7121-module/source/module.cpp
  • Drivers/st7121-module/source/st7121.cpp
  • Firmware/idf_component.yml
  • Modules/lvgl-module/source/devices/devices.cpp
  • TactilityKernel/include/tactility/drivers/keyboard.h
  • TactilityKernel/source/drivers/keyboard.cpp

Comment thread Devices/m5stack-tab5/Source/devices/detect.cpp
Comment thread Drivers/sc2356-module/source/sc2356.cpp Outdated
Comment thread Drivers/st7121-module/source/st7121.cpp

@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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
Devices/m5stack-tab5/m5stack,tab5.dts (1)

74-79: 🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

Restore the I/O expander labels.

The file references &io_expander0 and &io_expander1 below, but both nodes are missing labels, so those phandles are undefined.

Proposed fix
-		io_expander0 {
+		io_expander0: io_expander0 {
 			compatible = "diodes,pi4ioe5v6408";
 			reg = <0x43>;
 		};

-		io_expander1 {
+		io_expander1: io_expander1 {
 			compatible = "diodes,pi4ioe5v6408";
 			reg = <0x44>;
 		};

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d504abc6-a23c-4262-868e-22a2377872ab

📥 Commits

Reviewing files that changed from the base of the PR and between fb601f2 and 2ca8be8.

📒 Files selected for processing (3)
  • Devices/m5stack-tab5/Source/devices/detect.cpp
  • Devices/m5stack-tab5/m5stack,tab5.dts
  • Drivers/sc2356-module/source/sc2356.cpp

Comment thread Drivers/sc2356-module/source/sc2356.cpp
Comment thread Devices/m5stack-tab5/Source/devices/tab5_keyboard.cpp Outdated
Comment thread TactilityKernel/source/drivers/keyboard.cpp Outdated
@KenVanHoeylandt

Copy link
Copy Markdown
Contributor

Thanks for the improvements! I only had 1 feedback topic wrt the keyboard <> lvgl state.

@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: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 182eaf04-03a2-4203-88f6-715b3b4e38e0

📥 Commits

Reviewing files that changed from the base of the PR and between 2ca8be8 and fefc4c6.

📒 Files selected for processing (6)
  • Devices/m5stack-tab5/Source/devices/tab5_keyboard.cpp
  • Devices/m5stack-tab5/Source/devices/tab5_keyboard.h
  • Devices/m5stack-tab5/Source/devices/tab5_keyboard_attach_detect.cpp
  • Devices/m5stack-tab5/Source/devices/tab5_keyboard_attach_detect.h
  • Devices/m5stack-tab5/Source/module.cpp
  • TactilityKernel/include/tactility/drivers/keyboard.h
💤 Files with no reviewable changes (1)
  • TactilityKernel/include/tactility/drivers/keyboard.h

Comment thread Devices/m5stack-tab5/Source/devices/tab5_keyboard_attach_detect.cpp Outdated
Comment thread Devices/m5stack-tab5/Source/devices/tab5_keyboard_attach_detect.cpp
@KenVanHoeylandt

Copy link
Copy Markdown
Contributor

That looks good, thanks! The rabbit has some good points, and I added a suggestion in one of them.

@KenVanHoeylandt

Copy link
Copy Markdown
Contributor

Great, thank you!

@KenVanHoeylandt
KenVanHoeylandt merged commit 85fe1a3 into TactilityProject:main Aug 1, 2026
61 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