@@ -267,7 +267,7 @@ static void bigben_set_led(struct led_classdev *led,
for (n = 0; n < NUM_LEDS; n++) {
if (led == bigben->leds[n]) {
- if (value == LED_OFF) {
+ if (value == 0) {
work = (bigben->led_state & BIT(n));
bigben->led_state &= ~BIT(n);
} else {
@@ -293,15 +293,15 @@ static enum led_brightness bigben_get_led(struct led_classdev *led)
if (!bigben) {
hid_err(hid, "no device data\n");
- return LED_OFF;
+ return 0;
}
for (n = 0; n < NUM_LEDS; n++) {
if (led == bigben->leds[n])
- return (bigben->led_state & BIT(n)) ? LED_ON : LED_OFF;
+ return (bigben->led_state & BIT(n)) ? 1 : 0;
}
- return LED_OFF;
+ return 0;
}
static void bigben_remove(struct hid_device *hid)
@@ -375,7 +375,7 @@ static int bigben_probe(struct hid_device *hid,
dev_name(&hid->dev), n + 1
);
led->name = name;
- led->brightness = (n == 0) ? LED_ON : LED_OFF;
+ led->brightness = (n == 0) ? 1 : 0;
led->max_brightness = 1;
led->brightness_get = bigben_get_led;
led->brightness_set = bigben_set_led;
@@ -453,7 +453,7 @@ static int elan_init_mute_led(struct hid_device *hdev)
mute_led->name = "elan:red:mute";
mute_led->default_trigger = "audio-mute";
mute_led->brightness_set_blocking = elan_mute_led_set_brigtness;
- mute_led->max_brightness = LED_ON;
+ mute_led->max_brightness = 1;
mute_led->flags = LED_HW_PLUGGABLE;
mute_led->dev = &hdev->dev;
@@ -842,7 +842,7 @@ static int lenovo_led_brightness_set(struct led_classdev *led_cdev,
if (led_cdev == &data_pointer->led_micmute)
led_nr = 1;
- if (value == LED_OFF)
+ if (value == 0)
data_pointer->led_state &= ~(1 << led_nr);
else
data_pointer->led_state |= 1 << led_nr;
@@ -1136,10 +1136,10 @@ static void lg4ff_led_set_brightness(struct led_classdev *led_cdev,
if (led_cdev != entry->wdata.led[i])
continue;
state = (entry->wdata.led_state >> i) & 1;
- if (value == LED_OFF && state) {
+ if (value == 0 && state) {
entry->wdata.led_state &= ~(1 << i);
lg4ff_set_leds(hid, entry->wdata.led_state);
- } else if (value != LED_OFF && !state) {
+ } else if (value != 0 && !state) {
entry->wdata.led_state |= 1 << i;
lg4ff_set_leds(hid, entry->wdata.led_state);
}
@@ -1157,14 +1157,14 @@ static enum led_brightness lg4ff_led_get_brightness(struct led_classdev *led_cde
if (!drv_data) {
hid_err(hid, "Device data not found.");
- return LED_OFF;
+ return 0;
}
entry = drv_data->device_props;
if (!entry) {
hid_err(hid, "Device properties not found.");
- return LED_OFF;
+ return 0;
}
for (i = 0; i < 5; i++)
@@ -1173,7 +1173,7 @@ static enum led_brightness lg4ff_led_get_brightness(struct led_classdev *led_cde
break;
}
- return value ? LED_FULL : LED_OFF;
+ return value ? 255 : 0;
}
#endif
@@ -64,10 +64,10 @@ static void picolcd_led_set_brightness(struct led_classdev *led_cdev,
if (led_cdev != data->led[i])
continue;
state = (data->led_state >> i) & 1;
- if (value == LED_OFF && state) {
+ if (value == 0 && state) {
data->led_state &= ~(1 << i);
picolcd_leds_set(data);
- } else if (value != LED_OFF && !state) {
+ } else if (value != 0 && !state) {
data->led_state |= 1 << i;
picolcd_leds_set(data);
}
@@ -90,7 +90,7 @@ static enum led_brightness picolcd_led_get_brightness(struct led_classdev *led_c
value = (data->led_state >> i) & 1;
break;
}
- return value ? LED_FULL : LED_OFF;
+ return value ? 255 : 0;
}
int picolcd_init_leds(struct picolcd_data *data, struct hid_report *report)
@@ -873,7 +873,7 @@ static int dualsense_player_led_set_brightness(struct led_classdev *led, enum le
spin_lock_irqsave(&ds->base.lock, flags);
led_index = led - ds->player_leds;
- if (value == LED_OFF)
+ if (value == 0)
ds->player_leds_state &= ~BIT(led_index);
else
ds->player_leds_state |= BIT(led_index);
@@ -2048,7 +2048,7 @@ static enum led_brightness sony_led_get_brightness(struct led_classdev *led)
drv_data = hid_get_drvdata(hdev);
if (!drv_data) {
hid_err(hdev, "No device data\n");
- return LED_OFF;
+ return 0;
}
for (n = 0; n < drv_data->led_count; n++) {
@@ -2056,7 +2056,7 @@ static enum led_brightness sony_led_get_brightness(struct led_classdev *led)
return drv_data->led_state[n];
}
- return LED_OFF;
+ return 0;
}
static int sony_led_blink_set(struct led_classdev *led, unsigned long *delay_on,
@@ -146,7 +146,7 @@ static void steelseries_srws1_led_all_set_brightness(struct led_classdev *led_cd
return;
}
- if (value == LED_OFF)
+ if (value == 0)
drv_data->led_state = 0;
else
drv_data->led_state = (1 << (SRWS1_NUMBER_LEDS + 1)) - 1;
@@ -164,10 +164,10 @@ static enum led_brightness steelseries_srws1_led_all_get_brightness(struct led_c
if (!drv_data) {
hid_err(hid, "Device data not found.");
- return LED_OFF;
+ return 0;
}
- return (drv_data->led_state >> SRWS1_NUMBER_LEDS) ? LED_FULL : LED_OFF;
+ return (drv_data->led_state >> SRWS1_NUMBER_LEDS) ? 255 : 0;
}
static void steelseries_srws1_led_set_brightness(struct led_classdev *led_cdev,
@@ -188,10 +188,10 @@ static void steelseries_srws1_led_set_brightness(struct led_classdev *led_cdev,
continue;
state = (drv_data->led_state >> i) & 1;
- if (value == LED_OFF && state) {
+ if (value == 0 && state) {
drv_data->led_state &= ~(1 << i);
steelseries_srws1_set_leds(hid, drv_data->led_state);
- } else if (value != LED_OFF && !state) {
+ } else if (value != 0 && !state) {
drv_data->led_state |= 1 << i;
steelseries_srws1_set_leds(hid, drv_data->led_state);
}
@@ -210,7 +210,7 @@ static enum led_brightness steelseries_srws1_led_get_brightness(struct led_class
if (!drv_data) {
hid_err(hid, "Device data not found.");
- return LED_OFF;
+ return 0;
}
for (i = 0; i < SRWS1_NUMBER_LEDS; i++)
@@ -219,7 +219,7 @@ static enum led_brightness steelseries_srws1_led_get_brightness(struct led_class
break;
}
- return value ? LED_FULL : LED_OFF;
+ return value ? 255 : 0;
}
static int steelseries_srws1_probe(struct hid_device *hdev,
@@ -187,7 +187,7 @@ static int u2fzero_blink(struct led_classdev *ldev)
static int u2fzero_brightness_set(struct led_classdev *ldev,
enum led_brightness brightness)
{
- ldev->brightness = LED_OFF;
+ ldev->brightness = 0;
if (brightness)
return u2fzero_blink(ldev);
else
@@ -244,7 +244,7 @@ static int u2fzero_init_led(struct u2fzero_device *dev,
return -ENOMEM;
dev->ldev.name = dev->led_name;
- dev->ldev.max_brightness = LED_ON;
+ dev->ldev.max_brightness = 1;
dev->ldev.flags = LED_HW_PLUGGABLE;
dev->ldev.brightness_set_blocking = u2fzero_brightness_set;
@@ -308,7 +308,7 @@ static enum led_brightness wiimod_led_get(struct led_classdev *led_dev)
}
}
- return value ? LED_FULL : LED_OFF;
+ return value ? 255 : 0;
}
static void wiimod_led_set(struct led_classdev *led_dev,
@@ -325,7 +325,7 @@ static void wiimod_led_set(struct led_classdev *led_dev,
flag = WIIPROTO_FLAG_LED(i + 1);
spin_lock_irqsave(&wdata->state.lock, flags);
state = wdata->state.flags;
- if (value == LED_OFF)
+ if (value == 0)
wiiproto_req_leds(wdata, state & ~flag);
else
wiiproto_req_leds(wdata, state | flag);
@@ -1304,13 +1304,13 @@ enum led_brightness wacom_leds_brightness_get(struct wacom_led *led)
struct wacom *wacom = led->wacom;
if (wacom->led.max_hlv)
- return led->hlv * LED_FULL / wacom->led.max_hlv;
+ return led->hlv * 255 / wacom->led.max_hlv;
if (wacom->led.max_llv)
- return led->llv * LED_FULL / wacom->led.max_llv;
+ return led->llv * 255 / wacom->led.max_llv;
/* device doesn't support brightness tuning */
- return LED_FULL;
+ return 255;
}
static enum led_brightness __wacom_led_brightness_get(struct led_classdev *cdev)
@@ -1319,7 +1319,7 @@ static enum led_brightness __wacom_led_brightness_get(struct led_classdev *cdev)
struct wacom *wacom = led->wacom;
if (wacom->led.groups[led->group].select != led->id)
- return LED_OFF;
+ return 0;
return wacom_leds_brightness_get(led);
}
@@ -1333,14 +1333,14 @@ static int wacom_led_brightness_set(struct led_classdev *cdev,
mutex_lock(&wacom->lock);
- if (!wacom->led.groups || (brightness == LED_OFF &&
+ if (!wacom->led.groups || (brightness == 0 &&
wacom->led.groups[led->group].select != led->id)) {
error = 0;
goto out;
}
- led->llv = wacom->led.llv = wacom->led.max_llv * brightness / LED_FULL;
- led->hlv = wacom->led.hlv = wacom->led.max_hlv * brightness / LED_FULL;
+ led->llv = wacom->led.llv = wacom->led.max_llv * brightness / 255;
+ led->hlv = wacom->led.hlv = wacom->led.max_hlv * brightness / 255;
wacom->led.groups[led->group].select = led->id;
@@ -1389,7 +1389,7 @@ static int wacom_led_register_one(struct device *dev, struct wacom *wacom,
led->llv = wacom->led.llv;
led->hlv = wacom->led.hlv;
led->cdev.name = name;
- led->cdev.max_brightness = LED_FULL;
+ led->cdev.max_brightness = 255;
led->cdev.flags = LED_HW_PLUGGABLE;
led->cdev.brightness_get = __wacom_led_brightness_get;
if (!read_only) {
@@ -3958,7 +3958,7 @@ static void wacom_24hd_update_leds(struct wacom *wacom, int mask, int group)
}
if (!updated && mask & BIT(i)) {
led->held = true;
- led_trigger_event(&led->trigger, LED_FULL);
+ led_trigger_event(&led->trigger, 255);
} else {
led->held = false;
}