add support for Ambir/Syscan DS685

merge-requests/1/head
Stphane Voltz 2009-12-05 07:23:40 +01:00
rodzic eb66f734ba
commit ef4c5102ca
6 zmienionych plików z 131 dodań i 15 usunięć

Wyświetl plik

@ -1312,6 +1312,7 @@ genesys_send_offset_and_shading (Genesys_Device * dev, uint8_t * data,
&& dev->model->ccd_type != CCD_DSMOBILE600
&& dev->model->ccd_type != CCD_XP300
&& dev->model->ccd_type != CCD_DP665
&& dev->model->ccd_type != CCD_DP685
&& dev->model->ccd_type != CCD_ROADWARRIOR
&& dev->model->ccd_type != CCD_HP2300
&& dev->model->ccd_type != CCD_HP2400
@ -3030,6 +3031,7 @@ genesys_send_shading_coefficient (Genesys_Device * dev)
case CCD_XP300:
case CCD_ROADWARRIOR:
case CCD_DP665:
case CCD_DP685:
case CCD_DSMOBILE600:
target_code = 0xdc00;
o = 4;
@ -3699,7 +3701,7 @@ genesys_sheetfed_calibration (Genesys_Device * dev)
}
DBG (DBG_info, "genesys_flatbed_calibration\n");
DBG (DBG_info, "genesys_sheetfed_calibration\n");
/* led, offset and gain calibration are influenced by scan
* settings. So we set it to sensor resolution */
@ -3729,7 +3731,7 @@ genesys_sheetfed_calibration (Genesys_Device * dev)
if (status != SANE_STATUS_GOOD)
{
DBG (DBG_error,
"genesys_flatbed_calibration: led calibration failed: %s\n",
"genesys_sheetfed_calibration: led calibration failed: %s\n",
sane_strstatus (status));
return status;
}
@ -3742,7 +3744,7 @@ genesys_sheetfed_calibration (Genesys_Device * dev)
if (status != SANE_STATUS_GOOD)
{
DBG (DBG_error,
"genesys_flatbed_calibration: offset calibration failed: %s\n",
"genesys_sheetfed_calibration: offset calibration failed: %s\n",
sane_strstatus (status));
return status;
}
@ -3753,7 +3755,7 @@ genesys_sheetfed_calibration (Genesys_Device * dev)
if (status != SANE_STATUS_GOOD)
{
DBG (DBG_error,
"genesys_flatbed_calibration: coarse gain calibration: %s\n",
"genesys_sheetfed_calibration: coarse gain calibration: %s\n",
sane_strstatus (status));
return status;
}
@ -3767,7 +3769,7 @@ genesys_sheetfed_calibration (Genesys_Device * dev)
if (status != SANE_STATUS_GOOD)
{
DBG (DBG_error,
"genesys_flatbed_calibration: failed to send calibration registers: %s\n",
"genesys_sheetfed_calibration: failed to send calibration registers: %s\n",
sane_strstatus (status));
return status;
}
@ -3776,7 +3778,7 @@ genesys_sheetfed_calibration (Genesys_Device * dev)
if (status != SANE_STATUS_GOOD)
{
DBG (DBG_error,
"genesys_flatbed_calibration: failed to do static calibration: %s\n",
"genesys_sheetfed_calibration: failed to do static calibration: %s\n",
sane_strstatus (status));
return status;
}

Wyświetl plik

@ -62,3 +62,6 @@ usb 0x0a82 0x4800
# DCT DocketPort 487
usb 0x1dcc 0x4810
# Syscan/Ambir DocketPort 685
usb 0x0a82 0x480c

Wyświetl plik

