genesys: Extract register initialization out of init_regs_for_shading()

merge-requests/340/head
Povilas Kanapickas 2020-02-03 00:41:54 +02:00
rodzic c1791e6c83
commit 0a49fa10ee
6 zmienionych plików z 6 dodań i 18 usunięć

Wyświetl plik

@ -1650,11 +1650,13 @@ static void genesys_shading_calibration_impl(Genesys_Device* dev, const Genesys_
if (shading_progress_msg) { // FIXME: remove when updating tests
dev->interface->record_progress_message(shading_progress_msg);
}
dev->cmd_set->init_regs_for_shading(dev, sensor, local_reg);
if (dev->model->asic_type == AsicType::GL646) {
dev->cmd_set->init_regs_for_shading(dev, sensor, local_reg);
local_reg = dev->reg;
} else {
local_reg = dev->reg;
dev->cmd_set->init_regs_for_shading(dev, sensor, local_reg);
dev->interface->write_registers(local_reg);
}
@ -1896,11 +1898,12 @@ static void genesys_dark_white_shading_calibration(Genesys_Device* dev,
// FIXME: remove when updating tests
dev->interface->record_progress_message("init_regs_for_shading");
dev->cmd_set->init_regs_for_shading(dev, sensor, local_reg);
if (dev->model->asic_type == AsicType::GL646) {
dev->cmd_set->init_regs_for_shading(dev, sensor, local_reg);
local_reg = dev->reg;
} else {
local_reg = dev->reg;
dev->cmd_set->init_regs_for_shading(dev, sensor, local_reg);
dev->interface->write_registers(local_reg);
}

Wyświetl plik

@ -1178,9 +1178,6 @@ void CommandSetGl124::init_regs_for_shading(Genesys_Device* dev, const Genesys_S
DBG_HELPER(dbg);
int move, resolution, dpihw, factor;
/* initial calibration reg values */
regs = dev->reg;
dev->calib_channels = 3;
dev->calib_lines = dev->model->shading_lines;
dpihw = sensor.get_register_hwdpi(dev->settings.xres);

Wyświetl plik

@ -2436,9 +2436,6 @@ void CommandSetGl841::init_regs_for_shading(Genesys_Device* dev, const Genesys_S
SANE_Int ydpi;
unsigned starty = 0;
/* initial calibration reg values */
regs = dev->reg;
ydpi = dev->motor.base_ydpi;
if (dev->model->motor_id == MotorId::PLUSTEK_OPTICPRO_3600) /* TODO PLUSTEK_3600: 1200dpi not yet working, produces dark bar */
{

Wyświetl plik

@ -1698,9 +1698,6 @@ void CommandSetGl843::init_regs_for_shading(Genesys_Device* dev, const Genesys_S
DBG_HELPER(dbg);
int move, resolution, dpihw, factor;
/* initial calibration reg values */
regs = dev->reg;
dev->calib_channels = 3;
if (dev->settings.scan_method == ScanMethod::TRANSPARENCY ||

Wyświetl plik

@ -960,9 +960,6 @@ void CommandSetGl846::init_regs_for_shading(Genesys_Device* dev, const Genesys_S
dev->calib_channels = 3;
/* initial calibration reg values */
regs = dev->reg;
dev->calib_resolution = sensor.get_register_hwdpi(dev->settings.xres);
const auto& calib_sensor = sanei_genesys_find_sensor(dev, dev->calib_resolution,

Wyświetl plik

@ -967,9 +967,6 @@ void CommandSetGl847::init_regs_for_shading(Genesys_Device* dev, const Genesys_S
dev->calib_channels = 3;
/* initial calibration reg values */
regs = dev->reg;
dev->calib_resolution = sensor.get_register_hwdpi(dev->settings.xres);
const auto& calib_sensor = sanei_genesys_find_sensor(dev, dev->calib_resolution,