#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.
#define PIN_CONFIG_IN_PULLUP 0x03 |
#define PIN_CONFIG_IN_WO_PULLUP 0x02 |
#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 |
MODULE_AUTHOR |
( |
"Juergen |
Beisert, |
|
|
Wolfram Sang" |
|
|
) |
| |
MODULE_DESCRIPTION |
( |
"MAX730x GPIO- |
Expanders, |
|
|
generic parts" |
|
|
) |
| |
MODULE_LICENSE |
( |
"GPL v2" |
| ) |
|