Skip to content

drivers: led: lp50xx fix write_channels #92176

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions drivers/led/lp50xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ LOG_MODULE_REGISTER(lp50xx, CONFIG_LED_LOG_LEVEL);

/* Maximum number of channels */
#define LP50XX_MAX_CHANNELS(nmodules) \
((LP50XX_COLORS_PER_LED + 1) * ((nmodules) + 1))
(LP50XX_COLORS_PER_LED * nmodules)

#define LP50XX_DISABLE_DELAY_US 3
#define LP50XX_ENABLE_DELAY_US 500
Expand Down Expand Up @@ -168,7 +168,7 @@ static int lp50xx_write_channels(const struct device *dev,
struct lp50xx_data *data = dev->data;
uint8_t base_channel, end_channel, max_channels;

base_channel = LP50XX_BANK_BASE(config->num_modules);
base_channel = LP50XX_OUT0_COLOR(config->num_modules);
end_channel = base_channel + start_channel + num_channels;
max_channels = base_channel + LP50XX_MAX_CHANNELS(config->num_modules);

Expand Down