Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 358615
b: refs/heads/master
c: 240085e
h: refs/heads/master
i:
  358613: 5b3186a
  358611: f75accf
  358607: 57df2ed
v: v3
  • Loading branch information
Milo(Woogyom) Kim authored and Bryan Wu committed Feb 6, 2013
1 parent 63f7297 commit e0bbe7b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: db6eaf8388a413a5ee1b4547ce78506b9c6456b0
refs/heads/master: 240085e255cd2818aff2ccde3066b7db1f29076a
13 changes: 12 additions & 1 deletion trunk/drivers/leds/leds-lp55xx-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -493,8 +493,19 @@ EXPORT_SYMBOL_GPL(lp55xx_unregister_leds);
int lp55xx_register_sysfs(struct lp55xx_chip *chip)
{
struct device *dev = &chip->cl->dev;
struct lp55xx_device_config *cfg = chip->cfg;
int ret;

if (!cfg->run_engine || !cfg->firmware_cb)
goto dev_specific_attrs;

ret = sysfs_create_group(&dev->kobj, &lp55xx_engine_attr_group);
if (ret)
return ret;

return sysfs_create_group(&dev->kobj, &lp55xx_engine_attr_group);
dev_specific_attrs:
return cfg->dev_attr_group ?
sysfs_create_group(&dev->kobj, cfg->dev_attr_group) : 0;
}
EXPORT_SYMBOL_GPL(lp55xx_register_sysfs);

Expand Down
4 changes: 4 additions & 0 deletions trunk/drivers/leds/leds-lp55xx-common.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ struct lp55xx_reg {
* @set_led_current : LED current set function
* @firmware_cb : Call function when the firmware is loaded
* @run_engine : Run internal engine for pattern
* @dev_attr_group : Device specific attributes
*/
struct lp55xx_device_config {
const struct lp55xx_reg reset;
Expand All @@ -65,6 +66,9 @@ struct lp55xx_device_config {

/* used for running firmware LED patterns */
void (*run_engine) (struct lp55xx_chip *chip, bool start);

/* additional device specific attributes */
const struct attribute_group *dev_attr_group;
};

/*
Expand Down

0 comments on commit e0bbe7b

Please sign in to comment.