Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
fsa9480.c File Reference
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/err.h>
#include <linux/i2c.h>
#include <linux/platform_data/fsa9480.h>
#include <linux/irq.h>
#include <linux/interrupt.h>
#include <linux/workqueue.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/pm_runtime.h>

Go to the source code of this file.

Data Structures

struct  fsa9480_usbsw
 

Macros

#define FSA9480_REG_DEVID   0x01
 
#define FSA9480_REG_CTRL   0x02
 
#define FSA9480_REG_INT1   0x03
 
#define FSA9480_REG_INT2   0x04
 
#define FSA9480_REG_INT1_MASK   0x05
 
#define FSA9480_REG_INT2_MASK   0x06
 
#define FSA9480_REG_ADC   0x07
 
#define FSA9480_REG_TIMING1   0x08
 
#define FSA9480_REG_TIMING2   0x09
 
#define FSA9480_REG_DEV_T1   0x0a
 
#define FSA9480_REG_DEV_T2   0x0b
 
#define FSA9480_REG_BTN1   0x0c
 
#define FSA9480_REG_BTN2   0x0d
 
#define FSA9480_REG_CK   0x0e
 
#define FSA9480_REG_CK_INT1   0x0f
 
#define FSA9480_REG_CK_INT2   0x10
 
#define FSA9480_REG_CK_INTMASK1   0x11
 
#define FSA9480_REG_CK_INTMASK2   0x12
 
#define FSA9480_REG_MANSW1   0x13
 
#define FSA9480_REG_MANSW2   0x14
 
#define CON_SWITCH_OPEN   (1 << 4)
 
#define CON_RAW_DATA   (1 << 3)
 
#define CON_MANUAL_SW   (1 << 2)
 
#define CON_WAIT   (1 << 1)
 
#define CON_INT_MASK   (1 << 0)
 
#define CON_MASK
 
#define DEV_USB_OTG   (1 << 7)
 
#define DEV_DEDICATED_CHG   (1 << 6)
 
#define DEV_USB_CHG   (1 << 5)
 
#define DEV_CAR_KIT   (1 << 4)
 
#define DEV_UART   (1 << 3)
 
#define DEV_USB   (1 << 2)
 
#define DEV_AUDIO_2   (1 << 1)
 
#define DEV_AUDIO_1   (1 << 0)
 
#define DEV_T1_USB_MASK   (DEV_USB_OTG | DEV_USB)
 
#define DEV_T1_UART_MASK   (DEV_UART)
 
#define DEV_T1_CHARGER_MASK   (DEV_DEDICATED_CHG | DEV_USB_CHG)
 
#define DEV_AV   (1 << 6)
 
#define DEV_TTY   (1 << 5)
 
#define DEV_PPD   (1 << 4)
 
#define DEV_JIG_UART_OFF   (1 << 3)
 
#define DEV_JIG_UART_ON   (1 << 2)
 
#define DEV_JIG_USB_OFF   (1 << 1)
 
#define DEV_JIG_USB_ON   (1 << 0)
 
#define DEV_T2_USB_MASK   (DEV_JIG_USB_OFF | DEV_JIG_USB_ON)
 
#define DEV_T2_UART_MASK   (DEV_JIG_UART_OFF | DEV_JIG_UART_ON)
 
#define DEV_T2_JIG_MASK
 
#define SW_VAUDIO   ((4 << 5) | (4 << 2))
 
#define SW_UART   ((3 << 5) | (3 << 2))
 
#define SW_AUDIO   ((2 << 5) | (2 << 2))
 
#define SW_DHOST   ((1 << 5) | (1 << 2))
 
#define SW_AUTO   ((0 << 5) | (0 << 2))
 
#define INT_DETACH   (1 << 1)
 
#define INT_ATTACH   (1 << 0)
 
#define fsa9480_suspend   NULL
 
#define fsa9480_resume   NULL
 

Functions

 MODULE_DEVICE_TABLE (i2c, fsa9480_id)
 
 module_i2c_driver (fsa9480_i2c_driver)
 
 MODULE_AUTHOR ("Minkyu Kang <[email protected]>")
 
 MODULE_DESCRIPTION ("FSA9480 USB Switch driver")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define CON_INT_MASK   (1 << 0)

Definition at line 52 of file fsa9480.c.

#define CON_MANUAL_SW   (1 << 2)

Definition at line 50 of file fsa9480.c.

#define CON_MASK
Value:
CON_MANUAL_SW | CON_WAIT)

Definition at line 53 of file fsa9480.c.

#define CON_RAW_DATA   (1 << 3)

Definition at line 49 of file fsa9480.c.

#define CON_SWITCH_OPEN   (1 << 4)

Definition at line 48 of file fsa9480.c.

#define CON_WAIT   (1 << 1)

Definition at line 51 of file fsa9480.c.

#define DEV_AUDIO_1   (1 << 0)

Definition at line 64 of file fsa9480.c.

#define DEV_AUDIO_2   (1 << 1)

Definition at line 63 of file fsa9480.c.

#define DEV_AV   (1 << 6)

Definition at line 71 of file fsa9480.c.

#define DEV_CAR_KIT   (1 << 4)

Definition at line 60 of file fsa9480.c.

#define DEV_DEDICATED_CHG   (1 << 6)

Definition at line 58 of file fsa9480.c.

