linux-old/include/linux/i2c.h
<<
>>
Prefs
   1/* ------------------------------------------------------------------------- */
   2/*                                                                           */
   3/* i2c.h - definitions for the i2c-bus interface                             */
   4/*                                                                           */
   5/* ------------------------------------------------------------------------- */
   6/*   Copyright (C) 1995-2000 Simon G. Vogl
   7
   8    This program is free software; you can redistribute it and/or modify
   9    it under the terms of the GNU General Public License as published by
  10    the Free Software Foundation; either version 2 of the License, or
  11    (at your option) any later version.
  12
  13    This program is distributed in the hope that it will be useful,
  14    but WITHOUT ANY WARRANTY; without even the implied warranty of
  15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16    GNU General Public License for more details.
  17
  18    You should have received a copy of the GNU General Public License
  19    along with this program; if not, write to the Free Software
  20    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.                */
  21/* ------------------------------------------------------------------------- */
  22
  23/* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and
  24   Frodo Looijaard <frodol@dds.nl> */
  25
  26/* $Id: i2c.h,v 1.46 2001/08/31 00:04:07 phil Exp $ */
  27
  28#ifndef I2C_H
  29#define I2C_H
  30
  31#define I2C_DATE "20010830"
  32#define I2C_VERSION "2.6.1"
  33
  34#include <linux/i2c-id.h>       /* id values of adapters et. al.        */
  35#include <linux/types.h>
  36
  37
  38struct i2c_msg;
  39
  40
  41#ifdef __KERNEL__
  42
  43/* --- Includes and compatibility declarations ------------------------ */
  44
  45#include <asm/semaphore.h>
  46#include <linux/config.h>
  47
  48/* --- General options ------------------------------------------------ */
  49
  50#define I2C_ADAP_MAX    16              /* control memory consumption   */
  51#define I2C_DRIVER_MAX  16
  52#define I2C_CLIENT_MAX  32
  53
  54struct i2c_algorithm;
  55struct i2c_adapter;
  56struct i2c_client;
  57struct i2c_driver;
  58struct i2c_client_address_data;
  59union i2c_smbus_data;
  60
  61
  62/*
  63 * The master routines are the ones normally used to transmit data to devices
  64 * on a bus (or read from them). Apart from two basic transfer functions to 
  65 * transmit one message at a time, a more complex version can be used to 
  66 * transmit an arbitrary number of messages without interruption.
  67 */
  68extern int i2c_master_send(struct i2c_client *,const char* ,int);
  69extern int i2c_master_recv(struct i2c_client *,char* ,int);
  70
  71/* Transfer num messages.
  72 */
  73extern int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[],int num);
  74
  75/*
  76 * Some adapter types (i.e. PCF 8584 based ones) may support slave behaviuor. 
  77 * This is not tested/implemented yet and will change in the future.
  78 */
  79extern int i2c_slave_send(struct i2c_client *,char*,int);
  80extern int i2c_slave_recv(struct i2c_client *,char*,int);
  81
  82
  83
  84/* This is the very generalized SMBus access routine. You probably do not
  85   want to use this, though; one of the functions below may be much easier,
  86   and probably just as fast. 
  87   Note that we use i2c_adapter here, because you do not need a specific
  88   smbus adapter to call this function. */
  89extern s32 i2c_smbus_xfer (struct i2c_adapter * adapter, u16 addr, 
  90                           unsigned short flags,
  91                           char read_write, u8 command, int size,
  92                           union i2c_smbus_data * data);
  93
  94/* Now follow the 'nice' access routines. These also document the calling
  95   conventions of smbus_access. */
  96
  97extern s32 i2c_smbus_write_quick(struct i2c_client * client, u8 value);
  98extern s32 i2c_smbus_read_byte(struct i2c_client * client);
  99extern s32 i2c_smbus_write_byte(struct i2c_client * client, u8 value);
 100extern s32 i2c_smbus_read_byte_data(struct i2c_client * client, u8 command);
 101extern s32 i2c_smbus_write_byte_data(struct i2c_client * client,
 102                                     u8 command, u8 value);
 103extern s32 i2c_smbus_read_word_data(struct i2c_client * client, u8 command);
 104extern s32 i2c_smbus_write_word_data(struct i2c_client * client,
 105                                     u8 command, u16 value);
 106extern s32 i2c_smbus_process_call(struct i2c_client * client,
 107                                  u8 command, u16 value);
 108/* Returns the number of read bytes */
 109extern s32 i2c_smbus_read_block_data(struct i2c_client * client,
 110                                     u8 command, u8 *values);
 111extern s32 i2c_smbus_write_block_data(struct i2c_client * client,
 112                                      u8 command, u8 length,
 113                                      u8 *values);
 114extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client * client,
 115                                          u8 command, u8 length,
 116                                          u8 *values);
 117
 118
 119/*
 120 * A driver is capable of handling one or more physical devices present on
 121 * I2C adapters. This information is used to inform the driver of adapter
 122 * events.
 123 */
 124
 125struct i2c_driver {
 126        char name[32];
 127        int id;
 128        unsigned int flags;             /* div., see below              */
 129
 130        /* Notifies the driver that a new bus has appeared. This routine
 131         * can be used by the driver to test if the bus meets its conditions
 132         * & seek for the presence of the chip(s) it supports. If found, it 
 133         * registers the client(s) that are on the bus to the i2c admin. via
 134         * i2c_attach_client.
 135         */
 136        int (*attach_adapter)(struct i2c_adapter *);
 137
 138        /* tells the driver that a client is about to be deleted & gives it 
 139         * the chance to remove its private data. Also, if the client struct
 140         * has been dynamically allocated by the driver in the function above,
 141         * it must be freed here.
 142         */
 143        int (*detach_client)(struct i2c_client *);
 144        
 145        /* a ioctl like command that can be used to perform specific functions
 146         * with the device.
 147         */
 148        int (*command)(struct i2c_client *client,unsigned int cmd, void *arg);
 149        
 150        /* These two are mainly used for bookkeeping & dynamic unloading of 
 151         * kernel modules. inc_use tells the driver that a client is being  
 152         * used by another module & that it should increase its ref. counter.
 153         * dec_use is the inverse operation.
 154         * NB: Make sure you have no circular dependencies, or else you get a 
 155         * deadlock when trying to unload the modules.
 156        * You should use the i2c_{inc,dec}_use_client functions instead of
 157        * calling this function directly.
 158         */
 159        void (*inc_use)(struct i2c_client *client);
 160        void (*dec_use)(struct i2c_client *client);
 161};
 162
 163/*
 164 * i2c_client identifies a single device (i.e. chip) that is connected to an 
 165 * i2c bus. The behaviour is defined by the routines of the driver. This
 166 * function is mainly used for lookup & other admin. functions.
 167 */
 168struct i2c_client {
 169        char name[32];
 170        int id;
 171        unsigned int flags;             /* div., see below              */
 172        unsigned int addr;              /* chip address - NOTE: 7bit    */
 173                                        /* addresses are stored in the  */
 174                                        /* _LOWER_ 7 bits of this char  */
 175        /* addr: unsigned int to make lm_sensors i2c-isa adapter work
 176          more cleanly. It does not take any more memory space, due to
 177          alignment considerations */
 178        struct i2c_adapter *adapter;    /* the adapter we sit on        */
 179        struct i2c_driver *driver;      /* and our access routines      */
 180        void *data;                     /* for the clients              */
 181        int usage_count;                /* How many accesses currently  */
 182                                        /* to the client                */
 183};
 184
 185
 186/*
 187 * The following structs are for those who like to implement new bus drivers:
 188 * i2c_algorithm is the interface to a class of hardware solutions which can
 189 * be addressed using the same bus algorithms - i.e. bit-banging or the PCF8584
 190 * to name two of the most common.
 191 */
 192struct i2c_algorithm {
 193        char name[32];                          /* textual description  */
 194        unsigned int id;
 195
 196        /* If an adapter algorithm can't do I2C-level access, set master_xfer
 197           to NULL. If an adapter algorithm can do SMBus access, set 
 198           smbus_xfer. If set to NULL, the SMBus protocol is simulated
 199           using common I2C messages */
 200        int (*master_xfer)(struct i2c_adapter *adap,struct i2c_msg msgs[], 
 201                           int num);
 202        int (*smbus_xfer) (struct i2c_adapter *adap, u16 addr, 
 203                           unsigned short flags, char read_write,
 204                           u8 command, int size, union i2c_smbus_data * data);
 205
 206        /* --- these optional/future use for some adapter types.*/
 207        int (*slave_send)(struct i2c_adapter *,char*,int);
 208        int (*slave_recv)(struct i2c_adapter *,char*,int);
 209
 210        /* --- ioctl like call to set div. parameters. */
 211        int (*algo_control)(struct i2c_adapter *, unsigned int, unsigned long);
 212
 213        /* To determine what the adapter supports */
 214        u32 (*functionality) (struct i2c_adapter *);
 215};
 216
 217/*
 218 * i2c_adapter is the structure used to identify a physical i2c bus along
 219 * with the access algorithms necessary to access it.
 220 */
 221struct i2c_adapter {
 222        char name[32];  /* some useful name to identify the adapter     */
 223        unsigned int id;/* == is algo->id | hwdep.struct->id,           */
 224                        /* for registered values see below              */
 225        struct i2c_algorithm *algo;/* the algorithm to access the bus   */
 226        void *algo_data;
 227
 228        /* --- These may be NULL, but should increase the module use count */
 229        void (*inc_use)(struct i2c_adapter *);
 230        void (*dec_use)(struct i2c_adapter *);
 231
 232        /* --- administration stuff. */
 233        int (*client_register)(struct i2c_client *);
 234        int (*client_unregister)(struct i2c_client *);
 235
 236        void *data;     /* private data for the adapter                 */
 237                        /* some data fields that are used by all types  */
 238                        /* these data fields are readonly to the public */
 239                        /* and can be set via the i2c_ioctl call        */
 240
 241                        /* data fields that are valid for all devices   */
 242        struct semaphore lock;  
 243        unsigned int flags;/* flags specifying div. data                */
 244
 245        struct i2c_client *clients[I2C_CLIENT_MAX];
 246        int client_count;
 247
 248        int timeout;
 249        int retries;
 250
 251#ifdef CONFIG_PROC_FS 
 252        /* No need to set this when you initialize the adapter          */
 253        int inode;
 254#endif /* def CONFIG_PROC_FS */
 255};
 256
 257/*flags for the driver struct: */
 258#define I2C_DF_NOTIFY   0x01            /* notify on bus (de/a)ttaches  */
 259#define I2C_DF_DUMMY    0x02            /* do not connect any clients */
 260
 261/*flags for the client struct: */
 262#define I2C_CLIENT_ALLOW_USE            0x01    /* Client allows access */
 263#define I2C_CLIENT_ALLOW_MULTIPLE_USE   0x02    /* Allow multiple access-locks */
 264                                                /* on an i2c_client */
 265
 266/* i2c_client_address_data is the struct for holding default client
 267 * addresses for a driver and for the parameters supplied on the
 268 * command line
 269 */
 270struct i2c_client_address_data {
 271        unsigned short *normal_i2c;
 272        unsigned short *normal_i2c_range;
 273        unsigned short *probe;
 274        unsigned short *probe_range;
 275        unsigned short *ignore;
 276        unsigned short *ignore_range;
 277        unsigned short *force;
 278};
 279
 280/* Internal numbers to terminate lists */
 281#define I2C_CLIENT_END 0xfffe
 282
 283/* The numbers to use to set I2C bus address */
 284#define ANY_I2C_BUS 0xffff
 285
 286/* The length of the option lists */
 287#define I2C_CLIENT_MAX_OPTS 48
 288
 289
 290/* ----- functions exported by i2c.o */
 291
 292/* administration...
 293 */
 294extern int i2c_add_adapter(struct i2c_adapter *);
 295extern int i2c_del_adapter(struct i2c_adapter *);
 296
 297extern int i2c_add_driver(struct i2c_driver *);
 298extern int i2c_del_driver(struct i2c_driver *);
 299
 300extern int i2c_attach_client(struct i2c_client *);
 301extern int i2c_detach_client(struct i2c_client *);
 302
 303/* Only call these if you grab a resource that makes unloading the
 304   client and the adapter it is on completely impossible. Like when a
 305   /proc directory is entered. */
 306extern void i2c_inc_use_client(struct i2c_client *);
 307extern void i2c_dec_use_client(struct i2c_client *);
 308
 309/* New function: This is to get an i2c_client-struct for controlling the 
 310   client either by using i2c_control-function or having the 
 311   client-module export functions that can be used with the i2c_client
 312   -struct. */
 313extern struct i2c_client *i2c_get_client(int driver_id, int adapter_id, 
 314                                        struct i2c_client *prev);
 315
 316/* Should be used with new function
 317   extern struct i2c_client *i2c_get_client(int,int,struct i2c_client *);
 318   to make sure that client-struct is valid and that it is okay to access
 319   the i2c-client. 
 320   returns -EACCES if client doesn't allow use (default)
 321   returns -EBUSY if client doesn't allow multiple use (default) and 
 322   usage_count >0 */
 323extern int i2c_use_client(struct i2c_client *);
 324extern int i2c_release_client(struct i2c_client *);
 325
 326/* returns -EBUSY if address has been taken, 0 if not. Note that the only
 327   other place at which this is called is within i2c_attach_client; so
 328   you can cheat by simply not registering. Not recommended, of course! */
 329extern int i2c_check_addr (struct i2c_adapter *adapter, int addr);
 330
 331/* Detect function. It iterates over all possible addresses itself.
 332 * It will only call found_proc if some client is connected at the
 333 * specific address (unless a 'force' matched);
 334 */
 335typedef int i2c_client_found_addr_proc (struct i2c_adapter *adapter,
 336                                     int addr, unsigned short flags,int kind);
 337
 338extern int i2c_probe(struct i2c_adapter *adapter, 
 339                struct i2c_client_address_data *address_data,
 340                i2c_client_found_addr_proc *found_proc);
 341
 342/* An ioctl like call to set div. parameters of the adapter.
 343 */
 344extern int i2c_control(struct i2c_client *,unsigned int, unsigned long);
 345
 346/* This call returns a unique low identifier for each registered adapter,
 347 * or -1 if the adapter was not registered. 
 348 */
 349extern int i2c_adapter_id(struct i2c_adapter *adap);
 350
 351
 352
 353/* Return the functionality mask */
 354extern u32 i2c_get_functionality (struct i2c_adapter *adap);
 355
 356/* Return 1 if adapter supports everything we need, 0 if not. */
 357extern int i2c_check_functionality (struct i2c_adapter *adap, u32 func);
 358
 359#endif /* __KERNEL__ */
 360
 361/*
 362 * I2C Message - used for pure i2c transaction, also from /dev interface
 363 */
 364struct i2c_msg {
 365        __u16 addr;     /* slave address                        */
 366        __u16 flags;            
 367#define I2C_M_TEN       0x10    /* we have a ten bit chip address       */
 368#define I2C_M_RD        0x01
 369#define I2C_M_NOSTART   0x4000
 370#define I2C_M_REV_DIR_ADDR      0x2000
 371        __u16 len;              /* msg length                           */
 372        __u8 *buf;              /* pointer to msg data                  */
 373};
 374
 375/* To determine what functionality is present */
 376
 377#define I2C_FUNC_I2C                    0x00000001
 378#define I2C_FUNC_10BIT_ADDR             0x00000002
 379#define I2C_FUNC_PROTOCOL_MANGLING      0x00000004 /* I2C_M_{REV_DIR_ADDR,NOSTART} */
 380#define I2C_FUNC_SMBUS_QUICK            0x00010000 
 381#define I2C_FUNC_SMBUS_READ_BYTE        0x00020000 
 382#define I2C_FUNC_SMBUS_WRITE_BYTE       0x00040000 
 383#define I2C_FUNC_SMBUS_READ_BYTE_DATA   0x00080000 
 384#define I2C_FUNC_SMBUS_WRITE_BYTE_DATA  0x00100000 
 385#define I2C_FUNC_SMBUS_READ_WORD_DATA   0x00200000 
 386#define I2C_FUNC_SMBUS_WRITE_WORD_DATA  0x00400000 
 387#define I2C_FUNC_SMBUS_PROC_CALL        0x00800000 
 388#define I2C_FUNC_SMBUS_READ_BLOCK_DATA  0x01000000 
 389#define I2C_FUNC_SMBUS_WRITE_BLOCK_DATA 0x02000000 
 390#define I2C_FUNC_SMBUS_READ_I2C_BLOCK   0x04000000 /* New I2C-like block */
 391#define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK  0x08000000 /* transfer */
 392
 393#define I2C_FUNC_SMBUS_BYTE (I2C_FUNC_SMBUS_READ_BYTE | \
 394                             I2C_FUNC_SMBUS_WRITE_BYTE)
 395#define I2C_FUNC_SMBUS_BYTE_DATA (I2C_FUNC_SMBUS_READ_BYTE_DATA | \
 396                                  I2C_FUNC_SMBUS_WRITE_BYTE_DATA)
 397#define I2C_FUNC_SMBUS_WORD_DATA (I2C_FUNC_SMBUS_READ_WORD_DATA | \
 398                                  I2C_FUNC_SMBUS_WRITE_WORD_DATA)
 399#define I2C_FUNC_SMBUS_BLOCK_DATA (I2C_FUNC_SMBUS_READ_BLOCK_DATA | \
 400                                   I2C_FUNC_SMBUS_WRITE_BLOCK_DATA)
 401#define I2C_FUNC_SMBUS_I2C_BLOCK (I2C_FUNC_SMBUS_READ_I2C_BLOCK | \
 402                                  I2C_FUNC_SMBUS_WRITE_I2C_BLOCK)
 403
 404#define I2C_FUNC_SMBUS_EMUL (I2C_FUNC_SMBUS_QUICK | \
 405                             I2C_FUNC_SMBUS_BYTE | \
 406                             I2C_FUNC_SMBUS_BYTE_DATA | \
 407                             I2C_FUNC_SMBUS_WORD_DATA | \
 408                             I2C_FUNC_SMBUS_PROC_CALL | \
 409                             I2C_FUNC_SMBUS_WRITE_BLOCK_DATA)
 410
 411/* 
 412 * Data for SMBus Messages 
 413 */
 414#define I2C_SMBUS_BLOCK_MAX     32      /* As specified in SMBus standard */    
 415#define I2C_SMBUS_I2C_BLOCK_MAX 32      /* Not specified but we use same structure */
 416union i2c_smbus_data {
 417        __u8 byte;
 418        __u16 word;
 419        __u8 block[I2C_SMBUS_BLOCK_MAX + 2]; /* block[0] is used for length */
 420                          /* one more for read length in block process call */
 421};
 422
 423/* smbus_access read or write markers */
 424#define I2C_SMBUS_READ  1
 425#define I2C_SMBUS_WRITE 0
 426
 427/* SMBus transaction types (size parameter in the above functions) 
 428   Note: these no longer correspond to the (arbitrary) PIIX4 internal codes! */
 429#define I2C_SMBUS_QUICK             0
 430#define I2C_SMBUS_BYTE              1
 431#define I2C_SMBUS_BYTE_DATA         2 
 432#define I2C_SMBUS_WORD_DATA         3
 433#define I2C_SMBUS_PROC_CALL         4
 434#define I2C_SMBUS_BLOCK_DATA        5
 435#define I2C_SMBUS_I2C_BLOCK_DATA    6
 436
 437
 438/* ----- commands for the ioctl like i2c_command call:
 439 * note that additional calls are defined in the algorithm and hw 
 440 *      dependent layers - these can be listed here, or see the 
 441 *      corresponding header files.
 442 */
 443                                /* -> bit-adapter specific ioctls       */
 444#define I2C_RETRIES     0x0701  /* number of times a device address      */
 445                                /* should be polled when not            */
 446                                /* acknowledging                        */
 447#define I2C_TIMEOUT     0x0702  /* set timeout - call with int          */
 448
 449
 450/* this is for i2c-dev.c        */
 451#define I2C_SLAVE       0x0703  /* Change slave address                 */
 452                                /* Attn.: Slave address is 7 or 10 bits */
 453#define I2C_SLAVE_FORCE 0x0706  /* Change slave address                 */
 454                                /* Attn.: Slave address is 7 or 10 bits */
 455                                /* This changes the address, even if it */
 456                                /* is already taken!                    */
 457#define I2C_TENBIT      0x0704  /* 0 for 7 bit addrs, != 0 for 10 bit   */
 458
 459#define I2C_FUNCS       0x0705  /* Get the adapter functionality */
 460#define I2C_RDWR        0x0707  /* Combined R/W transfer (one stop only)*/
 461#if 0
 462#define I2C_ACK_TEST    0x0710  /* See if a slave is at a specific address */
 463#endif
 464
 465#define I2C_SMBUS       0x0720  /* SMBus-level access */
 466
 467/* ... algo-bit.c recognizes */
 468#define I2C_UDELAY      0x0705  /* set delay in microsecs between each  */
 469                                /* written byte (except address)        */
 470#define I2C_MDELAY      0x0706  /* millisec delay between written bytes */
 471
 472/* ----- I2C-DEV: char device interface stuff ------------------------- */
 473
 474#define I2C_MAJOR       89              /* Device major number          */
 475
 476#ifdef __KERNEL__
 477
 478#  ifndef NULL
 479#    define NULL ( (void *) 0 )
 480#  endif
 481
 482#  ifndef ENODEV
 483#    include <asm/errno.h>
 484#  endif
 485
 486/* These defines are used for probing i2c client addresses */
 487/* Default fill of many variables */
 488#define I2C_CLIENT_DEFAULTS {I2C_CLIENT_END, I2C_CLIENT_END, I2C_CLIENT_END, \
 489                          I2C_CLIENT_END, I2C_CLIENT_END, I2C_CLIENT_END, \
 490                          I2C_CLIENT_END, I2C_CLIENT_END, I2C_CLIENT_END, \
 491                          I2C_CLIENT_END, I2C_CLIENT_END, I2C_CLIENT_END, \
 492                          I2C_CLIENT_END, I2C_CLIENT_END, I2C_CLIENT_END, \
 493                          I2C_CLIENT_END, I2C_CLIENT_END, I2C_CLIENT_END, \
 494                          I2C_CLIENT_END, I2C_CLIENT_END, I2C_CLIENT_END, \
 495                          I2C_CLIENT_END, I2C_CLIENT_END, I2C_CLIENT_END, \
 496                          I2C_CLIENT_END, I2C_CLIENT_END, I2C_CLIENT_END, \
 497                          I2C_CLIENT_END, I2C_CLIENT_END, I2C_CLIENT_END, \
 498                          I2C_CLIENT_END, I2C_CLIENT_END, I2C_CLIENT_END, \
 499                          I2C_CLIENT_END, I2C_CLIENT_END, I2C_CLIENT_END, \
 500                          I2C_CLIENT_END, I2C_CLIENT_END, I2C_CLIENT_END, \
 501                          I2C_CLIENT_END, I2C_CLIENT_END, I2C_CLIENT_END, \
 502                          I2C_CLIENT_END, I2C_CLIENT_END, I2C_CLIENT_END, \
 503                          I2C_CLIENT_END, I2C_CLIENT_END, I2C_CLIENT_END}
 504
 505/* This is ugly. We need to evaluate I2C_CLIENT_MAX_OPTS before it is 
 506   stringified */
 507#define I2C_CLIENT_MODPARM_AUX1(x) "1-" #x "h"
 508#define I2C_CLIENT_MODPARM_AUX(x) I2C_CLIENT_MODPARM_AUX1(x)
 509#define I2C_CLIENT_MODPARM I2C_CLIENT_MODPARM_AUX(I2C_CLIENT_MAX_OPTS)
 510
 511/* I2C_CLIENT_MODULE_PARM creates a module parameter, and puts it in the
 512   module header */
 513
 514#define I2C_CLIENT_MODULE_PARM(var,desc) \
 515  static unsigned short var[I2C_CLIENT_MAX_OPTS] = I2C_CLIENT_DEFAULTS; \
 516  MODULE_PARM(var,I2C_CLIENT_MODPARM); \
 517  MODULE_PARM_DESC(var,desc)
 518
 519/* This is the one you want to use in your own modules */
 520#define I2C_CLIENT_INSMOD \
 521  I2C_CLIENT_MODULE_PARM(probe, \
 522                      "List of adapter,address pairs to scan additionally"); \
 523  I2C_CLIENT_MODULE_PARM(probe_range, \
 524                      "List of adapter,start-addr,end-addr triples to scan " \
 525                      "additionally"); \
 526  I2C_CLIENT_MODULE_PARM(ignore, \
 527                      "List of adapter,address pairs not to scan"); \
 528  I2C_CLIENT_MODULE_PARM(ignore_range, \
 529                      "List of adapter,start-addr,end-addr triples not to " \
 530                      "scan"); \
 531  I2C_CLIENT_MODULE_PARM(force, \
 532                      "List of adapter,address pairs to boldly assume " \
 533                      "to be present"); \
 534  static struct i2c_client_address_data addr_data = \
 535                                       {normal_i2c, normal_i2c_range, \
 536                                        probe, probe_range, \
 537                                        ignore, ignore_range, \
 538                                        force}
 539
 540/* Detect whether we are on the isa bus. If this returns true, all i2c
 541   access will fail! */
 542#define i2c_is_isa_client(clientptr) \
 543        ((clientptr)->adapter->algo->id == I2C_ALGO_ISA)
 544#define i2c_is_isa_adapter(adapptr) \
 545        ((adapptr)->algo->id == I2C_ALGO_ISA)
 546
 547#endif /* def __KERNEL__ */
 548#endif /* I2C_H */
 549
lxr.linux.no kindly hosted by Redpill Linpro AS, provider of Linux consulting and operations services since 1995.