Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
pcf8591.c File Reference
#include <linux/module.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/i2c.h>
#include <linux/mutex.h>
#include <linux/err.h>
#include <linux/hwmon.h>

Go to the source code of this file.

Data Structures

struct  pcf8591_data
 

Macros

#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
 
#define PCF8591_CONTROL_AOEF   0x40
 
#define PCF8591_CONTROL_AIP_MASK   0x30
 
#define PCF8591_CONTROL_AINC   0x04
 
#define PCF8591_CONTROL_AICH_MASK   0x03
 
#define PCF8591_INIT_CONTROL   ((input_mode << 4) | PCF8591_CONTROL_AOEF)
 
#define PCF8591_INIT_AOUT   0 /* DAC out = 0 */
 
#define REG_TO_SIGNED(reg)   (((reg) & 0x80) ? ((reg) - 256) : (reg))
 
#define show_in_channel(channel)
 

Functions

 module_param (input_mode, int, 0)
 
 MODULE_PARM_DESC (input_mode,"Analog input mode:\n"" 0 = four single ended inputs\n"" 1 = three differential inputs\n"" 2 = single ended and differential mixed\n"" 3 = two differential inputs\n")
 
 show_in_channel (0)
 
 show_in_channel (1)
 
 show_in_channel (2)
 
 show_in_channel (3)
 
 MODULE_DEVICE_TABLE (i2c, pcf8591_id)
 
 MODULE_AUTHOR ("Aurelien Jarno <[email protected]>")
 
 MODULE_DESCRIPTION ("PCF8591 driver")
 
 MODULE_LICENSE ("GPL")
 
 module_init (pcf8591_init)
 
 module_exit (pcf8591_exit)
 

Macro Definition Documentation

#define PCF8591_CONTROL_AICH_MASK   0x03

Definition at line 70 of file pcf8591.c.

#define PCF8591_CONTROL_AINC   0x04

Definition at line 61 of file pcf8591.c.

#define PCF8591_CONTROL_AIP_MASK   0x30

Definition at line 58 of file pcf8591.c.

#define PCF8591_CONTROL_AOEF   0x40

Definition at line 49 of file pcf8591.c.

#define PCF8591_INIT_AOUT   0 /* DAC out = 0 */

Definition at line 74 of file pcf8591.c.

#define PCF8591_INIT_CONTROL   ((input_mode << 4) | PCF8591_CONTROL_AOEF)

Definition at line 73 of file pcf8591.c.

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 21 of file pcf8591.c.

#define REG_TO_SIGNED (   reg)    (((reg) & 0x80) ? ((reg) - 256) : (reg))

Definition at line 77 of file pcf8591.c.

#define show_in_channel (   channel)
Value:
static ssize_t show_in##channel##_input(struct device *dev, \
char *buf) \
{ \
return sprintf(buf, "%d\n", pcf8591_read_channel(dev, channel));\
} \
static DEVICE_ATTR(in##channel##_input, S_IRUGO, \
show_in##channel##_input, NULL);

Definition at line 91 of file pcf8591.c.

Function Documentation

MODULE_AUTHOR ( "Aurelien Jarno <[email protected]>"  )
MODULE_DESCRIPTION ( "PCF8591 driver )
MODULE_DEVICE_TABLE ( i2c  ,
pcf8591_id   
)
module_exit ( pcf8591_exit  )
module_init ( pcf8591_init  )
MODULE_LICENSE ( "GPL"  )
module_param ( input_mode  ,
int  ,
 
)
MODULE_PARM_DESC ( input_mode  )
show_in_channel ( )
show_in_channel ( )
show_in_channel ( )
show_in_channel ( )