Attached is a patch with adds full support for suspend/resume in budget-av. Actually only the CI interface needs to be reinitialised as all the tuner stuff gets reinitialised at the next tuning-process anyway. So this patch should be ready to go pretty straightforward into head. -Julian
diff -r c45e373bbca3 linux/drivers/media/common/saa7146_core.c --- a/linux/drivers/media/common/saa7146_core.c Sat Jul 28 00:06:44 2007 -0300 +++ b/linux/drivers/media/common/saa7146_core.c Tue Aug 07 23:22:54 2007 +0200 @@ -515,6 +515,28 @@ static void saa7146_remove_one(struct pc saa7146_num--; } +static int saa7146_suspend(struct pci_dev *pdev) +{ + struct saa7146_dev* dev = pci_get_drvdata(pdev); + DEB_EE(("dev:%p\n",dev)); + int err; + + err = dev->ext->suspend(dev); + + return err; +} + +static int saa7146_resume(struct pci_dev *pdev) +{ + struct saa7146_dev* dev = pci_get_drvdata(pdev); + DEB_EE(("dev:%p\n",dev)); + int err; + + err = dev->ext->resume(dev); + + return err; +} + /*********************************************************************************/ /* extension handling functions */ @@ -526,6 +548,8 @@ int saa7146_register_extension(struct sa ext->driver.id_table = ext->pci_tbl; ext->driver.probe = saa7146_init_one; ext->driver.remove = saa7146_remove_one; + ext->driver.suspend = saa7146_suspend; + ext->driver.resume = saa7146_resume; printk("saa7146: register extension '%s'.\n",ext->name); return pci_register_driver(&ext->driver); diff -r c45e373bbca3 linux/drivers/media/dvb/ttpci/budget-av.c --- a/linux/drivers/media/dvb/ttpci/budget-av.c Sat Jul 28 00:06:44 2007 -0300 +++ b/linux/drivers/media/dvb/ttpci/budget-av.c Thu Aug 24 02:08:26 2006 +0200 @@ -1093,6 +1093,27 @@ static int budget_av_detach(struct saa71 return err; } +static int budget_av_suspend(struct saa7146_dev *dev) +{ + struct budget_av *budget_av = (struct budget_av *) dev->ext_priv; + dprintk(2, "dev: %p\n", dev); + + if (budget_av->budget.ci_present) + ciintf_deinit(budget_av); + + return 0; +} + +static int budget_av_resume(struct saa7146_dev *dev) +{ + struct budget_av *budget_av = (struct budget_av *) dev->ext_priv; + dprintk(2, "dev: %p\n", dev); + + ciintf_init(budget_av); + + return 0; +} + static struct saa7146_ext_vv vv_data; static int budget_av_attach(struct saa7146_dev *dev, struct saa7146_pci_extension_data *info) @@ -1299,6 +1320,8 @@ static struct saa7146_extension budget_e .module = THIS_MODULE, .attach = budget_av_attach, .detach = budget_av_detach, + .suspend = budget_av_suspend, + .resume = budget_av_resume, .irq_mask = MASK_10, .irq_func = budget_av_irq, diff -r c45e373bbca3 linux/include/media/saa7146.h --- a/linux/include/media/saa7146.h Sat Jul 28 00:06:44 2007 -0300 +++ b/linux/include/media/saa7146.h Tue Aug 07 23:20:55 2007 +0200 @@ -104,6 +104,8 @@ struct saa7146_extension int (*probe)(struct saa7146_dev *); int (*attach)(struct saa7146_dev *, struct saa7146_pci_extension_data *); int (*detach)(struct saa7146_dev*); + int (*suspend)(struct saa7146_dev*); + int (*resume)(struct saa7146_dev*); u32 irq_mask; /* mask to indicate, which irq-events are handled by the extension */ void (*irq_func)(struct saa7146_dev*, u32* irq_mask);
_______________________________________________ linux-dvb mailing list linux-dvb@xxxxxxxxxxx http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb