diff options
author | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2016-02-05 05:35:50 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2016-02-10 04:23:41 -0500 |
commit | 2773b0e9baa68beed1f93d04a8ae8ca04b35a60d (patch) | |
tree | 19325d3942b4e40d188d31410f862568479627e6 | |
parent | de39078779cb08b21e7e3d2daa7d3b64a53a8d20 (diff) |
[media] add media controller support to videobuf2-dvb
Allow devices to pass an optional argument to register the DVB
driver at the media controller.
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r-- | drivers/media/pci/cx23885/cx23885-dvb.c | 3 | ||||
-rw-r--r-- | drivers/media/pci/cx88/cx88-dvb.c | 3 | ||||
-rw-r--r-- | drivers/media/pci/netup_unidvb/netup_unidvb_core.c | 4 | ||||
-rw-r--r-- | drivers/media/pci/saa7134/saa7134-dvb.c | 2 | ||||
-rw-r--r-- | drivers/media/v4l2-core/videobuf2-dvb.c | 13 | ||||
-rw-r--r-- | include/media/videobuf2-dvb.h | 5 |
6 files changed, 23 insertions, 7 deletions
diff --git a/drivers/media/pci/cx23885/cx23885-dvb.c b/drivers/media/pci/cx23885/cx23885-dvb.c index 80319bb73d94..5131c9f555fb 100644 --- a/drivers/media/pci/cx23885/cx23885-dvb.c +++ b/drivers/media/pci/cx23885/cx23885-dvb.c | |||
@@ -2301,7 +2301,8 @@ static int dvb_register(struct cx23885_tsport *port) | |||
2301 | 2301 | ||
2302 | /* register everything */ | 2302 | /* register everything */ |
2303 | ret = vb2_dvb_register_bus(&port->frontends, THIS_MODULE, port, | 2303 | ret = vb2_dvb_register_bus(&port->frontends, THIS_MODULE, port, |
2304 | &dev->pci->dev, adapter_nr, mfe_shared); | 2304 | &dev->pci->dev, NULL, |
2305 | adapter_nr, mfe_shared); | ||
2305 | if (ret) | 2306 | if (ret) |
2306 | goto frontend_detach; | 2307 | goto frontend_detach; |
2307 | 2308 | ||
diff --git a/drivers/media/pci/cx88/cx88-dvb.c b/drivers/media/pci/cx88/cx88-dvb.c index afb20756d7a5..851d2a9caed3 100644 --- a/drivers/media/pci/cx88/cx88-dvb.c +++ b/drivers/media/pci/cx88/cx88-dvb.c | |||
@@ -1642,7 +1642,8 @@ static int dvb_register(struct cx8802_dev *dev) | |||
1642 | 1642 | ||
1643 | /* register everything */ | 1643 | /* register everything */ |
1644 | res = vb2_dvb_register_bus(&dev->frontends, THIS_MODULE, dev, | 1644 | res = vb2_dvb_register_bus(&dev->frontends, THIS_MODULE, dev, |
1645 | &dev->pci->dev, adapter_nr, mfe_shared); | 1645 | &dev->pci->dev, NULL, adapter_nr, |
1646 | mfe_shared); | ||
1646 | if (res) | 1647 | if (res) |
1647 | goto frontend_detach; | 1648 | goto frontend_detach; |
1648 | return res; | 1649 | return res; |
diff --git a/drivers/media/pci/netup_unidvb/netup_unidvb_core.c b/drivers/media/pci/netup_unidvb/netup_unidvb_core.c index c94cecd2aa40..2b667b315913 100644 --- a/drivers/media/pci/netup_unidvb/netup_unidvb_core.c +++ b/drivers/media/pci/netup_unidvb/netup_unidvb_core.c | |||
@@ -462,8 +462,8 @@ static int netup_unidvb_dvb_init(struct netup_unidvb_dev *ndev, | |||
462 | } | 462 | } |
463 | 463 | ||
464 | if (vb2_dvb_register_bus(&ndev->frontends[num], | 464 | if (vb2_dvb_register_bus(&ndev->frontends[num], |
465 | THIS_MODULE, NULL, | 465 | THIS_MODULE, NULL, |
466 | &ndev->pci_dev->dev, adapter_nr, 1)) { | 466 | &ndev->pci_dev->dev, NULL, adapter_nr, 1)) { |
467 | dev_dbg(&ndev->pci_dev->dev, | 467 | dev_dbg(&ndev->pci_dev->dev, |
468 | "%s(): unable to register DVB bus %d\n", | 468 | "%s(): unable to register DVB bus %d\n", |
469 | __func__, num); | 469 | __func__, num); |
diff --git a/drivers/media/pci/saa7134/saa7134-dvb.c b/drivers/media/pci/saa7134/saa7134-dvb.c index 101ba8729416..ed84f7dea94c 100644 --- a/drivers/media/pci/saa7134/saa7134-dvb.c +++ b/drivers/media/pci/saa7134/saa7134-dvb.c | |||
@@ -1884,7 +1884,7 @@ static int dvb_init(struct saa7134_dev *dev) | |||
1884 | 1884 | ||
1885 | /* register everything else */ | 1885 | /* register everything else */ |
1886 | ret = vb2_dvb_register_bus(&dev->frontends, THIS_MODULE, dev, | 1886 | ret = vb2_dvb_register_bus(&dev->frontends, THIS_MODULE, dev, |
1887 | &dev->pci->dev, adapter_nr, 0); | 1887 | &dev->pci->dev, NULL, adapter_nr, 0); |
1888 | 1888 | ||
1889 | /* this sequence is necessary to make the tda1004x load its firmware | 1889 | /* this sequence is necessary to make the tda1004x load its firmware |
1890 | * and to enter analog mode of hybrid boards | 1890 | * and to enter analog mode of hybrid boards |
diff --git a/drivers/media/v4l2-core/videobuf2-dvb.c b/drivers/media/v4l2-core/videobuf2-dvb.c index d09269846b7e..9f38b4218c0d 100644 --- a/drivers/media/v4l2-core/videobuf2-dvb.c +++ b/drivers/media/v4l2-core/videobuf2-dvb.c | |||
@@ -77,6 +77,7 @@ static int vb2_dvb_register_adapter(struct vb2_dvb_frontends *fe, | |||
77 | struct module *module, | 77 | struct module *module, |
78 | void *adapter_priv, | 78 | void *adapter_priv, |
79 | struct device *device, | 79 | struct device *device, |
80 | struct media_device *mdev, | ||
80 | char *adapter_name, | 81 | char *adapter_name, |
81 | short *adapter_nr, | 82 | short *adapter_nr, |
82 | int mfe_shared) | 83 | int mfe_shared) |
@@ -94,7 +95,10 @@ static int vb2_dvb_register_adapter(struct vb2_dvb_frontends *fe, | |||
94 | } | 95 | } |
95 | fe->adapter.priv = adapter_priv; | 96 | fe->adapter.priv = adapter_priv; |
96 | fe->adapter.mfe_shared = mfe_shared; | 97 | fe->adapter.mfe_shared = mfe_shared; |
97 | 98 | #ifdef CONFIG_MEDIA_CONTROLLER_DVB | |
99 | if (mdev) | ||
100 | fe->adapter.mdev = mdev; | ||
101 | #endif | ||
98 | return result; | 102 | return result; |
99 | } | 103 | } |
100 | 104 | ||
@@ -193,6 +197,7 @@ int vb2_dvb_register_bus(struct vb2_dvb_frontends *f, | |||
193 | struct module *module, | 197 | struct module *module, |
194 | void *adapter_priv, | 198 | void *adapter_priv, |
195 | struct device *device, | 199 | struct device *device, |
200 | struct media_device *mdev, | ||
196 | short *adapter_nr, | 201 | short *adapter_nr, |
197 | int mfe_shared) | 202 | int mfe_shared) |
198 | { | 203 | { |
@@ -207,7 +212,7 @@ int vb2_dvb_register_bus(struct vb2_dvb_frontends *f, | |||
207 | } | 212 | } |
208 | 213 | ||
209 | /* Bring up the adapter */ | 214 | /* Bring up the adapter */ |
210 | res = vb2_dvb_register_adapter(f, module, adapter_priv, device, | 215 | res = vb2_dvb_register_adapter(f, module, adapter_priv, device, mdev, |
211 | fe->dvb.name, adapter_nr, mfe_shared); | 216 | fe->dvb.name, adapter_nr, mfe_shared); |
212 | if (res < 0) { | 217 | if (res < 0) { |
213 | pr_warn("vb2_dvb_register_adapter failed (errno = %d)\n", res); | 218 | pr_warn("vb2_dvb_register_adapter failed (errno = %d)\n", res); |
@@ -224,7 +229,11 @@ int vb2_dvb_register_bus(struct vb2_dvb_frontends *f, | |||
224 | fe->dvb.name, res); | 229 | fe->dvb.name, res); |
225 | goto err; | 230 | goto err; |
226 | } | 231 | } |
232 | res = dvb_create_media_graph(&f->adapter, false); | ||
233 | if (res < 0) | ||
234 | goto err; | ||
227 | } | 235 | } |
236 | |||
228 | mutex_unlock(&f->lock); | 237 | mutex_unlock(&f->lock); |
229 | return 0; | 238 | return 0; |
230 | 239 | ||
diff --git a/include/media/videobuf2-dvb.h b/include/media/videobuf2-dvb.h index 5b64c9eac2c9..87b559024b4a 100644 --- a/include/media/videobuf2-dvb.h +++ b/include/media/videobuf2-dvb.h | |||
@@ -8,6 +8,10 @@ | |||
8 | #include <dvb_frontend.h> | 8 | #include <dvb_frontend.h> |
9 | 9 | ||
10 | #include <media/videobuf2-v4l2.h> | 10 | #include <media/videobuf2-v4l2.h> |
11 | |||
12 | /* We don't actually need to include media-device.h here */ | ||
13 | struct media_device; | ||
14 | |||
11 | /* | 15 | /* |
12 | * TODO: This header file should be replaced with videobuf2-core.h | 16 | * TODO: This header file should be replaced with videobuf2-core.h |
13 | * Currently, vb2_thread is not a stuff of videobuf2-core, | 17 | * Currently, vb2_thread is not a stuff of videobuf2-core, |
@@ -50,6 +54,7 @@ int vb2_dvb_register_bus(struct vb2_dvb_frontends *f, | |||
50 | struct module *module, | 54 | struct module *module, |
51 | void *adapter_priv, | 55 | void *adapter_priv, |
52 | struct device *device, | 56 | struct device *device, |
57 | struct media_device *mdev, | ||
53 | short *adapter_nr, | 58 | short *adapter_nr, |
54 | int mfe_shared); | 59 | int mfe_shared); |
55 | 60 | ||