[sane-devel] Backend for plustek Opticbook 3600

stef stef.dev at free.fr
Fri Jan 8 05:36:39 UTC 2010


Le vendredi 8 janvier 2010 04:38:07 Chris Berry, vous avez écrit :
> Thanks for the quick reply stef, hope you had a good christmas/new year :).
> 
> I have made changes to the GPIO settings as appropriate (i.e. matched
> the settings to what I believe is correct from register writes) but I
> could only find values for 0x6b, 0x6d, 0x6e and 0x6f. I couldn't find a
> write to 0x6c so I assumed that to be 0x00 and also I am unsure in which
> file the 0x6b register is set. Is 0x6b set in genesys_devices.c? If so
> which section?

	Search for the 0x6B and reg_0x6b strings in genesys_gl841.c. There occurence 
of them in gl841_init_registers() and gl841_save_power().

> 
> Another concern is that in the logs there are no URB's of the form:
> 
> control  0x40 0x0c 0x89 0x00 len  (Output enable)
> control  0xc0 0x0c 0x8a 0x00 len (read)
> control  0x40 0x0c 0x8b 0x00 len (write)

> 
> I checked these after running the initial perl scripts and before the
> awk scripts you forwarded to me. Is it maybe possible that the control
> URBs for this have happened at a time that hasn't been caught by the
> logs or is it more likely that there is a different value being used as
> opposed to 0x89, 0x8a and 0x8b?
> 

	GPIO are also available as 'regular' registers. You may write to them without 
these control values. Look in the decoded logs for this kind of pattern:
...
genesys_write_register(0x6c,0x1c)
sanei_genesys_read_register(0x6c)=0x1c
R6c=0x1c	TGTIME=0^2 periods, Z1MOD[18:16]=3, Z2MOD[18:16]=4, 
genesys_write_register(0x6c,0x1e)
genesys_write_register(0x6c,0x3e)
genesys_write_register(0x6e,0xfb)
genesys_write_register(0x6c,0x3f)
genesys_write_register(0x6b,0x03)
genesys_write_register(0x6c,0x3f)
sanei_genesys_read_register(0x6c)=0x3f
R6c=0x3f	TGTIME=0^2 periods, Z1MOD[18:16]=7, Z2MOD[18:16]=7, 
genesys_write_register(0x01,0x80)
genesys_write_register(0x02,0x00)
....


> Would incorrect GPO affect the light being on and off? I know for sure
> that the value for 0x6b from the logs is different to the one set by the
> genesys driver at the moment so I think maybe correcting this could be a
> big break through for this project :)
> 
	A different value can definitely get you black scans. It happened to me for 
the DS685. I got not data until I set the correct value for 0x6b register in  
gl841_init_registers():

  if (dev->model->gpo_type == GPO_DP685) 
    {
      /* REG6B_GPO18 lights on green led */
      dev->reg[reg_0x6b].value |= REG6B_GPO17|REG6B_GPO18;
    }


Regards,
	Stef



More information about the sane-devel mailing list