Lines Matching refs:id

112 static inline int bd2802_is_rgb_off(struct bd2802_led *led, enum led_ids id,  in bd2802_is_rgb_off()  argument
117 return !led->led[id].r; in bd2802_is_rgb_off()
119 return !led->led[id].g; in bd2802_is_rgb_off()
121 return !led->led[id].b; in bd2802_is_rgb_off()
128 static inline int bd2802_is_led_off(struct bd2802_led *led, enum led_ids id) in bd2802_is_led_off() argument
130 if (led->led[id].r || led->led[id].g || led->led[id].b) in bd2802_is_led_off()
147 static inline u8 bd2802_get_base_offset(enum led_ids id, enum led_colors color) in bd2802_get_base_offset() argument
149 return id * BD2802_LED_OFFSET + color * BD2802_COLOR_OFFSET; in bd2802_get_base_offset()
152 static inline u8 bd2802_get_reg_addr(enum led_ids id, enum led_colors color, in bd2802_get_reg_addr() argument
155 return reg_offset + bd2802_get_base_offset(id, color); in bd2802_get_reg_addr()
175 static void bd2802_update_state(struct bd2802_led *led, enum led_ids id, in bd2802_update_state() argument
182 if (i == id) { in bd2802_update_state()
204 if (!bd2802_is_led_off(led, id)) in bd2802_update_state()
216 value = (id == LED1) ? LED_CTL(1, 0) : LED_CTL(0, 1); in bd2802_update_state()
239 static void bd2802_enable(struct bd2802_led *led, enum led_ids id) in bd2802_enable() argument
241 enum led_ids other_led = (id == LED1) ? LED2 : LED1; in bd2802_enable()
245 if (id == LED1) in bd2802_enable()
253 static void bd2802_set_on(struct bd2802_led *led, enum led_ids id, in bd2802_set_on() argument
261 reg = bd2802_get_reg_addr(id, color, BD2802_REG_CURRENT1SETUP); in bd2802_set_on()
263 reg = bd2802_get_reg_addr(id, color, BD2802_REG_CURRENT2SETUP); in bd2802_set_on()
265 reg = bd2802_get_reg_addr(id, color, BD2802_REG_WAVEPATTERN); in bd2802_set_on()
268 bd2802_enable(led, id); in bd2802_set_on()
269 bd2802_update_state(led, id, color, BD2802_ON); in bd2802_set_on()
272 static void bd2802_set_blink(struct bd2802_led *led, enum led_ids id, in bd2802_set_blink() argument
280 reg = bd2802_get_reg_addr(id, color, BD2802_REG_CURRENT1SETUP); in bd2802_set_blink()
282 reg = bd2802_get_reg_addr(id, color, BD2802_REG_CURRENT2SETUP); in bd2802_set_blink()
284 reg = bd2802_get_reg_addr(id, color, BD2802_REG_WAVEPATTERN); in bd2802_set_blink()
287 bd2802_enable(led, id); in bd2802_set_blink()
288 bd2802_update_state(led, id, color, BD2802_BLINK); in bd2802_set_blink()
291 static void bd2802_turn_on(struct bd2802_led *led, enum led_ids id, in bd2802_turn_on() argument
301 bd2802_set_blink(led, id, color); in bd2802_turn_on()
303 bd2802_set_on(led, id, color); in bd2802_turn_on()
306 static void bd2802_turn_off(struct bd2802_led *led, enum led_ids id, in bd2802_turn_off() argument
311 if (bd2802_is_rgb_off(led, id, color)) in bd2802_turn_off()
314 reg = bd2802_get_reg_addr(id, color, BD2802_REG_CURRENT1SETUP); in bd2802_turn_off()
316 reg = bd2802_get_reg_addr(id, color, BD2802_REG_CURRENT2SETUP); in bd2802_turn_off()
319 bd2802_update_state(led, id, color, BD2802_OFF); in bd2802_turn_off()
531 #define BD2802_CONTROL_RGBS(name, id, clr) \ argument
537 led->led_id = id; \
552 led->led_id = id; \
674 const struct i2c_device_id *id) in bd2802_probe() argument