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

Manu Abraham abraham.manu at gmail.com
Sat Aug 4 12:12:17 CEST 2007


Hi Marko,

On 8/4/07, Marko Ristola <marko.ristola at kolumbus.fi> wrote:
>
> Hi Manu and all
>
> I have done small improvements into Mantis drivers:
> I have fixed the insmod/rmmod problem and I have implemented
> suspend/resume for cu1216.
> It does in mantis_dvb.c "power off"/ "power on" if no application
> uses the frontend.


Normally we handle this in the frontend. ie in this case cu1216
You can put the CU1216 into STANDBY using Reg:0x00 Bit:7


> So with my suspend/resume and with non-USB sound output,
> I am able to suspend to disk and back so that Kaffeine will
> continue displaying the TV channel.
> I use now 2.6.22.1-41.fc7 kernel.
>
> cu1216 needed only small changes with the current version.
> Most changes went into dvb/mantis directory.


You will need 2 callbacks, one for suspend, one for resume: both
handling the power control to the frontend/tuner. This will control
power ON/OFF from the PCI interface POV, to the entire frontend,
rather than a STANDBY.


> resume uses fe->opt.init for cu1216, so it must do something.


Probably, a tune again with the cached params would be all that's
needed, since init is empty.

The init should start by setting Reg:0x00 Bit:7, such that the
frontend resumes from Standby.

(A bit confused with all the different suspends, is this S2RAM or
S2DISK or Hibernate ? The suspend folks were discussing on how to
create a memory snapshot: wondering whether our memory states for the
previous successful states would be there)


> resume uses fe->opt.set_frontend(fe,NULL) currently, meaning
> "please set the previous tuning values".


yeah, that would be a quick way to handle it, though it could be a
problem when the frontend_params is "really" null in a normal case.

A better way would be: from the resume callback, pass the cached
parameter straight away
to cu1216_set_parameters(). That way you wouldn't need to handle the
problem when params=NULL

You will have the last cached state in params:

       struct cu1216_state {
        	struct i2c_adapter *i2c;
        	struct dvb_frontend_ops ops;

        	/*	config settings		*/
        	const struct cu1216_config *config;
        	struct dvb_frontend frontend;

        	u8 pwm;
        	u8 reg0;

        	struct dvb_frontend_parameters params;
       };



> I need to collect the patches and clean them up before sending them for you.


Cool. The last update from my side is at: http://jusst.de/hg/v4l-dvb/


Thanks,
Manu



More information about the linux-dvb mailing list