Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
gpio-max730x.c File Reference
#include <linux/module.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/mutex.h>
#include <linux/spi/max7301.h>
#include <linux/gpio.h>
#include <linux/slab.h>

Go to the source code of this file.

Macros

#define PIN_CONFIG_MASK   0x03
 
#define PIN_CONFIG_IN_PULLUP   0x03
 
#define PIN_CONFIG_IN_WO_PULLUP   0x02
 
#define PIN_CONFIG_OUT   0x01
 
#define PIN_NUMBER   28
 

Functions

int __devinit __max730x_probe (struct max7301 *ts)
 
 EXPORT_SYMBOL_GPL (__max730x_probe)
 
int __devexit __max730x_remove (struct device *dev)
 
 EXPORT_SYMBOL_GPL (__max730x_remove)
 
 MODULE_AUTHOR ("Juergen Beisert, Wolfram Sang")
 
 MODULE_LICENSE ("GPL v2")
 
 MODULE_DESCRIPTION ("MAX730x GPIO-Expanders, generic parts")
 

Macro Definition Documentation

#define PIN_CONFIG_IN_PULLUP   0x03

Definition at line 45 of file gpio-max730x.c.

#define PIN_CONFIG_IN_WO_PULLUP   0x02

Definition at line 46 of file gpio-max730x.c.

#define PIN_CONFIG_MASK   0x03

Copyright (C) 2006 Juergen Beisert, Pengutronix Copyright (C) 2008 Guennadi Liakhovetski, Pengutronix Copyright (C) 2009 Wolfram Sang, Pengutronix

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.

The Maxim MAX7300/1 device is an I2C/SPI driven GPIO expander. There are 28 GPIOs. 8 of them can trigger an interrupt. See datasheet for more details Note:

  • DIN must be stable at the rising edge of clock.
  • when writing:
    • always clock in 16 clocks at once
    • at DIN: D15 first, D0 last
    • D0..D7 = databyte, D8..D14 = commandbyte
    • D15 = low -> write command
  • when reading
    • always clock in 16 clocks at once
    • at DIN: D15 first, D0 last
    • D0..D7 = dummy, D8..D14 = register address
    • D15 = high -> read command
    • raise CS and assert it again
    • always clock in 16 clocks at once
    • at DOUT: D15 first, D0 last
    • D0..D7 contains the data from the first cycle

The driver exports a standard gpiochip interface

Definition at line 44 of file gpio-max730x.c.

#define PIN_CONFIG_OUT   0x01

Definition at line 47 of file gpio-max730x.c.

#define PIN_NUMBER   28

Definition at line 49 of file gpio-max730x.c.

Function Documentation

int __devinit __max730x_probe ( struct max7301 ts)

Definition at line 163 of file gpio-max730x.c.

int __devexit __max730x_remove ( struct device dev)

Definition at line 229 of file gpio-max730x.c.

EXPORT_SYMBOL_GPL ( __max730x_probe  )
EXPORT_SYMBOL_GPL ( __max730x_remove  )
MODULE_AUTHOR ( "Juergen  Beisert,
Wolfram Sang"   
)
MODULE_DESCRIPTION ( "MAX730x GPIO Expanders,
generic parts"   
)
MODULE_LICENSE ( "GPL v2 )