diff options
author | Daniel Scheller <d.scheller@gmx.net> | 2018-04-09 12:47:40 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-05-04 10:34:04 -0400 |
commit | 1dda87ac151034f74010818e2fb8637e7ee7f02d (patch) | |
tree | 528b606f5eec41536693e51a13cb06bee308eec8 /drivers/media/pci/ddbridge/ddbridge.h | |
parent | 6bf0f0512a85c0a28c2e879fc0f6f7f44008d588 (diff) |
media: ddbridge: add helper for IRQ handler setup
Introduce the ddb_irq_set() helper function (along with a matching
prototype in ddbridge.h) to improve the set up of the IRQ handlers
and handler_data, and rework storing this data into the ddb_link
using a new ddb_irq struct. This also does the necessary rework
of affected variables. And while at it, always do queue_work in
input_handler() as there's not much of a difference to directly
calling input_work if there's no ptr at input->redi, or queueing
this call.
Picked up from the upstream dddvb-0.9.33 release.
Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/pci/ddbridge/ddbridge.h')
-rw-r--r-- | drivers/media/pci/ddbridge/ddbridge.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/media/pci/ddbridge/ddbridge.h b/drivers/media/pci/ddbridge/ddbridge.h index dbd5f551ce76..de9ddf1068bf 100644 --- a/drivers/media/pci/ddbridge/ddbridge.h +++ b/drivers/media/pci/ddbridge/ddbridge.h @@ -305,6 +305,11 @@ struct ddb_lnb { u32 fmode; }; +struct ddb_irq { + void (*handler)(void *); + void *data; +}; + struct ddb_link { struct ddb *dev; const struct ddb_info *info; @@ -319,6 +324,7 @@ struct ddb_link { spinlock_t temp_lock; /* lock temp chip access */ int overtemperature_error; u8 temp_tab[11]; + struct ddb_irq irq[256]; }; struct ddb { @@ -343,9 +349,6 @@ struct ddb { struct ddb_dma idma[DDB_MAX_INPUT]; struct ddb_dma odma[DDB_MAX_OUTPUT]; - void (*handler[4][256])(unsigned long); - unsigned long handler_data[4][256]; - struct device *ddb_dev; u32 ddb_dev_users; u32 nr; @@ -369,6 +372,8 @@ int ddbridge_flashread(struct ddb *dev, u32 link, u8 *buf, u32 addr, u32 len); /****************************************************************************/ /* ddbridge-core.c */ +struct ddb_irq *ddb_irq_set(struct ddb *dev, u32 link, u32 nr, + void (*handler)(void *), void *data); void ddb_ports_detach(struct ddb *dev); void ddb_ports_release(struct ddb *dev); void ddb_buffers_free(struct ddb *dev); |