<div class="gmail_quote">2011/1/5 stef <span dir="ltr">&lt;<a href="mailto:stef.dev@free.fr">stef.dev@free.fr</a>&gt;</span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Le Wednesday 05 January 2011 15:39:31 Stefan Larsson, vous avez écrit :<br>
<div><div></div><div class="h5">&gt; 2011/1/4 stef &lt;<a href="mailto:stef.dev@free.fr">stef.dev@free.fr</a>&gt;<br>
&gt;<br>
&gt; &gt; Le Friday 31 December 2010 13:36:20 Stefan Larsson, vous avez écrit :<br>
&gt; &gt; &gt; Thank you for the information.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; I have extracted some information but it is a bit unclear how to<br>
&gt; &gt; &gt; proceed.<br>
&gt; &gt;<br>
&gt; &gt; I<br>
&gt; &gt;<br>
&gt; &gt; &gt; need to be able to isolate which portions are doing what. How do you<br>
&gt; &gt; &gt; usually perform the analysis in an efficient manner?  Since I am<br>
&gt; &gt; &gt; totally unfamiliar with the protocol I am not sure how to start<br>
&gt; &gt; &gt; finding the appropriate information.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; All the files are present in the attached file. Check readme.txt for<br>
&gt; &gt; &gt; further information.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; I also contacted Canon Sweden to ask for any technical information or a<br>
&gt; &gt; &gt; contact person which may simplify things. The support issue just got<br>
&gt; &gt; &gt; escalated to another department. We will see what that could give.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; /Stefan<br>
&gt; &gt; &gt;<br>
&gt; &gt;         Hello,<br>
&gt; &gt;<br>
&gt; &gt;        the decoded windows log seems to be missing the first URB when<br>
&gt; &gt;<br>
&gt; &gt; scanner is<br>
&gt; &gt; plugged. Important things happen then. You should logged it at least<br>
&gt; &gt; once. It<br>
&gt; &gt; helps determining the memory layout, the initial reigster set and the<br>
&gt; &gt; starting<br>
&gt; &gt; GPIO.<br>
&gt; &gt;<br>
&gt; &gt;        Try to record it, then the first step you could try is to adjust<br>
&gt; &gt;        the<br>
&gt; &gt;<br>
&gt; &gt; registers for the memory layout. There is a table &#39;layouts&#39; in<br>
&gt; &gt; genesys_gl847.h<br>
&gt; &gt; where you should tune registers d0-d2, e0-e7 based on the value you&#39;ll<br>
&gt; &gt; find in<br>
&gt; &gt; the decoded log.<br>
&gt; &gt;<br>
&gt; &gt;        The next step would be the GPIO, the registers to look are used in<br>
&gt; &gt;<br>
&gt; &gt; gl847_init_pio(), have special care for REG6C occurences.<br>
&gt; &gt;<br>
&gt; &gt; Regards,<br>
&gt; &gt;<br>
&gt; &gt;         Stef<br>
&gt;<br>
&gt; Ok, I have been able to get some initial very short &quot;buzz&quot;-sound out of the<br>
&gt; scanner now, which means it is responding to the initial register<br>
&gt; initialization. The execution is ending with the log below (I guess that<br>
&gt; the problem is with the unsupported frontend type 0):<br>
&gt;<br>
&gt; ...<br>
&gt; [genesys_gl847] gl847_init_memory_layout completed<br>
&gt; [genesys_low] sanei_genesys_write_gl847_register (0xf8, 0x01) completed<br>
&gt; [genesys_gl847] gl847_cold_boot completed<br>
&gt; [genesys_gl847] gl847_set_fe (init)<br>
&gt; [genesys_low] sanei_genesys_read_gl847_register(0x04)=0x20<br>
&gt; [genesys_gl847] gl847_set_fe(): unsupported frontend type 0<br>
&gt; [genesys_gl847] gl847_set_fe completed<br>
&gt; scanimage: open of device genesys:libusb:001:003 failed: Operation not<br>
&gt; supported<br>
&gt; [genesys] sane_exit: start<br>
&gt; [genesys] sane_exit: exit<br>
&gt;<br>
&gt; The changes so far are attached in the diff-file. I am not sure how such<br>
&gt; changes are to be incorporated in the code. There needs to be some kind of<br>
&gt; adaptability such as for the memory mapping.<br>
&gt;<br>
&gt; I was also unable to find any values for 0xd1 and 0xd2.<br>
&gt;<br>
&gt; Regarding the GPIO i am unsure how to interpret the rules in<br>
&gt; gl847_init_gpio() and what I am seeing in the logs. I guess I have to<br>
&gt; modify those rules to comply with what is seen below:<br>
&gt;<br>
&gt; genesys_read_register(0x6c)=0x80<br>
&gt; genesys_write_register(0x6c,0x80)<br>
&gt; genesys_read_register(0x6c)=0x80<br>
&gt; genesys_write_register(0x6c,0x80)<br>
&gt;<br>
&gt; genesys_read_register(0x6c)=0x80<br>
&gt; genesys_write_register(0x6c,0x81)<br>
&gt; genesys_read_register(0x6c)=0x81<br>
&gt; genesys_write_register(0x6c,0xc1)<br>
&gt; genesys_read_register(0x6c)=0xc1<br>
&gt; genesys_write_register(0x6c,0xd1)<br>
&gt;<br>
&gt; genesys_read_register(0x6c)=0xd1<br>
&gt; genesys_write_register(0x6c,0xd1)<br>
&gt; genesys_read_register(0x6c)=0xd1<br>
&gt; genesys_read_register(0x6c)=0xd1<br>
&gt; genesys_write_register(0x6c,0xf1)<br>
&gt; genesys_read_register(0x6c)=0xf1<br>
&gt;<br>
&gt; genesys_read_register(0x6c)=0xf1<br>
&gt; genesys_write_register(0x6c,0xf1)<br>
&gt; genesys_read_register(0x6c)=0xf1<br>
&gt; genesys_write_register(0x6c,0xf1)<br>
&gt;<br>
&gt; genesys_read_register(0x6c)=0xf1<br>
&gt; genesys_write_register(0x6c,0xf1)<br>
&gt; genesys_read_register(0x6c)=0xf1<br>
&gt; genesys_write_register(0x6c,0xf1)<br>
&gt;<br>
&gt; /Stefan<br>
<br>
</div></div>        Hello,<br>
<br>
        for setting the fe, Wolfson type aren&#39;t supported. You&#39;ll have to copy<br>
