From 85fd3be00b20552f8c8785f93e4dd25fe4669be6 Mon Sep 17 00:00:00 2001 From: Noe Rubinstein Date: Fri, 24 Dec 2010 15:41:18 +0100 Subject: update TDM driver with xilun's changes --- tdm/xivo_tdm_api.h | 44 +++++++++++++++----------------------------- 1 file changed, 15 insertions(+), 29 deletions(-) (limited to 'tdm/xivo_tdm_api.h') diff --git a/tdm/xivo_tdm_api.h b/tdm/xivo_tdm_api.h index 9191653..e9f5206 100644 --- a/tdm/xivo_tdm_api.h +++ b/tdm/xivo_tdm_api.h @@ -7,15 +7,10 @@ /* XXX matches with ICP_HSSDRV_PORT_LE89316_MEGREZ_PROTO_XIVO_CONFIG */ #define LE89316_MEGREZ_PROTO_XIVO_CONFIG (5) -/* fixed for now: */ +/* fixed: */ #define XIVO_TDM_TS_NUM (32) - -/* for audio propagation, xivo_tdm_cb will be called every ms (hopefully...) */ -struct xivo_tdm_tick_cb_struct { - void (*tick)(void *data); - void *tick_data; -}; +#define XIVO_TDM_VOICE_CHUNK_SZ (8) struct xivo_tdm_port; @@ -36,6 +31,12 @@ int xivo_tdm_config_port( struct xivo_tdm_port* xtp, unsigned int port_config); +/* will be called back after port 0 has been configured */ +void xivo_tdm_register_port0_configured( + struct xivo_tdm_port* xtp, + void (*port0_configured)(void *), + void *port0_configured_data); + /* hardirq: no -- softirq: no -- user: yes */ void xivo_tdm_register_port0_started( struct xivo_tdm_port* xtp, @@ -45,31 +46,16 @@ void xivo_tdm_register_port0_started( /* hardirq: no -- softirq: no -- user: yes */ int xivo_tdm_start_chans( struct xivo_tdm_port* xtp, - u32 chans, - struct xivo_tdm_tick_cb_struct *cb_struct); // optional, can be null + u8 ** const readchunk_ptrs[XIVO_TDM_TS_NUM], + u8 ** const writechunk_ptrs[XIVO_TDM_TS_NUM], + void (*txrx)(void *), + void *txrx_data); +/* hardirq: no -- softirq: no -- user: yes */ void xivo_tdm_stop_chans( struct xivo_tdm_port* xtp); - -/* If cb_struct is NULL, the user has to regularly call - * xivo_tdm_receive(), xivo_tdm_transmit() and xivo_tdm_tick() - */ - -/* hardirq: yes -- softirq: yes -- user: yes */ -void xivo_tdm_receive( - struct xivo_tdm_port* xtp, - const unsigned int cnum, - u8 samples[8]); - -/* hardirq: yes -- softirq: yes -- user: yes */ -void xivo_tdm_transmit( - struct xivo_tdm_port* xtp, - const unsigned int cnum, - const u8 samples[8]); - -/* hardirq: yes -- softirq: yes -- user: yes */ -void xivo_tdm_tick( - struct xivo_tdm_port* xtp); +/* hardirq: no -- softirq: no -- user: yes */ +void xivo_tdm_shutdown(void); #endif /* XIVO_TDM_API_H */ -- cgit v1.2.3