kopia lustrzana https://gitlab.com/sane-project/backends
genesys: Simplify motor setup on gl846
rodzic
fe8ffefe1b
commit
a41ffe3c33
|
@ -454,14 +454,6 @@ static void gl846_init_motor_regs_scan(Genesys_Device* dev,
|
|||
dev->interface->write_register(REG_0x6C, val);
|
||||
*/
|
||||
|
||||
if (dev->model->gpio_id == GpioId::IMG101) {
|
||||
if (scan_yres == sensor.get_register_hwdpi(scan_yres)) {
|
||||
dev->interface->write_register(REG_0x7E, 1);
|
||||
} else {
|
||||
dev->interface->write_register(REG_0x7E, 0);
|
||||
}
|
||||
}
|
||||
|
||||
unsigned min_restep = (scan_table.steps_count / step_multiplier) / 2 - 1;
|
||||
if (min_restep < 1) {
|
||||
min_restep = 1;
|
||||
|
|
|
@ -3044,21 +3044,25 @@ void genesys_init_sensor_tables()
|
|||
ValueFilterAny<unsigned> resolutions;
|
||||
Ratio pixel_count_ratio;
|
||||
unsigned shading_factor;
|
||||
GenesysRegisterSettingSet extra_custom_regs;
|
||||
};
|
||||
|
||||
CustomSensorSettings custom_settings[] = {
|
||||
{ { 75 }, Ratio{1, 4}, 8 },
|
||||
{ { 100 }, Ratio{1, 4}, 6 },
|
||||
{ { 150 }, Ratio{1, 4}, 4 },
|
||||
{ { 300 }, Ratio{1, 4}, 2 },
|
||||
{ { 600 }, Ratio{1, 4}, 1 },
|
||||
{ { 1200 }, Ratio{1, 2}, 1 },
|
||||
{ { 75 }, Ratio{1, 4}, 8, { { 0x7e, 0x00 } } },
|
||||
{ { 100 }, Ratio{1, 4}, 6, { { 0x7e, 0x00 } } },
|
||||
{ { 150 }, Ratio{1, 4}, 4, { { 0x7e, 0x00 } } },
|
||||
{ { 300 }, Ratio{1, 4}, 2, { { 0x7e, 0x00 } } },
|
||||
{ { 600 }, Ratio{1, 4}, 1, { { 0x7e, 0x01 } } },
|
||||
{ { 1200 }, Ratio{1, 2}, 1, { { 0x7e, 0x01 } } },
|
||||
};
|
||||
|
||||
auto base_custom_regs = sensor.custom_regs;
|
||||
for (const CustomSensorSettings& setting : custom_settings) {
|
||||
sensor.resolutions = setting.resolutions;
|
||||
sensor.pixel_count_ratio = setting.pixel_count_ratio;
|
||||
sensor.shading_factor = setting.shading_factor;
|
||||
sensor.custom_regs = base_custom_regs;
|
||||
sensor.custom_regs.merge(setting.extra_custom_regs);
|
||||
s_sensors->push_back(sensor);
|
||||
}
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue