Skip to content

Commit 92374e8

Browse files
Stefan RichterMauro Carvalho Chehab
authored andcommitted
[media] firedtv: drop obsolete backend abstraction
Since the drivers/ieee1394/ backend was removed from firedtv, its I/O no longer needs to be abstracted as exchangeable backend methods. Also, ieee1394 variants of module and device probe and removal are no longer there. Move module probe and removal into firedtv-fw.c where device probe and removal are implemented. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
1 parent 14ddc31 commit 92374e8

5 files changed

Lines changed: 140 additions & 190 deletions

File tree

‎drivers/media/dvb/firewire/firedtv-avc.c‎

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,8 @@ static int avc_write(struct firedtv *fdtv)
241241
if (unlikely(avc_debug))
242242
debug_fcp(fdtv->avc_data, fdtv->avc_data_length);
243243

244-
err = fdtv->backend->write(fdtv, FCP_COMMAND_REGISTER,
245-
fdtv->avc_data, fdtv->avc_data_length);
244+
err = fdtv_write(fdtv, FCP_COMMAND_REGISTER,
245+
fdtv->avc_data, fdtv->avc_data_length);
246246
if (err) {
247247
dev_err(fdtv->device, "FCP command write failed\n");
248248

@@ -1322,7 +1322,7 @@ static int cmp_read(struct firedtv *fdtv, u64 addr, __be32 *data)
13221322

13231323
mutex_lock(&fdtv->avc_mutex);
13241324

1325-
ret = fdtv->backend->read(fdtv, addr, data);
1325+
ret = fdtv_read(fdtv, addr, data);
13261326
if (ret < 0)
13271327
dev_err(fdtv->device, "CMP: read I/O error\n");
13281328

@@ -1340,7 +1340,7 @@ static int cmp_lock(struct firedtv *fdtv, u64 addr, __be32 data[])
13401340
/* data[] is stack-allocated and should not be DMA-mapped. */
13411341
memcpy(fdtv->avc_data, data, 8);
13421342

1343-
ret = fdtv->backend->lock(fdtv, addr, fdtv->avc_data);
1343+
ret = fdtv_lock(fdtv, addr, fdtv->avc_data);
13441344
if (ret < 0)
13451345
dev_err(fdtv->device, "CMP: lock I/O error\n");
13461346
else
@@ -1405,10 +1405,7 @@ int cmp_establish_pp_connection(struct firedtv *fdtv, int plug, int channel)
14051405
/* FIXME: this is for the worst case - optimize */
14061406
set_opcr_overhead_id(opcr, 0);
14071407

1408-
/*
1409-
* FIXME: allocate isochronous channel and bandwidth at IRM
1410-
* fdtv->backend->alloc_resources(fdtv, channels_mask, bw);
1411-
*/
1408+
/* FIXME: allocate isochronous channel and bandwidth at IRM */
14121409
}
14131410

14141411
set_opcr_p2p_connections(opcr, get_opcr_p2p_connections(*opcr) + 1);
@@ -1424,8 +1421,6 @@ int cmp_establish_pp_connection(struct firedtv *fdtv, int plug, int channel)
14241421
/*
14251422
* FIXME: if old_opcr.P2P_Connections > 0,
14261423
* deallocate isochronous channel and bandwidth at IRM
1427-
* if (...)
1428-
* fdtv->backend->dealloc_resources(fdtv, channel, bw);
14291424
*/
14301425

14311426
if (++attempts < 6) /* arbitrary limit */

‎drivers/media/dvb/firewire/firedtv-dvb.c‎

Lines changed: 3 additions & 127 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,9 @@
1414
#include <linux/device.h>
1515
#include <linux/errno.h>
1616
#include <linux/kernel.h>
17-
#include <linux/mod_devicetable.h>
1817
#include <linux/module.h>
1918
#include <linux/mutex.h>
20-
#include <linux/slab.h>
21-
#include <linux/string.h>
2219
#include <linux/types.h>
23-
#include <linux/wait.h>
24-
#include <linux/workqueue.h>
2520

2621
#include <dmxdev.h>
2722
#include <dvb_demux.h>
@@ -166,11 +161,11 @@ int fdtv_stop_feed(struct dvb_demux_feed *dvbdmxfeed)
166161