@ -115,7 +115,7 @@ static Genesys_Frontend Wolfson[] = {
, {0x93, 0x93, 0x93}
, {0x07, 0x00, 0x00}
}
, /* 8: XP300 */
, /* 8: HP3670 */
{DAC_WOLFSON_HP3670, /* uses one write for offset or gain like hp2300/2400 */
{0x00, 0x03, 0x04, 0x02}
, {0x00, 0x00, 0x00}
@ -124,7 +124,7 @@ static Genesys_Frontend Wolfson[] = {
, {0x00, 0x00, 0x00}
}
,
{DAC_WOLFSON_DSM600,{0x00, 0x35, 0x20, 0x14} /* 7a: DSMOBILE600 */
{DAC_WOLFSON_DSM600,{0x00, 0x35, 0x20, 0x14} /* 9: DSMOBILE600 */
, {0x00, 0x00, 0x00}
, {0x85, 0x85, 0x85}
, {0xa0, 0xa0, 0xa0}
@ -364,6 +364,28 @@ static Genesys_Sensor Sensor[] = {
1.0, 1.0, 1.0,
NULL, NULL, NULL}
,
/* 13: Strobe XP300 */
{CCD_DP685, 600,
27, /*(black) */
27, /* (dummy) */
0, /* (startxoffset) */
5020, /*sensor_pixels */
210,
200,
{0x00, 0x00, 0x00, 0x00},
{0x11, 0x00, 0x11, 0x00, 0x11, 0x00, 0x00, 0x02, 0x04, 0x50,
0x10, 0x00, 0x20, 0x02
},
{0x04, 0x05,
0x00, 0x00, 0x00, 0x00, /*[GB](HI|LOW) not needed for cis */
0x54, 0x03,
0x00, /*TODO: bit7 */
0x00, 0x00, 0x00, 0x01 /*TODO (these do no harm, but may be neccessery for CCD) */
}
,
1.0, 1.0, 1.0,
NULL, NULL, NULL}
,
};
@ -454,7 +476,15 @@ static Genesys_Gpo Gpo[] = {
GPO_DP665,
{0x18, 0x00},/*0x19,0x00*/
{0xbb, 0x00},
}
}
,
/* Syscan DP 685 */
{
GPO_DP685,
{0x3f, 0x46}, /* 6c, 6d */
{0xfb, 0x00}, /* 6e, 6f */
}
,
};
static Genesys_Motor Motor[] = {
@ -1565,6 +1595,58 @@ static Genesys_Model syscan_docketport_467_model = {
400
};
static Genesys_Model syscan_docketport_685_model = {
"syscan-docketport-685", /* Name */
"Syscan/Ambir", /* Device vendor string */
"DocketPORT 685", /* Device model name */
GENESYS_GL841,
NULL,
{600, 300, 150, 75, 0}, /* possible x-resolutions */
{600, 300, 150, 75, 0}, /* possible y-resolutions */
{16, 8, 0}, /* possible depths in gray mode */
{16, 8, 0}, /* possible depths in color mode */
SANE_FIX (0.0), /* Start of scan area in mm (x) */
SANE_FIX (1.0), /* Start of scan area in mm (y) */
SANE_FIX (212.0), /* Size of scan area in mm (x) */
SANE_FIX (500), /* Size of scan area in mm (y) */
SANE_FIX (3.0), /* Start of white strip in mm (y) */
SANE_FIX (0.0), /* Start of black mark in mm (x) */
SANE_FIX (0.0), /* Start of scan area in TA mode in mm (x) */
SANE_FIX (0.0), /* Start of scan area in TA mode in mm (y) */
SANE_FIX (100.0), /* Size of scan area in TA mode in mm (x) */
SANE_FIX (100.0), /* Size of scan area in TA mode in mm (y) */
SANE_FIX (0.0), /* Start of white strip in TA mode in mm (y) */
SANE_FIX (26.5), /* Size of scan area after paper sensor stops
sensing document in mm */
/* this is larger than needed -- accounts for second sensor head, which is a
calibration item */
SANE_FIX (0.0), /* Amount of feeding needed to eject document
after finishing scanning in mm */
0, 0, 0, /* RGB CCD Line-distance correction in pixel */
COLOR_ORDER_RGB, /* Order of the CCD/CIS colors */
SANE_TRUE, /* Is this a CIS scanner? */
SANE_TRUE, /* Is this a sheetfed scanner? */
CCD_DP685,
DAC_WOLFSON_DSM600,
GPO_DP685,
MOTOR_XP300,
GENESYS_FLAG_LAZY_INIT /* Which flags are needed for this scanner? */
| GENESYS_FLAG_SKIP_WARMUP
| GENESYS_FLAG_OFFSET_CALIBRATION
| GENESYS_FLAG_DARK_CALIBRATION,
GENESYS_HAS_SCAN_SW | GENESYS_HAS_PAGE_LOADED_SW | GENESYS_HAS_CALIBRATE,
100,
400
};
static Genesys_Model syscan_docketport_485_model = {
"syscan-docketport-485", /* Name */
"Syscan/Ambir", /* Device vendor string */
@ -1689,6 +1771,7 @@ static Genesys_USB_Device_Entry genesys_usb_device_list[] = {
{0x04a7, 0x049b, &visioneer_xp100_r3_model},
{0x0a17, 0x3210, &pentax_dsmobile_600_model},
{0x0a82, 0x4800, &syscan_docketport_485_model},
{0x0a82, 0x480c, &syscan_docketport_685_model},
{0x1dcc, 0x4810, &dct_docketport_487_model},
{0, 0, NULL}
};

Wyświetl plik

@ -1475,7 +1475,7 @@ gl841_init_registers (Genesys_Device * dev)
dev->reg[reg_0x06].value |= REG06_GAIN4;
/* XP300 CCD needs different clock and clock/pixels values */
if (dev->model->ccd_type != CCD_XP300)
if (dev->model->ccd_type != CCD_XP300 && dev->model->ccd_type != CCD_DP685)
{
dev->reg[reg_0x06].value |= 0 << REG06S_SCANMOD;
dev->reg[reg_0x09].value |= 1 << REG09S_CLKSET;
@ -1547,6 +1547,12 @@ gl841_init_registers (Genesys_Device * dev)
dev->reg[reg_0x6b].value |= REG6B_GPO17;
}
if (dev->model->gpo_type == GPO_DP685)
{
/* REG6B_GPO18 lights on green led */
dev->reg[reg_0x6b].value |= REG6B_GPO17|REG6B_GPO18;
}
DBG (DBG_proc, "gl841_init_registers complete\n");
}
@ -2180,7 +2186,7 @@ gl841_init_motor_regs_scan(Genesys_Device * dev,
&fast_exposure,
scan_power_mode);
if (dev->model->gpo_type == GPO_XP300)
if (dev->model->gpo_type == GPO_XP300 || dev->model->gpo_type == GPO_DP685)
{
/* quirk: looks like at least this scanner is unable to use
2-feed mode */
@ -3455,6 +3461,13 @@ gl841_save_power(Genesys_Device * dev, SANE_Bool enable) {
sanei_genesys_write_register(dev, 0x6D, val & ~0x80);
}
if (dev->model->gpo_type == GPO_DP685)
{
sanei_genesys_read_register(dev, 0x6B, &val);
sanei_genesys_write_register(dev, 0x6B, val & ~REG6B_GPO17);
dev->reg[reg_0x6b].value &= ~REG6B_GPO17;
dev->calib_reg[reg_0x6b].value &= ~REG6B_GPO17;
}
gl841_set_fe (dev, AFE_POWER_SAVE);
@ -3500,7 +3513,8 @@ gl841_save_power(Genesys_Device * dev, SANE_Bool enable) {
dev->calib_reg[reg_0x6b].value |= REG6B_GPO18;
}
if (dev->model->gpo_type == GPO_DP665)
if (dev->model->gpo_type == GPO_DP665
|| dev->model->gpo_type == GPO_DP685)
{
sanei_genesys_read_register(dev, 0x6B, &val);
sanei_genesys_write_register(dev, 0x6B, val | REG6B_GPO17);
@ -5077,7 +5091,7 @@ gl841_offset_calibration (Genesys_Device * dev)
RIE (sanei_genesys_read_data_from_scanner (dev, first_line, total_size));
if (DBG_LEVEL >= DBG_data) {
snprintf(fn,20,"offset1_%d.pnm",turn);
snprintf(fn,20,"offset1_%02d.pnm",turn);
sanei_genesys_write_pnm_file (fn,
first_line,
16,
@ -5108,6 +5122,11 @@ gl841_offset_calibration (Genesys_Device * dev)
cmax[j]++;
}
/* TODO the DP685 has a black strip in the middle of the sensor
* should be handled in a more elegant way , could be a bug */
if (dev->model->ccd_type == CCD_DP685)
cmin[j] -= 20;
if (cmin[j] > num_pixels/100) {
acceptable = SANE_FALSE;
if (dev->model->is_cis)
@ -5853,7 +5872,8 @@ gl841_update_hardware_sensors (Genesys_Scanner * s)
}
if (s->dev->model->gpo_type == GPO_XP300 ||
s->dev->model->gpo_type == GPO_DP665)
s->dev->model->gpo_type == GPO_DP665 ||
s->dev->model->gpo_type == GPO_DP685)
{
RIE(sanei_genesys_read_register(s->dev, 0x6d, &val));

Wyświetl plik

@ -270,6 +270,7 @@ Genesys_Color_Order;
#define CCD_ROADWARRIOR 11
#define CCD_DSMOBILE600 12
#define CCD_XP300 13
#define CCD_DP685 14
#define GPO_UMAX 0
#define GPO_ST12 1
@ -282,6 +283,7 @@ Genesys_Color_Order;
#define GPO_XP300 8
#define GPO_HP3670 9
#define GPO_DP665 10
#define GPO_DP685 11
#define MOTOR_UMAX 0
#define MOTOR_5345 1

Wyświetl plik

@ -152,4 +152,10 @@
:interface "USB"
:usbid "0x0a82" "0x4803"
:status :basic
:comment "All resolution and mode supported, but uncorrected scans"
:comment "All resolution and mode supported, calibration is available"
:model "DocketPort 685/ Ambir DS685"
:interface "USB"
:usbid "0x0a82" "0x480c"
:status :good
:comment "All resolution and mode supported, calibration is available, front- and backside side-by-side, with backside mirrored horizontally."