Re: [PATCH v2] Bitbanging i2c bus driver using the GPIO API

From: David Brownell
Date: Sat Mar 10 2007 - 23:32:21 EST


On Saturday 10 March 2007 5:13 am, Haavard Skinnemoen wrote:
> This is a very simple bitbanging i2c bus driver utilizing the new
> arch-neutral GPIO API. ...
> ---
> This patch is different from the first patch in the following ways:
> * Handles pins set up as open drain (aka multidrive) by toggling
> the output value instead of the direction
> * Handles output-only SCL pins the same way, and also does not
> install a getscl() callback for such pins
> * Does not add anything to include/linux/i2c-ids.h
> * Sets the output value explicitly after changing the direction to
> output.
> * Plugs a memory leak in remove() -- algo_data wasn't freed.
> * Prints out the pin IDs in decimal, with an extra note when clock
> stretching isn't supported
>
> This version has been compile-tested only. I'll give it a spin when I
> get back to work on monday.
>
> Dave, does this address your concerns?

Yes, though see my followup to Jean's note. Unless I make time
to test this out on some system, the issues seem to be:

(a) will need to change once gpio_direction_output() gains
that second argument;

(b) i2c-gpio.h could stand one minor comment addition to highlight
an assumption.

Looking good!

- Dave
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/