Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Functions
i2c-smbus.c File Reference
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/device.h>
#include <linux/interrupt.h>
#include <linux/workqueue.h>
#include <linux/i2c.h>
#include <linux/i2c-smbus.h>
#include <linux/slab.h>

Go to the source code of this file.

Data Structures

struct  i2c_smbus_alert
 
struct  alert_data
 

Functions

 MODULE_DEVICE_TABLE (i2c, smbalert_ids)
 
struct i2c_clienti2c_setup_smbus_alert (struct i2c_adapter *adapter, struct i2c_smbus_alert_setup *setup)
 
 EXPORT_SYMBOL_GPL (i2c_setup_smbus_alert)
 
int i2c_handle_smbus_alert (struct i2c_client *ara)
 
 EXPORT_SYMBOL_GPL (i2c_handle_smbus_alert)
 
 module_i2c_driver (smbalert_driver)
 
 MODULE_AUTHOR ("Jean Delvare <[email protected]>")
 
 MODULE_DESCRIPTION ("SMBus protocol extensions support")
 
 MODULE_LICENSE ("GPL")
 

Function Documentation

EXPORT_SYMBOL_GPL ( i2c_setup_smbus_alert  )
EXPORT_SYMBOL_GPL ( i2c_handle_smbus_alert  )
int i2c_handle_smbus_alert ( struct i2c_client ara)

i2c_handle_smbus_alert - Handle an SMBus alert : the ARA client on the relevant adapter Context: can't sleep

Helper function to be called from an I2C bus driver's interrupt handler. It will schedule the alert work, in turn calling the corresponding I2C device driver's alert function.

It is assumed that ara is a valid i2c client previously returned by i2c_setup_smbus_alert().

Definition at line 237 of file i2c-smbus.c.

struct i2c_client* i2c_setup_smbus_alert ( struct i2c_adapter adapter,
struct i2c_smbus_alert_setup setup 
)
read

i2c_setup_smbus_alert - Setup SMBus alert support : the target adapter : setup data for the SMBus alert handler Context: can sleep

Setup handling of the SMBus alert protocol on a given I2C bus segment.

Handling can be done either through our IRQ handler, or by the adapter (from its handler, periodic polling, or whatever).

NOTE that if we manage the IRQ, we MUST know if it's level or edge triggered in order to hand it to the workqueue correctly. If triggering the alert seems to wedge the system, you probably should have said it's level triggered.

This returns the ara client, which should be saved for later use with i2c_handle_smbus_alert() and ultimately i2c_unregister_device(); or NULL to indicate an error.

Definition at line 213 of file i2c-smbus.c.

MODULE_AUTHOR ( "Jean Delvare <[email protected]>"  )
MODULE_DESCRIPTION ( "SMBus protocol extensions support )
MODULE_DEVICE_TABLE ( i2c  ,
smbalert_ids   
)
module_i2c_driver ( smbalert_driver  )
MODULE_LICENSE ( "GPL"  )