Skip to content

Commit 38475da

Browse files
committed
Exploration around using the properties.
1 parent 05b8480 commit 38475da

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

drivers/platform/surface/surface_aggregator_registry.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,16 @@ static const struct software_node ssam_node_tmp_pprof = {
7474
.parent = &ssam_node_root,
7575
};
7676

77+
static const struct property_entry ssam_node_tmp_pprof_fan_control[] = {
78+
PROPERTY_ENTRY_BOOL("control_fan"),
79+
{ }
80+
};
81+
static const struct software_node ssam_node_tmp_pprof_with_fan = {
82+
.name = "ssam:01:03:01:00:01",
83+
.parent = &ssam_node_root,
84+
.properties = ssam_node_tmp_pprof_fan_control,
85+
};
86+
7787
/* Fan subsystem. */
7888
static const struct software_node ssam_node_fan = {
7989
.name = "ssam:01:05:01:01:00",
@@ -324,7 +334,7 @@ static const struct software_node *ssam_node_group_sp9[] = {
324334
&ssam_node_hub_kip,
325335
&ssam_node_bat_ac,
326336
&ssam_node_bat_main,
327-
&ssam_node_tmp_pprof,
337+
&ssam_node_tmp_pprof_with_fan,
328338
&ssam_node_fan,
329339
&ssam_node_pos_tablet_switch,
330340
&ssam_node_hid_kip_keyboard,

drivers/platform/surface/surface_platform_profile.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ static int ssam_platform_profile_set(struct platform_profile_handler *pprof,
144144
static int surface_platform_profile_probe(struct ssam_device *sdev)
145145
{
146146
struct ssam_tmp_profile_device *tpd;
147+
bool fan_profile;
147148

148149
tpd = devm_kzalloc(&sdev->dev, sizeof(*tpd), GFP_KERNEL);
149150
if (!tpd)
@@ -154,6 +155,9 @@ static int surface_platform_profile_probe(struct ssam_device *sdev)
154155
tpd->handler.profile_get = ssam_platform_profile_get;
155156
tpd->handler.profile_set = ssam_platform_profile_set;
156157

158+
fan_profile = fwnode_property_read_bool(sdev->dev.fwnode, "control_fan");
159+
printk(KERN_INFO "Message: %d\n", fan_profile);
160+
157161
set_bit(PLATFORM_PROFILE_LOW_POWER, tpd->handler.choices);
158162
set_bit(PLATFORM_PROFILE_BALANCED, tpd->handler.choices);
159163
set_bit(PLATFORM_PROFILE_BALANCED_PERFORMANCE, tpd->handler.choices);

0 commit comments

Comments
 (0)