Commit a6456d4
power: supply: sysfs: Add power_supply_show_enum_with_available() helper
Turn power_supply_charge_behaviour_show() into a generic function for
showing enum values with their available (for writing) values shown
and the current value shown surrounded by sqaure-brackets like
the show() output for "usb_type" and "charge_behaviour".
This is a preparation patch for refactoring the "usb_type" property
handling to use a bitmask indicating available usb-types + this new
generic function.
Signed-off-by: Hans de Goede <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Sebastian Reichel <[email protected]>1 parent 03ec41c commit a6456d4
1 file changed
+20
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
518 | 518 | | |
519 | 519 | | |
520 | 520 | | |
521 | | - | |
522 | | - | |
523 | | - | |
524 | | - | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
525 | 524 | | |
526 | 525 | | |
527 | 526 | | |
528 | 527 | | |
529 | 528 | | |
530 | | - | |
531 | | - | |
532 | | - | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
533 | 532 | | |
534 | 533 | | |
535 | | - | |
536 | | - | |
| 534 | + | |
537 | 535 | | |
538 | 536 | | |
539 | | - | |
540 | | - | |
| 537 | + | |
541 | 538 | | |
542 | 539 | | |
543 | 540 | | |
544 | 541 | | |
545 | | - | |
| 542 | + | |
546 | 543 | | |
547 | 544 | | |
548 | 545 | | |
| |||
551 | 548 | | |
552 | 549 | | |
553 | 550 | | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
554 | 562 | | |
555 | 563 | | |
556 | 564 | | |
| |||
0 commit comments