Skip to content

Instantly share code, notes, and snippets.

@philmb3487
Created April 17, 2021 15:00
Show Gist options
  • Save philmb3487/448d57653c83a4d24d1fb82f5e18f07b to your computer and use it in GitHub Desktop.
Save philmb3487/448d57653c83a4d24d1fb82f5e18f07b to your computer and use it in GitHub Desktop.
Coffee Lake (Tested on i5-9300H) Backlight Set Logic
// coffee lake chips use the BXT methods.
current = INREG(0xC8258);
max = INREG(0xC8254);
printf ("current backlight value: %d%%\n", current * 100 / max);
if (argc > 1) {
uint32_t v = atoi (argv[1]) * max / 100;
if (v > max)
v = max;
OUTREG(0xC8258, v);
(void) INREG(0xC8258);
printf ("set backlight to %d%%\n", v * 100 / max);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment