basic XPA support for HP3670

merge-requests/1/head
Stphane Voltz 2010-02-16 07:24:56 +01:00
rodzic b8a7f1ec2f
commit 5fdad99f95
3 zmienionych plików z 32 dodań i 1 usunięć

Wyświetl plik

@ -1079,6 +1079,7 @@ static Genesys_Model hp3670c_model = {
MOTOR_HP3670,
GENESYS_FLAG_LAZY_INIT
| GENESYS_FLAG_14BIT_GAMMA
| GENESYS_FLAG_XPA
| GENESYS_FLAG_DARK_CALIBRATION
| GENESYS_FLAG_OFFSET_CALIBRATION
| GENESYS_FLAG_SKIP_WARMUP

Wyświetl plik

@ -859,6 +859,13 @@ gl646_setup_registers (Genesys_Device * dev,
/* regs[reg_0x03].value |= REG03_AVEENB; */
regs[reg_0x03].value &= ~REG03_LAMPDOG;
/* select XPA */
regs[reg_0x03].value &= ~REG03_XPASEL;
if(scan_settings.scan_method == SCAN_METHOD_TRANSPARENCY)
{
regs[reg_0x03].value |= REG03_XPASEL;
}
/* R04 */
if (depth > 8)
{
@ -4960,6 +4967,29 @@ gl646_update_hardware_sensors (Genesys_Scanner * session)
}
}
/* XPA detection */
if (dev->model->flags & GENESYS_FLAG_XPA)
{
switch (dev->model->gpo_type)
{
case GPO_HP3670:
/* test if XPA is plugged-in */
if((value & 0x40)==0)
{
DBG (DBG_io, "gl646_update_hardware_sensors: enabling XPA\n");
session->opt[OPT_SOURCE].cap &= ~SANE_CAP_INACTIVE;
}
else
{
DBG (DBG_io, "gl646_update_hardware_sensors: disabling XPA\n");
session->opt[OPT_SOURCE].cap |= SANE_CAP_INACTIVE;
}
break;
default:
return SANE_STATUS_UNSUPPORTED;
}
}
return status;
}

Wyświetl plik

@ -77,7 +77,7 @@
#define GENESYS_FLAG_UNTESTED (1 << 0) /* Print a warning for these scanners */
#define GENESYS_FLAG_14BIT_GAMMA (1 << 1) /* use 14bit Gamma table instead of 12 */
#define GENESYS_FLAG_LAZY_INIT (1 << 2) /* skip extensive ASIC test at init */
/*#define GENESYS_FLAG_UNUSED (1 << 3) */
#define GENESYS_FLAG_XPA (1 << 3)
#define GENESYS_FLAG_SKIP_WARMUP (1 << 4) /* skip genesys_warmup() */
#define GENESYS_FLAG_OFFSET_CALIBRATION (1 << 5) /* do offset calibration */
#define GENESYS_FLAG_SEARCH_START (1 << 6) /* do start search beofre scanning */