Skip to content

Commit f729420

Browse files
kartbendkalowsk
authored andcommitted
drivers: led: fix LED_BRIGTHNESS_MAX typo
Renames LED_BRIGTHNESS_MAX to LED_BRIGHTNESS_MAX in led.h and all in-tree users of the macro. Signed-off-by: Benjamin Cabé <[email protected]>
1 parent 036a76a commit f729420

File tree

15 files changed

+23
-23
lines changed

15 files changed

+23
-23
lines changed

drivers/led/ht16k33.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ static int ht16k33_led_set_brightness(const struct device *dev, uint32_t led,
130130
uint8_t dim;
131131
uint8_t cmd;
132132

133-
dim = (value * (HT16K33_DIMMING_LEVELS - 1)) / LED_BRIGTHNESS_MAX;
133+
dim = (value * (HT16K33_DIMMING_LEVELS - 1)) / LED_BRIGHTNESS_MAX;
134134
cmd = HT16K33_CMD_DIMMING_SET | dim;
135135

136136
if (i2c_write_dt(&config->i2c, &cmd, sizeof(cmd))) {

drivers/led/is31fl3194.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ static int is31fl3194_set_brightness(const struct device *dev, uint32_t led, uin
146146
}
147147

148148
/* Rescale 0..100 to 0..255 */
149-
value = value * 255 / LED_BRIGTHNESS_MAX;
149+
value = value * 255 / LED_BRIGHTNESS_MAX;
150150

151151
ret = i2c_reg_write_byte_dt(&config->bus, led_channels[led], value);
152152
if (ret == 0) {

drivers/led/is31fl3216a.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ static int is31fl3216a_update_pwm(const struct i2c_dt_spec *i2c)
6262

6363
static uint8_t is31fl3216a_brightness_to_pwm(uint8_t brightness)
6464
{
65-
return (0xFFU * brightness) / LED_BRIGTHNESS_MAX;
65+
return (0xFFU * brightness) / LED_BRIGHTNESS_MAX;
6666
}
6767

6868
static int is31fl3216a_led_write_channels(const struct device *dev,
@@ -87,7 +87,7 @@ static int is31fl3216a_led_write_channels(const struct device *dev,
8787
i2c_buffer[0] = IS31FL3216A_REG_PWM_LAST - start_channel -
8888
(num_channels - 1);
8989
for (i = 0; i < num_channels; i++) {
90-
if (buf[num_channels - i - 1] > LED_BRIGTHNESS_MAX) {
90+
if (buf[num_channels - i - 1] > LED_BRIGHTNESS_MAX) {
9191
return -EINVAL;
9292
}
9393
i2c_buffer[i + 1] = is31fl3216a_brightness_to_pwm(

drivers/led/is31fl3733.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ static int is31fl3733_led_set_brightness(const struct device *dev, uint32_t led,
9696
{
9797
const struct is31fl3733_config *config = dev->config;
9898
int ret;
99-
uint8_t led_brightness = (uint8_t)(((uint32_t)value * 255) / LED_BRIGTHNESS_MAX);
99+
uint8_t led_brightness = (uint8_t)(((uint32_t)value * 255) / LED_BRIGHTNESS_MAX);
100100

101101
if (led >= IS31FL3733_MAX_LED) {
102102
return -EINVAL;

drivers/led/led_dac.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ static int led_dac_set_brightness(const struct device *dev, uint32_t led, uint8_
4343
value = pct > 0 ? config->leds[led].dac_min_brightness +
4444
(uint64_t)(config->leds[led].dac_max_brightness -
4545
config->leds[led].dac_min_brightness) *
46-
pct / LED_BRIGTHNESS_MAX
46+
pct / LED_BRIGHTNESS_MAX
4747
: 0;
4848

4949
return led_dac_set_raw(dev, led, value);

drivers/led/led_pwm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ static int led_pwm_set_brightness(const struct device *dev,
6565
dt_led = &config->led[led];
6666

6767
return pwm_set_pulse_dt(&config->led[led],
68-
(uint32_t) ((uint64_t) dt_led->period * value / LED_BRIGTHNESS_MAX));
68+
(uint32_t) ((uint64_t) dt_led->period * value / LED_BRIGHTNESS_MAX));
6969
}
7070

7171
static int led_pwm_init(const struct device *dev)

drivers/led/led_shell.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ static int cmd_set_brightness(const struct shell *sh,
164164
argv[arg_idx_value]);
165165
return -EINVAL;
166166
}
167-
if (value > LED_BRIGTHNESS_MAX) {
167+
if (value > LED_BRIGHTNESS_MAX) {
168168
shell_error(sh, "Invalid LED brightness value %lu (max 100)",
169169
value);
170170
return -EINVAL;

drivers/led/lp3943.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ static int lp3943_led_set_brightness(const struct device *dev, uint32_t led,
178178
reg = LP3943_PWM1;
179179
}
180180

181-
val = (value * 255U) / LED_BRIGTHNESS_MAX;
181+
val = (value * 255U) / LED_BRIGHTNESS_MAX;
182182
if (i2c_reg_write_byte_dt(&config->bus, reg, val)) {
183183
LOG_ERR("LED write failed");
184184
return -EIO;

drivers/led/lp50xx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ static int lp50xx_set_brightness(const struct device *dev,
125125
}
126126

127127
buf[0] = LP50XX_LED0_BRIGHTNESS(config->num_modules) + led_info->index;
128-
buf[1] = (value * 0xff) / LED_BRIGTHNESS_MAX;
128+
buf[1] = (value * 0xff) / LED_BRIGHTNESS_MAX;
129129

130130
return i2c_write_dt(&config->bus, buf, sizeof(buf));
131131
}

drivers/led/lp5562.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ static int lp5562_program_set_brightness(const struct device *dev,
601601
{
602602
uint8_t val;
603603

604-
val = (brightness * 0xFF) / LED_BRIGTHNESS_MAX;
604+
val = (brightness * 0xFF) / LED_BRIGHTNESS_MAX;
605605

606606
return lp5562_program_command(dev, engine, command_index,
607607
LP5562_PROG_COMMAND_SET_PWM, val);
@@ -781,7 +781,7 @@ static int lp5562_led_blink(const struct device *dev, uint32_t led,
781781
}
782782

783783
ret = lp5562_program_set_brightness(dev, engine, command_index,
784-
LED_BRIGTHNESS_MAX);
784+
LED_BRIGHTNESS_MAX);
785785
if (ret) {
786786
return ret;
787787
}
@@ -792,7 +792,7 @@ static int lp5562_led_blink(const struct device *dev, uint32_t led,
792792
}
793793

794794
ret = lp5562_program_set_brightness(dev, engine, ++command_index,
795-
LED_BRIGTHNESS_MAX);
795+
LED_BRIGHTNESS_MAX);
796796
if (ret) {
797797
return ret;
798798
}
@@ -845,7 +845,7 @@ static int lp5562_led_set_brightness(const struct device *dev, uint32_t led,
845845
}
846846
}
847847

848-
val = (value * 0xFF) / LED_BRIGTHNESS_MAX;
848+
val = (value * 0xFF) / LED_BRIGHTNESS_MAX;
849849

850850
ret = lp5562_get_pwm_reg(led, &reg);
851851
if (ret) {
@@ -862,7 +862,7 @@ static int lp5562_led_set_brightness(const struct device *dev, uint32_t led,
862862

863863
static inline int lp5562_led_on(const struct device *dev, uint32_t led)
864864
{
865-
return lp5562_led_set_brightness(dev, led, LED_BRIGTHNESS_MAX);
865+
return lp5562_led_set_brightness(dev, led, LED_BRIGHTNESS_MAX);
866866
}
867867

868868
static inline int lp5562_led_off(const struct device *dev, uint32_t led)
@@ -882,7 +882,7 @@ static inline int lp5562_led_off(const struct device *dev, uint32_t led)
882882
}
883883
}
884884

885-
return lp5562_led_set_brightness(dev, led, LED_BRIGTHNESS_MAX);
885+
return lp5562_led_set_brightness(dev, led, LED_BRIGHTNESS_MAX);
886886
}
887887

888888
static int lp5562_led_update_current(const struct device *dev)

0 commit comments

Comments
 (0)