Skip to content

gdeq031t10: support an optional frontlight, reported per board #625

Description

@Crazypedia

The GDEQ031T10 driver hardcodes its capability mask and leaves get_backlight and has_capability as nullptr, so a board that wires a frontlight to the panel has no way to expose it.

Whether the panel has one is a per-board fact, not a driver-wide one. The T-Deck Max has a frontlight; the T-Deck Pro does not. So DISPLAY_CAPABILITY_BACKLIGHT cannot live in the static mask.

What I have working is an optional backlight phandle in the binding, plus:

#define GDEQ031T10_STATIC_CAPABILITIES (DISPLAY_CAPABILITY_ON_OFF | DISPLAY_CAPABILITY_SLOW_REFRESH)

// Whether this panel has a frontlight is per-board, so BACKLIGHT can't live in the
// driver-wide static capability mask.
static bool gdeq031t10_has_capability(Device* device, uint32_t capability) {
    uint32_t capabilities = GDEQ031T10_STATIC_CAPABILITIES;
    if (GET_CONFIG(device)->backlight != nullptr) {
        capabilities |= DISPLAY_CAPABILITY_BACKLIGHT;
    }
    return (capabilities & capability) == capability;
}

get_backlight() returns ERROR_NOT_SUPPORTED when no phandle is set. Boards without a frontlight set nothing and report exactly what they do today.

Two questions:

  1. Is dynamic has_capability() the pattern you want for per-board capabilities, or would you rather this were a separate compatible string?
  2. The frontlight comes up at the board-agnostic DisplaySettings default of 200/255 on first boot, which lights a reflective panel that is perfectly readable without it. Should e-paper default to off? That touches every board, so it feels like your call rather than a board-level fix.

Verified on a LilyGO T-Deck Max.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions