Skip to content

Refactor HID drivers and align documentation with submission workflow#10

Open
eduardoc25 wants to merge 5 commits into
t2linux:mbp15from
eduardoc25:prep/upstream-series-v1
Open

Refactor HID drivers and align documentation with submission workflow#10
eduardoc25 wants to merge 5 commits into
t2linux:mbp15from
eduardoc25:prep/upstream-series-v1

Conversation

@eduardoc25

Copy link
Copy Markdown

This pull request introduces significant improvements to the Apple iBridge and Touch Bar Linux driver project, focusing on preparing it for upstream submission and enhancing documentation, maintainability, and user experience. The changes include new documentation files, sysfs ABI documentation, a detailed upstream plan, code cleanup to remove legacy compatibility shims, and updates to the build and validation process.

Documentation and Upstream Preparation:

  • Added a comprehensive upstream plan in UPSTREAM_PLAN.md, outlining a three-stage strategy for mainline kernel submission, including architecture cleanup, style/API improvements, and submission package preparation.
  • Introduced user and developer documentation for the Touch Bar driver in Documentation/hid/apple-touchbar.rst, describing features, sysfs interface, suspend/resume behavior, and testing recommendations.
  • Added sysfs ABI documentation in Documentation/ABI/testing/sysfs-driver-hid-apple-touchbar, specifying the attributes (fnmode, dim_timeout, idle_timeout) and their semantics.
  • Added a MAINTAINERS file with maintainer and file path information for the drivers and documentation.

Codebase Cleanup and Modernization:

  • Removed legacy compatibility code from apple-ibridge.c, including LINUX_VERSION_CODE checks, local hid-ids.h references, and conditional compilation for upstream vs. out-of-tree builds. Replaced with a local minimal USB ID set in apple-ibridge.h and a helper for USB device access. [1] [2] [3] [4] [5] [6] [7]

Build and Validation Improvements:

  • Updated README.md to provide clear build, DKMS installation, and runtime tuning instructions, including sysfs attribute usage and recommended module options for macOS-like behavior.
  • Added a test target to the Makefile for running a smoke test script, ensuring strict build quality and validation before submission.

Summary of Most Important Changes:

Documentation and Upstream Process:

  • Added a detailed upstream plan (UPSTREAM_PLAN.md) describing the three-stage submission strategy and readiness checklist.
  • Introduced user and ABI documentation for the Touch Bar driver and sysfs interface. [1] [2]
  • Added a MAINTAINERS file for proper ownership and submission tracking.

Code and Build System Modernization:

  • Removed version-compatibility and upstream/out-of-tree conditional code, simplifying apple-ibridge.c and using a minimal local USB ID set in apple-ibridge.h. [1] [2] [3] [4] [5] [6] [7]
  • Improved build and validation workflow with updated README.md instructions and a new test target in the Makefile. [1] [2]

Remove legacy out-of-tree compatibility branches and simplify the\ncode to a single modern API path.\n\n- remove UPSTREAM include split and LINUX_VERSION_CODE branches\n- add explicit usb-device helper for hid parent traversal\n- add sentinel in sub HID id table\n- move required Apple IDs to apple-ibridge.h and remove copied hid-ids.h\n\nThis keeps the driver buildable out-of-tree while aligning the code layout\nwith an upstream-oriented baseline.
Improve concurrency safety and address style issues found during strict\ncheckpatch review.\n\n- serialize sysfs writes for fnmode/dim_timeout/idle_timeout with tb_lock\n- normalize formatting in event handling and probe conditionals\n- remove minor style nits (cast spacing, continuation layout, blank line)\n- use kcalloc(1, sizeof(*obj), ...) for allocation style consistency\n\nNo functional behavior changes are intended beyond safer concurrent updates\nof runtime policy attributes.
Replace the previous docs commit to align the submission package with\nthe official project branch workflow and update maintainer identity.\n\n- update maintainer/sign-off email to eduardocp25@gmail.com\n- remove out-of-tree wording from cover letter and planning docs\n- explicitly reference official branch mbp15 for submission prep\n- keep ABI/HID docs and checklist artifacts for upstream sending\n\nThis preserves the 0001/0002/0003 series layout while making the docs\nconsistent with official branch maintenance.
Replace the previous docs commit to keep submission guidance,\ndocumentation artifacts, and validation harness in the same final patch.\n\n- align maintainer identity and official-branch submission wording\n- keep ABI and HID documentation for upstream prep\n- add make test smoke test covering W=1 build, checkpatch, and required artifacts\n- document the smoke test in README and submission checklist\n\nThis preserves the 0001/0002/0003 series layout while making patch 0003\nself-contained for documentation and validation.
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.

1 participant