Lines Matching defs:bank

62  * Each bank (BANK0 and BANK1) has two usage counts - LEDs using the
162 struct bank {
167 } bank[3];
178 int bank; /* Bank used, or -1 */
278 * bank or other. This can be used for timers, for levels, or for
281 static void set_code(struct tca6507_chip *tca, int reg, int bank, int new)
285 if (bank) {
298 static void set_level(struct tca6507_chip *tca, int bank, int level)
300 switch (bank) {
303 set_code(tca, TCA6507_MAX_INTENSITY, bank, level);
309 tca->bank[bank].level = level;
312 /* Record all relevant time codes for a given bank */
313 static void set_times(struct tca6507_chip *tca, int bank)
318 result = choose_times(tca->bank[bank].ontime, &c1, &c2);
324 c2, time_codes[c2], tca->bank[bank].ontime);
325 set_code(tca, TCA6507_FADE_ON, bank, c2);
326 set_code(tca, TCA6507_FULL_ON, bank, c1);
327 tca->bank[bank].ontime = result;
329 result = choose_times(tca->bank[bank].offtime, &c1, &c2);
333 c2, time_codes[c2], tca->bank[bank].offtime);
334 set_code(tca, TCA6507_FADE_OFF, bank, c2);
335 set_code(tca, TCA6507_FIRST_OFF, bank, c1);
336 set_code(tca, TCA6507_SECOND_OFF, bank, c1);
337 tca->bank[bank].offtime = result;
339 set_code(tca, TCA6507_INITIALIZE, bank, INIT_CODE);
368 if (led->bank >= 0) {
369 struct bank *b = tca->bank + led->bank;
375 led->bank = -1;
380 /* Assign this led to a bank, configuring that bank if
386 struct bank *b;
398 * bank. If none perfect, choose best. Count
399 * backwards so we check MASTER bank first to avoid
412 if (tca->bank[i].level == level ||
413 tca->bank[i].level_use == 0) {
417 d = abs(level - tca->bank[i].level);
430 if (!tca->bank[best].level_use)
433 tca->bank[best].level_use++;
434 led->bank = best;
436 led->led_cdev.brightness = TO_BRIGHT(tca->bank[best].level);
442 * bank. First check if times are compatible with hardware
451 if (tca->bank[i].level_use == 0)
454 if (tca->bank[i].level != level)
461 if (tca->bank[i].time_use == 0)
465 if (!(tca->bank[i].on_dflt ||
467 tca->bank[i].ontime == led->ontime))
471 if (!(tca->bank[i].off_dflt ||
473 tca->bank[i].offtime == led->offtime))
485 b = &tca->bank[i];
489 led->bank = i;
770 l->bank = -1;