Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
extcon-max8997.c File Reference
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/i2c.h>
#include <linux/slab.h>
#include <linux/interrupt.h>
#include <linux/err.h>
#include <linux/platform_device.h>
#include <linux/kobject.h>
#include <linux/mfd/max8997.h>
#include <linux/mfd/max8997-private.h>
#include <linux/extcon.h>
#include <linux/irqdomain.h>

Go to the source code of this file.

Data Structures

struct  max8997_muic_irq
 
struct  max8997_muic_info
 

Macros

#define DEV_NAME   "max8997-muic"
 
#define STATUS1_ADC_SHIFT   0
 
#define STATUS1_ADCLOW_SHIFT   5
 
#define STATUS1_ADCERR_SHIFT   6
 
#define STATUS1_ADC_MASK   (0x1f << STATUS1_ADC_SHIFT)
 
#define STATUS1_ADCLOW_MASK   (0x1 << STATUS1_ADCLOW_SHIFT)
 
#define STATUS1_ADCERR_MASK   (0x1 << STATUS1_ADCERR_SHIFT)
 
#define STATUS2_CHGTYP_SHIFT   0
 
#define STATUS2_CHGDETRUN_SHIFT   3
 
#define STATUS2_DCDTMR_SHIFT   4
 
#define STATUS2_DBCHG_SHIFT   5
 
#define STATUS2_VBVOLT_SHIFT   6
 
#define STATUS2_CHGTYP_MASK   (0x7 << STATUS2_CHGTYP_SHIFT)
 
#define STATUS2_CHGDETRUN_MASK   (0x1 << STATUS2_CHGDETRUN_SHIFT)
 
#define STATUS2_DCDTMR_MASK   (0x1 << STATUS2_DCDTMR_SHIFT)
 
#define STATUS2_DBCHG_MASK   (0x1 << STATUS2_DBCHG_SHIFT)
 
#define STATUS2_VBVOLT_MASK   (0x1 << STATUS2_VBVOLT_SHIFT)
 
#define STATUS3_OVP_SHIFT   2
 
#define STATUS3_OVP_MASK   (0x1 << STATUS3_OVP_SHIFT)
 
#define COMN1SW_SHIFT   0
 
#define COMP2SW_SHIFT   3
 
#define COMN1SW_MASK   (0x7 << COMN1SW_SHIFT)
 
#define COMP2SW_MASK   (0x7 << COMP2SW_SHIFT)
 
#define SW_MASK   (COMP2SW_MASK | COMN1SW_MASK)
 
#define MAX8997_SW_USB   ((1 << COMP2SW_SHIFT) | (1 << COMN1SW_SHIFT))
 
#define MAX8997_SW_AUDIO   ((2 << COMP2SW_SHIFT) | (2 << COMN1SW_SHIFT))
 
#define MAX8997_SW_UART   ((3 << COMP2SW_SHIFT) | (3 << COMN1SW_SHIFT))
 
#define MAX8997_SW_OPEN   ((0 << COMP2SW_SHIFT) | (0 << COMN1SW_SHIFT))
 
#define MAX8997_ADC_GROUND   0x00
 
#define MAX8997_ADC_MHL   0x01
 
#define MAX8997_ADC_JIG_USB_1   0x18
 
#define MAX8997_ADC_JIG_USB_2   0x19
 
#define MAX8997_ADC_DESKDOCK   0x1a
 
#define MAX8997_ADC_JIG_UART   0x1c
 
#define MAX8997_ADC_CARDOCK   0x1d
 
#define MAX8997_ADC_OPEN   0x1f
 

Functions

 module_platform_driver (max8997_muic_driver)
 
 MODULE_DESCRIPTION ("Maxim MAX8997 Extcon driver")
 
 MODULE_AUTHOR ("Donggeun Kim <[email protected]>")
 
 MODULE_LICENSE ("GPL")
 

Variables

const charmax8997_extcon_cable []
 

Macro Definition Documentation

#define COMN1SW_MASK   (0x7 << COMN1SW_SHIFT)

Definition at line 60 of file extcon-max8997.c.

#define COMN1SW_SHIFT   0

Definition at line 58 of file extcon-max8997.c.

#define COMP2SW_MASK   (0x7 << COMP2SW_SHIFT)

Definition at line 61 of file extcon-max8997.c.

#define COMP2SW_SHIFT   3

Definition at line 59 of file extcon-max8997.c.

#define DEV_NAME   "max8997-muic"

Definition at line 31 of file extcon-max8997.c.

#define MAX8997_ADC_CARDOCK   0x1d

Definition at line 75 of file extcon-max8997.c.

#define MAX8997_ADC_DESKDOCK   0x1a

Definition at line 73 of file extcon-max8997.c.

