- head parking fix for HP4400

- 75 dpi support for a sensor varaint of the HP4400
	- better sensor detection at init
merge-requests/1/head
Stéphane Voltz 2008-09-20 07:00:10 +00:00
rodzic 5ab0b2024c
commit 9f081c4508
4 zmienionych plików z 578 dodań i 279 usunięć

Wyświetl plik

@ -1,9 +1,14 @@
2008-09-20 Stéphane Voltz <stef.dev@free.fr>
* backend/rts8891.c backend/rts8891_low.c backend/rts8891_low.h: more
fix for HP4400 head parking, 75 dpi support for another HP4400 sensor
variant, better variant detector and initial setting
2008-09-13 Nicolas Martin <nicols-guest at users.alioth.debian.org>
* backend/pixma_mp150.c, doc/sane-pixma.man, doc/description/pixma.desc:
Changes in pixma backend for PIXMA MP970 at 4800 dpi (to be continued).
Declare MX7600 but yet untested.
2008-08-21 Stéphane Voltz <stef.dev@free.fr>
2008-09-11 Stéphane Voltz <stef.dev@free.fr>
* backend/rts8891.c backend/rts8891_low.c backend/rts8891_low.h: fix
parking for HP4400, tune dark calibration for HP4400
@ -15,7 +20,7 @@
- Modified scan area adjustments to enhance frontend area selection fit
but to be confirmed that it does not bring backward compatibility issues.
2008-08-21 Stéphane Voltz <stef.dev@free.fr>
2008-09-03 Stéphane Voltz <stef.dev@free.fr>
* backend/rts8891.c backend/rts8891_low.c backend/rts8891_low.h
backend/rts88xx_lib.c: minor changes for hp4400 support
@ -23,7 +28,7 @@
* backend/pixma_mp150.c:
Some tweaks to have PIXMA MP810 supported by the pixma backend.
2008-06-03 Stéphane Voltz <stef.dev@free.fr>
2008-08-29 Stéphane Voltz <stef.dev@free.fr>
* backend/genesys.c backend/genesys_gl646.c backend/genesys_devices.c:
- move to configuration framework
- fix GL646 GPO value usage

Wyświetl plik

