[sane-devel] Adding 700F/5600F to the gensys backend

stef stef.dev at free.fr
Wed Jan 5 20:29:50 UTC 2011


Le Wednesday 05 January 2011 15:39:31 Stefan Larsson, vous avez écrit :
> 2011/1/4 stef <stef.dev at free.fr>
> 
> > Le Friday 31 December 2010 13:36:20 Stefan Larsson, vous avez écrit :
> > > Thank you for the information.
> > > 
> > > I have extracted some information but it is a bit unclear how to
> > > proceed.
> > 
> > I
> > 
> > > need to be able to isolate which portions are doing what. How do you
> > > usually perform the analysis in an efficient manner?  Since I am
> > > totally unfamiliar with the protocol I am not sure how to start
> > > finding the appropriate information.
> > > 
> > > All the files are present in the attached file. Check readme.txt for
> > > further information.
> > > 
> > > I also contacted Canon Sweden to ask for any technical information or a
> > > contact person which may simplify things. The support issue just got
> > > escalated to another department. We will see what that could give.
> > > 
> > > /Stefan
> > > 
> >         Hello,
> >        
> >        the decoded windows log seems to be missing the first URB when
> > 
> > scanner is
> > plugged. Important things happen then. You should logged it at least
> > once. It
> > helps determining the memory layout, the initial reigster set and the
> > starting
> > GPIO.
> > 
> >        Try to record it, then the first step you could try is to adjust
> >        the
> > 
> > registers for the memory layout. There is a table 'layouts' in
> > genesys_gl847.h
> > where you should tune registers d0-d2, e0-e7 based on the value you'll
> > find in
> > the decoded log.
> > 
> >        The next step would be the GPIO, the registers to look are used in
> > 
> > gl847_init_pio(), have special care for REG6C occurences.
> > 
> > Regards,
> > 
> >         Stef
> 
> Ok, I have been able to get some initial very short "buzz"-sound out of the
> scanner now, which means it is responding to the initial register
> initialization. The execution is ending with the log below (I guess that
> the problem is with the unsupported frontend type 0):
> 
> ...
> [genesys_gl847] gl847_init_memory_layout completed
> [genesys_low] sanei_genesys_write_gl847_register (0xf8, 0x01) completed
> [genesys_gl847] gl847_cold_boot completed
> [genesys_gl847] gl847_set_fe (init)
> [genesys_low] sanei_genesys_read_gl847_register(0x04)=0x20
> [genesys_gl847] gl847_set_fe(): unsupported frontend type 0
> [genesys_gl847] gl847_set_fe completed
> scanimage: open of device genesys:libusb:001:003 failed: Operation not
> supported
> [genesys] sane_exit: start
> [genesys] sane_exit: exit
> 
> The changes so far are attached in the diff-file. I am not sure how such
> changes are to be incorporated in the code. There needs to be some kind of
> adaptability such as for the memory mapping.
> 
> I was also unable to find any values for 0xd1 and 0xd2.
> 
> Regarding the GPIO i am unsure how to interpret the rules in
> gl847_init_gpio() and what I am seeing in the logs. I guess I have to
> modify those rules to comply with what is seen below:
> 
> genesys_read_register(0x6c)=0x80
> genesys_write_register(0x6c,0x80)
> genesys_read_register(0x6c)=0x80
> genesys_write_register(0x6c,0x80)
> 
> genesys_read_register(0x6c)=0x80
> genesys_write_register(0x6c,0x81)
> genesys_read_register(0x6c)=0x81
> genesys_write_register(0x6c,0xc1)
> genesys_read_register(0x6c)=0xc1
> genesys_write_register(0x6c,0xd1)
> 
> genesys_read_register(0x6c)=0xd1
> genesys_write_register(0x6c,0xd1)
> genesys_read_register(0x6c)=0xd1
> genesys_read_register(0x6c)=0xd1
> genesys_write_register(0x6c,0xf1)
> genesys_read_register(0x6c)=0xf1
> 
> genesys_read_register(0x6c)=0xf1
> genesys_write_register(0x6c,0xf1)
> genesys_read_register(0x6c)=0xf1
> genesys_write_register(0x6c,0xf1)
> 
> genesys_read_register(0x6c)=0xf1
> genesys_write_register(0x6c,0xf1)
> genesys_read_register(0x6c)=0xf1
> genesys_write_register(0x6c,0xf1)
> 
> /Stefan

	Hello,

	for setting the fe, Wolfson type aren't supported. You'll have to copy 
the related part of gl841_set_fe to gl847_set_fe.
	For the d1, d2 registers, this isn't surprising since they are used for 
CIS scanners while the 700F is a CCD one. So value doesn't matter.
	For the 6C register, the value just before scan is the more important 
since some of its bits drive motor current.
	For the code, the memory layout is indeed driven by capability, there is 
a search in a table defined in genesys_gl847.h, please use it. In register 
init, don't replace existing values, but add them with code behind a 'if'. For 
instance register 01 should be set like this:
	if(dev->model->is_cis)
	  {
	    SETREG (0x01, 0x82);
	  }
	else
	  {
	    SETREG (0x01, 0x42);
	  }
      	 look at gl843_init_registers() has other examples on how handling 
different models.    
	Also, don't init register A7,A6 they are driven by gpio. Tune gpio 
setting code instead. In init register, don't do SETREG() on registers they 
weren't set before. Other part of the code will take care of them.

	I think it would be a good idea to clone the git tree, create your own 
branch locally so that you can track your own developments in it and 
eventually send a nice diff.

Regards,
	Stef



More information about the sane-devel mailing list