Lines Matching defs:bank

62  * Each bank (BANK0 and BANK1) has two usage counts - LEDs using the
159 struct bank {
164 } bank[3];
175 int bank; /* Bank used, or -1 */
275 * bank or other. This can be used for timers, for levels, or for
278 static void set_code(struct tca6507_chip *tca, int reg, int bank, int new)
282 if (bank) {
295 static void set_level(struct tca6507_chip *tca, int bank, int level)
297 switch (bank) {
300 set_code(tca, TCA6507_MAX_INTENSITY, bank, level);
306 tca->bank[bank].level = level;
309 /* Record all relevant time codes for a given bank */
310 static void set_times(struct tca6507_chip *tca, int bank)
315 result = choose_times(tca->bank[bank].ontime, &c1, &c2);
321 c2, time_codes[c2], tca->bank[bank].ontime);
322 set_code(tca, TCA6507_FADE_ON, bank, c2);
323 set_code(tca, TCA6507_FULL_ON, bank, c1);
324 tca->bank[bank].ontime = result;
326 result = choose_times(tca->bank[bank].offtime, &c1, &c2);
330 c2, time_codes[c2], tca->bank[bank].offtime);
331 set_code(tca, TCA6507_FADE_OFF, bank, c2);
332 set_code(tca, TCA6507_FIRST_OFF, bank, c1);
333 set_code(tca, TCA6507_SECOND_OFF, bank, c1);
334 tca->bank[bank].offtime = result;
336 set_code(tca, TCA6507_INITIALIZE, bank, INIT_CODE);
365 if (led->bank >= 0) {
366 struct bank *b = tca->bank + led->bank;
372 led->bank = -1;
377 /* Assign this led to a bank, configuring that bank if
383 struct bank *b;
395 * bank. If none perfect, choose best. Count
396 * backwards so we check MASTER bank first to avoid
409 if (tca->bank[i].level == level ||
410 tca->bank[i].level_use == 0) {
414 d = abs(level - tca->bank[i].level);
427 if (!tca->bank[best].level_use)
430 tca->bank[best].level_use++;
431 led->bank = best;
433 led->led_cdev.brightness = TO_BRIGHT(tca->bank[best].level);
439 * bank. First check if times are compatible with hardware
448 if (tca->bank[i].level_use == 0)
451 if (tca->bank[i].level != level)
458 if (tca->bank[i].time_use == 0)
462 if (!(tca->bank[i].on_dflt ||
464 tca->bank[i].ontime == led->ontime))
468 if (!(tca->bank[i].off_dflt ||
470 tca->bank[i].offtime == led->offtime))
482 b = &tca->bank[i];
486 led->bank = i;
753 l->bank = -1;