genesys: Only ever use sanei_genesys_set_lamp_power() to turn on lamp

merge-requests/82/head
Povilas Kanapickas 2019-06-08 14:04:27 +03:00
rodzic 6d9e783a51
commit d11971b220
5 zmienionych plików z 7 dodań i 35 usunięć

Wyświetl plik

@ -1066,10 +1066,7 @@ gl124_init_optical_regs_scan (Genesys_Device * dev,
DBG (DBG_io, "%s: enabling AVEENB\n", __func__);
}
if (flags & OPTICAL_FLAG_DISABLE_LAMP)
r->value &= ~REG03_LAMPPWR;
else
r->value |= REG03_LAMPPWR;
sanei_genesys_set_lamp_power(dev, sensor, *reg, !(flags & OPTICAL_FLAG_DISABLE_LAMP));
/* BW threshold */
RIE (sanei_genesys_write_register (dev, REG114, dev->settings.threshold));

Wyświetl plik

@ -1901,25 +1901,7 @@ gl841_init_optical_regs_scan(Genesys_Device * dev,
*/
r = sanei_genesys_get_address (reg, 0x03);
r->value |= REG03_AVEENB;
if (flags & OPTICAL_FLAG_DISABLE_LAMP)
r->value &= ~REG03_LAMPPWR;
else
r->value |= REG03_LAMPPWR;
/* exposure times */
if (flags & OPTICAL_FLAG_DISABLE_LAMP) {
// 0x0101 is as off as possible
sanei_genesys_set_exposure(*reg, {0x0101, 0x0101, 0x0101});
} else {
// EXP[R,G,B] only matter for CIS scanners
sanei_genesys_set_exposure(*reg, sanei_genesys_fixup_exposure(sensor.exposure));
}
r = sanei_genesys_get_address (reg, 0x19);
if (flags & OPTICAL_FLAG_DISABLE_LAMP)
r->value = 0xff;
else
r->value = 0x50;
sanei_genesys_set_lamp_power(dev, sensor, *reg, !(flags & OPTICAL_FLAG_DISABLE_LAMP));
/* BW threshold */
r = sanei_genesys_get_address (reg, 0x2e);

Wyświetl plik

@ -1180,10 +1180,9 @@ gl843_init_optical_regs_scan (Genesys_Device * dev,
else
r->value &= ~REG03_AVEENB;
if (flags & OPTICAL_FLAG_DISABLE_LAMP)
r->value &= ~REG03_LAMPPWR;
else
r->value |= REG03_LAMPPWR;
// FIXME: we probably don't need to set exposure to registers at this point. It was this way
// before a refactor.
sanei_genesys_set_lamp_power(dev, sensor, *reg, !(flags & OPTICAL_FLAG_DISABLE_LAMP));
/* select XPA */
r->value &= ~REG03_XPASEL;

Wyświetl plik

@ -942,10 +942,7 @@ gl846_init_optical_regs_scan (Genesys_Device * dev,
r = sanei_genesys_get_address (reg, REG03);
r->value &= ~REG03_AVEENB;
if (flags & OPTICAL_FLAG_DISABLE_LAMP)
r->value &= ~REG03_LAMPPWR;
else
r->value |= REG03_LAMPPWR;
sanei_genesys_set_lamp_power(dev, sensor, *reg, !(flags & OPTICAL_FLAG_DISABLE_LAMP));
/* BW threshold */
r = sanei_genesys_get_address (reg, 0x2e);

Wyświetl plik

@ -957,10 +957,7 @@ gl847_init_optical_regs_scan (Genesys_Device * dev,
r = sanei_genesys_get_address (reg, REG03);
r->value &= ~REG03_AVEENB;
if (flags & OPTICAL_FLAG_DISABLE_LAMP)
r->value &= ~REG03_LAMPPWR;
else
r->value |= REG03_LAMPPWR;
sanei_genesys_set_lamp_power(dev, sensor, *reg, !(flags & OPTICAL_FLAG_DISABLE_LAMP));
/* BW threshold */
r = sanei_genesys_get_address (reg, 0x2e);