Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
sh_irda.c File Reference
#include <linux/io.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/clk.h>
#include <net/irda/wrapper.h>
#include <net/irda/irda_device.h>

Go to the source code of this file.

Data Structures

struct  sh_irda_xir_func
 
struct  sh_irda_self
 

Macros

#define DRIVER_NAME   "sh_irda"
 
#define __IRDARAM_LEN   0x1039
 
#define IRTMR   0x1F00 /* Transfer mode */
 
#define IRCFR   0x1F02 /* Configuration */
 
#define IRCTR   0x1F04 /* IR control */
 
#define IRTFLR   0x1F20 /* Transmit frame length */
 
#define IRTCTR   0x1F22 /* Transmit control */
 
#define IRRFLR   0x1F40 /* Receive frame length */
 
#define IRRCTR   0x1F42 /* Receive control */
 
#define SIRISR   0x1F60 /* SIR-UART mode interrupt source */
 
#define SIRIMR   0x1F62 /* SIR-UART mode interrupt mask */
 
#define SIRICR   0x1F64 /* SIR-UART mode interrupt clear */
 
#define SIRBCR   0x1F68 /* SIR-UART mode baud rate count */
 
#define MFIRISR   0x1F70 /* MIR/FIR mode interrupt source */
 
#define MFIRIMR   0x1F72 /* MIR/FIR mode interrupt mask */
 
#define MFIRICR   0x1F74 /* MIR/FIR mode interrupt clear */
 
#define CRCCTR   0x1F80 /* CRC engine control */
 
#define CRCIR   0x1F86 /* CRC engine input data */
 
#define CRCCR   0x1F8A /* CRC engine calculation */
 
#define CRCOR   0x1F8E /* CRC engine output data */
 
#define FIFOCP   0x1FC0 /* FIFO current pointer */
 
#define FIFOFP   0x1FC2 /* FIFO follow pointer */
 
#define FIFORSMSK   0x1FC4 /* FIFO receive status mask */
 
#define FIFORSOR   0x1FC6 /* FIFO receive status OR */
 
#define FIFOSEL   0x1FC8 /* FIFO select */
 
#define FIFORS   0x1FCA /* FIFO receive status */
 
#define FIFORFL   0x1FCC /* FIFO receive frame length */
 
#define FIFORAMCP   0x1FCE /* FIFO RAM current pointer */
 
#define FIFORAMFP   0x1FD0 /* FIFO RAM follow pointer */
 
#define BIFCTL   0x1FD2 /* BUS interface control */
 
#define IRDARAM   0x0000 /* IrDA buffer RAM */
 
#define IRDARAM_LEN   __IRDARAM_LEN /* - 8/16/32 (read-only for 32) */
 
#define TMD_MASK   (0x3 << 14) /* Transfer Mode */
 
#define TMD_SIR   (0x0 << 14)
 
#define TMD_MIR   (0x3 << 14)
 
#define TMD_FIR   (0x2 << 14)
 
#define FIFORIM   (1 << 8) /* FIFO receive interrupt mask */
 
#define MIM   (1 << 4) /* MIR/FIR Interrupt Mask */
 
#define SIM   (1 << 0) /* SIR Interrupt Mask */
 
#define xIM_MASK   (FIFORIM | MIM | SIM)
 
#define RTO_SHIFT   8 /* shift for Receive Timeout */
 
#define RTO   (0x3 << RTO_SHIFT)
 
#define ARMOD   (1 << 15) /* Auto-Receive Mode */
 
#define TE   (1 << 0) /* Transmit Enable */
 
#define RFL_MASK   (0x1FFF) /* mask for Receive Frame Length */
 
#define RE   (1 << 0) /* Receive Enable */
 
#define FRE   (1 << 15) /* Frame Receive End */
 
#define TROV   (1 << 11) /* Transfer Area Overflow */
 
#define xIR_9   (1 << 9)
 
#define TOT   xIR_9 /* for SIR Timeout */
 
#define ABTD   xIR_9 /* for MIR/FIR Abort Detection */
 
#define xIR_8   (1 << 8)
 
#define FER   xIR_8 /* for SIR Framing Error */
 
#define CRCER   xIR_8 /* for MIR/FIR CRC error */
 
