kopia lustrzana https://gitlab.com/sane-project/backends
genesys: Pass sensor profile directly to *_setup_sensor() where possible
rodzic
37b60ada83
commit
f480521a23
|
@ -760,8 +760,8 @@ static void gl124_init_motor_regs_scan(Genesys_Device* dev,
|
|||
* */
|
||||
static void gl124_setup_sensor(Genesys_Device * dev,
|
||||
const Genesys_Sensor& sensor,
|
||||
Genesys_Register_Set * regs, unsigned dpihw,
|
||||
unsigned ccd_size_divisor)
|
||||
const SensorProfile& sensor_profile,
|
||||
Genesys_Register_Set * regs)
|
||||
{
|
||||
DBG_HELPER(dbg);
|
||||
uint32_t exp;
|
||||
|
@ -777,9 +777,6 @@ static void gl124_setup_sensor(Genesys_Device * dev,
|
|||
regs->set8(addr, sensor.custom_regs.get_value(addr));
|
||||
}
|
||||
|
||||
// set EXPDUMMY and CKxMAP
|
||||
const auto& sensor_profile = get_sensor_profile(sensor, dpihw, ccd_size_divisor);
|
||||
|
||||
for (auto reg : sensor_profile.custom_regs) {
|
||||
regs->set8(reg.address, reg.value);
|
||||
}
|
||||
|
@ -845,7 +842,8 @@ static void gl124_init_optical_regs_scan(Genesys_Device* dev, const Genesys_Sens
|
|||
DBG (DBG_io2, "%s: dpihw=%d (factor=%d)\n", __func__, dpihw, factor);
|
||||
|
||||
// sensor parameters
|
||||
gl124_setup_sensor(dev, sensor, reg, dpihw, session.ccd_size_divisor);
|
||||
const auto& sensor_profile = get_sensor_profile(sensor, dpihw, session.ccd_size_divisor);
|
||||
gl124_setup_sensor(dev, sensor, sensor_profile, reg);
|
||||
|
||||
/* start and end coordinate in optical dpi coordinates */
|
||||
/* startx = start / ccd_pixels_per_system_pixel + sensor.dummy_pixel; XXX STEF XXX */
|
||||
|
|
|
@ -186,10 +186,9 @@ static const SensorProfile& get_sensor_profile(const Genesys_Sensor& sensor, uns
|
|||
/** @brief sensor specific settings
|
||||
*/
|
||||
static void gl846_setup_sensor(Genesys_Device * dev, const Genesys_Sensor& sensor,
|
||||
Genesys_Register_Set * regs, int dpi)
|
||||
const SensorProfile& sensor_profile, Genesys_Register_Set* regs)
|
||||
{
|
||||
DBG_HELPER(dbg);
|
||||
int dpihw;
|
||||
uint16_t exp;
|
||||
|
||||
for (uint16_t addr = 0x16; addr < 0x1e; addr++) {
|
||||
|
@ -200,10 +199,6 @@ static void gl846_setup_sensor(Genesys_Device * dev, const Genesys_Sensor& senso
|
|||
regs->set8(addr, sensor.custom_regs.get_value(addr));
|
||||
}
|
||||
|
||||
// set EXPDUMMY and CKxMAP
|
||||
dpihw = sensor.get_register_hwdpi(dpi);
|
||||
const auto& sensor_profile = get_sensor_profile(sensor, dpihw);
|
||||
|
||||
for (const auto& reg : sensor_profile.custom_regs) {
|
||||
regs->set8(reg.address, reg.value);
|
||||
}
|
||||
|
@ -741,7 +736,7 @@ static void gl846_init_optical_regs_scan(Genesys_Device* dev, const Genesys_Sens
|
|||
|
||||
// sensor parameters
|
||||
const auto& sensor_profile = get_sensor_profile(sensor, dpihw);
|
||||
gl846_setup_sensor(dev, sensor, reg, dpihw);
|
||||
gl846_setup_sensor(dev, sensor, sensor_profile, reg);
|
||||
|
||||
// start and end coordinate in optical dpi coordinates
|
||||
unsigned startx = start / ccd_pixels_per_system_pixel + sensor.CCD_start_xoffset;
|
||||
|
|
|
@ -181,14 +181,11 @@ static const SensorProfile& get_sensor_profile(const Genesys_Sensor& sensor, uns
|
|||
/** @brief sensor specific settings
|
||||
*/
|
||||
static void gl847_setup_sensor(Genesys_Device * dev, const Genesys_Sensor& sensor,
|
||||
Genesys_Register_Set * regs, int dpi)
|
||||
const SensorProfile& sensor_profile, Genesys_Register_Set* regs)
|
||||
{
|
||||
DBG_HELPER(dbg);
|
||||
int dpihw;
|
||||
uint16_t exp;
|
||||
|
||||
dpihw = sensor.get_register_hwdpi(dpi);
|
||||
|
||||
for (uint16_t addr = 0x16; addr < 0x1e; addr++) {
|
||||
regs->set8(addr, sensor.custom_regs.get_value(addr));
|
||||
}
|
||||
|
@ -197,10 +194,6 @@ static void gl847_setup_sensor(Genesys_Device * dev, const Genesys_Sensor& senso
|
|||
regs->set8(addr, sensor.custom_regs.get_value(addr));
|
||||
}
|
||||
|
||||
// set EXPDUMMY and CKxMAP
|
||||
dpihw = sensor.get_register_hwdpi(dpi);
|
||||
const auto& sensor_profile = get_sensor_profile(sensor, dpihw);
|
||||
|
||||
for (const auto& reg : sensor_profile.custom_regs) {
|
||||
regs->set8(reg.address, reg.value);
|
||||
}
|
||||
|
@ -759,7 +752,7 @@ static void gl847_init_optical_regs_scan(Genesys_Device* dev, const Genesys_Sens
|
|||
|
||||
// sensor parameters
|
||||
const auto& sensor_profile = get_sensor_profile(sensor, dpihw);
|
||||
gl847_setup_sensor(dev, sensor, reg, dpihw);
|
||||
gl847_setup_sensor(dev, sensor, sensor_profile, reg);
|
||||
dpiset = session.params.xres * ccd_pixels_per_system_pixel;
|
||||
|
||||
// start and end coordinate in optical dpi coordinates
|
||||
|
|
Ładowanie…
Reference in New Issue