diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-02-27 18:39:39 -0500 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-02-29 14:47:42 -0500 |
commit | b0209b39951868069710c1e39ca14add9fa77ada (patch) | |
tree | 56f69726580d40ee2ea8004ee8387907dc291aa7 /drivers/i2c/algos/i2c-algo-bit.c | |
parent | 1298330bd6ab5ea7c9616a242a6f40ef4968521d (diff) |
i2c: export bit-banging algo functions
i915 has a hw i2c controller (gmbus) but for a bunch of stupid reasons
we need to be able to fall back to the bit-banging algo on gpio pins.
The current code sets up a 2nd i2c controller for the same i2c bus using
the bit-banging algo. This has a bunch of issues, the major one being
that userspace can directly access this fallback i2c adaptor behind
the drivers back.
But we need to frob a few registers before and after using fallback
gpio bit-banging, so this horribly fails.
The new plan is to only set up one i2c adaptor and transparently fall
back to bit-banging by directly calling the xfer function of the bit-
banging algo in the i2c core.
To make that possible, export the 2 i2c algo functions.
v2: As suggested by Jean Delvare, simply export the i2c_bit_algo
vtable instead of the individual functions.
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/i2c/algos/i2c-algo-bit.c')
-rw-r--r-- | drivers/i2c/algos/i2c-algo-bit.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/i2c/algos/i2c-algo-bit.c b/drivers/i2c/algos/i2c-algo-bit.c index 525c7345fa0b..ad0459c4c1cf 100644 --- a/drivers/i2c/algos/i2c-algo-bit.c +++ b/drivers/i2c/algos/i2c-algo-bit.c | |||
@@ -610,10 +610,11 @@ static u32 bit_func(struct i2c_adapter *adap) | |||
610 | 610 | ||
611 | /* -----exported algorithm data: ------------------------------------- */ | 611 | /* -----exported algorithm data: ------------------------------------- */ |
612 | 612 | ||
613 | static const struct i2c_algorithm i2c_bit_algo = { | 613 | const struct i2c_algorithm i2c_bit_algo = { |
614 | .master_xfer = bit_xfer, | 614 | .master_xfer = bit_xfer, |
615 | .functionality = bit_func, | 615 | .functionality = bit_func, |
616 | }; | 616 | }; |
617 | EXPORT_SYMBOL(i2c_bit_algo); | ||
617 | 618 | ||
618 | /* | 619 | /* |
619 | * registering functions to load algorithms at runtime | 620 | * registering functions to load algorithms at runtime |