2 * drivers/i2c/chips/gpio_expander_omap.c
4 * Copyright (C) 2004 Texas Instruments Inc
7 * gpio expander is used to configure IrDA, camera and audio devices on omap 1710 processor.
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
15 #include <linux/types.h>
16 #include <linux/i2c.h>
17 #include <linux/errno.h>
19 int read_gpio_expa(u8
* val
, int addr
);
20 int write_gpio_expa(u8 val
, int addr
);
22 int write_gpio_expa(u8 val
, int addr
)
24 struct i2c_adapter
*adap
;
26 struct i2c_msg msg
[1];
27 unsigned char data
[1];
29 adap
= i2c_get_adapter(1);
32 msg
->addr
= addr
; /* I2C address of GPIO EXPA */
37 err
= i2c_transfer(adap
, msg
, 1);
43 /* Read from I/O EXPANDER on the H3 board.
44 * The IO expanders need an independent I2C client driver.
47 int read_gpio_expa(u8
* val
, int addr
)
49 struct i2c_adapter
*adap
;
51 struct i2c_msg msg
[1];
52 unsigned char data
[1];
54 adap
= i2c_get_adapter(1);
57 msg
->addr
= addr
; /* I2C address of GPIO EXPA */
58 msg
->flags
= I2C_M_RD
;
61 err
= i2c_transfer(adap
, msg
, 1);
69 EXPORT_SYMBOL(read_gpio_expa
);
70 EXPORT_SYMBOL(write_gpio_expa
);