Commit 2141aee
auxdisplay: vk2c21: add sysfs brightness control
Expose a `brightness` sysfs attribute that drives the chip's IVASET
register (0x8A):
- "default" (the boot-time state): IVASET=0x0F, IVA off, bias driven
by the board's external VR resistor (same as before this change).
- 0..15: IVASET=0x3F..0x30 (IVA on, SEG mode);
15 = brightest (1.000 x VDD), 0 =
dimmest (0.529 x VDD at 1/3 bias).
SEG mode (0x30..0x3F) is used rather than VLCD-output mode (0x10..0x1F)
because the R58X-Pro ties the VLCD pin to VDD through an external
resistor: in VLCD-output mode the external circuit dominates the chip's
internal driver and the brightness register has no visible effect. In
SEG mode the chip ignores the VLCD pin and generates the bias voltage
purely internally, so the 16 levels actually take effect.
Probe-time behaviour is unchanged: init still sends IVA=0x0F, and the
attribute reads back as "default" until userspace writes a number.
Signed-off-by: Ricardo Pardini <ricardo@pardini.net>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent 64a8171 commit 2141aee
1 file changed
Lines changed: 61 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
45 | 61 | | |
46 | 62 | | |
47 | 63 | | |
| |||
185 | 201 | | |
186 | 202 | | |
187 | 203 | | |
| 204 | + | |
188 | 205 | | |
189 | 206 | | |
190 | 207 | | |
| |||
414 | 431 | | |
415 | 432 | | |
416 | 433 | | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
417 | 475 | | |
418 | 476 | | |
419 | 477 | | |
| 478 | + | |
420 | 479 | | |
421 | 480 | | |
422 | 481 | | |
| |||
445 | 504 | | |
446 | 505 | | |
447 | 506 | | |
| 507 | + | |
448 | 508 | | |
449 | 509 | | |
450 | 510 | | |
| |||
0 commit comments