Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
gpio-max732x.c File Reference
#include <linux/module.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/string.h>
#include <linux/gpio.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/i2c.h>
#include <linux/i2c/max732x.h>

Go to the source code of this file.

Data Structures

struct  max732x_chip
 

Macros

#define PORT_NONE   0x0 /* '/' No Port */
 
#define PORT_OUTPUT   0x1 /* 'O' Push-Pull, Output Only */
 
#define PORT_INPUT   0x2 /* 'I' Input Only */
 
#define PORT_OPENDRAIN   0x3 /* 'P' Open-Drain, I/O */
 
#define IO_4I4O   0x5AA5 /* O7 O6 I5 I4 I3 I2 O1 O0 */
 
#define IO_4P4O   0x5FF5 /* O7 O6 P5 P4 P3 P2 O1 O0 */
 
#define IO_8I   0xAAAA /* I7 I6 I5 I4 I3 I2 I1 I0 */
 
#define IO_8P   0xFFFF /* P7 P6 P5 P4 P3 P2 P1 P0 */
 
#define IO_8O   0x5555 /* O7 O6 O5 O4 O3 O2 O1 O0 */
 
#define GROUP_A(x)   ((x) & 0xffff) /* I2C Addr: 0b'110xxxx */
 
#define GROUP_B(x)   ((x) << 16) /* I2C Addr: 0b'101xxxx */
 
#define INT_NONE   0x0 /* No interrupt capability */
 
#define INT_NO_MASK   0x1 /* Has interrupts, no mask */
 
#define INT_INDEP_MASK   0x2 /* Has interrupts, independent mask */
 
#define INT_MERGED_MASK   0x3 /* Has interrupts, merged mask */
 
#define INT_CAPS(x)   (((uint64_t)(x)) << 32)
 

Enumerations

enum  {
  MAX7319, MAX7320, MAX7321, MAX7322,
  MAX7323, MAX7324, MAX7325, MAX7326,
  MAX7327
}
 

Functions

 MODULE_DEVICE_TABLE (i2c, max732x_id)
 
 subsys_initcall (max732x_init)
 
 module_exit (max732x_exit)
 
 MODULE_AUTHOR ("Eric Miao <[email protected]>")
 
 MODULE_DESCRIPTION ("GPIO expander driver for MAX732X")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define GROUP_A (   x)    ((x) & 0xffff) /* I2C Addr: 0b'110xxxx */

Definition at line 71 of file gpio-max732x.c.

#define GROUP_B (   x)    ((x) << 16) /* I2C Addr: 0b'101xxxx */

Definition at line 72 of file gpio-max732x.c.

#define INT_CAPS (   x)    (((uint64_t)(x)) << 32)

Definition at line 79 of file gpio-max732x.c.

#define INT_INDEP_MASK   0x2 /* Has interrupts, independent mask */

Definition at line 76 of file gpio-max732x.c.

#define INT_MERGED_MASK   0x3 /* Has interrupts, merged mask */

Definition at line 77 of file gpio-max732x.c.

#define INT_NO_MASK   0x1 /* Has interrupts, no mask */

Definition at line 75 of file gpio-max732x.c.

#define INT_NONE   0x0 /* No interrupt capability */

Definition at line 74 of file gpio-max732x.c.

#define IO_4I4O   0x5AA5 /* O7 O6 I5 I4 I3 I2 O1 O0 */

Definition at line 65 of file gpio-max732x.c.

#define IO_4P4O   0x5FF5 /* O7 O6 P5 P4 P3 P2 O1 O0 */

Definition at line 66 of file gpio-max732x.c.

#define IO_8I   0xAAAA /* I7 I6 I5 I4 I3 I2 I1 I0 */

Definition at line 67 of file gpio-max732x.c.

#define IO_8O   0x5555 /* O7 O6 O5 O4 O3 O2 O1 O0 */

Definition at line 69 of file gpio-max732x.c.

#define IO_8P   0xFFFF /* P7 P6 P5 P4 P3 P2 P1 P0 */

Definition at line 68 of file gpio-max732x.c.

#define PORT_INPUT   0x2 /* 'I' Input Only */

Definition at line 62 of file gpio-max732x.c.

#define PORT_NONE   0x0 /* '/' No Port */

Definition at line 60 of file gpio-max732x.c.

#define PORT_OPENDRAIN   0x3 /* 'P' Open-Drain, I/O */

Definition at line 63 of file gpio-max732x.c.

#define PORT_OUTPUT   0x1 /* 'O' Push-Pull, Output Only */

Definition at line 61 of file gpio-max732x.c.

Enumeration Type Documentation

anonymous enum
Enumerator:
MAX7319 
MAX7320 
MAX7321 
MAX7322 
MAX7323 
MAX7324 
MAX7325 
MAX7326 
MAX7327 

Definition at line 81 of file gpio-max732x.c.

Function Documentation

MODULE_AUTHOR ( "Eric Miao <[email protected]>"  )
MODULE_DESCRIPTION ( "GPIO expander driver for MAX732X"  )
MODULE_DEVICE_TABLE ( i2c  ,
max732x_id   
)
module_exit ( max732x_exit  )
MODULE_LICENSE ( "GPL"  )
subsys_initcall ( max732x_init  )