Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions docs/power-and-lock.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,3 +190,33 @@ last frame; the lock screen's own update follows when `user.slice` thaws.
`omarchy-tablet-power` (one process per press, state in brightness and files, a
fixed window after resume), `omarchy-screen-toggle` and `omarchy-greeter-wake`
(a second and third writer of the backlight).

## J71t Mac USB charging candidate

`system/overlay/etc/orchard/mac-usb-current` opts J71t into the matching
Orchard root initrd's Mac-current compatibility profile. It selects
05ac:1014 with ACM+NCM and 500 mA descriptor power. Only a real host vendor
grant allows the kernel charger to ramp higher, within board/pack limits.
This requires the 2026-11-08 hardware changes and a freshly matched initrd;
the file alone has no effect with older hardware bundles. No systemd gadget
service rewrites the initrd's gadget or serial during switch-root.

This candidate has host tests but no device charging result. Unlock the Mac,
approve the new accessory and, if needed, reconnect it. The BOOT serial is
retained for Orchard discovery and can require fresh authorization each boot.
To disable the profile, remove `/etc/orchard/mac-usb-current` and reboot.
No PMIC current limit or host authorization policy is forced by this file.

The USB recovery service recognizes the bound NCM or ECM function. In addition
to its carrier-loss handler, it probes 172.16.42.2 through usb0 while carrier
and UDC configuration remain up. After a peer has replied once, 15 seconds
of failed replies trigger an `ip link` down/up cycle, without rebinding UDC
or disturbing ACM/charging. It logs `usb0-stall-bounce` to journal and kmsg,
including packet/drop counters. There is a 60-second cooldown and at most
three attempts without a new successful reply. Suspended, unconfigured,
unbound, admin-down and VBUS-absent links do not trigger this fallback;
unknown charging current_max does not prevent network recovery. Hosts that
never answer ICMP do not arm it. All recovery remains disabled on NBD roots.
The runner's transient oi-usb0-watchdog should not run alongside this service
for an acceptance test; count all bounce markers and require zero for a clean
NCM sustained-transfer result.
1 change: 1 addition & 0 deletions system/overlay/etc/orchard/mac-usb-current
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1
18 changes: 18 additions & 0 deletions tests/test_mac_usb_current.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"""The system opts in through data, leaving USB ownership to the initrd."""
from pathlib import Path
import unittest

ROOT = Path(__file__).resolve().parents[1]

class MacUsbCurrent(unittest.TestCase):
def test_profile_is_exact_opt_in_for_matching_hardware(self):
self.assertEqual((ROOT/'system/overlay/etc/orchard/mac-usb-current').read_bytes(), b'1\n')
self.assertIn('freshly matched initrd', (ROOT/'docs/power-and-lock.md').read_text())

def test_system_root_includes_the_opt_in(self):
from release.public_root import system_files
data, mode = system_files()['etc/orchard/mac-usb-current']
self.assertEqual((data, mode), (b'1\n', 0o644))

if __name__ == '__main__':
unittest.main()
33 changes: 33 additions & 0 deletions tests/test_tablet_port.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import importlib.machinery
import importlib.util
import json
import os
from pathlib import Path
import struct
import subprocess
import unittest
from unittest.mock import patch
import xml.etree.ElementTree as ET

PROJECT = Path(__file__).resolve().parents[1]

def load(name, path):
loader=importlib.machinery.SourceFileLoader(name,str(PROJECT/path))
spec=importlib.util.spec_from_loader(name,loader)
mod=importlib.util.module_from_spec(spec); loader.exec_module(mod); return mod

p=load('power','system/overlay/usr/libexec/omarchy-powerd')

class TabletPort(unittest.TestCase):
pass










if __name__=='__main__': unittest.main()
Loading