Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / drivers / media / pci / mantis / mantis_link.h
blobebef995579b93a9a65ad2a4525701744ef478cc4
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3 Mantis PCI bridge driver
5 Copyright (C) Manu Abraham (abraham.manu@gmail.com)
7 */
9 #ifndef __MANTIS_LINK_H
10 #define __MANTIS_LINK_H
12 #include <linux/mutex.h>
13 #include <linux/workqueue.h>
14 #include <media/dvb_ca_en50221.h>
16 enum mantis_sbuf_status {
17 MANTIS_SBUF_DATA_AVAIL = 1,
18 MANTIS_SBUF_DATA_EMPTY = 2,
19 MANTIS_SBUF_DATA_OVFLW = 3
22 struct mantis_slot {
23 u32 timeout;
24 u32 slave_cfg;
25 u32 bar;
28 /* Physical layer */
29 enum mantis_slot_state {
30 MODULE_INSERTED = 3,
31 MODULE_XTRACTED = 4
34 struct mantis_ca {
35 struct mantis_slot slot[4];
37 struct work_struct hif_evm_work;
39 u32 hif_event;
40 wait_queue_head_t hif_opdone_wq;
41 wait_queue_head_t hif_brrdyw_wq;
42 wait_queue_head_t hif_data_wq;
43 wait_queue_head_t hif_write_wq; /* HIF Write op */
45 enum mantis_sbuf_status sbuf_status;
47 enum mantis_slot_state slot_state;
49 void *ca_priv;
51 struct dvb_ca_en50221 en50221;
52 struct mutex ca_lock;
55 /* CA */
56 extern void mantis_event_cam_plugin(struct mantis_ca *ca);
57 extern void mantis_event_cam_unplug(struct mantis_ca *ca);
58 extern int mantis_pcmcia_init(struct mantis_ca *ca);
59 extern void mantis_pcmcia_exit(struct mantis_ca *ca);
60 extern int mantis_evmgr_init(struct mantis_ca *ca);
61 extern void mantis_evmgr_exit(struct mantis_ca *ca);
63 /* HIF */
64 extern int mantis_hif_init(struct mantis_ca *ca);
65 extern void mantis_hif_exit(struct mantis_ca *ca);
66 extern int mantis_hif_read_mem(struct mantis_ca *ca, u32 addr);
67 extern int mantis_hif_write_mem(struct mantis_ca *ca, u32 addr, u8 data);
68 extern int mantis_hif_read_iom(struct mantis_ca *ca, u32 addr);
69 extern int mantis_hif_write_iom(struct mantis_ca *ca, u32 addr, u8 data);
71 #endif /* __MANTIS_LINK_H */