the related part of gl841_set_fe to gl847_set_fe.<br>
        For the d1, d2 registers, this isn&#39;t surprising since they are used for<br>
CIS scanners while the 700F is a CCD one. So value doesn&#39;t matter.<br>
        For the 6C register, the value just before scan is the more important<br>
since some of its bits drive motor current.<br>
        For the code, the memory layout is indeed driven by capability, there is<br>
a search in a table defined in genesys_gl847.h, please use it. In register<br>
init, don&#39;t replace existing values, but add them with code behind a &#39;if&#39;. For<br>
instance register 01 should be set like this:<br>
        if(dev-&gt;model-&gt;is_cis)<br>
          {<br>
            SETREG (0x01, 0x82);<br>
          }<br>
        else<br>
          {<br>
            SETREG (0x01, 0x42);<br>
          }<br>
         look at gl843_init_registers() has other examples on how handling<br>
different models.<br>
        Also, don&#39;t init register A7,A6 they are driven by gpio. Tune gpio<br>
setting code instead. In init register, don&#39;t do SETREG() on registers they<br>
weren&#39;t set before. Other part of the code will take care of them.<br>
<br>
        I think it would be a good idea to clone the git tree, create your own<br>
branch locally so that you can track your own developments in it and<br>
eventually send a nice diff.<br>
<br>
Regards,<br>
<font color="#888888">        Stef<br>
</font></blockquote></div><br>Hello again,<br><br>the 5600F is now giving more sound at startup and the lamp is<br>even flashing once. The startup writing of data is looking quite<br>good with some strange artifacts such as trying to write 0x80 to<br>
register 0x05 but getting 0x40 all the time... (see comments in<br>attached SANE-log). I think discussions on implementation<br>details have to wait. My focus right now is to get the scanner<br>responding properly, the implementation can be corrected later.<br>
<br>I am unsuccessful at getting the motor running so far. Any hints<br>on what to try next would be appreciated.<br><br>I am showing you what I have tried so far in the attached file where<br>one SANE-log and one USB-log is present. There is also a git-diff<br>
for the code so far.<br><br>I am currently getting stuck in a loop where the driver is waiting for<br>data:<br><br>[genesys_low] sanei_genesys_read_gl847_register(0x42)=0x00<br>[genesys_low] sanei_genesys_read_gl847_register(0x43)=0x00<br>
[genesys_low] sanei_genesys_read_gl847_register(0x44)=0x00<br>[genesys_low] sanei_genesys_read_gl847_register(0x45)=0x00<br><br><br>I am also a bit confused by for example some changing registers:<br><br>I have created a CCD-entry for the 5600F-scanner where registers<br>
0x52-0x5e are initialized according to the initial write.<br><br>genesys_write_register(0x52,0x0e)<br>genesys_write_register(0x53,0x00)<br>genesys_write_register(0x54,0x02)<br>genesys_write_register(0x55,0x04)<br>genesys_write_register(0x56,0x06)<br>
genesys_write_register(0x57,0x08)<br>genesys_write_register(0x58,0x52)<br>genesys_write_register(0x59,0xe1)<br>genesys_write_register(0x5a,0x40)<br>genesys_write_register(0x5e,0x15)<br><br>Later in the log when trying to start the scan the following is<br>
happening:<br><br>genesys_write_register(0x52,0x02)<br>genesys_write_register(0x53,0x04)<br>genesys_write_register(0x54,0x06)<br>genesys_write_register(0x55,0x08)<br>genesys_write_register(0x56,0x0a)<br>genesys_write_register(0x57,0x0c)<br>
genesys_write_register(0x58,0x72)<br>genesys_write_register(0x59,0x5a)<br><br>Which are quite different...<br><br>/Stefan<br><br>