#define FTE   (1 << 7) /* Frame Transmit End */
 
#define xIR_MASK   (FRE | TROV | xIR_9 | xIR_8 | FTE)
 
#define BRC_MASK   (0x3F) /* mask for Baud Rate Count */
 
#define CRC_RST   (1 << 15) /* CRC Engine Reset */
 
#define CRC_CT_MASK   0x0FFF /* mask for CRC Engine Input Data Count */
 
#define CRC_IN_MASK   0x0FFF /* mask for CRC Engine Input Data */
 

Enumerations

enum  sh_irda_mode { SH_IRDA_NONE = 0, SH_IRDA_SIR, SH_IRDA_MIR, SH_IRDA_FIR }
 

Functions

 module_platform_driver (sh_irda_driver)
 
 MODULE_AUTHOR ("Kuninori Morimoto <[email protected]>")
 
 MODULE_DESCRIPTION ("SuperH IrDA driver")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define __IRDARAM_LEN   0x1039

Definition at line 39 of file sh_irda.c.

#define ABTD   xIR_9 /* for MIR/FIR Abort Detection */

Definition at line 106 of file sh_irda.c.

#define ARMOD   (1 << 15) /* Auto-Receive Mode */

Definition at line 89 of file sh_irda.c.

#define BIFCTL   0x1FD2 /* BUS interface control */

Definition at line 69 of file sh_irda.c.

#define BRC_MASK   (0x3F) /* mask for Baud Rate Count */

Definition at line 114 of file sh_irda.c.

#define CRC_CT_MASK   0x0FFF /* mask for CRC Engine Input Data Count */

Definition at line 118 of file sh_irda.c.

#define CRC_IN_MASK   0x0FFF /* mask for CRC Engine Input Data */

Definition at line 121 of file sh_irda.c.

#define CRC_RST   (1 << 15) /* CRC Engine Reset */

Definition at line 117 of file sh_irda.c.

#define CRCCR   0x1F8A /* CRC engine calculation */

Definition at line 58 of file sh_irda.c.

#define CRCCTR   0x1F80 /* CRC engine control */

Definition at line 56 of file sh_irda.c.

#define CRCER   xIR_8 /* for MIR/FIR CRC error */

Definition at line 109 of file sh_irda.c.

#define CRCIR   0x1F86 /* CRC engine input data */

Definition at line 57 of file sh_irda.c.

#define CRCOR   0x1F8E /* CRC engine output data */

Definition at line 59 of file sh_irda.c.

#define DRIVER_NAME   "sh_irda"

Definition at line 34 of file sh_irda.c.

#define FER   xIR_8 /* for SIR Framing Error */

Definition at line 108 of file sh_irda.c.

#define FIFOCP   0x1FC0 /* FIFO current pointer */

Definition at line 60 of file sh_irda.c.

#define FIFOFP   0x1FC2 /* FIFO follow pointer */

Definition at line 61 of file sh_irda.c.

#define FIFORAMCP   0x1FCE /* FIFO RAM current pointer */

Definition at line 67 of file sh_irda.c.

#define FIFORAMFP   0x1FD0 /* FIFO RAM follow pointer */

Definition at line 68 of file sh_irda.c.

#define FIFORFL   0x1FCC /* FIFO receive frame length */

Definition at line 66 of file sh_irda.c.

#define FIFORIM   (1 << 8) /* FIFO receive interrupt mask */

Definition at line 79 of file sh_irda.c.

#define FIFORS   0x1FCA /* FIFO receive status */

Definition at line 65 of file sh_irda.c.

#define FIFORSMSK   0x1FC4 /* FIFO receive status mask */

Definition at line 62 of file sh_irda.c.

#define FIFORSOR   0x1FC6 /* FIFO receive status OR */

Definition at line 63 of file sh_irda.c.

#define FIFOSEL   0x1FC8 /* FIFO select */

Definition at line 64 of file sh_irda.c.

#define FRE   (1 << 15) /* Frame Receive End */

Definition at line 102 of file sh_irda.c.

#define FTE   (1 << 7) /* Frame Transmit End */

Definition at line 110 of file sh_irda.c.

#define IRCFR   0x1F02 /* Configuration */

Definition at line 43 of file sh_irda.c.

