mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-24 21:54:34 -04:00
Merge branch 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging
* 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging: i2c: Document the message size limit i2c-algo-pca: Drop duplicate variable i2c: Hook up runtime PM support i2c-parport-light: Add SMBus alert support i2c-parport: Add SMBus alert support i2c: Separate Kconfig option for i2c-smbus i2c: Add SMBus alert support i2c-parport: Give powered devices some time to settle i2c-tiny-usb: Fix a comment on bus frequency i2c-i801: Add Intel Cougar Point device IDs i2c: Make PCI device ids constant
This commit is contained in:
commit
a03696e912
33 changed files with 537 additions and 38 deletions
50
include/linux/i2c-smbus.h
Normal file
50
include/linux/i2c-smbus.h
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
* i2c-smbus.h - SMBus extensions to the I2C protocol
|
||||
*
|
||||
* Copyright (C) 2010 Jean Delvare <khali@linux-fr.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_I2C_SMBUS_H
|
||||
#define _LINUX_I2C_SMBUS_H
|
||||
|
||||
#include <linux/i2c.h>
|
||||
|
||||
|
||||
/**
|
||||
* i2c_smbus_alert_setup - platform data for the smbus_alert i2c client
|
||||
* @alert_edge_triggered: whether the alert interrupt is edge (1) or level (0)
|
||||
* triggered
|
||||
* @irq: IRQ number, if the smbus_alert driver should take care of interrupt
|
||||
* handling
|
||||
*
|
||||
* If irq is not specified, the smbus_alert driver doesn't take care of
|
||||
* interrupt handling. In that case it is up to the I2C bus driver to either
|
||||
* handle the interrupts or to poll for alerts.
|
||||
*
|
||||
* If irq is specified then it it crucial that alert_edge_triggered is
|
||||
* properly set.
|
||||
*/
|
||||
struct i2c_smbus_alert_setup {
|
||||
unsigned int alert_edge_triggered:1;
|
||||
int irq;
|
||||
};
|
||||
|
||||
struct i2c_client *i2c_setup_smbus_alert(struct i2c_adapter *adapter,
|
||||
struct i2c_smbus_alert_setup *setup);
|
||||
int i2c_handle_smbus_alert(struct i2c_client *ara);
|
||||
|
||||
#endif /* _LINUX_I2C_SMBUS_H */
|
||||
|
|
@ -53,6 +53,7 @@ struct i2c_board_info;
|
|||
* on a bus (or read from them). Apart from two basic transfer functions to
|
||||
* transmit one message at a time, a more complex version can be used to
|
||||
* transmit an arbitrary number of messages without interruption.
|
||||
* @count must be be less than 64k since msg.len is u16.
|
||||
*/
|
||||
extern int i2c_master_send(struct i2c_client *client, const char *buf,
|
||||
int count);
|
||||
|
|
@ -152,6 +153,13 @@ struct i2c_driver {
|
|||
int (*suspend)(struct i2c_client *, pm_message_t mesg);
|
||||
int (*resume)(struct i2c_client *);
|
||||
|
||||
/* Alert callback, for example for the SMBus alert protocol.
|
||||
* The format and meaning of the data value depends on the protocol.
|
||||
* For the SMBus alert protocol, there is a single bit of data passed
|
||||
* as the alert response's low bit ("event flag").
|
||||
*/
|
||||
void (*alert)(struct i2c_client *, unsigned int data);
|
||||
|
||||
/* a ioctl like command that can be used to perform specific functions
|
||||
* with the device.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in a new issue