kopia lustrzana https://gitlab.com/sane-project/backends
genesys: Return errors as exceptions from *init_regs_for_scan()
rodzic
8837f8adcc
commit
d46d5cd027
|
@ -3662,13 +3662,7 @@ genesys_start_scan (Genesys_Device * dev, SANE_Bool lamp_off)
|
||||||
RIE(dev->model->cmd_set->move_to_ta(dev));
|
RIE(dev->model->cmd_set->move_to_ta(dev));
|
||||||
}
|
}
|
||||||
|
|
||||||
status = dev->model->cmd_set->init_regs_for_scan(dev, sensor);
|
dev->model->cmd_set->init_regs_for_scan(dev, sensor);
|
||||||
if (status != SANE_STATUS_GOOD)
|
|
||||||
{
|
|
||||||
DBG(DBG_error, "%s: failed to do init registers for scan: %s\n", __func__,
|
|
||||||
sane_strstatus(status));
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* no lamp during scan */
|
/* no lamp during scan */
|
||||||
if(lamp_off == SANE_TRUE)
|
if(lamp_off == SANE_TRUE)
|
||||||
|
|
|
@ -2123,8 +2123,7 @@ static void gl124_wait_for_motor_stop(Genesys_Device* dev)
|
||||||
|
|
||||||
/** @brief set up registers for the actual scan
|
/** @brief set up registers for the actual scan
|
||||||
*/
|
*/
|
||||||
static SANE_Status
|
static void gl124_init_regs_for_scan(Genesys_Device* dev, const Genesys_Sensor& sensor)
|
||||||
gl124_init_regs_for_scan (Genesys_Device * dev, const Genesys_Sensor& sensor)
|
|
||||||
{
|
{
|
||||||
DBG_HELPER(dbg);
|
DBG_HELPER(dbg);
|
||||||
int channels;
|
int channels;
|
||||||
|
@ -2194,8 +2193,6 @@ gl124_init_regs_for_scan (Genesys_Device * dev, const Genesys_Sensor& sensor)
|
||||||
params.flags = flags;
|
params.flags = flags;
|
||||||
|
|
||||||
gl124_init_scan_regs(dev, sensor, &dev->reg, params);
|
gl124_init_scan_regs(dev, sensor, &dev->reg, params);
|
||||||
|
|
||||||
return SANE_STATUS_GOOD;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -2335,19 +2335,15 @@ static bool gl646_needs_home_before_init_regs_for_scan(Genesys_Device* dev)
|
||||||
* set up registers for the actual scan. The scan's parameters are given
|
* set up registers for the actual scan. The scan's parameters are given
|
||||||
* through the device settings. It allocates the scan buffers.
|
* through the device settings. It allocates the scan buffers.
|
||||||
*/
|
*/
|
||||||
static SANE_Status
|
static void gl646_init_regs_for_scan(Genesys_Device* dev, const Genesys_Sensor& sensor)
|
||||||
gl646_init_regs_for_scan (Genesys_Device * dev, const Genesys_Sensor& sensor)
|
|
||||||
{
|
{
|
||||||
DBG_HELPER(dbg);
|
DBG_HELPER(dbg);
|
||||||
SANE_Status status = SANE_STATUS_GOOD;
|
|
||||||
|
|
||||||
setup_for_scan(dev, sensor, &dev->reg, dev->settings, SANE_FALSE, SANE_TRUE, SANE_TRUE);
|
setup_for_scan(dev, sensor, &dev->reg, dev->settings, SANE_FALSE, SANE_TRUE, SANE_TRUE);
|
||||||
|
|
||||||
/* gamma is only enabled at final scan time */
|
/* gamma is only enabled at final scan time */
|
||||||
if (dev->settings.depth < 16)
|
if (dev->settings.depth < 16)
|
||||||
dev->reg.find_reg(0x05).value |= REG05_GMMENB;
|
dev->reg.find_reg(0x05).value |= REG05_GMMENB;
|
||||||
|
|
||||||
return status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -3157,10 +3157,8 @@ static void gl841_init_regs_for_shading(Genesys_Device* dev, const Genesys_Senso
|
||||||
sanei_genesys_bulk_write_register(dev, regs);
|
sanei_genesys_bulk_write_register(dev, regs);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* set up registers for the actual scan
|
// set up registers for the actual scan
|
||||||
*/
|
static void gl841_init_regs_for_scan(Genesys_Device* dev, const Genesys_Sensor& sensor)
|
||||||
static SANE_Status
|
|
||||||
gl841_init_regs_for_scan (Genesys_Device * dev, const Genesys_Sensor& sensor)
|
|
||||||
{
|
{
|
||||||
DBG_HELPER(dbg);
|
DBG_HELPER(dbg);
|
||||||
int channels;
|
int channels;
|
||||||
|
@ -3267,8 +3265,6 @@ gl841_init_regs_for_scan (Genesys_Device * dev, const Genesys_Sensor& sensor)
|
||||||
params.flags = flags;
|
params.flags = flags;
|
||||||
|
|
||||||
gl841_init_scan_regs(dev, sensor, &dev->reg, params);
|
gl841_init_scan_regs(dev, sensor, &dev->reg, params);
|
||||||
|
|
||||||
return SANE_STATUS_GOOD;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2677,8 +2677,7 @@ static void gl843_init_regs_for_shading(Genesys_Device* dev, const Genesys_Senso
|
||||||
|
|
||||||
/** @brief set up registers for the actual scan
|
/** @brief set up registers for the actual scan
|
||||||
*/
|
*/
|
||||||
static SANE_Status
|
static void gl843_init_regs_for_scan(Genesys_Device* dev, const Genesys_Sensor& sensor)
|
||||||
gl843_init_regs_for_scan (Genesys_Device * dev, const Genesys_Sensor& sensor)
|
|
||||||
{
|
{
|
||||||
DBG_HELPER(dbg);
|
DBG_HELPER(dbg);
|
||||||
int channels;
|
int channels;
|
||||||
|
@ -2771,8 +2770,6 @@ gl843_init_regs_for_scan (Genesys_Device * dev, const Genesys_Sensor& sensor)
|
||||||
gl843_compute_session(dev, session, sensor);
|
gl843_compute_session(dev, session, sensor);
|
||||||
|
|
||||||
gl843_init_scan_regs(dev, sensor, &dev->reg, session);
|
gl843_init_scan_regs(dev, sensor, &dev->reg, session);
|
||||||
|
|
||||||
return SANE_STATUS_GOOD;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1827,8 +1827,7 @@ static void gl846_init_regs_for_shading(Genesys_Device* dev, const Genesys_Senso
|
||||||
|
|
||||||
/** @brief set up registers for the actual scan
|
/** @brief set up registers for the actual scan
|
||||||
*/
|
*/
|
||||||
static SANE_Status
|
static void gl846_init_regs_for_scan(Genesys_Device* dev, const Genesys_Sensor& sensor)
|
||||||
gl846_init_regs_for_scan (Genesys_Device * dev, const Genesys_Sensor& sensor)
|
|
||||||
{
|
{
|
||||||
DBG_HELPER(dbg);
|
DBG_HELPER(dbg);
|
||||||
int channels;
|
int channels;
|
||||||
|
@ -1925,8 +1924,6 @@ gl846_init_regs_for_scan (Genesys_Device * dev, const Genesys_Sensor& sensor)
|
||||||
params.flags = flags;
|
params.flags = flags;
|
||||||
|
|
||||||
gl846_init_scan_regs(dev, sensor, &dev->reg, params);
|
gl846_init_scan_regs(dev, sensor, &dev->reg, params);
|
||||||
|
|
||||||
return SANE_STATUS_GOOD;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1887,8 +1887,7 @@ static void gl847_init_regs_for_shading(Genesys_Device* dev, const Genesys_Senso
|
||||||
|
|
||||||
/** @brief set up registers for the actual scan
|
/** @brief set up registers for the actual scan
|
||||||
*/
|
*/
|
||||||
static SANE_Status
|
static void gl847_init_regs_for_scan(Genesys_Device* dev, const Genesys_Sensor& sensor)
|
||||||
gl847_init_regs_for_scan (Genesys_Device * dev, const Genesys_Sensor& sensor)
|
|
||||||
{
|
{
|
||||||
DBG_HELPER(dbg);
|
DBG_HELPER(dbg);
|
||||||
int channels;
|
int channels;
|
||||||
|
@ -1985,8 +1984,6 @@ gl847_init_regs_for_scan (Genesys_Device * dev, const Genesys_Sensor& sensor)
|
||||||
params.flags = flags;
|
params.flags = flags;
|
||||||
|
|
||||||
gl847_init_scan_regs(dev, sensor, &dev->reg, params);
|
gl847_init_scan_regs(dev, sensor, &dev->reg, params);
|
||||||
|
|
||||||
return SANE_STATUS_GOOD;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1051,7 +1051,7 @@ struct Genesys_Command_Set
|
||||||
Genesys_Register_Set& regs);
|
Genesys_Register_Set& regs);
|
||||||
void (*init_regs_for_shading) (Genesys_Device* dev, const Genesys_Sensor& sensor,
|
void (*init_regs_for_shading) (Genesys_Device* dev, const Genesys_Sensor& sensor,
|
||||||
Genesys_Register_Set& regs);
|
Genesys_Register_Set& regs);
|
||||||
SANE_Status (*init_regs_for_scan) (Genesys_Device * dev, const Genesys_Sensor& sensor);
|
void (*init_regs_for_scan) (Genesys_Device* dev, const Genesys_Sensor& sensor);
|
||||||
|
|
||||||
SANE_Bool (*get_filter_bit) (Genesys_Register_Set * reg);
|
SANE_Bool (*get_filter_bit) (Genesys_Register_Set * reg);
|
||||||
SANE_Bool (*get_lineart_bit) (Genesys_Register_Set * reg);
|
SANE_Bool (*get_lineart_bit) (Genesys_Register_Set * reg);
|
||||||
|
|
Ładowanie…
Reference in New Issue