aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/mdtv/smscoreapi.h
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2008-05-19 17:56:13 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-07-20 06:19:35 -0400
commit2e5c1ec8865abd81e24a394918c7ba315e0b7b70 (patch)
treecd241de9b5eeddc27455b07e3530f69bc3e7d95d /drivers/media/mdtv/smscoreapi.h
parenta9e285856112e5e721b6a341d15437a164128b30 (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.h101
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 000000000000..a8c025f74eb7
--- /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
16typedef struct _smscore_device smscore_device_t;
17typedef struct _smscore_client smscore_client_t;
18typedef struct _smscore_buffer smscore_buffer_t;
19
20typedef int (*hotplug_t)(smscore_device_t *coredev, struct device *device, int arrival);
21
22typedef int (*setmode_t)(void *context, int mode);
23typedef void (*detectmode_t)(void *context, int *mode);
24typedef int (*sendrequest_t)(void *context, void *buffer, size_t size);
25typedef int (*loadfirmware_t)(void *context, void *buffer, size_t size);
26typedef int (*preload_t)(void *context);
27typedef int (*postload_t)(void *context);
28
29typedef int (*onresponse_t)(void *context, smscore_buffer_t *cb);
30typedef void (*onremove_t)(void *context);
31
32typedef 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
45typedef 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
64typedef 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
74extern void smscore_registry_setmode(char *devpath, int mode);
75extern int smscore_registry_getmode(char *devpath);
76
77extern int smscore_register_hotplug(hotplug_t hotplug);
78extern void smscore_unregister_hotplug(hotplug_t hotplug);
79
80extern int smscore_register_device(smsdevice_params_t *params, smscore_device_t **coredev);
81extern void smscore_unregister_device(smscore_device_t *coredev);
82
83extern int smscore_start_device(smscore_device_t *coredev);
84extern int smscore_load_firmware(smscore_device_t *coredev, char* filename, loadfirmware_t loadfirmware_handler);
85
86extern int smscore_set_device_mode(smscore_device_t *coredev, int mode);
87extern int smscore_get_device_mode(smscore_device_t *coredev);
88
89extern int smscore_register_client(smscore_device_t *coredev, smsclient_params_t* params, smscore_client_t **client);
90extern void smscore_unregister_client(smscore_client_t *client);
91
92extern int smsclient_sendrequest(smscore_client_t *client, void *buffer, size_t size);
93extern void smscore_onresponse(smscore_device_t *coredev, smscore_buffer_t *cb);
94
95extern int smscore_get_common_buffer_size(smscore_device_t *coredev);
96extern int smscore_map_common_buffer(smscore_device_t *coredev, struct vm_area_struct * vma);
97
98extern smscore_buffer_t *smscore_getbuffer(smscore_device_t *coredev);
99extern void smscore_putbuffer(smscore_device_t *coredev, smscore_buffer_t *cb);
100
101#endif // __smscoreapi_h__