diff options
author | Michael Krufky <mkrufky@linuxtv.org> | 2008-05-19 17:56:13 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-07-20 06:19:35 -0400 |
commit | 2e5c1ec8865abd81e24a394918c7ba315e0b7b70 (patch) | |
tree | cd241de9b5eeddc27455b07e3530f69bc3e7d95d /drivers/media/mdtv/smscoreapi.h | |
parent | a9e285856112e5e721b6a341d15437a164128b30 (diff) |
V4L/DVB (8258): add support for SMS1010 and SMS1150 based digital television devices
initial driver drop, provided by Siano Mobile Silicon, Inc.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/mdtv/smscoreapi.h')
-rw-r--r-- | drivers/media/mdtv/smscoreapi.h | 101 |
1 files changed, 101 insertions, 0 deletions
diff --git a/drivers/media/mdtv/smscoreapi.h b/drivers/media/mdtv/smscoreapi.h new file mode 100644 index 00000000000..a8c025f74eb --- /dev/null +++ b/drivers/media/mdtv/smscoreapi.h | |||
@@ -0,0 +1,101 @@ | |||
1 | #ifndef __smscoreapi_h__ | ||
2 | #define __smscoreapi_h__ | ||
3 | |||
4 | #ifndef min | ||
5 | #define min(a,b) (((a) < (b)) ? (a) : (b)) | ||
6 | #endif | ||
7 | |||
8 | #define SMS_ALLOC_ALIGNMENT 128 | ||
9 | #define SMS_DMA_ALIGNMENT 16 | ||
10 | #define SMS_ALIGN_ADDRESS(addr) ((((u32)(addr)) + (SMS_DMA_ALIGNMENT-1)) & ~(SMS_DMA_ALIGNMENT-1)) | ||
11 | |||
12 | #define SMS_DEVICE_FAMILY2 1 | ||
13 | #define SMS_ROM_NO_RESPONSE 2 | ||
14 | #define SMS_DEVICE_NOT_READY 0x8000000 | ||
15 | |||
16 | typedef struct _smscore_device smscore_device_t; | ||
17 | typedef struct _smscore_client smscore_client_t; | ||
18 | typedef struct _smscore_buffer smscore_buffer_t; | ||
19 | |||
20 | typedef int (*hotplug_t)(smscore_device_t *coredev, struct device *device, int arrival); | ||
21 | |||
22 | typedef int (*setmode_t)(void *context, int mode); | ||
23 | typedef void (*detectmode_t)(void *context, int *mode); | ||
24 | typedef int (*sendrequest_t)(void *context, void *buffer, size_t size); | ||
25 | typedef int (*loadfirmware_t)(void *context, void *buffer, size_t size); | ||
26 | typedef int (*preload_t)(void *context); | ||
27 | typedef int (*postload_t)(void *context); | ||
28 | |||
29 | typedef int (*onresponse_t)(void *context, smscore_buffer_t *cb); | ||
30 | typedef void (*onremove_t)(void *context); | ||
31 | |||
32 | typedef struct _smscore_buffer | ||
33 | { | ||
34 | // public members, once passed to clients can be changed freely | ||
35 | struct list_head entry; | ||
36 | int size; | ||
37 | int offset; | ||
38 | |||
39 | // private members, read-only for clients | ||
40 | void *p; | ||
41 | dma_addr_t phys; | ||
42 | unsigned long offset_in_common; | ||
43 | } *psmscore_buffer_t; | ||
44 | |||
45 | typedef struct _smsdevice_params | ||
46 | { | ||
47 | struct device *device; | ||
48 | |||
49 | int buffer_size; | ||
50 | int num_buffers; | ||
51 | |||
52 | char devpath[32]; | ||
53 | unsigned long flags; | ||
54 | |||
55 | setmode_t setmode_handler; | ||
56 | detectmode_t detectmode_handler; | ||
57 | sendrequest_t sendrequest_handler; | ||
58 | preload_t preload_handler; | ||
59 | postload_t postload_handler; | ||
60 | |||
61 | void *context; | ||
62 | } smsdevice_params_t; | ||
63 | |||
64 | typedef struct _smsclient_params | ||
65 | { | ||
66 | int initial_id; | ||
67 | int data_type; | ||
68 | onresponse_t onresponse_handler; | ||
69 | onremove_t onremove_handler; | ||
70 | |||
71 | void *context; | ||
72 | } smsclient_params_t; | ||
73 | |||
74 | extern void smscore_registry_setmode(char *devpath, int mode); | ||
75 | extern int smscore_registry_getmode(char *devpath); | ||
76 | |||
77 | extern int smscore_register_hotplug(hotplug_t hotplug); | ||
78 | extern void smscore_unregister_hotplug(hotplug_t hotplug); | ||
79 | |||
80 | extern int smscore_register_device(smsdevice_params_t *params, smscore_device_t **coredev); | ||
81 | extern void smscore_unregister_device(smscore_device_t *coredev); | ||
82 | |||
83 | extern int smscore_start_device(smscore_device_t *coredev); | ||
84 | extern int smscore_load_firmware(smscore_device_t *coredev, char* filename, loadfirmware_t loadfirmware_handler); | ||
85 | |||
86 | extern int smscore_set_device_mode(smscore_device_t *coredev, int mode); | ||
87 | extern int smscore_get_device_mode(smscore_device_t *coredev); | ||
88 | |||
89 | extern int smscore_register_client(smscore_device_t *coredev, smsclient_params_t* params, smscore_client_t **client); | ||
90 | extern void smscore_unregister_client(smscore_client_t *client); | ||
91 | |||
92 | extern int smsclient_sendrequest(smscore_client_t *client, void *buffer, size_t size); | ||
93 | extern void smscore_onresponse(smscore_device_t *coredev, smscore_buffer_t *cb); | ||
94 | |||
95 | extern int smscore_get_common_buffer_size(smscore_device_t *coredev); | ||
96 | extern int smscore_map_common_buffer(smscore_device_t *coredev, struct vm_area_struct * vma); | ||
97 | |||
98 | extern smscore_buffer_t *smscore_getbuffer(smscore_device_t *coredev); | ||
99 | extern void smscore_putbuffer(smscore_device_t *coredev, smscore_buffer_t *cb); | ||
100 | |||
101 | #endif // __smscoreapi_h__ | ||