Commit b3b6f811 authored by Milo(Woogyom) Kim's avatar Milo(Woogyom) Kim Committed by Bryan Wu

leds-lp55xx: add new lp55xx_register_sysfs() for the firmware interface

 LP55xx family chips have internal program memory which run various patterns.
 Using this memory, LEDs continue on blinking/dimming without continuous I2C
 commands. That means the I2C HOST can be entered into sleep once the memory
 is updated.

 An application can get hex data from a file and write them into
 the program memory through the I2C. This is general firwmare interface.

 This patch is the initial step for adding the firmware interface.
Signed-off-by: default avatarMilo(Woogyom) Kim <milo.kim@ti.com>
Signed-off-by: default avatarBryan Wu <cooloney@gmail.com>
parent d9067d28
...@@ -197,6 +197,14 @@ static int lp55xx_init_led(struct lp55xx_led *led, ...@@ -197,6 +197,14 @@ static int lp55xx_init_led(struct lp55xx_led *led,
return 0; return 0;
} }
static struct attribute *lp55xx_engine_attributes[] = {
NULL,
};
static const struct attribute_group lp55xx_engine_attr_group = {
.attrs = lp55xx_engine_attributes,
};
int lp55xx_write(struct lp55xx_chip *chip, u8 reg, u8 val) int lp55xx_write(struct lp55xx_chip *chip, u8 reg, u8 val)
{ {
return i2c_smbus_write_byte_data(chip->cl, reg, val); return i2c_smbus_write_byte_data(chip->cl, reg, val);
...@@ -365,6 +373,14 @@ void lp55xx_unregister_leds(struct lp55xx_led *led, struct lp55xx_chip *chip) ...@@ -365,6 +373,14 @@ void lp55xx_unregister_leds(struct lp55xx_led *led, struct lp55xx_chip *chip)
} }
EXPORT_SYMBOL_GPL(lp55xx_unregister_leds); EXPORT_SYMBOL_GPL(lp55xx_unregister_leds);
int lp55xx_register_sysfs(struct lp55xx_chip *chip)
{
struct device *dev = &chip->cl->dev;
return sysfs_create_group(&dev->kobj, &lp55xx_engine_attr_group);
}
EXPORT_SYMBOL_GPL(lp55xx_register_sysfs);
MODULE_AUTHOR("Milo Kim <milo.kim@ti.com>"); MODULE_AUTHOR("Milo Kim <milo.kim@ti.com>");
MODULE_DESCRIPTION("LP55xx Common Driver"); MODULE_DESCRIPTION("LP55xx Common Driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
...@@ -103,4 +103,8 @@ extern int lp55xx_register_leds(struct lp55xx_led *led, ...@@ -103,4 +103,8 @@ extern int lp55xx_register_leds(struct lp55xx_led *led,
struct lp55xx_chip *chip); struct lp55xx_chip *chip);
extern void lp55xx_unregister_leds(struct lp55xx_led *led, extern void lp55xx_unregister_leds(struct lp55xx_led *led,
struct lp55xx_chip *chip); struct lp55xx_chip *chip);
/* common device attributes functions */
extern int lp55xx_register_sysfs(struct lp55xx_chip *chip);
#endif /* _LEDS_LP55XX_COMMON_H */ #endif /* _LEDS_LP55XX_COMMON_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment