Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

driver: Always call set_tear_on on CMD mode panels #37

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
11 changes: 10 additions & 1 deletion driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import simple
import wrap
from generator import Options, GpioFlag
from panel import Panel, BacklightControl, CommandSequence, CompressionMode
from panel import Panel, BacklightControl, CommandSequence, CompressionMode, Mode


def generate_includes(p: Panel, options: Options) -> str:
Expand Down Expand Up @@ -140,6 +140,15 @@ def generate_commands(p: Panel, options: Options, cmd_name: str) -> str:
if c.wait and c.wait > options.ignore_wait:
s += f'\t{msleep(c.wait)};\n'

if cmd_name == 'on' and p.mode == Mode.CMD_MODE:
s += '''
ret = mipi_dsi_dcs_set_tear_on(ctx->dsi, MIPI_DSI_DCS_TEAR_MODE_VBLANK);
if (ret < 0) {
dev_err(dev, "Failed to set tear on: %d\\n", ret);
return ret;
}
'''

s += '''
return 0;
}
Expand Down