167162
DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
168163

169-
int fdtv_dvb_register(struct firedtv *fdtv)
164+
int fdtv_dvb_register(struct firedtv *fdtv, const char *name)
170165
{
171166
int err;
172167

173-
err = dvb_register_adapter(&fdtv->adapter, fdtv_model_names[fdtv->type],
168+
err = dvb_register_adapter(&fdtv->adapter, name,
174169
THIS_MODULE, fdtv->device, adapter_nr);
175170
if (err < 0)
176171
goto fail_log;
@@ -210,7 +205,7 @@ int fdtv_dvb_register(struct firedtv *fdtv)
210205

211206
dvb_net_init(&fdtv->adapter, &fdtv->dvbnet, &fdtv->demux.dmx);
212207

213-
fdtv_frontend_init(fdtv);
208+
fdtv_frontend_init(fdtv, name);
214209
err = dvb_register_frontend(&fdtv->adapter, &fdtv->fe);
215210
if (err)
216211
goto fail_net_release;
@@ -248,122 +243,3 @@ void fdtv_dvb_unregister(struct firedtv *fdtv)
248243
dvb_dmx_release(&fdtv->demux);
249244
dvb_unregister_adapter(&fdtv->adapter);
250245
}
251-
252-
const char *fdtv_model_names[] = {
253-
[FIREDTV_UNKNOWN] = "unknown type",
254-
[FIREDTV_DVB_S] = "FireDTV S/CI",
255-
[FIREDTV_DVB_C] = "FireDTV C/CI",
256-
[FIREDTV_DVB_T] = "FireDTV T/CI",
257-
[FIREDTV_DVB_S2] = "FireDTV S2 ",
258-
};
259-
260-
struct firedtv *fdtv_alloc(struct device *dev,
261-
const struct firedtv_backend *backend,
262-
const char *name, size_t name_len)
263-
{
264-
struct firedtv *fdtv;
265-
int i;
266-
267-
fdtv = kzalloc(sizeof(*fdtv), GFP_KERNEL);
268-
if (!fdtv)
269-
return NULL;
270-
271-
dev_set_drvdata(dev, fdtv);
272-
fdtv->device = dev;
273-
fdtv->isochannel = -1;
274-
fdtv->voltage = 0xff;
275-
fdtv->tone = 0xff;
276-
fdtv->backend = backend;
277-
278-
mutex_init(&fdtv->avc_mutex);
279-
init_waitqueue_head(&fdtv->avc_wait);
280-
mutex_init(&fdtv->demux_mutex);
281-
INIT_WORK(&fdtv->remote_ctrl_work, avc_remote_ctrl_work);
282-
283-
for (i = ARRAY_SIZE(fdtv_model_names); --i; )
284-
if (strlen(fdtv_model_names[i]) <= name_len &&
285-
strncmp(name, fdtv_model_names[i], name_len) == 0)
286-
break;
287-
fdtv->type = i;
288-
289-
return fdtv;
290-
}
291-
292-
#define MATCH_FLAGS (IEEE1394_MATCH_VENDOR_ID | IEEE1394_MATCH_MODEL_ID | \
293-
IEEE1394_MATCH_SPECIFIER_ID | IEEE1394_MATCH_VERSION)
294-
295-
#define DIGITAL_EVERYWHERE_OUI 0x001287
296-
#define AVC_UNIT_SPEC_ID_ENTRY 0x00a02d
297-
#define AVC_SW_VERSION_ENTRY 0x010001
298-
299-
const struct ieee1394_device_id fdtv_id_table[] = {
300-
{
301-
/* FloppyDTV S/CI and FloppyDTV S2 */
302-
.match_flags = MATCH_FLAGS,
303-
.vendor_id = DIGITAL_EVERYWHERE_OUI,
304-
.model_id = 0x000024,
305-
.specifier_id = AVC_UNIT_SPEC_ID_ENTRY,
306-
.version = AVC_SW_VERSION_ENTRY,
307-
}, {
308-
/* FloppyDTV T/CI */
309-
.match_flags = MATCH_FLAGS,
310-
.vendor_id = DIGITAL_EVERYWHERE_OUI,
311-
.model_id = 0x000025,
312-
.specifier_id = AVC_UNIT_SPEC_ID_ENTRY,
313-
.version = AVC_SW_VERSION_ENTRY,
314-
}, {
315-
/* FloppyDTV C/CI */
316-
.match_flags = MATCH_FLAGS,
317-
.vendor_id = DIGITAL_EVERYWHERE_OUI,
318-
.model_id = 0x000026,
319-
.specifier_id = AVC_UNIT_SPEC_ID_ENTRY,
320-
.version = AVC_SW_VERSION_ENTRY,
321-
}, {
322-
/* FireDTV S/CI and FloppyDTV S2 */
323-
.match_flags = MATCH_FLAGS,
324-
.vendor_id = DIGITAL_EVERYWHERE_OUI,
325-
.model_id = 0x000034,
326-
.specifier_id = AVC_UNIT_SPEC_ID_ENTRY,
327-
.version = AVC_SW_VERSION_ENTRY,
328-
}, {
329-
/* FireDTV T/CI */
330-
.match_flags = MATCH_FLAGS,
331-
.vendor_id = DIGITAL_EVERYWHERE_OUI,
332-
.model_id = 0x000035,
333-
.specifier_id = AVC_UNIT_SPEC_ID_ENTRY,
334-
.version = AVC_SW_VERSION_ENTRY,
335-
}, {
336-
/* FireDTV C/CI */
337-
.match_flags = MATCH_FLAGS,
338-
.vendor_id = DIGITAL_EVERYWHERE_OUI,
339-
.model_id = 0x000036,
340-
.specifier_id = AVC_UNIT_SPEC_ID_ENTRY,
341-
.version = AVC_SW_VERSION_ENTRY,
342-
}, {}
343-
};
344-
MODULE_DEVICE_TABLE(ieee1394, fdtv_id_table);
345-
346-
static int __init fdtv_init(void)
347-
{
348-
int ret;
349-
350-
ret = fdtv_fw_init();
351-
if (ret < 0)
352-
return ret;
353-
354-
return ret;
355-
}
356-
357-
static void __exit fdtv_exit(void)
358-
{
359-
fdtv_fw_exit();
360-
}
361-
362-
module_init(fdtv_init);
363-
module_exit(fdtv_exit);
364-
365-
MODULE_AUTHOR("Andreas Monitzer <andy@monitzer.com>");
366-
MODULE_AUTHOR("Ben Backx <ben@bbackx.com>");
367-
MODULE_DESCRIPTION("FireDTV DVB Driver");
368-
MODULE_LICENSE("GPL");
369-
MODULE_SUPPORTED_DEVICE("FireDTV DVB");

