genesys: Implement support for 8600F

merge-requests/79/head
Povilas Kanapickas 2019-05-18 14:56:02 +03:00
rodzic 41e2029e4b
commit 33a60dcc7b
9 zmienionych plików z 418 dodań i 52 usunięć

Wyświetl plik

@ -917,6 +917,7 @@ genesys_send_offset_and_shading (Genesys_Device * dev, uint8_t * data,
&& dev->model->ccd_type != CCD_G4050 && dev->model->ccd_type != CCD_G4050
&& dev->model->ccd_type != CCD_CS4400F && dev->model->ccd_type != CCD_CS4400F
&& dev->model->ccd_type != CCD_CS8400F && dev->model->ccd_type != CCD_CS8400F
&& dev->model->ccd_type != CCD_CS8600F
&& dev->model->ccd_type != CCD_DSMOBILE600 && dev->model->ccd_type != CCD_DSMOBILE600
&& dev->model->ccd_type != CCD_XP300 && dev->model->ccd_type != CCD_XP300
&& dev->model->ccd_type != CCD_DP665 && dev->model->ccd_type != CCD_DP665
@ -2836,6 +2837,7 @@ genesys_send_shading_coefficient (Genesys_Device * dev)
case CCD_G4050: case CCD_G4050:
case CCD_CS4400F: case CCD_CS4400F:
case CCD_CS8400F: case CCD_CS8400F:
case CCD_CS8600F:
target_code = 0xe000; target_code = 0xe000;
o = 0; o = 0;
compute_coefficients (dev, compute_coefficients (dev,
@ -3092,6 +3094,9 @@ genesys_flatbed_calibration (Genesys_Device * dev)
if (dev->settings.yres <= dev->sensor.optical_res / 2) if (dev->settings.yres <= dev->sensor.optical_res / 2)
yres /= 2; yres /= 2;
if (dev->model->model_id == MODEL_CANON_CANOSCAN_8600F)
yres = 1200;
/* do offset calibration if needed */ /* do offset calibration if needed */
if (dev->model->flags & GENESYS_FLAG_OFFSET_CALIBRATION) if (dev->model->flags & GENESYS_FLAG_OFFSET_CALIBRATION)
{ {

Wyświetl plik

@ -69,6 +69,9 @@ usb 0x04a9 0x190f
# Canon 5600f # Canon 5600f
usb 0x04a9 0x1906 usb 0x04a9 0x1906
# Canon 8600F
usb 0x04a9 0x2229
# Visioneer Strobe XP200 # Visioneer Strobe XP200
usb 0x04a7 0x0426 usb 0x04a7 0x0426

Wyświetl plik

@ -8,7 +8,7 @@
Copyright (C) 2007 Luke <iceyfor@gmail.com> Copyright (C) 2007 Luke <iceyfor@gmail.com>
Copyright (C) 2010 Jack McGill <jmcgill85258@yahoo.com> Copyright (C) 2010 Jack McGill <jmcgill85258@yahoo.com>
Copyright (C) 2010 Andrey Loginov <avloginov@gmail.com>, Copyright (C) 2010 Andrey Loginov <avloginov@gmail.com>,
xerox travelscan device entry xerox travelscan device entry
Copyright (C) 2010 Chris Berry <s0457957@sms.ed.ac.uk> and Michael Rickmann <mrickma@gwdg.de> Copyright (C) 2010 Chris Berry <s0457957@sms.ed.ac.uk> and Michael Rickmann <mrickma@gwdg.de>
for Plustek Opticbook 3600 support for Plustek Opticbook 3600 support
@ -213,8 +213,15 @@ static Genesys_Frontend Wolfson[] = {
, {0x60, 0x5c, 0x6c} /* 0x20, 0x21, 0x22 */ , {0x60, 0x5c, 0x6c} /* 0x20, 0x21, 0x22 */
, {0x8a, 0x9f, 0xc2} /* 0x28, 0x29, 0x2a */ , {0x8a, 0x9f, 0xc2} /* 0x28, 0x29, 0x2a */
, {0x00, 0x00, 0x00} , {0x00, 0x00, 0x00}
} },
, {
DAC_CS8600F,
{ 0x00, 0x23, 0x24, 0x2f },
{ 0x00, 0x00, 0x00 },
{ 0x67, 0x69, 0x68 }, // 0x20, 0x21, 0x22
{ 0xdb, 0xda, 0xd7 }, // 0x28, 0x29, 0x2a
{ 0x00, 0x00, 0x00 },
},
{DAC_IMG101, {DAC_IMG101,
{0x78, 0xf0, 0x00, 0x00} {0x78, 0xf0, 0x00, 0x00}
, {0x00, 0x00, 0x00} , {0x00, 0x00, 0x00}
@ -724,6 +731,29 @@ void genesys_init_sensor_tables()
s_sensors->push_back(sensor); s_sensors->push_back(sensor);
sensor = Genesys_Sensor();
sensor.sensor_id = CCD_CS8600F;
sensor.optical_res = 4800;
sensor.black_pixels = 31;
sensor.dummy_pixel = 20;
sensor.CCD_start_xoffset = 0; // not used at the moment
// 11372 pixels at 1200 dpi
sensor.sensor_pixels = 11372*4;
sensor.fau_gain_white_ref = 160;
sensor.gain_white_ref = 160;
sensor.regs_0x08_0x0b = { 0x00, 0x00, 0x00, 0x00 }; // not used
// 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d
sensor.regs_0x10_0x1d = {
0x9c, 0x40, 0x9c, 0x40, 0x9c, 0x40, 0x13, 0x15, 0x10, 0x2a, 0x30, 0x00, 0x20, 0x75
};
// 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e
sensor.regs_0x52_0x5e = {
0x0c, 0x0f, 0x00, 0x03, 0x06, 0x09, 0x6b, 0x00, 0x40, 0x00, 0x00, 0x00, 0x1f
};
sensor.gamma = {1.0, 1.0, 1.0};
s_sensors->push_back(sensor);
sensor = Genesys_Sensor(); sensor = Genesys_Sensor();
sensor.sensor_id = CCD_HP_N6310; sensor.sensor_id = CCD_HP_N6310;
sensor.optical_res = 2400; sensor.optical_res = 2400;
@ -1083,6 +1113,12 @@ static Genesys_Gpo Gpo[] = {
{0x9a, 0xdf}, {0x9a, 0xdf},
{0xfe, 0x60}, {0xfe, 0x60},
} }
/* CanoScan 8600F */
,
{ GPO_CS8600F,
{ 0x20, 0x7c },
{ 0xff, 0x00 },
}
/* Canon Image formula 101 */ /* Canon Image formula 101 */
, ,
{GPO_IMG101, {GPO_IMG101,
@ -1389,6 +1425,20 @@ static Genesys_Motor Motor[] = {
}, },
}, },
}, },
{
MOTOR_CS8600F,
2400,
9600,
2,
1,
{ /* motor slopes */
{ /* power mode 0 */
{ 3961, 240, 246, 0.8 }, /* full step */
{ 3961, 240, 246, 0.8 }, /* half step */
{ 3961, 240, 246, 0.8 }, /* quarter step */
},
},
},
{MOTOR_CANONLIDE110, /* Canon LiDE 110 */ {MOTOR_CANONLIDE110, /* Canon LiDE 110 */
4800, 4800,
9600, 9600,
@ -1921,6 +1971,63 @@ static Genesys_Model canon_8400f_model = {
}; };
static Genesys_Model canon_8600f_model = {
"canon-canoscan-8600f", // name
"Canon", // Device vendor string
"Canoscan 8600f", // Device model name
MODEL_CANON_CANOSCAN_8600F,
GENESYS_GL843, // ASIC type
NULL,
{ 4800, 2400, 1200, 600, 400, 300, 0}, // TODO: resolutions for non-XPA mode
{ 4800, 2400, 1200, 600, 400, 300, 0}, // TODO: resolutions for non-XPA mode
{ 16, 8, 0 }, // possible depths in gray mode
{ 16, 8, 0 }, // possible depths in color mode
SANE_FIX(24.0), // Start of scan area in mm (x)
SANE_FIX(10.0), // Start of scan area in mm (y)
SANE_FIX(216.0), // Size of scan area in mm (x)
SANE_FIX(297.0), // Size of scan area in mm (y)
SANE_FIX(0.0), // Start of white strip in mm (y)
SANE_FIX(8.0), // Start of black mark in mm (x)
SANE_FIX(8.0), // Start of scan area in TA mode in mm (x)
SANE_FIX(13.00), // Start of scan area in TA mode in mm (y)
SANE_FIX(217.9), // Size of scan area in TA mode in mm (x)
SANE_FIX(250.0), // Size of scan area in TA mode in mm (y)
SANE_FIX(40.0), // Start of white strip in TA mode in mm (y)
SANE_FIX(0.0), // Size of scan area after paper sensor stops
// sensing document in mm
SANE_FIX(0.0), // Amount of feeding needed to eject document
// after finishing scanning in mm
0, 48, 96, // RGB CCD Line-distance correction in line number
COLOR_ORDER_RGB, // Order of the CCD/CIS colors
SANE_FALSE, // Is this a CIS scanner?
SANE_FALSE, // Is this a sheetfed scanner?
CCD_CS8600F,
DAC_CS8600F,
GPO_CS8600F,
MOTOR_CS8600F,
GENESYS_FLAG_LAZY_INIT |
GENESYS_FLAG_OFFSET_CALIBRATION |
GENESYS_FLAG_STAGGERED_LINE |
GENESYS_FLAG_SKIP_WARMUP |
GENESYS_FLAG_DARK_CALIBRATION |
GENESYS_FLAG_FULL_HWDPI_MODE |
GENESYS_FLAG_CUSTOM_GAMMA |
GENESYS_FLAG_SHADING_REPARK |
GENESYS_FLAG_HALF_CCD_MODE,
GENESYS_HAS_SCAN_SW | GENESYS_HAS_FILE_SW | GENESYS_HAS_COPY_SW,
50, // shading_lines
100
};
static Genesys_Model canon_lide_100_model = { static Genesys_Model canon_lide_100_model = {
"canon-lide-100", /* Name */ "canon-lide-100", /* Name */
@ -3813,6 +3920,7 @@ static Genesys_USB_Device_Entry genesys_usb_device_list[] = {
{0x03f0, 0x4605, &hpg4050_model}, {0x03f0, 0x4605, &hpg4050_model},
{0x04a9, 0x2228, &canon_4400f_model}, {0x04a9, 0x2228, &canon_4400f_model},
{0x04a9, 0x221e, &canon_8400f_model}, {0x04a9, 0x221e, &canon_8400f_model},
{0x04a9, 0x2229, &canon_8600f_model},
/* GL845 devices */ /* GL845 devices */
{0x07b3, 0x1300, &plustek_3800_model}, {0x07b3, 0x1300, &plustek_3800_model},
/* GL846 devices */ /* GL846 devices */

Wyświetl plik

@ -393,11 +393,42 @@ gl843_init_registers (Genesys_Device * dev)
/* default to KV-SS080 */ /* default to KV-SS080 */
SETREG (0xa2, 0x0f); SETREG (0xa2, 0x0f);
if (dev->model->model_id == MODEL_CANON_CANOSCAN_8600F)
{
SETREG(0xa2, 0x1f);
}
SETREG (0x01, 0x00); SETREG (0x01, 0x00);
SETREG (0x02, 0x78); SETREG (0x02, 0x78);
SETREG (0x03, 0x1f); SETREG (0x03, 0x1f);
SETREG (0x04, 0x10); SETREG (0x04, 0x10);
// fine tune upon device description
SETREG (0x05, 0x80); SETREG (0x05, 0x80);
if (dev->model->model_id == MODEL_HP_SCANJET_G4010 ||
dev->model->model_id == MODEL_HP_SCANJET_G4050 ||
dev->model->model_id == MODEL_HP_SCANJET_4850C)
{
SETREG (0x05, 0x08);
}
dev->reg[reg_0x05].value &= ~REG05_DPIHW;
switch (dev->sensor.optical_res)
{
case 600:
dev->reg[reg_0x05].value |= REG05_DPIHW_600;
break;
case 1200:
dev->reg[reg_0x05].value |= REG05_DPIHW_1200;
break;
case 2400:
dev->reg[reg_0x05].value |= REG05_DPIHW_2400;
break;
case 4800:
dev->reg[reg_0x05].value |= REG05_DPIHW_4800;
break;
}
// TODO: on 8600F the windows driver turns off GAIN4 which is recommended
SETREG (0x06, 0xd8); /* SCANMOD=110, PWRBIT and GAIN4 */ SETREG (0x06, 0xd8); /* SCANMOD=110, PWRBIT and GAIN4 */
SETREG (0x08, 0x00); SETREG (0x08, 0x00);
SETREG (0x09, 0x00); SETREG (0x09, 0x00);
@ -407,6 +438,11 @@ gl843_init_registers (Genesys_Device * dev)
// gl843_boot // gl843_boot
SETREG (0x0b, 0x6a); SETREG (0x0b, 0x6a);
if (dev->model->model_id == MODEL_CANON_CANOSCAN_8600F)
{
SETREG(0x0b, 0x89);
}
// EXPR[0:15], EXPG[0:15], EXPB[0:15]: Exposure time settings. // EXPR[0:15], EXPG[0:15], EXPB[0:15]: Exposure time settings.
SETREG(0x10, 0x00); // SENSOR_DEF SETREG(0x10, 0x00); // SENSOR_DEF
SETREG(0x11, 0x00); // SENSOR_DEF SETREG(0x11, 0x00); // SENSOR_DEF
@ -414,7 +450,12 @@ gl843_init_registers (Genesys_Device * dev)
SETREG(0x13, 0x00); // SENSOR_DEF SETREG(0x13, 0x00); // SENSOR_DEF
SETREG(0x14, 0x00); // SENSOR_DEF SETREG(0x14, 0x00); // SENSOR_DEF
SETREG(0x15, 0x00); // SENSOR_DEF SETREG(0x15, 0x00); // SENSOR_DEF
if (dev->model->model_id == MODEL_CANON_CANOSCAN_8600F)
{
sanei_genesys_set_double(dev->reg,REG_EXPR,0x9c40);
sanei_genesys_set_double(dev->reg,REG_EXPG,0x9c40);
sanei_genesys_set_double(dev->reg,REG_EXPB,0x9c40);
}
// CCD signal settings. // CCD signal settings.
SETREG(0x16, 0x33); // SENSOR_DEF SETREG(0x16, 0x33); // SENSOR_DEF
SETREG(0x17, 0x1c); // SENSOR_DEF SETREG(0x17, 0x1c); // SENSOR_DEF
@ -430,18 +471,40 @@ gl843_init_registers (Genesys_Device * dev)
SETREG(0x1d, 0x04); // SENSOR_DEF SETREG(0x1d, 0x04); // SENSOR_DEF
SETREG (0x1e, 0x10); SETREG (0x1e, 0x10);
if (dev->model->model_id == MODEL_CANON_CANOSCAN_8600F)
{
SETREG(0x1e, 0x20);
}
SETREG (0x1f, 0x01); SETREG (0x1f, 0x01);
if (dev->model->model_id == MODEL_CANON_CANOSCAN_8600F)
{
SETREG(0x1f, 0xff);
}
SETREG (0x20, 0x10); SETREG (0x20, 0x10);
SETREG (0x21, 0x04); SETREG (0x21, 0x04);
SETREG (0x22, 0x01); SETREG (0x22, 0x01);
if (dev->model->model_id == MODEL_CANON_CANOSCAN_8600F)
{
SETREG(0x22, 0xc8);
}
SETREG (0x23, 0x01); SETREG (0x23, 0x01);
if (dev->model->model_id == MODEL_CANON_CANOSCAN_8600F)
{
SETREG(0x23, 0xc8);
}
SETREG (0x24, 0x04); SETREG (0x24, 0x04);
SETREG (0x25, 0x00); SETREG (0x25, 0x00);
SETREG (0x26, 0x00); SETREG (0x26, 0x00);
SETREG (0x27, 0x00); SETREG (0x27, 0x00);
SETREG (0x2c, 0x02); SETREG (0x2c, 0x02);
SETREG (0x2d, 0x58); SETREG (0x2d, 0x58);
// BWHI[0:7]: high level of black and white threshold
SETREG (0x2e, 0x80); SETREG (0x2e, 0x80);
// BWLOW[0:7]: low level of black and white threshold
SETREG (0x2f, 0x80); SETREG (0x2f, 0x80);
SETREG (0x30, 0x00); SETREG (0x30, 0x00);
SETREG (0x31, 0x14); SETREG (0x31, 0x14);
@ -450,11 +513,18 @@ gl843_init_registers (Genesys_Device * dev)
// DUMMY: CCD dummy and optically black pixel count // DUMMY: CCD dummy and optically black pixel count
SETREG (0x34, 0x24); SETREG (0x34, 0x24);
if (dev->model->model_id == MODEL_CANON_CANOSCAN_8600F)
{
SETREG(0x34, 0x14);
}
// MAXWD: If available buffer size is less than 2*MAXWD words, then
// "buffer full" state will be set.
SETREG (0x35, 0x00); SETREG (0x35, 0x00);
SETREG (0x36, 0xff); SETREG (0x36, 0xff);
SETREG (0x37, 0xff); SETREG (0x37, 0xff);
// LPERIOD: Line period or exposure time for CCD or CIS. // ZZTODO 0x59d8 // LPERIOD: Line period or exposure time for CCD or CIS.
SETREG(0x38, 0x55); // SENSOR_DEF SETREG(0x38, 0x55); // SENSOR_DEF
SETREG(0x39, 0xf0); // SENSOR_DEF SETREG(0x39, 0xf0); // SENSOR_DEF
@ -493,8 +563,18 @@ gl843_init_registers (Genesys_Device * dev)
// STOPTIM[0:4]: The stop duration between change of directions in // STOPTIM[0:4]: The stop duration between change of directions in
// backtracking // backtracking
SETREG (0x5e, 0x23); SETREG (0x5e, 0x23);
if (dev->model->model_id == MODEL_CANON_CANOSCAN_8600F)
{
SETREG(0x5e, 0x1f);
}
// FMOVDEC: The number of deceleration steps in table 5 for auto-go-home // FMOVDEC: The number of deceleration steps in table 5 for auto-go-home
SETREG (0x5f, 0x01); SETREG (0x5f, 0x01);
if (dev->model->model_id == MODEL_CANON_CANOSCAN_8600F)
{
SETREG(0x5f, 0xf0);
}
// Z1MOD[0:20] // Z1MOD[0:20]
SETREG (0x60, 0x00); SETREG (0x60, 0x00);
SETREG (0x61, 0x00); SETREG (0x61, 0x00);
@ -517,12 +597,26 @@ gl843_init_registers (Genesys_Device * dev)
// FSHDEC[0:7]: The number of deceleration steps after scanning is finished // FSHDEC[0:7]: The number of deceleration steps after scanning is finished
// (table 3) // (table 3)
SETREG (0x69, 0x01); SETREG (0x69, 0x01);
if (dev->model->model_id == MODEL_CANON_CANOSCAN_8600F)
{
SETREG(0x69, 64);
}
// FMOVNO[0:7] The number of acceleration or deceleration steps for fast // FMOVNO[0:7] The number of acceleration or deceleration steps for fast
// moving (table 4) // moving (table 4)
SETREG (0x6a, 0x04); SETREG (0x6a, 0x04);
if (dev->model->model_id == MODEL_CANON_CANOSCAN_8600F)
{
SETREG(0x69, 64);
}
// GPIO-related register bits // GPIO-related register bits
SETREG (0x6b, 0x30); SETREG (0x6b, 0x30);
if (dev->model->model_id == MODEL_CANON_CANOSCAN_8600F)
{
SETREG(0x6b, 0x72);
}
// 0x6c, 0x6d, 0x6e, 0x6f are set according to gpio tables. See // 0x6c, 0x6d, 0x6e, 0x6f are set according to gpio tables. See
// gl843_init_gpio. // gl843_init_gpio.
@ -535,6 +629,14 @@ gl843_init_registers (Genesys_Device * dev)
SETREG (0x72, 0x04); SETREG (0x72, 0x04);
SETREG (0x73, 0x05); SETREG (0x73, 0x05);
if (dev->model->model_id == MODEL_CANON_CANOSCAN_8600F)
{
SETREG(0x70, 0x00);
SETREG(0x71, 0x02);
SETREG(0x72, 0x02);
SETREG(0x73, 0x04);
}
// CK1MAP[0:17], CK3MAP[0:17], CK4MAP[0:17]: CCD clock bit mapping setting. // CK1MAP[0:17], CK3MAP[0:17], CK4MAP[0:17]: CCD clock bit mapping setting.
SETREG(0x74, 0x00); // SENSOR_DEF SETREG(0x74, 0x00); // SENSOR_DEF
SETREG(0x75, 0x00); // SENSOR_DEF SETREG(0x75, 0x00); // SENSOR_DEF
@ -552,8 +654,14 @@ gl843_init_registers (Genesys_Device * dev)
// GPOLED[x]: LED vs GPIO settings // GPOLED[x]: LED vs GPIO settings
SETREG(0x7e, 0x00); SETREG(0x7e, 0x00);
// BSMPDLY, VSMPDLY
// LEDCNT[0:1]: Controls led blinking and its period
SETREG (0x7f, 0x00); SETREG (0x7f, 0x00);
// VRHOME, VRMOVE, VRBACK, VRSCAN: Vref settings of the motor driver IC for
// moving in various situations.
SETREG (0x80, 0x00); SETREG (0x80, 0x00);
if (dev->model->model_id != MODEL_CANON_CANOSCAN_4400F) if (dev->model->model_id != MODEL_CANON_CANOSCAN_4400F)
{ {
// NOTE: Historical code. None of the following 6 registers are // NOTE: Historical code. None of the following 6 registers are
@ -568,8 +676,63 @@ gl843_init_registers (Genesys_Device * dev)
} }
SETREG (0x87, 0x00); SETREG (0x87, 0x00);
SETREG (0x9d, 0x04); if (dev->model->model_id == MODEL_CANON_CANOSCAN_8600F)
SETREG (0x9e, 0x00); {
SETREG(0x87, 0x02);
}
// MTRPLS[0:7]: The width of the ADF motor trigger signal pulse.
if (dev->model->model_id == MODEL_CANON_CANOSCAN_8600F)
{
SETREG(0x94, 0xff);
}
// 0x95-0x97: SCANLEN[0:19]: Controls when paper jam bit is set in sheetfed
// scanners.
// ONDUR[0:15]: The duration of PWM ON phase for LAMP control
// OFFDUR[0:15]: The duration of PWM OFF phase for LAMP control
// both of the above are in system clocks
if (dev->model->model_id == MODEL_CANON_CANOSCAN_8600F)
{
SETREG(0x98, 0x00);
SETREG(0x99, 0x00);
SETREG(0x9a, 0x00);
SETREG(0x9b, 0x00);
}
// RMADLY[0:1], MOTLAG, CMODE, STEPTIM, MULDMYLN, IFRS
SETREG(0x9d, 0x04);
if (dev->model->model_id == MODEL_CANON_CANOSCAN_8600F)
{
SETREG(0x9d, 0x08); // additionally sets the multiplier for slope tables
}
// SEL3INV, TGSTIME[0:2], TGWTIME[0:2]
SETREG (0x9e, 0x00); // SENSOR_DEF
// RFHSET[0:4]: Refresh time of SDRAM in units of 2us
if (dev->model->model_id == MODEL_CANON_CANOSCAN_8600F)
{
SETREG(0xa2, 0x1f);
}
// 0xa6-0xa9: controls gpio, see gl843_gpio_init
// GPOM9, MULSTOP[0-2], NODECEL, TB3TB1, TB5TB2, FIX16CLK.
if (dev->model->model_id == MODEL_CANON_CANOSCAN_8600F)
{
SETREG(0xab, 0x00);
}
// VRHOME[3:2], VRMOVE[3:2], VRBACK[3:2]: Vref setting of the motor driver IC
// for various situations.
if (dev->model->model_id == MODEL_CANON_CANOSCAN_8600F)
{
SETREG(0xac, 0x00);
}
if (dev->model->model_id != MODEL_CANON_CANOSCAN_8400F) if (dev->model->model_id != MODEL_CANON_CANOSCAN_8400F)
{ {
SETREG (0x0c, 0x00); SETREG (0x0c, 0x00);
@ -577,7 +740,6 @@ gl843_init_registers (Genesys_Device * dev)
SETREG (0xab, 0x50); SETREG (0xab, 0x50);
} }
/* so many time burnt for this register ....*/
if (dev->model->model_id != MODEL_CANON_CANOSCAN_4400F if (dev->model->model_id != MODEL_CANON_CANOSCAN_4400F
&& dev->model->model_id != MODEL_CANON_CANOSCAN_8400F) && dev->model->model_id != MODEL_CANON_CANOSCAN_8400F)
{ {
@ -590,7 +752,6 @@ gl843_init_registers (Genesys_Device * dev)
dev->model->model_id == MODEL_HP_SCANJET_4850C) dev->model->model_id == MODEL_HP_SCANJET_4850C)
{ {
SETREG (0x03, 0x1d); SETREG (0x03, 0x1d);
SETREG (0x05, 0x08);
SETREG (0x06, 0xd0); /* SCANMOD=110, PWRBIT and no GAIN4 */ SETREG (0x06, 0xd0); /* SCANMOD=110, PWRBIT and no GAIN4 */
SETREG (0x06, 0xd8); /* SCANMOD=110, PWRBIT and GAIN4 */ SETREG (0x06, 0xd8); /* SCANMOD=110, PWRBIT and GAIN4 */
SETREG (0x0a, 0x18); SETREG (0x0a, 0x18);
@ -663,24 +824,6 @@ gl843_init_registers (Genesys_Device * dev)
SETREG (0x9d, 0x08); /* STEPTIM=2 */ SETREG (0x9d, 0x08); /* STEPTIM=2 */
} }
/* fine tune upon device description */
dev->reg[reg_0x05].value &= ~REG05_DPIHW;
switch (dev->sensor.optical_res)
{
case 600:
dev->reg[reg_0x05].value |= REG05_DPIHW_600;
break;
case 1200:
dev->reg[reg_0x05].value |= REG05_DPIHW_1200;
break;
case 2400:
dev->reg[reg_0x05].value |= REG05_DPIHW_2400;
break;
case 4800:
dev->reg[reg_0x05].value |= REG05_DPIHW_4800;
break;
}
/* initalize calibration reg */ /* initalize calibration reg */
memcpy (dev->calib_reg, dev->reg, GENESYS_GL843_MAX_REGS * sizeof (Genesys_Register_Set)); memcpy (dev->calib_reg, dev->reg, GENESYS_GL843_MAX_REGS * sizeof (Genesys_Register_Set));
@ -750,6 +893,7 @@ gl843_set_fe (Genesys_Device * dev, uint8_t set)
} }
/* check analog frontend type */ /* check analog frontend type */
// FIXME: looks like we write to that register with initial data
RIE (sanei_genesys_read_register (dev, REG04, &val)); RIE (sanei_genesys_read_register (dev, REG04, &val));
if ((val & REG04_FESET) != 0x00) if ((val & REG04_FESET) != 0x00)
{ {
@ -1136,7 +1280,11 @@ gl843_init_optical_regs_scan (Genesys_Device * dev,
} }
r = sanei_genesys_get_address (reg, REG03); r = sanei_genesys_get_address (reg, REG03);
r->value &= ~REG03_AVEENB; if (dev->model->model_id == MODEL_CANON_CANOSCAN_8600F)
r->value |= REG03_AVEENB;
else
r->value &= ~REG03_AVEENB;
if (flags & OPTICAL_FLAG_DISABLE_LAMP) if (flags & OPTICAL_FLAG_DISABLE_LAMP)
r->value &= ~REG03_LAMPPWR; r->value &= ~REG03_LAMPPWR;
else else
@ -1648,7 +1796,10 @@ gl843_calculate_current_setup (Genesys_Device * dev)
depth = 1; depth = 1;
/* start */ /* start */
start = SANE_UNFIX (dev->model->x_offset); if (dev->model->model_id == MODEL_CANON_CANOSCAN_8600F)
start = SANE_UNFIX (dev->model->x_offset) / 4;
else
start = SANE_UNFIX (dev->model->x_offset);
start += dev->settings.tl_x; start += dev->settings.tl_x;
start = (start * dev->sensor.optical_res) / MM_PER_INCH; start = (start * dev->sensor.optical_res) / MM_PER_INCH;
@ -2897,7 +3048,10 @@ gl843_init_regs_for_scan (Genesys_Device * dev)
DBG(DBG_info, "%s: move=%f steps\n", __func__, move); DBG(DBG_info, "%s: move=%f steps\n", __func__, move);
/* start */ /* start */
start = SANE_UNFIX (dev->model->x_offset); if (dev->model->model_id == MODEL_CANON_CANOSCAN_8600F)
start = SANE_UNFIX (dev->model->x_offset) / 4;
else
start = SANE_UNFIX (dev->model->x_offset);
start += dev->settings.tl_x; start += dev->settings.tl_x;
start = (start * dev->sensor.optical_res) / MM_PER_INCH; start = (start * dev->sensor.optical_res) / MM_PER_INCH;
@ -3681,30 +3835,54 @@ gl843_boot (Genesys_Device * dev, SANE_Bool cold)
/* Set default values for registers */ /* Set default values for registers */
gl843_init_registers (dev); gl843_init_registers (dev);
RIE (sanei_genesys_write_register (dev, REG6B, 0x02)); if (dev->model->model_id == MODEL_CANON_CANOSCAN_8600F)
{
// turns on vref control for maximum current of the motor driver
RIE(sanei_genesys_write_register (dev, REG6B, 0x72));
}
else
{
RIE(sanei_genesys_write_register (dev, REG6B, 0x02));
}
/* Write initial registers */ /* Write initial registers */
RIE (dev->model->cmd_set->bulk_write_register (dev, dev->reg, GENESYS_GL843_MAX_REGS)); RIE (dev->model->cmd_set->bulk_write_register (dev, dev->reg, GENESYS_GL843_MAX_REGS));
/* Enable DRAM by setting a rising edge on bit 3 of reg 0x0b */ // Enable DRAM by setting a rising edge on bit 3 of reg 0x0b
val = dev->reg[reg_0x0b].value & REG0B_DRAMSEL; val = dev->reg[reg_0x0b].value & REG0B_DRAMSEL;
val = (val | REG0B_ENBDRAM); val = (val | REG0B_ENBDRAM);
RIE (sanei_genesys_write_register (dev, REG0B, val)); RIE (sanei_genesys_write_register (dev, REG0B, val));
dev->reg[reg_0x0b].value = val; dev->reg[reg_0x0b].value = val;
/* URB 14 control 0x40 0x0c 0x8c 0x10 len 1 wrote 0xb4 */
RIE (sanei_genesys_write_0x8c (dev, 0x10, 0xb4)); if (dev->model->model_id == MODEL_CANON_CANOSCAN_8600F)
{
RIE (sanei_genesys_write_0x8c (dev, 0x10, 0xc8));
}
else
{
RIE (sanei_genesys_write_0x8c (dev, 0x10, 0xb4));
}
/* CLKSET */ /* CLKSET */
val = (dev->reg[reg_0x0b].value & ~REG0B_CLKSET) | REG0B_48MHZ; int clock_freq = REG0B_48MHZ;
if (dev->model->model_id == MODEL_CANON_CANOSCAN_8600F)
clock_freq = REG0B_60MHZ;
val = (dev->reg[reg_0x0b].value & ~REG0B_CLKSET) | clock_freq;
RIE (sanei_genesys_write_register (dev, REG0B, val)); RIE (sanei_genesys_write_register (dev, REG0B, val));
dev->reg[reg_0x0b].value = val; dev->reg[reg_0x0b].value = val;
/* prevent further writings by bulk write register */ /* prevent further writings by bulk write register */
dev->reg[reg_0x0b].address = 0x00; dev->reg[reg_0x0b].address = 0x00;
/* set up end access */ if (dev->model->model_id != MODEL_CANON_CANOSCAN_8600F)
sanei_genesys_write_register (dev, REGA7, 0x04); {
sanei_genesys_write_register (dev, REGA9, 0x00); // set up end access
// FIXME: this is overwritten in gl843_init_gpio
sanei_genesys_write_register(dev, REGA7, 0x04);
sanei_genesys_write_register(dev, REGA9, 0x00);
}
/* set RAM read address */ /* set RAM read address */
RIE (sanei_genesys_write_register (dev, REG29, 0x00)); RIE (sanei_genesys_write_register (dev, REG29, 0x00));

File diff suppressed because one or more lines are too long

Wyświetl plik

@ -1765,7 +1765,7 @@ sanei_genesys_wait_for_home (Genesys_Device * dev)
*/ */
int sanei_genesys_compute_dpihw(Genesys_Device *dev, int xres) int sanei_genesys_compute_dpihw(Genesys_Device *dev, int xres)
{ {
/* some scanners use alxways hardware dpi for sensor */ /* some scanners use always hardware dpi for sensor */
if (dev->model->flags & GENESYS_FLAG_FULL_HWDPI_MODE) if (dev->model->flags & GENESYS_FLAG_FULL_HWDPI_MODE)
{ {
return dev->sensor.optical_res; return dev->sensor.optical_res;
@ -1954,7 +1954,7 @@ Motor_Profile *profile;
i++; i++;
} }
/* return used steps and acceleration sum */ // return used steps and taken time
*steps=i/factor; *steps=i/factor;
return sum; return sum;
} }

Wyświetl plik

@ -390,6 +390,7 @@ enum Genesys_Model_Type
MODEL_HP_SCANJET_G4050, MODEL_HP_SCANJET_G4050,
MODEL_CANON_CANOSCAN_4400F, MODEL_CANON_CANOSCAN_4400F,
MODEL_CANON_CANOSCAN_8400F, MODEL_CANON_CANOSCAN_8400F,
MODEL_CANON_CANOSCAN_8600F,
MODEL_CANON_LIDE_100, MODEL_CANON_LIDE_100,
MODEL_CANON_LIDE_110, MODEL_CANON_LIDE_110,
MODEL_CANON_LIDE_120, MODEL_CANON_LIDE_120,
@ -446,6 +447,7 @@ enum Genesys_Dac_Type
DAC_PLUSTEK_3600, DAC_PLUSTEK_3600,
DAC_CANONLIDE700, DAC_CANONLIDE700,
DAC_CS8400F, DAC_CS8400F,
DAC_CS8600F,
DAC_IMG101, DAC_IMG101,
DAC_PLUSTEK3800, DAC_PLUSTEK3800,
DAC_CANONLIDE80, DAC_CANONLIDE80,
@ -478,6 +480,7 @@ enum Genesys_Sensor_Type
CIS_CANONLIDE700, CIS_CANONLIDE700,
CCD_CS4400F, CCD_CS4400F,
CCD_CS8400F, CCD_CS8400F,
CCD_CS8600F,
CCD_IMG101, CCD_IMG101,
CCD_PLUSTEK3800, CCD_PLUSTEK3800,
CIS_CANONLIDE210, CIS_CANONLIDE210,
@ -510,6 +513,7 @@ enum Genesys_Gpo_Type
GPO_CANONLIDE700, GPO_CANONLIDE700,
GPO_CS4400F, GPO_CS4400F,
GPO_CS8400F, GPO_CS8400F,
GPO_CS8600F,
GPO_IMG101, GPO_IMG101,
GPO_PLUSTEK3800, GPO_PLUSTEK3800,
GPO_CANONLIDE80, GPO_CANONLIDE80,
@ -538,6 +542,7 @@ enum Genesys_Motor_Type
MOTOR_PLUSTEK_3600, MOTOR_PLUSTEK_3600,
MOTOR_CANONLIDE700, MOTOR_CANONLIDE700,
MOTOR_CS8400F, MOTOR_CS8400F,
MOTOR_CS8600F,
MOTOR_IMG101, MOTOR_IMG101,
MOTOR_PLUSTEK3800, MOTOR_PLUSTEK3800,
MOTOR_CANONLIDE210, MOTOR_CANONLIDE210,
@ -1033,7 +1038,7 @@ typedef struct {
int motor_type; /**< motor id */ int motor_type; /**< motor id */
int exposure; /**< exposure for the slope table */ int exposure; /**< exposure for the slope table */
int step_type; /**< default step type for given exposure */ int step_type; /**< default step type for given exposure */
uint32_t *table; /**< 0 terminated slope table at full step */ uint32_t *table; // 0-terminated slope table at full step (i.e. step_type == 0)
} Motor_Profile; } Motor_Profile;
#define FULL_STEP 0 #define FULL_STEP 0

Wyświetl plik

@ -181,6 +181,13 @@
:status :unsupported :status :unsupported
:comment "GL847 based, to be added to the genesys backend" :comment "GL847 based, to be added to the genesys backend"
:model "CanoScan 8600F"
:url "unsupported/canon-8600.html"
:interface "USB"
:usbid "0x04a9" "0x2229"
:status :basic
:comment "GL841 based, to be added to genesys backend"
:model "CanoScan 700F" :model "CanoScan 700F"
:interface "USB" :interface "USB"
:usbid "0x04a9" "0x1907" :usbid "0x04a9" "0x1907"

Wyświetl plik

@ -340,14 +340,6 @@
:status :unsupported :status :unsupported
:comment "GL841 based, to be added to genesys backend" :comment "GL841 based, to be added to genesys backend"
:model "CanoScan 8600F"
:url "unsupported/canon-8600.html"
:interface "USB"
:usbid "0x04a9" "0x2229"
:status :unsupported
:comment "GL841 based, to be added to genesys backend"
:model "CanoScan 9900F" :model "CanoScan 9900F"
:url "unsupported/canon-9900f.html" :url "unsupported/canon-9900f.html"
:interface "USB" :interface "USB"