* genesys/gl646: HP2400 warmup fix by Luke <iceyfor@gmail.com>

merge-requests/1/head
Stéphane Voltz 2007-08-26 09:49:18 +00:00
rodzic a55ccf9ad0
commit 825ff7335e
4 zmienionych plików z 801 dodań i 719 usunięć

Wyświetl plik

@ -1,3 +1,8 @@
2007-08-26 Stephane Voltz <stef.dev@free.fr>
* backend/genesys.c backend/genesys_gl646.c backend/genesys_devices.c:
HP2400 warmup fix by Luke
2007-08-19 Henning Geinitz <sane@geinitz.org>
* backend/gt68xx.c backend/gt68xx.conf.in backend/gt68xx_devices.c

Plik diff jest za duży Load Diff

Wyświetl plik

@ -3,8 +3,9 @@
Copyright (C) 2003 Oliver Rauch
Copyright (C) 2003-2005 Henning Meier-Geinitz <henning@meier-geinitz.de>
Copyright (C) 2004, 2005 Gerhard Jaeger <gerhard@gjaeger.de>
Copyright (C) 2004, 2005 Stephane Voltz <svoltz@numericable.fr>
Copyright (C) 2004-2007 Stephane Voltz <stef.dev@free.fr>
Copyright (C) 2005 Pierre Willenbrock <pierre@pirsoft.dnsalias.org>
Copyright (C) 2007 Luke <iceyfor@gmail.com>
This file is part of the SANE package.
@ -198,22 +199,22 @@ static Genesys_Sensor Sensor[] = {
/* CANOLIDE35 */
{1200,
/*TODO: find a good reason for keeping all three following variables*/
87, /*(black)*/
87, /* (dummy)*/
0, /* (startxoffset)*/
10400, /*sensor_pixels*/
210,
87, /*(black) */
87, /* (dummy) */
0, /* (startxoffset) */
10400, /*sensor_pixels */
210,
200,
{0x00, 0x00, 0x00, 0x00},
{0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x02, 0x00, 0x50,
0x00, 0x00, 0x00, 0x00 /* TODO(these do no harm, but may be neccessery for CCD)*/
},
{0x05, 0x07,
0x00, 0x00, 0x00, 0x00, /*[GB](HI|LOW) not needed for cis*/
0x3a, 0x03,
0x40, /*TODO: bit7*/
0x00, 0x00, 0x00, 0x00 /*TODO (these do no harm, but may be neccessery for CCD)*/
}
{0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x02, 0x00, 0x50,
0x00, 0x00, 0x00, 0x00 /* TODO(these do no harm, but may be neccessery for CCD) */
},
{0x05, 0x07,
0x00, 0x00, 0x00, 0x00, /*[GB](HI|LOW) not needed for cis */
0x3a, 0x03,
0x40, /*TODO: bit7 */
0x00, 0x00, 0x00, 0x00 /*TODO (these do no harm, but may be neccessery for CCD) */
}
,
1.0, 1.0, 1.0,
NULL, NULL, NULL}
@ -287,111 +288,111 @@ static Genesys_Motor Motor[] = {
{
1200, /* motor base steps */
2400, /* maximum motor resolution */
1, /* maximum step mode*/
{{
11000, /* maximum start speed */
3000, /* maximum end speed */
128, /* step count */
1.0, /* nonlinearity */
},
1, /* maximum step mode */
{{
11000, /* maximum start speed */
3000, /* maximum end speed */
128, /* step count */
1.0, /* nonlinearity */
},
{
11000,
3000,
128,
1.0,
11000,
3000,
128,
1.0,
},
},
},
},
{ /* MD5345/6228/6471 */
1200,
2400,
1,
{{
2000,
1375,
128,
0.5,
},
{{
2000,
1375,
128,
0.5,
},
{
2000,
1375,
128,
0.5,
2000,
1375,
128,
0.5,
},
},
},
},
{ /* ST24 */
2400,
2400,
1,
{{
2289,
2100,
128,
0.3,
},
{{
2289,
2100,
128,
0.3,
},
{
2289,
2100,
128,
0.3,
2289,
2100,
128,
0.3,
},
},
},
},
{ /* HP 2400c */
1200,
2400,
1,
{{
11000,
3000,
128,
1.0,
},
{{
11000,
3000,
128,
1.0,
},
{
11000,
3000,
128,
1.0,
11000,
3000,
128,
1.0,
},
},
},
},
{ /* HP 2300c */
600,
1200,
1,
{{
3200,
1200,
128,
0.5,
},
{{
3200,
1200,
128,
0.5,
},
{
3200,
1200,
128,
0.5,
3200,
1200,
128,
0.5,
},
},
},
},
{ /* Canon LiDE 35 */
1200,
2400,
1,
{{
3500,
1300,
60,
0.8,
},
3500,
1300,
60,
0.8,
},
{
3500,
1400,
60,
0.8,
3500,
1400,
60,
0.8,
},
},
},
},
};
/* here we have the various device settings...
@ -441,7 +442,7 @@ static Genesys_Model umax_astra_4500_model = {
static Genesys_Model canon_lide_50_model = {
"canon-lide-50", /* Name */
"Canon", /* Device vendor string */
"LiDE 35/40/50", /* Device model name */
"LiDE 35/40/50", /* Device model name */
GENESYS_GL841,
NULL,
@ -474,10 +475,7 @@ static Genesys_Model canon_lide_50_model = {
DAC_CANONLIDE35,
GPO_CANONLIDE35,
MOTOR_CANONLIDE35,
GENESYS_FLAG_LAZY_INIT
| GENESYS_FLAG_SKIP_WARMUP
| GENESYS_FLAG_OFFSET_CALIBRATION
| GENESYS_FLAG_DARK_WHITE_CALIBRATION, /* Which flags are needed for this scanner? */
GENESYS_FLAG_LAZY_INIT | GENESYS_FLAG_SKIP_WARMUP | GENESYS_FLAG_OFFSET_CALIBRATION | GENESYS_FLAG_DARK_WHITE_CALIBRATION, /* Which flags are needed for this scanner? */
280,
400
};
@ -518,13 +516,10 @@ static Genesys_Model canon_lide_60_model = {
DAC_CANONLIDE35,
GPO_CANONLIDE35,
MOTOR_CANONLIDE35,
GENESYS_FLAG_LAZY_INIT
| GENESYS_FLAG_SKIP_WARMUP
| GENESYS_FLAG_OFFSET_CALIBRATION
| GENESYS_FLAG_DARK_WHITE_CALIBRATION, /* Which flags are needed for this scanner? */
GENESYS_FLAG_LAZY_INIT | GENESYS_FLAG_SKIP_WARMUP | GENESYS_FLAG_OFFSET_CALIBRATION | GENESYS_FLAG_DARK_WHITE_CALIBRATION, /* Which flags are needed for this scanner? */
300,
400
}; /* this is completely untested -- hmg */
}; /* this is completely untested -- hmg */
static Genesys_Model hp2300c_model = {
"hewlett-packard-scanjet-2300c", /* Name */
@ -607,8 +602,12 @@ static Genesys_Model hp2400c_model = {
DAC_WOLFSON_HP2400,
GPO_HP2400,
MOTOR_HP2400,
GENESYS_FLAG_UNTESTED
| GENESYS_FLAG_REPARK | GENESYS_FLAG_USE_PARK | GENESYS_FLAG_14BIT_GAMMA,
GENESYS_FLAG_UNTESTED /* not fully working yet */
| GENESYS_FLAG_REPARK
| GENESYS_FLAG_14BIT_GAMMA
| GENESYS_FLAG_SEARCH_START
| GENESYS_FLAG_MUST_WAIT
| GENESYS_FLAG_DARK_CALIBRATION | GENESYS_FLAG_OFFSET_CALIBRATION,
20,
132
};

Wyświetl plik

@ -3,8 +3,9 @@
Copyright (C) 2003 Oliver Rauch
Copyright (C) 2003, 2004 Henning Meier-Geinitz <henning@meier-geinitz.de>
Copyright (C) 2004 Gerhard Jaeger <gerhard@gjaeger.de>
Copyright (C) 2004 - 2006 Stephane Voltz <stefdev@modulonet.fr>
Copyright (C) 2004 - 2007 Stephane Voltz <stef.dev@free.fr>
Copyright (C) 2005, 2006 Pierre Willenbrock <pierre@pirsoft.dnsalias.org>
Copyright (C) 2007 Luke <iceyfor@gmail.com>
This file is part of the SANE package.
@ -722,6 +723,17 @@ gl646_setup_sensor (Genesys_Device * dev,
{
/* settings for CCD used at half is max resolution */
if (half_ccd)
{
r = sanei_genesys_get_address (regs, 0x08);
r->value = 0x14;
r = sanei_genesys_get_address (regs, 0x09);
r->value = 0x15;
r = sanei_genesys_get_address (regs, 0x0a);
r->value = 0x00;
r = sanei_genesys_get_address (regs, 0x0b);
r->value = 0x00;
}
else
{
r = sanei_genesys_get_address (regs, 0x08);
r->value = 2;
@ -732,6 +744,7 @@ gl646_setup_sensor (Genesys_Device * dev,
r = sanei_genesys_get_address (regs, 0x0b);
r->value = 0;
}
}
}
@ -952,11 +965,20 @@ gl646_init_regs (Genesys_Device * dev)
/* ST12: 0x20 0x10 0x21 0x08 0x22 0x10 0x23 0x10 0x24 0x08 0x25 0x00 0x26 0x00 0x27 0xd4 0x28 0x01 0x29 0xff */
/* ST24: 0x20 0x10 0x21 0x08 0x22 0x10 0x23 0x10 0x24 0x08 0x25 0x00 0x26 0x00 0x27 0xd4 0x28 0x01 0x29 0xff */
/* TODO this construct deserve a switch */
if (dev->model->ccd_type != CCD_HP2300)
{
dev->reg[reg_0x1f].value = 0x01; /* scan feed step for table one in two table mode only */
dev->reg[reg_0x20].value = 0x10 /*0x01 */ ; /* n * 2k, below this condition, motor move forward *//* todo: huh, 2k is pretty low? */
if (dev->model->ccd_type == CCD_HP2400)
{
dev->reg[reg_0x1e].value = 0x40;
dev->reg[reg_0x1f].value = 0x10;
dev->reg[reg_0x20].value = 0x20;
}
else
{
dev->reg[reg_0x1f].value = 0x01; /* scan feed step for table one in two table mode only */
dev->reg[reg_0x20].value = 0x10 /*0x01 */ ; /* n * 2k, below this condition, motor move forward *//* todo: huh, 2k is pretty low? */
}
}
else
{
@ -1050,7 +1072,8 @@ gl646_init_regs (Genesys_Device * dev)
/* ST12: 0x6a 0x7f 0x6b 0xff 0x6c 0x00 0x6d 0x01 */
/* ST24: 0x6a 0x40 0x6b 0xff 0x6c 0x00 0x6d 0x01 */
if (dev->model->motor_type == MOTOR_HP2300)
if (dev->model->motor_type == MOTOR_HP2300
|| dev->model->motor_type == MOTOR_HP2400)
{
dev->reg[reg_0x6a].value = 0x7f; /* table two steps number for acc/dec */
dev->reg[reg_0x6b].value = 0x78; /* table two steps number for acc/dec */
@ -1550,7 +1573,8 @@ gl646_slow_back_home (Genesys_Device * dev, SANE_Bool wait_until_home)
prepare_steps = 4;
exposure_time = 6 * MOTOR_SPEED_MAX;
steps = 14700 - 2 * prepare_steps;
if (dev->model->motor_type == MOTOR_HP2300)
if (dev->model->motor_type == MOTOR_HP2300
|| dev->model->motor_type == MOTOR_HP2400)
{
steps = 65535; /* enough to get back home ... */
dpi = dev->motor.base_ydpi / 4;
@ -1563,7 +1587,8 @@ gl646_slow_back_home (Genesys_Device * dev, SANE_Bool wait_until_home)
local_reg[reg_0x01].value =
local_reg[reg_0x01].value & ~REG01_FASTMOD & ~REG01_SCAN;
local_reg[reg_0x02].value = (local_reg[reg_0x02].value & ~REG02_FASTFED & ~REG02_STEPSEL) | REG02_MTRPWR | REG02_MTRREV; /* Motor on, direction = reverse */
if (dev->model->motor_type == MOTOR_HP2300)
if (dev->model->motor_type == MOTOR_HP2300
|| dev->model->motor_type == MOTOR_HP2400)
local_reg[reg_0x02].value =
(local_reg[reg_0x02].value & ~REG02_STEPSEL) | REG02_HALFSTEP;
@ -1578,7 +1603,8 @@ gl646_slow_back_home (Genesys_Device * dev, SANE_Bool wait_until_home)
local_reg[reg_0x3f].value = LOBYTE (LOWORD (steps));
local_reg[reg_0x6c].value = 0x00; /* one time period (only one speed) */
if (dev->model->motor_type != MOTOR_HP2300)
if (dev->model->motor_type != MOTOR_HP2300
&& dev->model->motor_type != MOTOR_HP2400)
{
local_reg[reg_0x66].value = local_reg[reg_0x66].value | REG66_LOW_CURRENT; /* gpio7-12: reset GPIO11 (low current) */
local_reg[reg_0x6d].value = 0x54;
@ -2019,7 +2045,8 @@ gl646_search_start_position (Genesys_Device * dev)
local_reg[reg_0x62].value = LOBYTE (0);
local_reg[reg_0x63].value = HIBYTE (0);
if (dev->model->motor_type != MOTOR_HP2300)
if (dev->model->motor_type != MOTOR_HP2300
&& dev->model->motor_type != MOTOR_HP2400)
local_reg[reg_0x65].value = 0x00; /* PWM duty cycle for table one motor phase (63 = max) */
else
{
@ -2408,7 +2435,8 @@ gl646_init_regs_for_shading (Genesys_Device * dev)
if (dev->model->motor_type == MOTOR_5345)
gl646_setup_steps (dev, dev->calib_reg, dpiset);
else if (dev->model->motor_type == MOTOR_HP2300)
else if (dev->model->motor_type == MOTOR_HP2300
|| dev->model->motor_type == MOTOR_HP2400)
{
dev->calib_reg[reg_0x21].value = 2;
dev->calib_reg[reg_0x22].value = 16;
@ -2429,7 +2457,8 @@ gl646_init_regs_for_shading (Genesys_Device * dev)
steps = dev->model->y_offset * step_parts;
if (dev->model->motor_type == MOTOR_5345)
steps = 0;
else if (dev->model->motor_type == MOTOR_HP2300)
else if (dev->model->motor_type == MOTOR_HP2300
|| dev->model->motor_type == MOTOR_HP2400)
steps = 1;
else
dev->calib_reg[reg_0x6b].value = 0x20 * step_parts;
@ -2897,7 +2926,8 @@ gl646_init_regs_for_scan (Genesys_Device * dev)
dev->reg[reg_0x37].value = LOBYTE (LOWORD (words_per_line));
if ((dev->model->ccd_type == CCD_5345)
|| (dev->model->ccd_type == CCD_HP2300))
|| (dev->model->ccd_type == CCD_HP2300)
|| (dev->model->ccd_type == CCD_HP2400))
exposure_time =
sanei_genesys_exposure_time (dev, dev->reg, dev->settings.xres);
else
@ -3241,7 +3271,7 @@ static SANE_Status
gl646_led_calibration (Genesys_Device * dev)
{
DBG (DBG_error, "Implementation for led calibration missing\n");
if(dev || dev==NULL)
if (dev || dev == NULL)
return SANE_STATUS_INVAL;
return SANE_STATUS_INVAL;
}
@ -3289,7 +3319,8 @@ gl646_offset_calibration (Genesys_Device * dev)
steps = 0;
lincnt = 1;
}
else if (dev->model->ccd_type == CCD_HP2300)
else if (dev->model->ccd_type == CCD_HP2300
|| dev->model->ccd_type == CCD_HP2400)
{
dpi = dev->settings.xres;
steps = 1;
@ -3312,7 +3343,7 @@ gl646_offset_calibration (Genesys_Device * dev)
dev->calib_reg[reg_0x01].value &= ~REG01_DVDSET;
dev->calib_reg[reg_0x02].value = REG02_ACDCDIS;
if (dev->model->motor_type == MOTOR_5345 || MOTOR_HP2300)
if (dev->model->motor_type == MOTOR_5345 || MOTOR_HP2300 || MOTOR_HP2400)
{
if (half_ccd)
dev->calib_reg[reg_0x02].value =
@ -3447,7 +3478,8 @@ ST12: 0x60 0x00 0x61 0x00 0x62 0x00 0x63 0x00 0x64 0x00 0x65 0x3f 0x66 0x00 0x67
dev->calib_reg[reg_0x62].value = HIBYTE (0);
dev->calib_reg[reg_0x63].value = LOBYTE (0);
if (dev->model->motor_type == MOTOR_HP2300)
if (dev->model->motor_type == MOTOR_HP2300
|| dev->model->motor_type == MOTOR_HP2400)
{
dev->calib_reg[reg_0x65].value = 0x3f; /* PWM duty cycle for table one motor phase (63 = max) */
dev->calib_reg[reg_0x6b].value = 0x02;
@ -3806,7 +3838,7 @@ gl646_init_regs_for_warmup (Genesys_Device * dev,
int *channels, int *total_size)
{
int num_pixels = (int) (4 * 300);
int dpi=300, lincnt, exposure_time, words_per_line;
int dpi = 300, lincnt, exposure_time, words_per_line;
int startpixel, endpixel;
int steps = 0;
SANE_Status status = SANE_STATUS_GOOD;
@ -3888,7 +3920,7 @@ gl646_init_regs_for_warmup (Genesys_Device * dev,
local_reg[reg_0x37].value = LOBYTE (LOWORD (words_per_line));
exposure_time = sanei_genesys_exposure_time (dev, local_reg, dpi),
local_reg[reg_0x38].value = HIBYTE (exposure_time);
local_reg[reg_0x38].value = HIBYTE (exposure_time);
local_reg[reg_0x39].value = LOBYTE (exposure_time);
/* monochrome scan */