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

Stefan Larsson lastsys at gmail.com
Thu Jan 6 18:43:32 UTC 2011


2011/1/5 stef <stef.dev at free.fr>

> 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
>

Hello again,

the 5600F is now giving more sound at startup and the lamp is
even flashing once. The startup writing of data is looking quite
good with some strange artifacts such as trying to write 0x80 to
register 0x05 but getting 0x40 all the time... (see comments in
attached SANE-log). I think discussions on implementation
details have to wait. My focus right now is to get the scanner
responding properly, the implementation can be corrected later.

I am unsuccessful at getting the motor running so far. Any hints
on what to try next would be appreciated.

I am showing you what I have tried so far in the attached file where
one SANE-log and one USB-log is present. There is also a git-diff
for the code so far.

I am currently getting stuck in a loop where the driver is waiting for
data:

[genesys_low] sanei_genesys_read_gl847_register(0x42)=0x00
[genesys_low] sanei_genesys_read_gl847_register(0x43)=0x00
[genesys_low] sanei_genesys_read_gl847_register(0x44)=0x00
[genesys_low] sanei_genesys_read_gl847_register(0x45)=0x00


I am also a bit confused by for example some changing registers:

I have created a CCD-entry for the 5600F-scanner where registers
0x52-0x5e are initialized according to the initial write.

genesys_write_register(0x52,0x0e)
genesys_write_register(0x53,0x00)
genesys_write_register(0x54,0x02)
genesys_write_register(0x55,0x04)
genesys_write_register(0x56,0x06)
genesys_write_register(0x57,0x08)
genesys_write_register(0x58,0x52)
genesys_write_register(0x59,0xe1)
genesys_write_register(0x5a,0x40)
genesys_write_register(0x5e,0x15)

Later in the log when trying to start the scan the following is
happening:

genesys_write_register(0x52,0x02)
genesys_write_register(0x53,0x04)
genesys_write_register(0x54,0x06)
genesys_write_register(0x55,0x08)
genesys_write_register(0x56,0x0a)
genesys_write_register(0x57,0x0c)
genesys_write_register(0x58,0x72)
genesys_write_register(0x59,0x5a)

Which are quite different...

/Stefan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20110106/b1d8551a/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 5600f_2.tgz
Type: application/x-gzip
Size: 23228 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20110106/b1d8551a/attachment-0001.bin>


More information about the sane-devel mailing list