Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

PM / devfreq: Allow devfreq driver to add custom sysfs ABIs

Extend the devfreq_dev_profile to allow drivers optionally create
device-specific sysfs ABIs together with other common devfreq ABIs under
the devfreq device path.

Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Reviewed-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Jie Zhan <zhanjie9@hisilicon.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Link: https://patchwork.kernel.org/project/linux-pm/patch/20250623143401.4095045-2-zhanjie9@hisilicon.com/

authored by

Jie Zhan and committed by
Chanwoo Choi
45b9d1da c3bc3613

+5
+1
drivers/devfreq/devfreq.c
··· 831 831 mutex_lock(&devfreq->lock); 832 832 devfreq->dev.parent = dev; 833 833 devfreq->dev.class = devfreq_class; 834 + devfreq->dev.groups = profile->dev_groups; 834 835 devfreq->dev.release = devfreq_dev_release; 835 836 INIT_LIST_HEAD(&devfreq->node); 836 837 devfreq->profile = profile;
+4
include/linux/devfreq.h
··· 103 103 * 104 104 * @is_cooling_device: A self-explanatory boolean giving the device a 105 105 * cooling effect property. 106 + * @dev_groups: Optional device-specific sysfs attribute groups that to 107 + * be attached to the devfreq device. 106 108 */ 107 109 struct devfreq_dev_profile { 108 110 unsigned long initial_freq; ··· 121 119 unsigned int max_state; 122 120 123 121 bool is_cooling_device; 122 + 123 + const struct attribute_group **dev_groups; 124 124 }; 125 125 126 126 /**