#define DEV_JIG_UART_OFF   (1 << 3)

Definition at line 74 of file fsa9480.c.

#define DEV_JIG_UART_ON   (1 << 2)

Definition at line 75 of file fsa9480.c.

#define DEV_JIG_USB_OFF   (1 << 1)

Definition at line 76 of file fsa9480.c.

#define DEV_JIG_USB_ON   (1 << 0)

Definition at line 77 of file fsa9480.c.

#define DEV_PPD   (1 << 4)

Definition at line 73 of file fsa9480.c.

#define DEV_T1_CHARGER_MASK   (DEV_DEDICATED_CHG | DEV_USB_CHG)

Definition at line 68 of file fsa9480.c.

#define DEV_T1_UART_MASK   (DEV_UART)

Definition at line 67 of file fsa9480.c.

#define DEV_T1_USB_MASK   (DEV_USB_OTG | DEV_USB)

Definition at line 66 of file fsa9480.c.

#define DEV_T2_JIG_MASK
Value:
DEV_JIG_UART_OFF | DEV_JIG_UART_ON)

Definition at line 81 of file fsa9480.c.

#define DEV_T2_UART_MASK   (DEV_JIG_UART_OFF | DEV_JIG_UART_ON)

Definition at line 80 of file fsa9480.c.

#define DEV_T2_USB_MASK   (DEV_JIG_USB_OFF | DEV_JIG_USB_ON)

Definition at line 79 of file fsa9480.c.

#define DEV_TTY   (1 << 5)

Definition at line 72 of file fsa9480.c.

#define DEV_UART   (1 << 3)

Definition at line 61 of file fsa9480.c.

#define DEV_USB   (1 << 2)

Definition at line 62 of file fsa9480.c.

#define DEV_USB_CHG   (1 << 5)

Definition at line 59 of file fsa9480.c.

#define DEV_USB_OTG   (1 << 7)

Definition at line 57 of file fsa9480.c.

#define FSA9480_REG_ADC   0x07

Definition at line 32 of file fsa9480.c.

#define FSA9480_REG_BTN1   0x0c

Definition at line 37 of file fsa9480.c.

#define FSA9480_REG_BTN2   0x0d

Definition at line 38 of file fsa9480.c.

#define FSA9480_REG_CK   0x0e

Definition at line 39 of file fsa9480.c.

#define FSA9480_REG_CK_INT1   0x0f

Definition at line 40 of file fsa9480.c.

#define FSA9480_REG_CK_INT2   0x10

Definition at line 41 of file fsa9480.c.

#define FSA9480_REG_CK_INTMASK1   0x11

Definition at line 42 of file fsa9480.c.

#define FSA9480_REG_CK_INTMASK2   0x12

Definition at line 43 of file fsa9480.c.

#define FSA9480_REG_CTRL   0x02

Definition at line 27 of file fsa9480.c.

#define FSA9480_REG_DEV_T1   0x0a

Definition at line 35 of file fsa9480.c.

#define FSA9480_REG_DEV_T2   0x0b

Definition at line 36 of file fsa9480.c.

#define FSA9480_REG_DEVID   0x01

Definition at line 26 of file fsa9480.c.

#define FSA9480_REG_INT1   0x03

Definition at line 28 of file fsa9480.c.

#define FSA9480_REG_INT1_MASK   0x05

Definition at line 30 of file fsa9480.c.

#define FSA9480_REG_INT2   0x04

Definition at line 29 of file fsa9480.c.

#define FSA9480_REG_INT2_MASK   0x06

Definition at line 31 of file fsa9480.c.

#define FSA9480_REG_MANSW1   0x13

Definition at line 44 of file fsa9480.c.

#define FSA9480_REG_MANSW2   0x14

Definition at line 45 of file fsa9480.c.

#define FSA9480_REG_TIMING1   0x08

Definition at line 33 of file fsa9480.c.

#define FSA9480_REG_TIMING2   0x09

Definition at line 34 of file fsa9480.c.

#define fsa9480_resume   NULL

Definition at line 521 of file fsa9480.c.

#define fsa9480_suspend   NULL

Definition at line 520 of file fsa9480.c.

#define INT_ATTACH   (1 << 0)

Definition at line 97 of file fsa9480.c.

#define INT_DETACH   (1 << 1)

Definition at line 96 of file fsa9480.c.

#define SW_AUDIO   ((2 << 5) | (2 << 2))

Definition at line 91 of file fsa9480.c.

#define SW_AUTO   ((0 << 5) | (0 << 2))

Definition at line 93 of file fsa9480.c.

#define SW_DHOST   ((1 << 5) | (1 << 2))

Definition at line 92 of file fsa9480.c.

#define SW_UART   ((3 << 5) | (3 << 2))

Definition at line 90 of file fsa9480.c.

#define SW_VAUDIO   ((4 << 5) | (4 << 2))

Definition at line 89 of file fsa9480.c.

Function Documentation

MODULE_AUTHOR ( "Minkyu Kang <[email protected]>"  )
MODULE_DESCRIPTION ( "FSA9480 USB Switch driver )
MODULE_DEVICE_TABLE ( i2c  ,
fsa9480_id   
)
module_i2c_driver ( fsa9480_i2c_driver  )
MODULE_LICENSE ( "GPL"  )