[linux-dvb] Suspend/resume for Mantis 2033 driver

Marko Ristola marko.ristola at kolumbus.fi
Tue Aug 7 20:55:09 CEST 2007


Hi Manu,

Here is the first version of the patch
that will implement Suspend/resume S2DISK
(no remote control support).

S2DISK works for me on cu1216.c on 2.6.22.1-41.fc7 kernel.

For another Mantis device, you have to
- introduce  tuner_ops.sleep and tuner_ops.init in mantis_dvb.c (two 
lines after dvb_attach(cu1216)).
- implement fe->ops.init to do something if necessary (I did it on 
cu1216.c).
- implement fe->ops.set_frontend() to accept NULL for "set those params 
that were active during suspend".
- If tuner_ops.init is defined, resume in mantis_dvb.c assumes that 
set_frontend() accepts NULL argument.

I tried to make the patch so, that you could check it into your version 
control as such.
Unfortunately I couldn't compile your v4l-dvb branch, and thus
I converted your v4l-dvb branch into the very latest LinuxTV v4l-dvb 
version for testing.

This patch doesn't include remote control support,
because mantis_rc.c is not yet in the version control.

cu1216.c: many small adjustments.
- Fixes rmmod/insmod "lost frontend" problem.
- Fixes inversion=1 support requirement for Finland DVB-C.
- dvb_core is able to reset cu1216 module if it fails.

dvb/mantis: many suspend related adjustments.
- Suspend/resume support for S2DISK: it works for cu1216. See 
mantis_dvb.c if you
  like to add support for other frontend.
- mantis_dvb.c: will not load all Mantis frontend modules, but just the 
ones that are needed.
- mantis_dvb.c: will turn off tuner (tuner_ops.sleep) , and turn it on 
again for cu1216.c (tuner_ops.init).
- mantis_dvb.c: suspend/resume support takes advantage of the tuner 
power functions and fe->ops.set_frontend(fe,NULL) if tuner_ops.init is 
defined.
- mantis_pci.c: share code with probe and resume and with exit and suspend.
- mantis_i2c.c: suspend/resume support.
- mantis_i2c.c: mantis_i2c_init and mantis_i2c_exit altered a lot, but 
those changes aren't necessary anymore.
    Maybe remove those unnecessary changes?
- mantis_dma.c: suspend/resume support. mantis_start_dma and 
mantis_stop_dma calls are enough  though.
    Maybe just remove all suspend/resume code from mantis_start/stop_dma?
- mantis_common.h: suspend/resume support. Some suspend status support 
added and introduced some functions.
- mantis_core.h: suspend/resume support: Introduced some functions.
- mantis/Makefile: Use += for flags: this is the way in current v4l-dvb 
main branch.

Now you have my code to be seen and even applied into your Mantis 
branch, if you want.
mantis_rc.c: This code is not yet to be seen, but at least I had to 
enable Mantis IRQ for
remote control during resume.

        Developer's Certificate of Origin 1.1

        By making a contribution to this project, I certify that:

        (b) The contribution is based upon previous work that, to the best
            of my knowledge, is covered under an appropriate open source
            license and I have the right under that license to submit that
            work with modifications, whether created in whole or in part
            by me, under the same open source license (unless I am
            permitted to submit under a different license), as indicated
            in the file.

        (d) I understand and agree that this project and the contribution
            are public and that a record of the contribution (including all
            personal information I submit with it, including my sign-off) is
            maintained indefinitely and may be redistributed consistent with
            this project or the open source license(s) involved.

Signed-off-by: Marko M Ristola <marko.ristola at kolumbus.fi>

Regards,
Marko Ristola


-------------- next part --------------
A non-text attachment was scrubbed...
Name: PATCH1_cu1216_improvements.diff
Type: text/x-patch
Size: 10400 bytes
Desc: not available
Url : http://www.linuxtv.org/pipermail/linux-dvb/attachments/20070807/9e26824f/attachment-0002.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PATCH2_suspend_and_resume.diff
Type: text/x-patch
Size: 21310 bytes
Desc: not available
Url : http://www.linuxtv.org/pipermail/linux-dvb/attachments/20070807/9e26824f/attachment-0003.bin 


More information about the linux-dvb mailing list