‎drivers/media/dvb/firewire/firedtv-fe.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ static int fdtv_dvb_init(struct dvb_frontend *fe)
3636
return err;
3737
}
3838

39-
return fdtv->backend->start_iso(fdtv);
39+
return fdtv_start_iso(fdtv);
4040
}
4141

4242
static int fdtv_sleep(struct dvb_frontend *fe)
4343
{
4444
struct firedtv *fdtv = fe->sec_priv;
4545

46-
fdtv->backend->stop_iso(fdtv);
46+
fdtv_stop_iso(fdtv);
4747
cmp_break_pp_connection(fdtv, fdtv->subunit, fdtv->isochannel);
4848
fdtv->isochannel = -1;
4949
return 0;
@@ -165,7 +165,7 @@ static int fdtv_set_property(struct dvb_frontend *fe, struct dtv_property *tvp)
165165
return 0;
166166
}
167167

168-
void fdtv_frontend_init(struct firedtv *fdtv)
168+
void fdtv_frontend_init(struct firedtv *fdtv, const char *name)
169169
{
170170
struct dvb_frontend_ops *ops = &fdtv->fe.ops;
171171
struct dvb_frontend_info *fi = &ops->info;
@@ -266,7 +266,7 @@ void fdtv_frontend_init(struct firedtv *fdtv)
266266
dev_err(fdtv->device, "no frontend for model type %d\n",
267267
fdtv->type);
268268
}
269-
strcpy(fi->name, fdtv_model_names[fdtv->type]);
269+
strcpy(fi->name, name);
270270

271271
fdtv->fe.dvb = &fdtv->adapter;
272272
fdtv->fe.sec_priv = fdtv;

0 commit comments

Comments
 (0)