@ -118,7 +118,7 @@
/* #define FAST_INIT 1 */
#define BUILD 5
#define BUILD 6
#define MOVE_DPI 100
@ -1173,12 +1173,16 @@ sane_start (SANE_Handle handle)
light = 0x2a;
mode = 0x10;
break;
case SENSOR_TYPE_4400_BARE:
light = 0x22;
mode = 0x10;
break;
default:
light = 0x3b;
mode = 0x20;
break;
}
DBG (DBG_info, "sane_start: mode=0x%02x, light=0x%02x\n", mode, light);
DBG (DBG_info, "sane_start: mode=0x%02x, light=0x%02x\n", mode, light);
/* step 2: dark calibration */
status = dark_calibration (dev, mode, light);
@ -2875,7 +2879,7 @@ init_lamp (struct Rts8891_Device *dev)
sanei_rts88xx_write_regs (dev->devnum, 0x14, dev->regs + 0x14, 2);
sanei_rts88xx_write_control (dev->devnum, 0x00);
sanei_rts88xx_write_control (dev->devnum, 0x00);
if (dev->sensor != SENSOR_TYPE_4400)
if (dev->sensor != SENSOR_TYPE_4400 && dev->sensor != SENSOR_TYPE_4400_BARE)
{
sanei_rts88xx_set_status (dev->devnum, dev->regs, 0x28, 0x3f);
dev->regs[0x11] = 0x3f;
@ -3015,7 +3019,7 @@ find_origin (struct Rts8891_Device *dev, SANE_Bool * changed)
dev->regs[0xcb] = 0xff;
dev->regs[0xd7] = 0x10;
}
if (dev->sensor == SENSOR_TYPE_4400)
if (dev->sensor == SENSOR_TYPE_4400 || dev->sensor == SENSOR_TYPE_4400_BARE)
{
/* 4400 values / 'XPA' values */
dev->regs[0x13] = 0x39; /* 0x20 */
@ -3028,6 +3032,19 @@ find_origin (struct Rts8891_Device *dev, SANE_Bool * changed)
dev->regs[0x39] = 0x00; /* 0x02 */
}
if (dev->sensor == SENSOR_TYPE_4400_BARE)
{
dev->regs[0xc3] = 0xff; /* 0x00 */
dev->regs[0xc4] = 0xff; /* 0xf0 */
dev->regs[0xc7] = 0xff; /* 0x0f */
dev->regs[0xc8] = 0xff; /* 0x00 */
dev->regs[0xc9] = 0x00; /* 0xff */
dev->regs[0xca] = 0x0e; /* 0xf1 */
dev->regs[0xcb] = 0x00; /* 0xff */
dev->regs[0xd7] = 0x30; /* 0x10 */
dev->regs[0xda] = 0xa7; /* 0xa0 */
}
/* allocate memory for the data */
total = width * height;
@ -3217,7 +3234,7 @@ find_margin (struct Rts8891_Device *dev)
sanei_rts88xx_write_reg (dev->devnum, LAMP_BRIGHT_REG, &reg);
/* maximum gain, offsets untouched */
if (dev->sensor == SENSOR_TYPE_4400)
if (dev->sensor == SENSOR_TYPE_4400 || dev->sensor == SENSOR_TYPE_4400_BARE)
{
sanei_rts88xx_set_status (dev->devnum, dev->regs, 0x10, 0x23);
}
@ -3302,6 +3319,24 @@ find_margin (struct Rts8891_Device *dev)
dev->regs[0xd4] = 0x12;
dev->regs[0xd7] = 0x31;
}
if (dev->sensor == SENSOR_TYPE_4400_BARE)
{
dev->regs[0x13] = 0x39; /* 0x20 */
dev->regs[0x14] = 0xf0; /* 0xf8 */
dev->regs[0x15] = 0x29; /* 0x28 */
dev->regs[0x16] = 0x0f; /* 0x07 */
dev->regs[0x17] = 0x10; /* 0x00 */
dev->regs[0x23] = 0x00; /* 0xff */
dev->regs[0x39] = 0x00; /* 0x02 */
dev->regs[0x80] = 0xb0; /* 0x32 */
dev->regs[0x82] = 0xb1; /* 0x33 */
dev->regs[0x85] = 0x46; /* 0x00 */
dev->regs[0x86] = 0x0b; /* 0x06 */
dev->regs[0x87] = 0x8c; /* 0x00 */
dev->regs[0x88] = 0x10; /* 0x06 */
dev->regs[0x89] = 0xb2; /* 0x34 */
dev->regs[0x8d] = 0x3b; /* 0x00 */
}
/* set vertical and horizontal start/end positions */
sanei_rts88xx_set_scan_area (dev->regs, starty, starty + height, startx,
@ -3553,6 +3588,7 @@ init_device (struct Rts8891_Device *dev)
SANE_Int i, page;
SANE_Byte buffer[2072];
char message[256 * 6];
SANE_Int val;
/* these commands are used to acces NVRAM through a serial manner */
/* we ignore NVRAM settingsd for now */
@ -3663,257 +3699,344 @@ init_device (struct Rts8891_Device *dev)
{
sprintf (message, "init_device: initial register settings: ");
for (i = 0; i < dev->reg_count; i++)
sprintf (message + strlen (message), "0x%02x", dev->regs[i]);
sprintf (message + strlen (message), "0x%02x ", dev->regs[i]);
sprintf (message + strlen (message), "\n");
DBG (DBG_io2, message);
}
/* initial sensor guess */
val = dev->regs[0x44] + 256 * dev->regs[0x45];
DBG (DBG_io, "init_device: R44/45=0x%04x\n", val);
if (dev->sensor == SENSOR_TYPE_4400 && val == 0x00)
{
dev->sensor = SENSOR_TYPE_4400_BARE;
DBG (DBG_info, "init_device: changing to SENSOR_TYPE_4400_BARE\n");
}
/* initial set written to scanner
* 0xe5 0x41 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x0a 0x0a 0x0a 0x70 0x00 0x00 0x00 0x00 0x60 0x1b 0x08 0x20 0x00 0x20 0x08 0x00 0x00 0x00 0x00 0x00 0x00 0x20 0x00 0x00 0x3a 0xf2 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x10 0x00 0x07 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x20 0x00 0x00 0x00 0x8c 0x76 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x80 0x68 0x00 0x00 0x00 0x00 0x02 0x0e 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xcc 0x27 0x64 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x02 ---- 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xe0 0x00 0x00 0x00 0x00 0x86 0x1b 0x00 0xff 0x00 0x27 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x01 0x00 0x00 0x14 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
*/
/* lengthy set up to make register content obvious, may be some day I will
* group corresponding values between models */
switch (dev->sensor)
{
case SENSOR_TYPE_BARE:
case SENSOR_TYPE_XPA:
dev->regs[0x01] = 0x41;
dev->regs[0x0b] = 0x70;
dev->regs[0x0c] = 0x00;
dev->regs[0x0d] = 0x00;
dev->regs[0x0e] = 0x00;
dev->regs[0x0f] = 0x00;
dev->regs[0x12] = 0x00;
dev->regs[0x13] = 0x20;
dev->regs[0x14] = 0x00;
dev->regs[0x15] = 0x20;
dev->regs[0x16] = 0x00;
dev->regs[0x17] = 0x00;
dev->regs[0x18] = 0x00;
dev->regs[0x19] = 0x00;
dev->regs[0x1a] = 0x00;
dev->regs[0x1b] = 0x00;
dev->regs[0x1c] = 0x00;
dev->regs[0x1d] = 0x20;
dev->regs[0x1e] = 0x00;
dev->regs[0x1f] = 0x00;
/* LCD display */
dev->regs[0x20] = 0x3a;
dev->regs[0x21] = 0xf2;
dev->regs[0x22] = 0x00;
dev->regs[0x23] = 0x00;
dev->regs[0x24] = 0x00;
dev->regs[0x25] = 0x00;
dev->regs[0x26] = 0x00;
dev->regs[0x27] = 0x00;
dev->regs[0x28] = 0x00;
dev->regs[0x29] = 0x00;
dev->regs[0x2a] = 0x00;
dev->regs[0x2b] = 0x00;
dev->regs[0x2c] = 0x00;
dev->regs[0x2d] = 0x00;
dev->regs[0x2e] = 0x00;
dev->regs[0x2f] = 0x00;
dev->regs[0x30] = 0x00;
dev->regs[0x31] = 0x00;
dev->regs[0x32] = 0x00;
dev->regs[0x33] = 0x00;
dev->regs[0x34] = 0x10;
dev->regs[0x35] = 0x00;
dev->regs[0x36] = 0x07;
dev->regs[0x37] = 0x00;
dev->regs[0x38] = 0x00;
dev->regs[0x39] = 0x00;
dev->regs[0x3a] = 0x00;
dev->regs[0x3b] = 0x00;
dev->regs[0x3c] = 0x00;
dev->regs[0x3d] = 0x00;
dev->regs[0x3e] = 0x00;
dev->regs[0x3f] = 0x00;
dev->regs[0x40] = 0x20;
dev->regs[0x41] = 0x00;
dev->regs[0x42] = 0x00;
dev->regs[0x43] = 0x00;
dev->regs[0x44] = 0x8c;
dev->regs[0x45] = 0x76;
dev->regs[0x46] = 0x00;
dev->regs[0x47] = 0x00;
dev->regs[0x48] = 0x00;
dev->regs[0x49] = 0x00;
dev->regs[0x4a] = 0x00;
dev->regs[0x4b] = 0x00;
dev->regs[0x4c] = 0x00;
dev->regs[0x4d] = 0x00;
dev->regs[0x4e] = 0x00;
dev->regs[0x4f] = 0x00;
dev->regs[0x50] = 0x00;
dev->regs[0x51] = 0x00;
dev->regs[0x52] = 0x00;
dev->regs[0x53] = 0x00;
dev->regs[0x54] = 0x00;
dev->regs[0x55] = 0x00;
dev->regs[0x56] = 0x00;
dev->regs[0x57] = 0x00;
dev->regs[0x58] = 0x00;
dev->regs[0x59] = 0x00;
dev->regs[0x5a] = 0x00;
dev->regs[0x5b] = 0x00;
dev->regs[0x5c] = 0x00;
dev->regs[0x5d] = 0x00;
dev->regs[0x5e] = 0x00;
dev->regs[0x5f] = 0x00;
dev->regs[0x60] = 0x00;
dev->regs[0x61] = 0x00;
dev->regs[0x62] = 0x00;
dev->regs[0x63] = 0x00;
dev->regs[0x64] = 0x00;
dev->regs[0x65] = 0x00;
dev->regs[0x66] = 0x00;
dev->regs[0x67] = 0x00;
dev->regs[0x68] = 0x00;
dev->regs[0x69] = 0x00;
dev->regs[0x6a] = 0x00;
dev->regs[0x6b] = 0x00;
dev->regs[0x6c] = 0x00;
dev->regs[0x6d] = 0x00;
dev->regs[0x6e] = 0x00;
dev->regs[0x6f] = 0x00;
dev->regs[0x70] = 0x00;
dev->regs[0x71] = 0x00;
dev->regs[0x72] = 0x00;
dev->regs[0x73] = 0x00;
dev->regs[0x74] = 0x00;
dev->regs[0x75] = 0x00;
dev->regs[0x76] = 0x00;
dev->regs[0x77] = 0x00;
dev->regs[0x78] = 0x00;
dev->regs[0x79] = 0x00;
dev->regs[0x7a] = 0x00;
dev->regs[0x7b] = 0x00;
dev->regs[0x7c] = 0x00;
dev->regs[0x7d] = 0x00;
dev->regs[0x7e] = 0x00;
dev->regs[0x7f] = 0x00;
dev->regs[0x80] = 0x00;
dev->regs[0x81] = 0x00;
dev->regs[0x82] = 0x00;
dev->regs[0x83] = 0x00;
dev->regs[0x84] = 0x00;
dev->regs[0x85] = 0x00;
dev->regs[0x86] = 0x00;
dev->regs[0x87] = 0x00;
dev->regs[0x88] = 0x00;
dev->regs[0x89] = 0x00;
dev->regs[0x8a] = 0x00;
dev->regs[0x8b] = 0x00;
dev->regs[0x8c] = 0x00;
dev->regs[0x8d] = 0x80;
dev->regs[0x8e] = 0x68;
dev->regs[0x8f] = 0x00;
dev->regs[0x90] = 0x00;
dev->regs[0x91] = 0x00;
dev->regs[0x92] = 0x00;
dev->regs[0x93] = 0x02;
dev->regs[0x94] = 0x0e;
dev->regs[0x95] = 0x00;
dev->regs[0x96] = 0x00;
dev->regs[0x97] = 0x00;
dev->regs[0x98] = 0x00;
dev->regs[0x99] = 0x00;
dev->regs[0x9a] = 0x00;
dev->regs[0x9b] = 0x00;
dev->regs[0x9c] = 0x00;
dev->regs[0x9d] = 0x00;
dev->regs[0x9e] = 0x00;
dev->regs[0x9f] = 0x00;
dev->regs[0xa0] = 0x00;
dev->regs[0xa1] = 0x00;
dev->regs[0xa2] = 0x00;
dev->regs[0xa3] = 0xcc;
dev->regs[0xa4] = 0x27;
dev->regs[0xa5] = 0x64;
dev->regs[0xa6] = 0x00;
dev->regs[0xa7] = 0x00;
dev->regs[0xa8] = 0x00;
dev->regs[0xa9] = 0x00;
dev->regs[0xaa] = 0x00;
dev->regs[0xab] = 0x00;
dev->regs[0xac] = 0x00;
dev->regs[0xad] = 0x00;
dev->regs[0xae] = 0x00;
dev->regs[0xaf] = 0x00;
dev->regs[0xb0] = 0x00;
dev->regs[0xb1] = 0x00;
dev->regs[0xb2] = 0x02;
dev->regs[0xb4] = 0x00;
dev->regs[0xb5] = 0x00;
dev->regs[0xb6] = 0x00;
dev->regs[0xb7] = 0x00;
dev->regs[0xb8] = 0x00;
dev->regs[0xb9] = 0x00;
dev->regs[0xba] = 0x00;
dev->regs[0xbb] = 0x00;
dev->regs[0xbc] = 0x00;
dev->regs[0xbd] = 0x00;
dev->regs[0xbe] = 0x00;
dev->regs[0xbf] = 0x00;
dev->regs[0xc0] = 0x00;
dev->regs[0xc1] = 0x00;
dev->regs[0xc2] = 0x00;
dev->regs[0xc3] = 0x00;
dev->regs[0xc4] = 0x00;
dev->regs[0xc5] = 0x00;
dev->regs[0xc6] = 0x00;
dev->regs[0xc7] = 0x00;
dev->regs[0xc8] = 0x00;
dev->regs[0xc9] = 0x00;
dev->regs[0xca] = 0x00;
dev->regs[0xcb] = 0x00;
dev->regs[0xcc] = 0x00;
dev->regs[0xcd] = 0x00;
dev->regs[0xce] = 0x00;
dev->regs[0xcf] = 0x00;
dev->regs[0xd0] = 0x00;
dev->regs[0xd1] = 0x00;
dev->regs[0xd2] = 0x00;
dev->regs[0xd3] = 0x00;
dev->regs[0xd4] = 0x00;
dev->regs[0xd5] = 0x86;
dev->regs[0xd6] = 0x1b;
dev->regs[0xd7] = 0x00;
dev->regs[0xd8] = 0xff;
dev->regs[0xd9] = 0x00;
dev->regs[0xda] = 0x27;
dev->regs[0xdb] = 0x00;
dev->regs[0xdc] = 0x00;
dev->regs[0xdd] = 0x00;
dev->regs[0xde] = 0x00;
dev->regs[0xdf] = 0x00;
dev->regs[0xe0] = 0x00;
dev->regs[0xe1] = 0x00;
dev->regs[0xe2] = 0x01;
dev->regs[0xe3] = 0x00;
dev->regs[0xe4] = 0x00;
/*dev->regs[0xe5] = 0x14;
dev->regs[0xe6] = 0x00; 14=20 */
SET_DOUBLE (dev->regs, EXPOSURE_REG, 20);
dev->regs[0xe7] = 0x00;
dev->regs[0xe8] = 0x00;
dev->regs[0xe9] = 0x00;
dev->regs[0xea] = 0x00;
dev->regs[0xeb] = 0x00;
dev->regs[0xec] = 0x00;
dev->regs[0xed] = 0x00;
dev->regs[0xee] = 0x00;
dev->regs[0xef] = 0x00;
dev->regs[0xf0] = 0x00;
dev->regs[0xf1] = 0x00;
dev->regs[0xf2] = 0x00;
dev->regs[0xf3] = 0x00;
break;
case SENSOR_TYPE_4400:
case SENSOR_TYPE_4400_BARE:
for (i = 0; i < dev->reg_count; i++)
dev->regs[i] = 0x00;
/* 2d may be 0x20 or 0x22: signals something */
dev->regs[0x00] = 0xf5;
dev->regs[0x01] = 0x41;
dev->regs[0x0b] = 0x70;
dev->regs[0x10] = 0x50;
dev->regs[0x11] = 0x03;
dev->regs[0x12] = 0xff;
dev->regs[0x13] = 0x3e;
dev->regs[0x16] = 0xff;
dev->regs[0x17] = 0x3e;
dev->regs[0x1d] = 0x22;
dev->regs[0x22] = 0x01;
dev->regs[0x23] = 0xff;
dev->regs[0x25] = 0xfe;
dev->regs[0x34] = 0x10;
dev->regs[0x39] = 0x02;
dev->regs[0x40] = 0x80;
dev->regs[0x44] = 0x8c;
dev->regs[0x45] = 0x76;
dev->regs[0x50] = 0x20;
dev->regs[0x8b] = 0xff;
dev->regs[0x8c] = 0x3f;
dev->regs[0x8d] = 0x80;
dev->regs[0x8e] = 0x68;
dev->regs[0x93] = 0x01;
dev->regs[0x94] = 0x1e;
dev->regs[0xa3] = 0xcc;
dev->regs[0xa4] = 0x27;
dev->regs[0xa5] = 0x64;
dev->regs[0xb0] = 0x80;
dev->regs[0xb1] = 0x01;
dev->regs[0xb2] = 0x06;
dev->regs[0xd4] = 0x01;
dev->regs[0xd5] = 0x06;
dev->regs[0xd6] = 0x1b;
dev->regs[0xd7] = 0x10;
dev->regs[0xd8] = 0x7a;
dev->regs[0xda] = 0xa7;
dev->regs[0xe5] = 0x0f;
if (dev->sensor == SENSOR_TYPE_4400_BARE)
{
dev->regs[0x30] = 0x40; /* 0x00 */
dev->regs[0x31] = 0x80; /* 0x00 */
dev->regs[0x44] = 0x00; /* 0x8c */
dev->regs[0x45] = 0x00; /* 0x76 */
dev->regs[0x52] = 0x04; /* 0x00 */
dev->regs[0x69] = 0x01; /* 0x00 */
dev->regs[0x6a] = 0x10; /* 0x00 */
dev->regs[0x6e] = 0x08; /* 0x00 */
dev->regs[0x70] = 0x40; /* 0x00 */
dev->regs[0x71] = 0x08; /* 0x00 */
dev->regs[0x78] = 0x08; /* 0x00 */
dev->regs[0x79] = 0x11; /* 0x00 */
dev->regs[0x82] = 0x40; /* 0x00 */
dev->regs[0x83] = 0x30; /* 0x00 */
dev->regs[0x84] = 0x45; /* 0x00 */
dev->regs[0x87] = 0x02; /* 0x00 */
dev->regs[0x88] = 0x05; /* 0x00 */
dev->regs[0x8b] = 0x01; /* 0xff */
dev->regs[0x8c] = 0x80; /* 0x3f */
dev->regs[0x8d] = 0x04; /* 0x80 */
dev->regs[0x8e] = 0x10; /* 0x68 */
dev->regs[0x8f] = 0x01; /* 0x00 */
dev->regs[0x90] = 0x80; /* 0x00 */
}
break;
}
sanei_rts88xx_set_offset (dev->regs, 31, 31, 31);
sanei_rts88xx_set_gain (dev->regs, 10, 10, 10);
dev->regs[0] = dev->regs[0] & 0xef;
dev->regs[0x01] = 0x41;
dev->regs[0x0b] = 0x70;
dev->regs[0x0c] = 0x00;
dev->regs[0x0d] = 0x00;
dev->regs[0x0e] = 0x00;
dev->regs[0x0f] = 0x00;
dev->regs[0x12] = 0x00;
dev->regs[0x13] = 0x20;
dev->regs[0x14] = 0x00;
dev->regs[0x15] = 0x20;
dev->regs[0x16] = 0x00;
dev->regs[0x17] = 0x00;
dev->regs[0x18] = 0x00;
dev->regs[0x19] = 0x00;
dev->regs[0x1a] = 0x00;
dev->regs[0x1b] = 0x00;
dev->regs[0x1c] = 0x00;
dev->regs[0x1d] = 0x20;
dev->regs[0x1e] = 0x00;
dev->regs[0x1f] = 0x00;
/* LCD display */
dev->regs[0x20] = 0x3a;
dev->regs[0x21] = 0xf2;
dev->regs[0x22] = 0x00;
dev->regs[0x23] = 0x00;
dev->regs[0x24] = 0x00;
dev->regs[0x25] = 0x00;
dev->regs[0x26] = 0x00;
dev->regs[0x27] = 0x00;
dev->regs[0x28] = 0x00;
dev->regs[0x29] = 0x00;
dev->regs[0x2a] = 0x00;
dev->regs[0x2b] = 0x00;
dev->regs[0x2c] = 0x00;
dev->regs[0x2d] = 0x00;
dev->regs[0x2e] = 0x00;
dev->regs[0x2f] = 0x00;
dev->regs[0x30] = 0x00;
dev->regs[0x31] = 0x00;
dev->regs[0x32] = 0x00;
dev->regs[0x33] = 0x00;
dev->regs[0x34] = 0x10;
dev->regs[0x35] = 0x00;
dev->regs[0x36] = 0x07;
dev->regs[0x37] = 0x00;
dev->regs[0x38] = 0x00;
dev->regs[0x39] = 0x00;
dev->regs[0x3a] = 0x00;
dev->regs[0x3b] = 0x00;
dev->regs[0x3c] = 0x00;
dev->regs[0x3d] = 0x00;
dev->regs[0x3e] = 0x00;
dev->regs[0x3f] = 0x00;
dev->regs[0x40] = 0x20;
dev->regs[0x41] = 0x00;
dev->regs[0x42] = 0x00;
dev->regs[0x43] = 0x00;
dev->regs[0x44] = 0x8c;
dev->regs[0x45] = 0x76;
dev->regs[0x46] = 0x00;
dev->regs[0x47] = 0x00;
dev->regs[0x48] = 0x00;
dev->regs[0x49] = 0x00;
dev->regs[0x4a] = 0x00;
dev->regs[0x4b] = 0x00;
dev->regs[0x4c] = 0x00;
dev->regs[0x4d] = 0x00;
dev->regs[0x4e] = 0x00;
dev->regs[0x4f] = 0x00;
dev->regs[0x50] = 0x00;
dev->regs[0x51] = 0x00;
dev->regs[0x52] = 0x00;
dev->regs[0x53] = 0x00;
dev->regs[0x54] = 0x00;
dev->regs[0x55] = 0x00;
dev->regs[0x56] = 0x00;
dev->regs[0x57] = 0x00;
dev->regs[0x58] = 0x00;
dev->regs[0x59] = 0x00;
dev->regs[0x5a] = 0x00;
dev->regs[0x5b] = 0x00;
dev->regs[0x5c] = 0x00;
dev->regs[0x5d] = 0x00;
dev->regs[0x5e] = 0x00;
dev->regs[0x5f] = 0x00;
dev->regs[0x60] = 0x00;
dev->regs[0x61] = 0x00;
dev->regs[0x62] = 0x00;
dev->regs[0x63] = 0x00;
dev->regs[0x64] = 0x00;
dev->regs[0x65] = 0x00;
dev->regs[0x66] = 0x00;
dev->regs[0x67] = 0x00;
dev->regs[0x68] = 0x00;
dev->regs[0x69] = 0x00;
dev->regs[0x6a] = 0x00;
dev->regs[0x6b] = 0x00;
dev->regs[0x6c] = 0x00;
dev->regs[0x6d] = 0x00;
dev->regs[0x6e] = 0x00;
dev->regs[0x6f] = 0x00;
dev->regs[0x70] = 0x00;
dev->regs[0x71] = 0x00;
dev->regs[0x72] = 0x00;
dev->regs[0x73] = 0x00;
dev->regs[0x74] = 0x00;
dev->regs[0x75] = 0x00;
dev->regs[0x76] = 0x00;
dev->regs[0x77] = 0x00;
dev->regs[0x78] = 0x00;
dev->regs[0x79] = 0x00;
dev->regs[0x7a] = 0x00;
dev->regs[0x7b] = 0x00;
dev->regs[0x7c] = 0x00;
dev->regs[0x7d] = 0x00;
dev->regs[0x7e] = 0x00;
dev->regs[0x7f] = 0x00;
dev->regs[0x80] = 0x00;
dev->regs[0x81] = 0x00;
dev->regs[0x82] = 0x00;
dev->regs[0x83] = 0x00;
dev->regs[0x84] = 0x00;
dev->regs[0x85] = 0x00;
dev->regs[0x86] = 0x00;
dev->regs[0x87] = 0x00;
dev->regs[0x88] = 0x00;
dev->regs[0x89] = 0x00;
dev->regs[0x8a] = 0x00;
dev->regs[0x8b] = 0x00;
dev->regs[0x8c] = 0x00;
dev->regs[0x8d] = 0x80;
dev->regs[0x8e] = 0x68;
dev->regs[0x8f] = 0x00;
dev->regs[0x90] = 0x00;
dev->regs[0x91] = 0x00;
dev->regs[0x92] = 0x00;
dev->regs[0x93] = 0x02;
dev->regs[0x94] = 0x0e;
dev->regs[0x95] = 0x00;
dev->regs[0x96] = 0x00;
dev->regs[0x97] = 0x00;
dev->regs[0x98] = 0x00;
dev->regs[0x99] = 0x00;
dev->regs[0x9a] = 0x00;
dev->regs[0x9b] = 0x00;
dev->regs[0x9c] = 0x00;
dev->regs[0x9d] = 0x00;
dev->regs[0x9e] = 0x00;
dev->regs[0x9f] = 0x00;
dev->regs[0xa0] = 0x00;
dev->regs[0xa1] = 0x00;
dev->regs[0xa2] = 0x00;
dev->regs[0xa3] = 0xcc;
dev->regs[0xa4] = 0x27;
dev->regs[0xa5] = 0x64;
dev->regs[0xa6] = 0x00;
dev->regs[0xa7] = 0x00;
dev->regs[0xa8] = 0x00;
dev->regs[0xa9] = 0x00;
dev->regs[0xaa] = 0x00;
dev->regs[0xab] = 0x00;
dev->regs[0xac] = 0x00;
dev->regs[0xad] = 0x00;
dev->regs[0xae] = 0x00;
dev->regs[0xaf] = 0x00;
dev->regs[0xb0] = 0x00;
dev->regs[0xb1] = 0x00;
dev->regs[0xb2] = 0x02;
dev->regs[0xb4] = 0x00;
dev->regs[0xb5] = 0x00;
dev->regs[0xb6] = 0x00;
dev->regs[0xb7] = 0x00;
dev->regs[0xb8] = 0x00;
dev->regs[0xb9] = 0x00;
dev->regs[0xba] = 0x00;
dev->regs[0xbb] = 0x00;
dev->regs[0xbc] = 0x00;
dev->regs[0xbd] = 0x00;
dev->regs[0xbe] = 0x00;
dev->regs[0xbf] = 0x00;
dev->regs[0xc0] = 0x00;
dev->regs[0xc1] = 0x00;
dev->regs[0xc2] = 0x00;
dev->regs[0xc3] = 0x00;
dev->regs[0xc4] = 0x00;
dev->regs[0xc5] = 0x00;
dev->regs[0xc6] = 0x00;
dev->regs[0xc7] = 0x00;
dev->regs[0xc8] = 0x00;
dev->regs[0xc9] = 0x00;
dev->regs[0xca] = 0x00;
dev->regs[0xcb] = 0x00;
dev->regs[0xcc] = 0x00;
dev->regs[0xcd] = 0x00;
dev->regs[0xce] = 0x00;
dev->regs[0xcf] = 0x00;
dev->regs[0xd0] = 0x00;
dev->regs[0xd1] = 0x00;
dev->regs[0xd2] = 0x00;
dev->regs[0xd3] = 0x00;
dev->regs[0xd4] = 0x00;
dev->regs[0xd5] = 0x86;
dev->regs[0xd6] = 0x1b;
dev->regs[0xd7] = 0x00;
dev->regs[0xd8] = 0xff;
dev->regs[0xd9] = 0x00;
dev->regs[0xda] = 0x27;
dev->regs[0xdb] = 0x00;
dev->regs[0xdc] = 0x00;
dev->regs[0xdd] = 0x00;
dev->regs[0xde] = 0x00;
dev->regs[0xdf] = 0x00;
dev->regs[0xe0] = 0x00;
dev->regs[0xe1] = 0x00;
dev->regs[0xe2] = 0x01;
dev->regs[0xe3] = 0x00;
dev->regs[0xe4] = 0x00;
/*dev->regs[0xe5] = 0x14;
dev->regs[0xe6] = 0x00; 14=20 */
SET_DOUBLE (dev->regs, EXPOSURE_REG, 20);
dev->regs[0xe7] = 0x00;
dev->regs[0xe8] = 0x00;
dev->regs[0xe9] = 0x00;
dev->regs[0xea] = 0x00;
dev->regs[0xeb] = 0x00;
dev->regs[0xec] = 0x00;
dev->regs[0xed] = 0x00;
dev->regs[0xee] = 0x00;
dev->regs[0xef] = 0x00;
dev->regs[0xf0] = 0x00;
dev->regs[0xf1] = 0x00;
dev->regs[0xf2] = 0x00;
dev->regs[0xf3] = 0x00;
rts8891_write_all (dev->devnum, dev->regs, dev->reg_count);
/* now read button status read_reg(0x1a,2)=0x00 0x00 */
sanei_rts88xx_read_regs (dev->devnum, 0x1a, dev->regs + 0x1a, 2);
@ -4321,10 +4444,20 @@ detect_device (struct Rts8891_Device *dev)
{
sprintf (message, "init_device: initial register settings: ");
for (i = 0; i < dev->reg_count; i++)
sprintf (message + strlen (message), "0x%02x", dev->regs[i]);
sprintf (message + strlen (message), "0x%02x ", dev->regs[i]);
sprintf (message + strlen (message), "\n");
DBG (DBG_io2, message);
}
/* initial sensor guess */
val = dev->regs[0x44] + 256 * dev->regs[0x45];
DBG (DBG_io, "detect_device: R44/45=0x%04x\n", val);
if (dev->sensor == SENSOR_TYPE_4400 && val == 0x00)
{
dev->sensor = SENSOR_TYPE_4400_BARE;
DBG (DBG_info, "detect_device: changing to SENSOR_TYPE_4400_BARE\n");
}
DBG (DBG_io, "detect_device: status=0x%02x 0x%02x\n", dev->regs[0x10],
dev->regs[0x11]);
DBG (DBG_io, "detect_device: lamp status=0x%02x\n", dev->regs[0x8e]);
@ -4356,12 +4489,12 @@ dark_calibration (struct Rts8891_Device *dev, int mode, int light)
DBG (DBG_proc, "dark_calibration: start\n");
/* set up sensor specific bottom values */
if(dev->sensor == SENSOR_TYPE_4400)
{
bro = 128;
bgo = 128;
bbo = 128;
}
if (dev->sensor == SENSOR_TYPE_4400)
{
bro = 128;
bgo = 128;
bbo = 128;
}
/* set up starting values */
sanei_rts88xx_set_gain (dev->regs, 0, 0, 0);
@ -4460,6 +4593,26 @@ dark_calibration (struct Rts8891_Device *dev, int mode, int light)
dev->regs[0xef] = 0x02; /* 0x03 */
dev->regs[0xf0] = 0xa8; /* 0x70 */
}
if (dev->sensor == SENSOR_TYPE_4400_BARE)
{
dev->regs[0x13] = 0x39; /* 0x20 */
dev->regs[0x14] = 0xf0; /* 0xf8 */
dev->regs[0x15] = 0x29; /* 0x28 */
dev->regs[0x16] = 0x0f; /* 0x07 */
dev->regs[0x17] = 0x10; /* 0x00 */
dev->regs[0x23] = 0x00; /* 0xff */
dev->regs[0x35] = 0x48; /* 0x45 */
dev->regs[0x39] = 0x00; /* 0x02 */
dev->regs[0xda] = 0xa7; /* 0xa0 */
dev->regs[0xe2] = 0x0f; /* 0x1f */
SET_DOUBLE (dev->regs, EXPOSURE_REG, 82);
dev->regs[0xe7] = 0x0e; /* 0x75 */
dev->regs[0xe9] = 0x0a; /* 0x0b */
dev->regs[0xea] = 0xc2; /* 0x54 */
dev->regs[0xed] = 0xf6; /* 0xb8 */
dev->regs[0xef] = 0x02; /* 0x03 */
dev->regs[0xf0] = 0xa8; /* 0x70 */
}
/* we loop scanning a 637 (1911 bytes) pixels wide area in color mode
* until each black average reaches the desired value */
@ -4714,6 +4867,26 @@ gain_calibration (struct Rts8891_Device *dev, int mode, int light)
dev->regs[0xef] = 0x02; /* 0x03 */
dev->regs[0xf0] = 0xa8; /* 0x70 */
}
if (dev->sensor == SENSOR_TYPE_4400_BARE)
{
dev->regs[0x13] = 0x39; /* 0x20 */
dev->regs[0x14] = 0xf0; /* 0xf8 */
dev->regs[0x15] = 0x29; /* 0x28 */
dev->regs[0x16] = 0x0f; /* 0x07 */
dev->regs[0x17] = 0x10; /* 0x00 */
dev->regs[0x23] = 0x00; /* 0xff */
dev->regs[0x35] = 0x48; /* 0x45 */
dev->regs[0x39] = 0x00; /* 0x02 */
dev->regs[0xe2] = 0x0f; /* 0x1f */
SET_DOUBLE (dev->regs, EXPOSURE_REG, 82);
dev->regs[0xe7] = 0x0e; /* 0x75 */
dev->regs[0xe9] = 0x0a; /* 0x0b */
dev->regs[0xea] = 0xc2; /* 0x54 */
dev->regs[0xed] = 0xf6; /* 0xb8 */
dev->regs[0xef] = 0x02; /* 0x03 */
dev->regs[0xf0] = 0xa8; /* 0x70 */
}
/* we loop scanning a 637 (1911 bytes) pixels wide area in color mode until each white average
* reaches the desired value, doing a dichotomy */
@ -5009,6 +5182,25 @@ offset_calibration (struct Rts8891_Device *dev, int mode, int light)
dev->regs[0xef] = 0x02; /* 0x03 */
dev->regs[0xf0] = 0xa8; /* 0x70 */
}
if (dev->sensor == SENSOR_TYPE_4400_BARE)
{
dev->regs[0x13] = 0x39; /* 0x20 */
dev->regs[0x14] = 0xf0; /* 0xf8 */
dev->regs[0x15] = 0x29; /* 0x28 */
dev->regs[0x16] = 0x0f; /* 0x07 */
dev->regs[0x17] = 0x10; /* 0x00 */
dev->regs[0x23] = 0x00; /* 0xff */
dev->regs[0x35] = 0x48; /* 0x45 */
dev->regs[0x39] = 0x00; /* 0x02 */
dev->regs[0xe2] = 0x0f; /* 0x1f */
SET_DOUBLE (dev->regs, EXPOSURE_REG, 82); /* 2*40+2 */
dev->regs[0xe7] = 0x0e; /* 0x75 */
dev->regs[0xe9] = 0x0a; /* 0x0b */
dev->regs[0xea] = 0xc2; /* 0x54 */
dev->regs[0xed] = 0xf6; /* 0xb8 */
dev->regs[0xef] = 0x02; /* 0x03 */
dev->regs[0xf0] = 0xa8; /* 0x70 */
}
/* we loop scanning a 637 (1911 bytes) pixels wide area in color mode until each black average
* reaches the desired value */
@ -5230,6 +5422,19 @@ shading_calibration (struct Rts8891_Device *dev, SANE_Bool color, int mode,
dev->regs[0xe6] = 0x01; 1bb =443 */
SET_DOUBLE (dev->regs, EXPOSURE_REG, 443); /* 221*2+1 */
}
if (dev->sensor == SENSOR_TYPE_4400_BARE)
{
dev->regs[0x13] = 0x39; /* 0x20 */
dev->regs[0x14] = 0xf0; /* 0xf8 */
dev->regs[0x15] = 0x29; /* 0x28 */
dev->regs[0x16] = 0x0f; /* 0x07 */
dev->regs[0x17] = 0x10; /* 0x00 */
dev->regs[0x23] = 0x00; /* 0xff */
dev->regs[0x36] = 0x29; /* 0x2c */
dev->regs[0x39] = 0x00; /* 0x02 */
dev->regs[0xe2] = 0x02; /* 0x05 */
SET_DOUBLE (dev->regs, EXPOSURE_REG, 443); /* 221*2+1 */
}
break;
case 150:
@ -5237,7 +5442,7 @@ shading_calibration (struct Rts8891_Device *dev, SANE_Bool color, int mode,
if (dev->sensor == SENSOR_TYPE_XPA)
{
dev->regs[0x80] = 0x2b;
dev->regs[0x81] = 0x02; /* 22b=555 */
dev->regs[0x81] = 0x02; /* 22b=555 */
dev->regs[0x82] = 0x2c;
dev->regs[0x83] = 0x02; /* 22c=556 */
dev->regs[0x85] = 0x18;
@ -5245,7 +5450,7 @@ shading_calibration (struct Rts8891_Device *dev, SANE_Bool color, int mode,
dev->regs[0x87] = 0x30;
dev->regs[0x88] = 0x30;
dev->regs[0x89] = 0x2d;
dev->regs[0x8a] = 0x02; /* 22d=557=3*150+107 */
dev->regs[0x8a] = 0x02; /* 22d=557=3*150+107 */
dev->regs[0x8d] = 0xef;
dev->regs[0xc0] = 0x00;
dev->regs[0xc1] = 0x8e;
@ -5275,7 +5480,7 @@ shading_calibration (struct Rts8891_Device *dev, SANE_Bool color, int mode,
{
dev->regs[0x80] = 0x2e;
dev->regs[0x81] = 0x01; /* 12e=302 */
dev->regs[0x82] = 0x2f;
dev->regs[0x82] = 0x2f;
dev->regs[0x83] = 0x01; /* 12f */
dev->regs[0x85] = 0x8c;
dev->regs[0x86] = 0x10;
@ -5304,6 +5509,43 @@ shading_calibration (struct Rts8891_Device *dev, SANE_Bool color, int mode,
/* dev->regs[0xe5] = 0xe4; */
SET_DOUBLE (dev->regs, EXPOSURE_REG, 228);
}
if (dev->sensor == SENSOR_TYPE_4400_BARE)
{
dev->regs[0x13] = 0x39; /* 0x20 */
dev->regs[0x14] = 0xf0; /* 0xf8 */
dev->regs[0x15] = 0x29; /* 0x28 */
dev->regs[0x16] = 0x0f; /* 0x07 */
dev->regs[0x17] = 0x10; /* 0x00 */
dev->regs[0x23] = 0x00; /* 0xff */
dev->regs[0x36] = 0x29; /* 0x2c */
dev->regs[0x39] = 0x00; /* 0x02 */
dev->regs[0x80] = 0xb0; /* 0x32 */
dev->regs[0x82] = 0xb1; /* 0x33 */
dev->regs[0x85] = 0x46; /* 0x00 */
dev->regs[0x86] = 0x0b; /* 0x06 */
dev->regs[0x87] = 0x8c; /* 0x00 */
dev->regs[0x88] = 0x10; /* 0x06 */
dev->regs[0x89] = 0xb2; /* 0x34 */
dev->regs[0x8d] = 0x3b; /* 0x00 */
dev->regs[0xc0] = 0xff; /* 0x06 */
dev->regs[0xc1] = 0x0f; /* 0xe6 */
dev->regs[0xc2] = 0x00; /* 0x67 */
dev->regs[0xc9] = 0x00; /* 0x07 */
dev->regs[0xca] = 0x0e; /* 0x00 */
dev->regs[0xcb] = 0x00; /* 0xfe */
dev->regs[0xcc] = 0x00; /* 0xf9 */
dev->regs[0xcd] = 0xf0; /* 0x19 */
dev->regs[0xce] = 0xff; /* 0x98 */
dev->regs[0xcf] = 0xf5; /* 0xe8 */
dev->regs[0xd0] = 0xf7; /* 0xea */
dev->regs[0xd1] = 0xea; /* 0xf3 */
dev->regs[0xd2] = 0x0b; /* 0x14 */
dev->regs[0xd3] = 0x17; /* 0x02 */
dev->regs[0xd4] = 0x01; /* 0x04 */
dev->regs[0xe2] = 0x02; /* 0x05 */
/* regs[0xe5] = 0x93; regs[0xe6] = 0x03; */
SET_DOUBLE (dev->regs, EXPOSURE_REG, 915); /* 221*2+1 */
}
break;
case 300:
@ -5901,6 +6143,7 @@ write_scan_registers (struct Rts8891_Session *session)
switch (dev->sensor)
{
case SENSOR_TYPE_4400:
case SENSOR_TYPE_4400_BARE:
status1 = 0x10;
status2 = 0x2a;
break;
@ -6221,6 +6464,43 @@ write_scan_registers (struct Rts8891_Session *session)
dev->regs[0xef] = 0x02; /* 0x03 */
dev->regs[0xf0] = 0xa8; /* 0x72 */
}
if (dev->sensor == SENSOR_TYPE_4400_BARE)
{
dev->regs[0x13] = 0x39; /* 0x20 */
dev->regs[0x14] = 0xf0; /* 0xf8 */
dev->regs[0x15] = 0x29; /* 0x28 */
dev->regs[0x16] = 0x00; /* 0x07 */
dev->regs[0x17] = 0x10; /* 0x00 */
dev->regs[0x23] = 0x00; /* 0xff */
dev->regs[0x35] = 0x47; /* 0x0e */
dev->regs[0x36] = 0x29; /* 0x2c */
dev->regs[0x39] = 0x00; /* 0x02 */
dev->regs[0x3a] = 0x43; /* 0x0e */
dev->regs[0x40] = 0x2c; /* 0x20 */
dev->regs[0x80] = 0xaf; /* 0x32 */
dev->regs[0x82] = 0xb0; /* 0x33 */
dev->regs[0x85] = 0x46; /* 0x00 */
dev->regs[0x86] = 0x0b; /* 0x06 */
dev->regs[0x87] = 0x8c; /* 0x00 */
dev->regs[0x88] = 0x10; /* 0x06 */
dev->regs[0x89] = 0xb1; /* 0x34 */
dev->regs[0x8d] = 0x3b; /* 0x00 */
dev->regs[0x90] = 0x18; /* 0x1c */
dev->regs[0xe2] = 0x07; /* 0x05 */
dev->regs[0xe3] = 0x84; /* 0x00 */
dev->regs[0xe4] = 0x03; /* 0x00 */
dev->regs[0xe5] = 0xa5; /* 0xdd */
dev->regs[0xe7] = 0x0e; /* 0x00 */
dev->regs[0xe8] = 0x01; /* 0x00 */
dev->regs[0xe9] = 0x0a; /* 0x00 */
dev->regs[0xea] = 0xc2; /* 0x00 */
dev->regs[0xeb] = 0x01; /* 0x00 */
dev->regs[0xec] = 0x04; /* 0x00 */
dev->regs[0xed] = 0xf6; /* 0x00 */
dev->regs[0xef] = 0x02; /* 0x00 */
dev->regs[0xf0] = 0xa8; /* 0x00 */
dev->regs[0xf2] = 0x01; /* 0x00 */
}
switch (dev->xdpi)
{
case 75:
@ -6449,15 +6729,15 @@ write_scan_registers (struct Rts8891_Session *session)
dev->regs[0x73] = 0x15;
dev->regs[0x74] = 0x62;
dev->regs[0x80] = 0x25; /* 425=1061 */
dev->regs[0x80] = 0x25; /* 425=1061 */
dev->regs[0x81] = 0x04;
dev->regs[0x82] = 0x26; /* 426=1062 */
dev->regs[0x82] = 0x26; /* 426=1062 */
dev->regs[0x83] = 0x04;
dev->regs[0x85] = 0x30;
dev->regs[0x86] = 0x30;
dev->regs[0x87] = 0x60;
dev->regs[0x88] = 0x5a;
dev->regs[0x89] = 0x27; /* 427=1063 */
dev->regs[0x89] = 0x27; /* 427=1063 */
dev->regs[0x8a] = 0x04;
dev->regs[0x8d] = 0xde;
@ -6506,15 +6786,15 @@ write_scan_registers (struct Rts8891_Session *session)
dev->regs[0x3a] = 0x1b;
dev->regs[0x40] = 0xac;
dev->regs[0x80] = 0x1a;
dev->regs[0x81] = 0x08; /* 81a=2074 */
dev->regs[0x81] = 0x08; /* 81a=2074 */
dev->regs[0x82] = 0x1b;
dev->regs[0x83] = 0x08; /* 81b=2075 */
dev->regs[0x83] = 0x08; /* 81b=2075 */
dev->regs[0x85] = 0x60;
dev->regs[0x86] = 0x5a;
dev->regs[0x87] = 0xc0;
dev->regs[0x88] = 0xae;
dev->regs[0x89] = 0x1c;
dev->regs[0x8a] = 0x08; /* 81c=2076 */
dev->regs[0x8a] = 0x08; /* 81c=2076 */
dev->regs[0x8d] = 0xbd; /* about twice the 600 dpi values */
dev->regs[0x8e] = 0x63; /* low nibble of 8e and 8d are proportional to
@ -6612,8 +6892,16 @@ park_head (struct Rts8891_Device *dev)
sanei_rts88xx_write_reg (dev->devnum, 0x23, &reg);
/* TODO create write_double_reg */
dev->regs[0x16] = 0x07;
dev->regs[0x17] = 0x00;
if (dev->sensor != SENSOR_TYPE_4400)
{
dev->regs[0x16] = 0x07;
dev->regs[0x17] = 0x00;
}
else
{
dev->regs[0x16] = 0x0f;
dev->regs[0x17] = 0x10;
}
sanei_rts88xx_write_regs (dev->devnum, 0x16, dev->regs + 0x16, 2);
reg = 0x8d;

Wyświetl plik

@ -57,7 +57,7 @@
#endif
#include "rts8891_low.h"
#define RTS8891_BUILD 5
#define RTS8891_BUILD 6
#define RTS8891_MAX_REGISTERS 244
/* init rts8891 library */
@ -330,7 +330,7 @@ rts8891_data_format (SANE_Int dpi)
}
/**
* set up default values for a 75xdpy, 150 ydpi scan
* set up default values for a 75xdpi, 150 ydpi scan
*/
static void
rts8891_set_default_regs (SANE_Byte * scanner_regs)
@ -369,19 +369,27 @@ rts8891_set_default_regs (SANE_Byte * scanner_regs)
}
static SANE_Status
rts8891_move (struct Rts8891_Device *device, SANE_Byte * regs, SANE_Int distance,
SANE_Bool forward)
rts8891_move (struct Rts8891_Device *device, SANE_Byte * regs,
SANE_Int distance, SANE_Bool forward)
{
SANE_Status status = SANE_STATUS_GOOD;
DBG (DBG_proc, "rts8891_move: start\n");
DBG (DBG_io, "rts8891_move: %d lines %s\n", distance,
forward == SANE_TRUE ? "forward" : "backward");
DBG (DBG_io, "rts8891_move: %d lines %s, sensor=%d\n", distance,
forward == SANE_TRUE ? "forward" : "backward",device->sensor);
/* prepare scan */
rts8891_set_default_regs (regs);
regs[0x10] = 0x20;
regs[0x11] = 0x28;
if (device->sensor != SENSOR_TYPE_4400 && device->sensor != SENSOR_TYPE_4400_BARE)
{
regs[0x10] = 0x20;
regs[0x11] = 0x28;
}
else
{
regs[0x10] = 0x10;
regs[0x11] = 0x2a;
}
regs[0x32] = 0x80;
regs[0x33] = 0x81;
@ -439,10 +447,8 @@ rts8891_move (struct Rts8891_Device *device, SANE_Byte * regs, SANE_Int distance
regs[0xe9] = 0x02;
/* hp4400 sensor */
if (device->sensor == SENSOR_TYPE_4400)
if (device->sensor == SENSOR_TYPE_4400 || device->sensor == SENSOR_TYPE_4400_BARE)
{
device->regs[0x10] = 0x10; /* 0x20 */
device->regs[0x11] = 0x2a; /* 0x28 */
device->regs[0x13] = 0x39; /* 0x20 */
device->regs[0x14] = 0xf0; /* 0xf8 */
device->regs[0x15] = 0x29; /* 0x28 */
@ -459,7 +465,6 @@ rts8891_move (struct Rts8891_Device *device, SANE_Byte * regs, SANE_Int distance
device->regs[0xe6] = 0x01; /* 0x00 */
}
/* disable CCD */
regs[0] = 0xf5;

Wyświetl plik

@ -73,7 +73,8 @@
#define SENSOR_TYPE_BARE 0 /* sensor for hp4470 sold bare */
#define SENSOR_TYPE_XPA 1 /* sensor for hp4470 sold with XPA */
#define SENSOR_TYPE_4400 2 /* sensor for hp4400 */
#define SENSOR_TYPE_4400 2 /* sensor for hp4400 */
#define SENSOR_TYPE_4400_BARE 3 /* sensor for hp4400 */
/* Forward typedefs */
typedef struct Rts8891_Device Rts8891_Device;