Commit 4a1cf5e
cpufreq: CPPC: Add generic helpers for sysfs show/store
Add generic helper functions for u64 sysfs attributes that follow the
common pattern of calling CPPC get/set APIs:
- cppc_cpufreq_sysfs_show_u64(): reads value and handles -EOPNOTSUPP
- cppc_cpufreq_sysfs_store_u64(): parses input and calls set function
Add CPPC_CPUFREQ_ATTR_RW_U64() macro to generate show/store functions
using these helpers, reducing boilerplate for simple attributes.
Convert auto_act_window and energy_performance_preference_val to use
the new macro.
No functional changes.
Signed-off-by: Sumit Gupta <sumitg@nvidia.com>
Reviewed-by: Lifeng Zheng <zhenglifeng1@huawei.com>
[ rjw: Retained empty code line after a conditional ]
Link: https://patch.msgid.link/20260120145623.2959636-2-sumitg@nvidia.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>1 parent b753c32 commit 4a1cf5e
1 file changed
Lines changed: 25 additions & 43 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
863 | 863 | | |
864 | 864 | | |
865 | 865 | | |
866 | | - | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
867 | 869 | | |
868 | 870 | | |
869 | | - | |
870 | | - | |
871 | | - | |
| 871 | + | |
872 | 872 | | |
873 | | - | |
874 | 873 | | |
875 | 874 | | |
876 | 875 | | |
| |||
880 | 879 | | |
881 | 880 | | |
882 | 881 | | |
883 | | - | |
884 | | - | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
885 | 885 | | |
886 | | - | |
| 886 | + | |
887 | 887 | | |
888 | 888 | | |
889 | | - | |
| 889 | + | |
890 | 890 | | |
891 | 891 | | |
892 | 892 | | |
893 | | - | |
894 | | - | |
895 | | - | |
| 893 | + | |
896 | 894 | | |
897 | | - | |
| 895 | + | |
898 | 896 | | |
899 | 897 | | |
900 | | - | |
901 | | - | |
902 | | - | |
903 | | - | |
904 | | - | |
905 | | - | |
906 | | - | |
907 | | - | |
908 | | - | |
909 | | - | |
910 | | - | |
911 | | - | |
912 | | - | |
913 | | - | |
914 | | - | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
915 | 908 | | |
916 | 909 | | |
917 | | - | |
918 | | - | |
919 | | - | |
920 | | - | |
921 | | - | |
922 | | - | |
923 | | - | |
924 | | - | |
925 | | - | |
926 | | - | |
927 | | - | |
928 | | - | |
929 | | - | |
| 910 | + | |
| 911 | + | |
930 | 912 | | |
931 | | - | |
932 | | - | |
| 913 | + | |
| 914 | + | |
933 | 915 | | |
934 | 916 | | |
935 | 917 | | |
| |||
0 commit comments