Lines Matching +full:machine +full:- +full:mode

1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (C) ST-Ericsson SA 2011
5 * Author: Lee Jones <lee.jones@linaro.org> for ST-Ericsson.
36 static DEVICE_ATTR(machine, 0444, soc_info_show, NULL);
44 return &soc_dev->dev; in soc_device_to_device()
54 if ((attr == &dev_attr_machine.attr) && soc_dev->attr->machine) in soc_attribute_mode()
55 return attr->mode; in soc_attribute_mode()
56 if ((attr == &dev_attr_family.attr) && soc_dev->attr->family) in soc_attribute_mode()
57 return attr->mode; in soc_attribute_mode()
58 if ((attr == &dev_attr_revision.attr) && soc_dev->attr->revision) in soc_attribute_mode()
59 return attr->mode; in soc_attribute_mode()
60 if ((attr == &dev_attr_serial_number.attr) && soc_dev->attr->serial_number) in soc_attribute_mode()
61 return attr->mode; in soc_attribute_mode()
62 if ((attr == &dev_attr_soc_id.attr) && soc_dev->attr->soc_id) in soc_attribute_mode()
63 return attr->mode; in soc_attribute_mode()
76 output = soc_dev->attr->machine; in soc_info_show()
78 output = soc_dev->attr->family; in soc_info_show()
80 output = soc_dev->attr->revision; in soc_info_show()
82 output = soc_dev->attr->serial_number; in soc_info_show()
84 output = soc_dev->attr->soc_id; in soc_info_show()
86 return -EINVAL; in soc_info_show()
109 ida_free(&soc_ida, soc_dev->soc_dev_num); in soc_release()
110 kfree(soc_dev->dev.groups); in soc_release()
118 if (soc_dev_attr->machine) in soc_device_get_machine()
122 of_property_read_string(np, "model", &soc_dev_attr->machine); in soc_device_get_machine()
138 return ERR_PTR(-EBUSY); in soc_device_register()
145 ret = -ENOMEM; in soc_device_register()
151 ret = -ENOMEM; in soc_device_register()
155 soc_attr_groups[1] = soc_dev_attr->custom_attr_group; in soc_device_register()
161 soc_dev->soc_dev_num = ret; in soc_device_register()
163 soc_dev->attr = soc_dev_attr; in soc_device_register()
164 soc_dev->dev.bus = &soc_bus_type; in soc_device_register()
165 soc_dev->dev.groups = soc_attr_groups; in soc_device_register()
166 soc_dev->dev.release = soc_release; in soc_device_register()
168 dev_set_name(&soc_dev->dev, "soc%d", soc_dev->soc_dev_num); in soc_device_register()
170 ret = device_register(&soc_dev->dev); in soc_device_register()
172 put_device(&soc_dev->dev); in soc_device_register()
187 /* Ensure soc_dev->attr is freed after calling soc_device_unregister. */
190 device_unregister(&soc_dev->dev); in soc_device_unregister()
214 if (match->machine && in soc_device_match_attr()
215 (!attr->machine || !glob_match(match->machine, attr->machine))) in soc_device_match_attr()
218 if (match->family && in soc_device_match_attr()
219 (!attr->family || !glob_match(match->family, attr->family))) in soc_device_match_attr()
222 if (match->revision && in soc_device_match_attr()
223 (!attr->revision || !glob_match(match->revision, attr->revision))) in soc_device_match_attr()
226 if (match->soc_id && in soc_device_match_attr()
227 (!attr->soc_id || !glob_match(match->soc_id, attr->soc_id))) in soc_device_match_attr()
237 return soc_device_match_attr(soc_dev->attr, arg); in soc_device_match_one()
241 * soc_device_match - identify the SoC in the machine
242 * @matches: zero-terminated array of possible matches
266 while (matches->machine || matches->family || matches->revision || in soc_device_match()
267 matches->soc_id) { in soc_device_match()