diff options
Diffstat (limited to 'drivers/ssb')
-rw-r--r-- | drivers/ssb/main.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/drivers/ssb/main.c b/drivers/ssb/main.c index c68b3dc19e11..3918d2cc5856 100644 --- a/drivers/ssb/main.c +++ b/drivers/ssb/main.c | |||
@@ -383,6 +383,35 @@ static int ssb_device_uevent(struct device *dev, struct kobj_uevent_env *env) | |||
383 | ssb_dev->id.revision); | 383 | ssb_dev->id.revision); |
384 | } | 384 | } |
385 | 385 | ||
386 | #define ssb_config_attr(attrib, field, format_string) \ | ||
387 | static ssize_t \ | ||
388 | attrib##_show(struct device *dev, struct device_attribute *attr, char *buf) \ | ||
389 | { \ | ||
390 | return sprintf(buf, format_string, dev_to_ssb_dev(dev)->field); \ | ||
391 | } | ||
392 | |||
393 | ssb_config_attr(core_num, core_index, "%u\n") | ||
394 | ssb_config_attr(coreid, id.coreid, "0x%04x\n") | ||
395 | ssb_config_attr(vendor, id.vendor, "0x%04x\n") | ||
396 | ssb_config_attr(revision, id.revision, "%u\n") | ||
397 | ssb_config_attr(irq, irq, "%u\n") | ||
398 | static ssize_t | ||
399 | name_show(struct device *dev, struct device_attribute *attr, char *buf) | ||
400 | { | ||
401 | return sprintf(buf, "%s\n", | ||
402 | ssb_core_name(dev_to_ssb_dev(dev)->id.coreid)); | ||
403 | } | ||
404 | |||
405 | static struct device_attribute ssb_device_attrs[] = { | ||
406 | __ATTR_RO(name), | ||
407 | __ATTR_RO(core_num), | ||
408 | __ATTR_RO(coreid), | ||
409 | __ATTR_RO(vendor), | ||
410 | __ATTR_RO(revision), | ||
411 | __ATTR_RO(irq), | ||
412 | __ATTR_NULL, | ||
413 | }; | ||
414 | |||
386 | static struct bus_type ssb_bustype = { | 415 | static struct bus_type ssb_bustype = { |
387 | .name = "ssb", | 416 | .name = "ssb", |
388 | .match = ssb_bus_match, | 417 | .match = ssb_bus_match, |
@@ -392,6 +421,7 @@ static struct bus_type ssb_bustype = { | |||
392 | .suspend = ssb_device_suspend, | 421 | .suspend = ssb_device_suspend, |
393 | .resume = ssb_device_resume, | 422 | .resume = ssb_device_resume, |
394 | .uevent = ssb_device_uevent, | 423 | .uevent = ssb_device_uevent, |
424 | .dev_attrs = ssb_device_attrs, | ||
395 | }; | 425 | }; |
396 | 426 | ||
397 | static void ssb_buses_lock(void) | 427 | static void ssb_buses_lock(void) |