summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Corbet <corbet@lwn.net>2010-04-23 08:56:55 -0600
committerJonathan Corbet <corbet@lwn.net>2010-05-07 17:17:37 -0600
commitb8f7e5d846387e3bcda35f3809856cf085740a24 (patch)
tree4ca50fc7021b056c3cddd83045861b1871bf669c
parentb052d7f81fdd352a5d89ef1ac37a2c77f219463b (diff)
viafb: Introduce viafb_find_i2c_adapter()
The camera driver will need this to look up a specific adapter. Cc: ScottFang@viatech.com.cn Cc: JosephChan@via.com.tw Cc: Harald Welte <laforge@gnumonks.org> Acked-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
-rw-r--r--drivers/video/via/via_i2c.c13
-rw-r--r--drivers/video/via/via_i2c.h1
2 files changed, 14 insertions, 0 deletions
diff --git a/drivers/video/via/via_i2c.c b/drivers/video/via/via_i2c.c
index c88450ee62b..febc1dda69c 100644
--- a/drivers/video/via/via_i2c.c
+++ b/drivers/video/via/via_i2c.c
@@ -157,6 +157,19 @@ int viafb_i2c_readbytes(u8 adap, u8 slave_addr, u8 index, u8 *buff, int buff_len
return i2c_transfer(&via_i2c_par[adap].adapter, msgs, 2);
}
+/*
+ * Allow other viafb subdevices to look up a specific adapter
+ * by port name.
+ */
+struct i2c_adapter *viafb_find_i2c_adapter(enum viafb_i2c_adap which)
+{
+ struct via_i2c_stuff *stuff = &via_i2c_par[which];
+
+ return &stuff->adapter;
+}
+EXPORT_SYMBOL_GPL(viafb_find_i2c_adapter);
+
+
static int create_i2c_bus(struct i2c_adapter *adapter,
struct i2c_algo_bit_data *algo,
struct via_port_cfg *adap_cfg,
diff --git a/drivers/video/via/via_i2c.h b/drivers/video/via/via_i2c.h
index 1d18e7d57b7..44532e468c0 100644
--- a/drivers/video/via/via_i2c.h
+++ b/drivers/video/via/via_i2c.h
@@ -35,6 +35,7 @@ struct via_i2c_stuff {
int viafb_i2c_readbyte(u8 adap, u8 slave_addr, u8 index, u8 *pdata);
int viafb_i2c_writebyte(u8 adap, u8 slave_addr, u8 index, u8 data);
int viafb_i2c_readbytes(u8 adap, u8 slave_addr, u8 index, u8 *buff, int buff_len);
+struct i2c_adapter *viafb_find_i2c_adapter(enum viafb_i2c_adap which);
extern int viafb_i2c_init(void);
extern void viafb_i2c_exit(void);