#define IRCTR   0x1F04 /* IR control */

Definition at line 44 of file sh_irda.c.

#define IRDARAM   0x0000 /* IrDA buffer RAM */

Definition at line 70 of file sh_irda.c.

#define IRDARAM_LEN   __IRDARAM_LEN /* - 8/16/32 (read-only for 32) */

Definition at line 71 of file sh_irda.c.

#define IRRCTR   0x1F42 /* Receive control */

Definition at line 48 of file sh_irda.c.

#define IRRFLR   0x1F40 /* Receive frame length */

Definition at line 47 of file sh_irda.c.

#define IRTCTR   0x1F22 /* Transmit control */

Definition at line 46 of file sh_irda.c.

#define IRTFLR   0x1F20 /* Transmit frame length */

Definition at line 45 of file sh_irda.c.

#define IRTMR   0x1F00 /* Transfer mode */

Definition at line 42 of file sh_irda.c.

#define MFIRICR   0x1F74 /* MIR/FIR mode interrupt clear */

Definition at line 55 of file sh_irda.c.

#define MFIRIMR   0x1F72 /* MIR/FIR mode interrupt mask */

Definition at line 54 of file sh_irda.c.

#define MFIRISR   0x1F70 /* MIR/FIR mode interrupt source */

Definition at line 53 of file sh_irda.c.

#define MIM   (1 << 4) /* MIR/FIR Interrupt Mask */

Definition at line 80 of file sh_irda.c.

#define RE   (1 << 0) /* Receive Enable */

Definition at line 96 of file sh_irda.c.

#define RFL_MASK   (0x1FFF) /* mask for Receive Frame Length */

Definition at line 93 of file sh_irda.c.

#define RTO   (0x3 << RTO_SHIFT)

Definition at line 86 of file sh_irda.c.

#define RTO_SHIFT   8 /* shift for Receive Timeout */

Definition at line 85 of file sh_irda.c.

#define SIM   (1 << 0) /* SIR Interrupt Mask */

Definition at line 81 of file sh_irda.c.

#define SIRBCR   0x1F68 /* SIR-UART mode baud rate count */

Definition at line 52 of file sh_irda.c.

#define SIRICR   0x1F64 /* SIR-UART mode interrupt clear */

Definition at line 51 of file sh_irda.c.

#define SIRIMR   0x1F62 /* SIR-UART mode interrupt mask */

Definition at line 50 of file sh_irda.c.

#define SIRISR   0x1F60 /* SIR-UART mode interrupt source */

Definition at line 49 of file sh_irda.c.

#define TE   (1 << 0) /* Transmit Enable */

Definition at line 90 of file sh_irda.c.

#define TMD_FIR   (0x2 << 14)

Definition at line 77 of file sh_irda.c.

#define TMD_MASK   (0x3 << 14) /* Transfer Mode */

Definition at line 74 of file sh_irda.c.

#define TMD_MIR   (0x3 << 14)

Definition at line 76 of file sh_irda.c.

#define TMD_SIR   (0x0 << 14)

Definition at line 75 of file sh_irda.c.

#define TOT   xIR_9 /* for SIR Timeout */

Definition at line 105 of file sh_irda.c.

#define TROV   (1 << 11) /* Transfer Area Overflow */

Definition at line 103 of file sh_irda.c.

#define xIM_MASK   (FIFORIM | MIM | SIM)

Definition at line 82 of file sh_irda.c.

#define xIR_8   (1 << 8)

Definition at line 107 of file sh_irda.c.

#define xIR_9   (1 << 9)

Definition at line 104 of file sh_irda.c.

#define xIR_MASK   (FRE | TROV | xIR_9 | xIR_8 | FTE)

Definition at line 111 of file sh_irda.c.

Enumeration Type Documentation

Enumerator:
SH_IRDA_NONE 
SH_IRDA_SIR 
SH_IRDA_MIR 
SH_IRDA_FIR 

Definition at line 130 of file sh_irda.c.

Function Documentation

MODULE_AUTHOR ( "Kuninori Morimoto <[email protected]>"  )
MODULE_DESCRIPTION ( "SuperH IrDA driver )
MODULE_LICENSE ( "GPL"  )
module_platform_driver ( sh_irda_driver  )