[sane-devel] genesys GL841

Philipp Schmid Philipp8288@web.de
Wed, 27 Apr 2005 20:50:29 +0200

This is a multi-part message in MIME format.
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit


Stef, I think you are absolutely right with your diagnostic that the 
genesys driver (written for gl646) fails with gl841 because the 
registers of the gl841 are different to the regs from gl646.

So I've shortly compared the gl841 with the gl646. The result is in the 
attached file.

As far as I am concerned, I think we mainly have to adapt the functions 
handling the scanner controler registers (e.g. genesys_init_registers). 
I think we can use the whole file genesys.c and the register/memory 
write/read functions for a gl841 driver, but I don't have the overview 
to decide this.

As I don't know the best way to support the gl841 controller without the 
development of parts, that are equal to gl646, I'd be glad to get some 
suggestions on this subject.  

Thanks for your suggestions


Content-Type: text/plain;
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;

This is a comparison of between the scanner controllers GL841 and GL646.
The bases of this comparision are the datasheets of this controllers.
(http://www.genesyslogic.com/econtents/product02.asp?SN=47&minicidx=3&lastcidx=18 and http://www.genesyslogic.com/econtents/product02.asp?SN=48&minicidx=3&lastcidx=18)

Attention: This comparison isn't complete at all !  

analogue frontend:

GL646 has a built-in 16-bit AFE. GL841 needs an external AFE. In lide50, it
is reported to be WM8199CDS (see http://www.wolfsonmicro.com/products/digital_imaging/WM8199/)

PC interface:

GL646 has a built-in USB 1.1 interface. Optional there is an extern USB 2.0 or
IEEE 1394 interface controller.
The only interface in the GL841 is the built-in USB 2.0 controller.


view of GL 841:

0x01	Bit 4: 		nothing 	instead of	FASTMOD
	Bit 3: 		M16DRAM 	instead of	COMPENB
0x02	Bit 2: 		HOMENEG 
	Bit 1: 		LONGCURV	instead of 	STEPSEL[1:0] 
0x03	Bit 7: 		LAMPDOG		instead of	TG3
	Bit 4-0:	LAMPTIM[3:0]	instead of	LAMPDOG, LAMPTIM[2:0]
0x04	Bit 5-4:	AFEMOD[1:0]	instead of	ADTYPE[1:0]
0x05	Bit 5-4:	MTLLAMP[1:0]	instead of	GMMITYPE[1:0]
	Bit 2:		nothing		instead of	LEDADD
	Bit 1-0:	MTLBASE[1:0]	instead of	BASESEL[1:0]
0x06	Bit 7-5:	SCANMOD[2:0]	instead of	nothing
0x07	Bit 3:		SRAMSEL		instead of	nothing
	Bit 2:		FASTDMA		instead of	nothing
0x08	Bit 6:		DECFLAG		instead of	nothing
	Bit 5:		GMMFFR		instead of	nothing
	Bit 4: 		GMMFFG
	Bit 3:		GMMFFB
	Bit 2:		GMMZR
	Bit 1:		GMMZG
	Bit 0:		GMMZB		instead of	RSH[4:0]
0x09	Bit 7-6:	MCNTSET[1:0]	instead of	nothing
	Bit 5-4:	CLKSET[1:0]
	Bit 3:		BACKSCAN	
	Bit 2:		ENHANCE
	Bit 1:		SHORTTG
	Bit 0:		NWAIT		instead of	RSL[4:0]
0x0A	Bit 0:		SRAMBUG		instead of	CPH[4:0] (Bit 4-0)
0x0B			nothing		instead of	CPL[4:0] (Bit 4-0)
0x0C	equal (nothing)
0x0D	Bit 7:		CLRLNCNT	instead of	nothing
0x0E	equal (nothing)
0x0F	equal (nothing)
0x10	equal (nothing)
0x11	equal (nothing)
0x12	equal (nothing)
0x13	equal (nothing)
0x14	equal (nothing)
0x15	equal (nothing)
0x16	Bit 6:		TOSHIBA		instead of 	SELINV
0x17	equal
0x18	equal
0x19	equal
0x1A	Bit 5:		MANUAL3
	Bit 4:		MANUAL1
	Bit 3:		CK4INV
	Bit 2:		CK3INV
	Bit 1:		LINECLP		instead of	CKH[4:0] (Bit 4-0)
0x1B			nothing		instead of	CKL[4:0] (Bit 4-0)
0x1C	Bit 7:		CK3MTGL		instead of	CK3SEL
	Bit 6:		CK3MTGL		instead of 	CK3INV
	Bit 5:		CK1MTGL
	Bit 4:		CKAREA
	Bit 3:		MTLWD
	Bit 2-0:	GGTIME[2:0]	instead of	TGSEL[5:0]	
0x1D	Bit 7:		CK4LOW		instead of	CKMANUAL
	Bit 6:		CK3LOW		instead of	TCDFAST
	Bit 5:		CK1LOW		instead of	DMYPIY
0x1E	equal
0x1F	equal
0x20	equal
0x21	equal
0x22	equal
0x23	equal
0x24	equal
0x25	Bit 3-0:	LINCNT[19:16]	instead of	LINCNT[17:16] (Bit 1-0)
0x26 	equal
0x27	equal
0x28	Bit 7-0		"GMMWRDATA"	instead of	LAMPPWM[8] (Bit 0)
0x29	equal
0x2A/B			RAMADDR[15:0]	instead of	RAMA[14:0]
	(This registers have different names, but I think, the meaning is the
	same exept for missing Bit 15 in gl646)
0x2C	equal
0x2D	equal
0x2E	equal
0x2F	equal
0x30	equal
0x31	equal
0x32	equal
0x33	equal
0x34	equal
0x35			MAXWD[19:16]	instead of	MAXWD[18:16]
0x36	equal
0x37	equal
0x38	equal
0x39	equal
0x3A			FEWRDATA[8]	instead of	FEWDATA[9:8]
0x3B	equal
0x3C	equal
0x3D			FEEDL[19:16]	instead of	FEEDL[17:16]
0x3E	equal
0x3F	equal
0x40	Bit 2:		HISPDFLG
	Bit 1:		MOTMFGL
	Bit 0:		DATAENB		instead of	empty register
0x41	Bit 0:		MOTORENB	instead of	MOTMFLG
0x42	equal
0x43	equal	
0x44	equal
0x45	equal
0x46	equal
0x47			FERDATA[8]	instead of	FERDATA[9:8]
0x48			FEDCNT[19:16]	instead of	FEDCNT[17:16]
0x49	equal
0x4A	equal
0x4B			SCANCNT[19:16]	instead of	SCANCNT[17:16]
0x4C	equal
0x4D	equal
0x4E			"GMMRDDATA"	instead of	LPERIODRD[15:8]
0x4F			empty register	instead of	LPERIODRD[7:0]
0x50	equal
0x51	equal
0x52	equal
0x53	equal
0x54	equal
0x55	equal
0x56	equal
0x57	equal
0x58	equal
0x59	equal
0x5A	Bit 1:		ADCLKINV	instead of	WMSEL
0x5B			GMMADDR[9:8]	instead of	CKFH[4:0]
0x5C			GMMADDR[7:0]	instead of	CKFL[4:0]
0x5D			HISPD[7:0]	instead of	CKSH[4:0]
0x5E	Bit 7-5:	DECSEL[2:0]	
	Bit 4-0:	STOPTIM[4:0]	instead of 	CKSL[4:0]
0x5F			FMOVDEC[7:0]	instead of	empty register

Z1MOD and Z2MOD are 21 bit big instead of 18 bit on the gl646. In the gl841, the Z1MOD[20:16] and ZIMOD[20:16] bits are next to the other Z1MOD and Z2MOD bits. 
In the gl646 Z1MOD[18:16] and Z2MOD[18:16] bits are behind the GPO bits in register
So the differences after 0x5F are enourmous. gl841 has 0x87 registers wheras
gl646 has only 0x71 registers. Please read the datasheets to get the detailed