Simplifying System IntegrationTM 73M1822/73M1922 Hardware Module for SMDK412 User Guide January 20, 2010 Rev. 1.
73M1822/73M1922 Hardware Module for SMDK412 User Guide UG_1x22_054 © 2010 Teridian Semiconductor Corporation. All rights reserved. Teridian Semiconductor Corporation is a registered trademark of Teridian Semiconductor Corporation. Simplifying System Integration is a trademark of Teridian Semiconductor Corporation. Linux is a registered trademark of Linus Torvalds. All other trademarks are the property of their respective owners.
UG_1x22_054 73M1822/73M1922 Hardware Module for SMDK412 User Guide Table of Contents 1 Introduction ............................................................................................................................... 5 1.1 Purpose and Scope ............................................................................................................ 5 1.2 Conventions Used in this Guide ........................................................................................ 5 1.3 Acronyms .......
73M1822/73M1922 Control Module User Guide 4.6.11 4.6.12 4.6.13 4.6.14 4.6.15 4.6.16 4.6.17 UG_1x22_054 tsc_1x22_mafe_irq_hw ............................................................................................ 26 tsc_1x22_mafe_irq_sw............................................................................................. 27 tsc_1x22_mafe_irq_enable ...................................................................................... 27 tsc_1x22_mafe_irq_disable.................................
UG_1x22_054 1 73M1822/73M1922 Hardware Module for SMDK412 User Guide Introduction This document describes the capabilities of the 73M1822/73M1922 Hardware Module for the SMDK2412. This driver software is provided for use and integration by Teridian customers on their individual platforms. Throughout this document the 73M1822/73M1922 Hardware Module for the SMDK2412 is simply referred to as “driver” or “device driver”. The 73M1822 and 73M1922 is collectively referred to as the 73M1x22 or the device. 1.
73M1822/73M1922 Hardware Module for SMDK412 User Guide 2 2.1 UG_1x22_054 Overview Driver Architecture The driver provides a framework by which applications can leverage the features of the 73M1x22 device. The main interface of the driver provides an abstraction layer for monitoring and control of the device status. Figure 1 depicts the driver functional block diagram.
UG_1x22_054 3 73M1822/73M1922 Hardware Module for SMDK412 User Guide Accessing the Driver from the Linux User Space The driver provides the link between the modem device and the user application via a standard linux character device. Access to the driver is done via Linux supplied file descriptors The following sections describe how the driver is brought into action based on the operating system environment. 3.
73M1822/73M1922 Hardware Module for SMDK412 User Guide 3.3 UG_1x22_054 close Description A file descriptor obtained with an open() command must be subsequently released with a corresponding close.. Prototype int close (int fd); Parameters Data Type int Name fd Description File descriptor to close. Return Values Data Type Description int 0 = Success. -1 = Failure. 3.
UG_1x22_054 3.5 73M1822/73M1922 Hardware Module for SMDK412 User Guide write Description A file descriptor obtained with an open() command can be called with the standard Linux write command to transmit MAFE audio samples. The write command copy as many 16 bit samples from the user supplied buffer as possible and return the amount of data that was copied.
73M1822/73M1922 Hardware Module for SMDK412 User Guide UG_1x22_054 3.6.1 TSC_1X22_MAFE_GET_RS232 Description Retrieves the current status of the RS232 RTS, DTS, CTR and DTR pins. Prototype int ioctl ( int fd, int TSC_1X22_MAFE_GET_RS232, void ); Parameters Data Type Name Description int fd Channel descriptor. int TSC_1X22_MAFE_GET_RS232 I/O control identifier for this operation. void NA Return Values Data Type unsigned char Description See RS232 #defines. 3.6.
UG_1x22_054 73M1822/73M1922 Hardware Module for SMDK412 User Guide 3.6.3 TSC_1X22_MAFE_GET_RX_STAT Description Retrieves the current status of the Rx Data Sample FIFO. Prototype int ioctl ( int fd, int TSC_1X22_MAFE_GET_RX_STAT, void ); Parameters Data Type Name Description int fd Channel descriptor. int TSC_1X22_MAFE_GET_RX_STAT I/O control identifier for this operation. void NA Return Values Data Type Unsigned char Description See Rx and Tx FIFO status #defines. 3.6.
73M1822/73M1922 Hardware Module for SMDK412 User Guide UG_1x22_054 3.6.5 TSC_1X22_MAFE_RD_REG_NB Description It copies the last read value of the supplied register number into the members of the supplied structure pointer and then requests another read access from the device. Prototype int ioctl ( int fd, int TSC_1X22_MAFE_RD_REG_NB, TSC_1X22_REG_IOCTL_t *); Parameters Data Type Name Description int fd Channel descriptor. int TSC_1X22_MAFE_RD_REG_NB I/O control identifier.
UG_1x22_054 73M1822/73M1922 Hardware Module for SMDK412 User Guide 3.6.6 TSC_1X22_MAFE_RD_REG_IM Description It copies the last read value of the supplied register number into the members of the supplied structure pointer without requesting another read from the device. Prototype int ioctl ( int fd, int TSC_1X22_MAFE_RD_REG_IM, TSC_1X22_REG_IOCTL_t *); Parameters Data Type Name Description Int Fd Channel descriptor. Int TSC_1X22_MAFE_RD_REG_IM I/O control identifier.
73M1822/73M1922 Hardware Module for SMDK412 User Guide UG_1x22_054 3.6.8 TSC_1X22_MAFE_WR_REG_NB Description Issues a write command to the 73M1x22 device of the supplied register number with the supplied data. Prototype int ioctl ( int fd, int TSC_1X22_MAFE_WR_REG_NB, TSC_1X22_REG_IOCTL_t *); Parameters Data Type Name Description int fd Channel descriptor. int TSC_1X22_MAFE_WR_REG_NB I/O control identifier. TSC_1X22_REG_IOCTL_t * See TSC_1X22_REG_IOCTL_t.
UG_1x22_054 73M1822/73M1922 Hardware Module for SMDK412 User Guide 3.6.10 TSC_1X22_MAFE_SET_REG_AUTO_POLL Description This IOCLT starts/stops the automatic polling of the 73M1x22 device registers dependent upon the user supplied arguments. An argument (mask) of 0 disables this feature. Prototype int ioctl ( int fd, int TSC_1X22_MAFE_SET_REG_AUTO_POLL, unsigned int mask); Parameters Data Type Name Description int fd Channel descriptor. int TSC_1X22_MAFE_SET_REG_AUTO_POLL I/O control identifier.
73M1822/73M1922 Hardware Module for SMDK412 User Guide UG_1x22_054 3.6.12 TSC_1X22_MAFE_IRQ_SW Description This IOCTL enables the use of a SW based interrupt scheme for the 73M1x22 device to be reported through the HW Module. Auto polling (see TSC_1X22_MAFE_SET_REG_AUTO_POLL) must be enabled for register 0x03 for this feature to work properly. The interrupt mutex/enables remains in their current state after this call.
UG_1x22_054 73M1822/73M1922 Hardware Module for SMDK412 User Guide 3.6.14 TSC_1X22_MAFE_IRQ_DISABLE Description This IOCTL disables the reporting of interrupts for the 73M1x22 device through the HW Module. Prototype int ioctl ( int fd, int TSC_1X22_MAFE_IRQ_DISABLE); Parameters Data Type int Name fd Description int TSC_1X22_MAFE_IRQ_DISABLE I/O control identifier. Channel descriptor. Return Values Data Type Description int 0 = Success. -1 = Failure. 3.6.
73M1822/73M1922 Hardware Module for SMDK412 User Guide UG_1x22_054 3.6.16 TSC_1X22_MAFE_IRQ_DOWN_TRY Description This IOCTL attempts a mutex down_try call on an internal mutex. This IOCTL does not block and always completes. Prototype int ioctl ( int fd, int TSC_1X22_MAFE_IRQ_DOWN_TRY); Parameters Data Type int Name fd Description Channel descriptor. int TSC_1X22_MAFE_IRQ_DOWN_TRY I/O control identifier.
UG_1x22_054 4 73M1822/73M1922 Hardware Module for SMDK412 User Guide Accessing the Driver from the Linux Kernel Space When accessing the driver from the Linux Kernel space the user should use the exported API function calls instead of the standard device file based user space functions. 4.1 mknod The device does not require a character device file to be created via a mknod command to access the driver functionality from the kernel space. 4.
73M1822/73M1922 Hardware Module for SMDK412 User Guide 4.4 UG_1x22_054 tsc_1x22_mafe_read Description The user can call this tsc_1x22_mafe_read command to obtain MAFE audio samples. The read command reads as many 16 bit samples into the user supplied kernel space buffer as possible and returns the amount of data that was copied. Prototype size_t tsc_1x22_mafe_read (void * buf, size_t buf_size); Parameters Data Type Name Description int fd File descriptor.
UG_1x22_054 4.6 73M1822/73M1922 Hardware Module for SMDK412 User Guide ioctl Description The driver, while accessed from the kernel space, does not require the calling of a specific IOCTL command. The following sections detail the equivalent exported direct function calls that are available in the Kernel space. 4.6.1 tsc_1x22_rs232_get Description Retrieves the current status of the RS232 RTS, DTS, CTR and DTR pins.
73M1822/73M1922 Hardware Module for SMDK412 User Guide UG_1x22_054 4.6.3 tsc_1x22_mafe_get_rx_stat Description Retrieves the current status of the Rx Data Sample FIFO. IOCTL Equivalent TSC_1X22_MAFE_GET_RX_STAT Prototype int tsc_1x22_mafe_get_rx_stat (void); Parameters Data Type void Name NA Description NA Return Values Data Type unsigned char Description See Rx and Tx FIFO status #defines. 4.6.4 tsc_1x22_mafe_get_tx_stat Description Retrieves the current status of the Tx Data Sample FIFO.
UG_1x22_054 73M1822/73M1922 Hardware Module for SMDK412 User Guide 4.6.5 tsc_1x22_mafe_rd_rg_nb Description It copies the last read value of the supplied register number into the members of the supplied structure pointer and then requests another read update from the device. IOCTL Equivalent TSC_1X22_MAFE_RD_REG_NB Prototype int tsc_1x22_mafe_rd_rg_nb(TSC_1X22_REG_t *); Parameters Data Type TSC_1X22_REG_t * Name Description See TSC_1X22_REG_t. Return Values Data Type Description int 0 = Success.
73M1822/73M1922 Hardware Module for SMDK412 User Guide UG_1x22_054 4.6.6 tsc_1x22_mafe_rd_rg_im Description It copies the last read value of the supplied register number into the members of the supplied structure pointer without requesting another read from the device. IOCTL Equivalent TSC_1X22_MAFE_RD_REG_IM Prototype int tsc_1x22_mafe_rd_rg_im(TSC_1X22_REG_t *); Parameters Data Type Name TSC_1X22_REG_t * Description See TSC_1X22_REG_t. Return Values Data Type int Description 0 = Success.
UG_1x22_054 73M1822/73M1922 Hardware Module for SMDK412 User Guide 4.6.8 tsc_1x22_mafe_wr_rg_nb Description Issues a write command to the 73M1x22 device of the supplied register number with the supplied data. IOCTL Equivalent TSC_1X22_MAFE_WR_REG_NB Prototype int tsc_1x22_mafe_wr_rg_nb(TSC_1X22_REG_t *); Parameters Data Type Name TSC_1X22_REG_t * Description See TSC_1X22_REG_t. Return Values Data Type int Description 0 = Success. -1 = Failure. 4.6.
73M1822/73M1922 Hardware Module for SMDK412 User Guide UG_1x22_054 4.6.10 tsc_1x22_mafe_set_reg_auto_poll Description This starts/stops the automatic polling of the 73M1x22 device registers dependent upon the user supplied arguments. An argument (mask) of 0 disables this feature. IOCTL Equivalent TSC_1X22_MAFE_SET_REG_AUTO_POLL Prototype int tsc_1x22_mafe_set_reg_auto_poll(unsigned int mask); Parameters Data Type Name Description unsigned int mask If mask[bit i] is set then poll register i.
UG_1x22_054 73M1822/73M1922 Hardware Module for SMDK412 User Guide 4.6.12 tsc_1x22_mafe_irq_sw Description This IOCTL enables the use of a SW based interrupt scheme for the 73M1x22 device to be reported through the HW Module. Auto polling (see TSC_1X22_MAFE_SET_REG_AUTO_POLL) must be enabled for register 0x03 for this feature to work properly. The interrupt mutex/enables remains in their current state after this call.
73M1822/73M1922 Hardware Module for SMDK412 User Guide UG_1x22_054 4.6.14 tsc_1x22_mafe_irq_disable Description This IOCTL disables the reporting of interrupts for the 73M1x22 device through the HW Module. IOCTL Equivalent TSC_1X22_MAFE_IRQ_DISABLE Prototype void tsc_1x22_mafe_irq_disable(void); Parameters Data Type Name Description NA NA NA Return Values Data Type void Description NA 4.6.15 tsc_1x22_mafe_irq_down Description This IOCTL attempts a mutex down call on an internal mutex.
UG_1x22_054 73M1822/73M1922 Hardware Module for SMDK412 User Guide 4.6.16 tsc_1x22_mafe_irq_down_try Description This IOCTL attempts a mutex down_try call on an internal mutex. This IOCTL does not block and always complete. IOCTL Equivalent TSC_1X22_MAFE_IRQ_DOWN_TRY Prototype int tsc_1x22_mafe_irq_down_try(void); Parameters Data Type NA Name NA Description NA Return Values Data Type int Description Returns 0 upon successfully acquiring the lock, non-zero upon failure. 4.6.
73M1822/73M1922 Hardware Module for SMDK412 User Guide UG_1x22_054 4.7 Type and Structure Definition Reference This section contains the type definitions, reference of data type and structure used in the driver. 4.7.1 RS232 #defines Description #defines used in the TSC_1X22_MAFE_GET_RS232 and TSC_1X22_MAFE_SET_RS232 IOCTLs. Prototype #define #define #define #define RS232_DTR_O RS232_RTS_O RS232_DSR_I RS232_CTS_I 0x40 0x02 0x80 0x01 4.
UG_1x22_054 73M1822/73M1922 Hardware Module for SMDK412 User Guide 4.11 Driver Source and Include Files The driver software is written exclusively in the C programming language and consists of the following: Table 1: Driver Source Code Files File Name tsc_1x22_mafe_module.h Description Contains headers for the Linux module. tsc_1x22_mafe_module.c Contains definitions for the Linux module. tsc_1x22_mafe_api.h Contains headers for the exported API functions. tsc_1x22_mafe_api.
73M1822/73M1922 Hardware Module for SMDK412 User Guide UG_1x22_054 Revision History Revision Date Description 1.0 12/23/2009 First publication. 1.1 01/20/2010 In Section 3.6.5, added “and then requests another read access from the device” to the end of the description. Added Section 3.6.6, TSC_1x22_MAFE_RD_REG_IM. In Section 4.6.5, added “and then requests another read update from the device” to the end of the description. Added Section 4.6.6, tsc_1x22_mafe_rd_rg_im. 32 Rev. 1.