#define MAX8997_ADC_GROUND   0x00

Definition at line 69 of file extcon-max8997.c.

#define MAX8997_ADC_JIG_UART   0x1c

Definition at line 74 of file extcon-max8997.c.

#define MAX8997_ADC_JIG_USB_1   0x18

Definition at line 71 of file extcon-max8997.c.

#define MAX8997_ADC_JIG_USB_2   0x19

Definition at line 72 of file extcon-max8997.c.

#define MAX8997_ADC_MHL   0x01

Definition at line 70 of file extcon-max8997.c.

#define MAX8997_ADC_OPEN   0x1f

Definition at line 76 of file extcon-max8997.c.

#define MAX8997_SW_AUDIO   ((2 << COMP2SW_SHIFT) | (2 << COMN1SW_SHIFT))

Definition at line 65 of file extcon-max8997.c.

#define MAX8997_SW_OPEN   ((0 << COMP2SW_SHIFT) | (0 << COMN1SW_SHIFT))

Definition at line 67 of file extcon-max8997.c.

#define MAX8997_SW_UART   ((3 << COMP2SW_SHIFT) | (3 << COMN1SW_SHIFT))

Definition at line 66 of file extcon-max8997.c.

#define MAX8997_SW_USB   ((1 << COMP2SW_SHIFT) | (1 << COMN1SW_SHIFT))

Definition at line 64 of file extcon-max8997.c.

#define STATUS1_ADC_MASK   (0x1f << STATUS1_ADC_SHIFT)

Definition at line 37 of file extcon-max8997.c.

#define STATUS1_ADC_SHIFT   0

Definition at line 34 of file extcon-max8997.c.

#define STATUS1_ADCERR_MASK   (0x1 << STATUS1_ADCERR_SHIFT)

Definition at line 39 of file extcon-max8997.c.

#define STATUS1_ADCERR_SHIFT   6

Definition at line 36 of file extcon-max8997.c.

#define STATUS1_ADCLOW_MASK   (0x1 << STATUS1_ADCLOW_SHIFT)

Definition at line 38 of file extcon-max8997.c.

#define STATUS1_ADCLOW_SHIFT   5

Definition at line 35 of file extcon-max8997.c.

#define STATUS2_CHGDETRUN_MASK   (0x1 << STATUS2_CHGDETRUN_SHIFT)

Definition at line 48 of file extcon-max8997.c.

#define STATUS2_CHGDETRUN_SHIFT   3

Definition at line 43 of file extcon-max8997.c.

#define STATUS2_CHGTYP_MASK   (0x7 << STATUS2_CHGTYP_SHIFT)

Definition at line 47 of file extcon-max8997.c.

#define STATUS2_CHGTYP_SHIFT   0

Definition at line 42 of file extcon-max8997.c.

#define STATUS2_DBCHG_MASK   (0x1 << STATUS2_DBCHG_SHIFT)

Definition at line 50 of file extcon-max8997.c.

#define STATUS2_DBCHG_SHIFT   5

Definition at line 45 of file extcon-max8997.c.

#define STATUS2_DCDTMR_MASK   (0x1 << STATUS2_DCDTMR_SHIFT)

Definition at line 49 of file extcon-max8997.c.

#define STATUS2_DCDTMR_SHIFT   4

Definition at line 44 of file extcon-max8997.c.

#define STATUS2_VBVOLT_MASK   (0x1 << STATUS2_VBVOLT_SHIFT)

Definition at line 51 of file extcon-max8997.c.

#define STATUS2_VBVOLT_SHIFT   6

Definition at line 46 of file extcon-max8997.c.

#define STATUS3_OVP_MASK   (0x1 << STATUS3_OVP_SHIFT)

Definition at line 55 of file extcon-max8997.c.

#define STATUS3_OVP_SHIFT   2

Definition at line 54 of file extcon-max8997.c.

#define SW_MASK   (COMP2SW_MASK | COMN1SW_MASK)

Definition at line 62 of file extcon-max8997.c.

Function Documentation

MODULE_AUTHOR ( "Donggeun Kim <[email protected]>"  )
MODULE_DESCRIPTION ( "Maxim MAX8997 Extcon driver )
MODULE_LICENSE ( "GPL"  )
module_platform_driver ( max8997_muic_driver  )

Variable Documentation

const char* max8997_extcon_cable[]
Initial value:
= {
[0] = "USB",
[1] = "USB-Host",
[2] = "TA",
[3] = "Fast-charger",
[4] = "Slow-charger",
[5] = "Charge-downstream",
[6] = "MHL",
[7] = "Dock-desk",
[8] = "Dock-card",
[9] = "JIG",
}

Definition at line 112 of file extcon-max8997.c.