flare-edge's sdk-patches/ patched the legacy vendor Luckfox SDK (U-Boot 2017.09, optionally the vendor 5.10.160 kernel, the aic8800 wifi driver, board build glue, and buildroot deltas) directly in that repo, even though the workspace rule already says kernel/U-Boot/driver work belongs in this SDK repo. Move the whole tree here as luckfox-sdk-patches/, named to stay unambiguous next to this repo's own patches/ (the unrelated 6.18.46 forward-port series). Every patch, config fragment, include and the embedded control DTB is byte-identical to the flare-edge originals (verified: diff -rq against a snapshot taken before the move). Only the two README files were rewritten for the new location, cross-repo pointers, and a license note; also updated build/vendor.manifest's stale flare-edge cross-reference and this repo's own top-level README layout table. Source: flare-edge@86d4633:sdk-patches/ (blueflare/flare-edge, worktree sdk-patches-in-sdk). flare-edge's own consumers (tools/build-firmware.sh, verify-sdk-patches.sh, sync-sdk-patches.sh, check-invariants.sh, auto-version.sh, tests, docs) are updated in a companion commit on the flare-edge side of this same branch. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SMRwnkPp1upR6QFWCZouE7
69 lines
2.8 KiB
C
69 lines
2.8 KiB
C
/* SPDX-License-Identifier: GPL-2.0+ */
|
|
/*
|
|
* flare-edge: bootloader-side touch probe for the verbose-boot choice.
|
|
* See arch/arm/mach-rockchip/flare_touch.c for why the decision is made here
|
|
* rather than in userspace, and why it costs no boot time.
|
|
*/
|
|
#ifndef __FLARE_TOUCH_H
|
|
#define __FLARE_TOUCH_H
|
|
|
|
/**
|
|
* struct flare_touch_state - what the controller said, for the boot report
|
|
*
|
|
* @addr: I2C address that answered, or 0 if the controller was never
|
|
* reached
|
|
* @status: raw value of the coordinate/status register, sampled at the
|
|
* read this struct reports (i.e. after the splash appeared)
|
|
* @arm_status: raw value of the same register, sampled by flare_touch_arm()
|
|
* before it cleared any power-on report -- lets the two reads be
|
|
* told apart, one from before the splash and one from after
|
|
* @armed: whether flare_touch_arm() ran and reached the controller
|
|
* before this read, so @arm_status can be trusted
|
|
* @id: product id string the controller reports ("911" on this
|
|
* panel), NUL-terminated, empty if it could not be read
|
|
*
|
|
* A panel in the field has no serial console, so every one of these ends up on
|
|
* the kernel command line. "No touchscreen", "touchscreen present but silent"
|
|
* and "not touched" are three different faults that look identical without it.
|
|
*/
|
|
struct flare_touch_state {
|
|
int addr;
|
|
unsigned char status;
|
|
unsigned char arm_status;
|
|
bool armed;
|
|
char id[8];
|
|
};
|
|
|
|
/**
|
|
* flare_touch_arm() - discard whatever the controller is holding right now
|
|
*
|
|
* Call once, early, as soon as the splash is up. The GT911 publishes a report
|
|
* when it powers up, so on a COLD boot there is already one waiting before
|
|
* anybody has touched anything -- and a later read cannot tell that apart from
|
|
* a tap that has since been released, because both read as "ready, zero
|
|
* fingers". Clearing here makes the later read mean something precise: a
|
|
* report that arrived AFTER the splash appeared.
|
|
*
|
|
* Costs one I2C transaction and no delay. Safe if the controller is absent.
|
|
*/
|
|
void flare_touch_arm(void);
|
|
|
|
/**
|
|
* flare_touch_tapped() - is a touch report waiting?
|
|
*
|
|
* ONE I2C read, no polling and no delay. The controller latches a report and
|
|
* holds it until the host acknowledges it, so a single late read catches a
|
|
* touch that happened any time earlier in the boot. Watching for a window
|
|
* would add that window to every boot, touched or not, which is not a price
|
|
* worth paying for a diagnostic escape hatch.
|
|
*
|
|
* Safe on a board with no reachable controller: reports "not touched" rather
|
|
* than failing, so no boot path depends on the hardware answering.
|
|
*
|
|
* @st: filled in with what was observed; may be NULL
|
|
* @return 1 if a touch was waiting, 0 otherwise
|
|
*/
|
|
int flare_touch_tapped(struct flare_touch_state *st);
|
|
|
|
#endif /* __FLARE_TOUCH_H */
|