lp5523_wait_opmode_done();
}
-static void lp5523_turn_off_channels(struct lp55xx_chip *chip)
-{
- int i;
-
- for (i = 0; i < LP5523_MAX_LEDS; i++)
- lp55xx_write(chip, LP5523_REG_LED_PWM_BASE + i, 0);
-}
-
static void lp5523_run_engine(struct lp55xx_chip *chip, bool start)
{
/* stop engine */
if (!start) {
lp5523_stop_engine(chip);
- lp5523_turn_off_channels(chip);
+ lp55xx_turn_off_channels(chip);
return;
}
}
EXPORT_SYMBOL_GPL(lp55xx_set_led_current);
+void lp55xx_turn_off_channels(struct lp55xx_chip *chip)
+{
+ const struct lp55xx_device_config *cfg = chip->cfg;
+ int i;
+
+ for (i = 0; i < cfg->max_channel; i++)
+ lp55xx_write(chip, cfg->reg_led_pwm_base.addr + i, 0);
+}
+EXPORT_SYMBOL_GPL(lp55xx_turn_off_channels);
+
static void lp55xx_reset_device(struct lp55xx_chip *chip)
{
const struct lp55xx_device_config *cfg = chip->cfg;
extern int lp55xx_led_brightness(struct lp55xx_led *led);
extern int lp55xx_multicolor_brightness(struct lp55xx_led *led);
extern void lp55xx_set_led_current(struct lp55xx_led *led, u8 led_current);
+extern void lp55xx_turn_off_channels(struct lp55xx_chip *chip);
/* common probe/remove function */
extern int lp55xx_probe(struct i2c_client *client);
LP8501_PWR_CONFIG_M, chip->pdata->pwr_sel);
}
-static void lp8501_turn_off_channels(struct lp55xx_chip *chip)
-{
- int i;
-
- for (i = 0; i < LP8501_MAX_LEDS; i++)
- lp55xx_write(chip, LP8501_REG_LED_PWM_BASE + i, 0);
-}
-
static void lp8501_run_engine(struct lp55xx_chip *chip, bool start)
{
/* stop engine */
if (!start) {
lp55xx_stop_all_engine(chip);
- lp8501_turn_off_channels(chip);
+ lp55xx_turn_off_channels(chip);
return;
}