Lines Matching +full:sensor +full:- +full:node
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * PowerNV OPAL Sensor-groups interface
8 #define pr_fmt(fmt) "opal-sensor-groups: " fmt
45 ret = -EIO; in sensor_group_enable()
72 return -EINVAL; in sg_store()
84 ret = opal_sensor_group_clear(sattr->handle, token); in sg_store()
90 ret = -EIO; in sg_store()
122 attr->handle = handle; in add_attr()
123 sysfs_attr_init(&attr->attr.attr); in add_attr()
124 attr->attr.attr.name = ops_info[index].attr_name; in add_attr()
125 attr->attr.attr.mode = 0220; in add_attr()
126 attr->attr.store = ops_info[index].store; in add_attr()
138 add_attr(handle, &sg->sgattrs[count], j); in add_attr_group()
139 sg->sg.attrs[count] = in add_attr_group()
140 &sg->sgattrs[count].attr.attr; in add_attr_group()
144 return sysfs_create_group(sg_kobj, &sg->sg); in add_attr_group()
162 struct device_node *sg, *node; in opal_sensor_groups_init() local
165 sg = of_find_compatible_node(NULL, NULL, "ibm,opal-sensor-group"); in opal_sensor_groups_init()
167 pr_devel("Sensor groups node not found\n"); in opal_sensor_groups_init()
177 pr_warn("Failed to create sensor group kobject\n"); in opal_sensor_groups_init()
181 for_each_child_of_node(sg, node) { in opal_sensor_groups_init()
185 ops = of_get_property(node, "ops", &len); in opal_sensor_groups_init()
207 if (of_property_read_u32(node, "sensor-group-id", &sgid)) { in opal_sensor_groups_init()
208 pr_warn("sensor-group-id property not found\n"); in opal_sensor_groups_init()
212 if (!of_property_read_u32(node, "ibm,chip-id", &chipid)) in opal_sensor_groups_init()
213 sprintf(sgs[i].name, "%pOFn%d", node, chipid); in opal_sensor_groups_init()
215 sprintf(sgs[i].name, "%pOFn", node); in opal_sensor_groups_init()
219 pr_warn("Failed to create sensor attribute group %s\n", in opal_sensor_groups_init()
230 while (--i >= 0) { in opal_sensor_groups_init()
235 of_node_put(node); in opal_sensor_groups_init()