aboutsummaryrefslogtreecommitdiff
path: root/drivers/i2c/busses/i2c-gpio.c
AgeCommit message (Collapse)Author
2007-12-12i2c-gpio: Initialize adapter classAtsushi Nemoto
This is required to let hwmon drivers attach to the adapter. Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2007-09-09i2c-gpio: Fix adapter numberDavid Brownell
It turns out that platform_device.id is a "u32" so testing it for being nonnegative is useless when setting up an i2c bitbang device. Instead, do what the platform_bus code does and test it against the value "-1". Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Acked-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2007-07-12i2c-gpio: Make some internal functions staticAtsushi Nemoto
i2c_gpio_getsda() and i2c_gpio_getscl() are only used in this file. Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Acked-by: Haavard Skinnemoen <hskinnemoen@atmel.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2007-07-12i2c-gpio: Add support for new-style clientsAtsushi Nemoto
Use i2c_bit_add_numbered_bus() so that the i2c-gpio adapter works well with new-style pre-declared devices. Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2007-05-01i2c: Bitbanging I2C bus driver using the GPIO APIHaavard Skinnemoen
This is a very simple bitbanging I2C bus driver utilizing the new arch-neutral GPIO API. Useful for chips that don't have a built-in I2C controller, additional I2C busses, or testing purposes. To use, include something similar to the following in the board-specific setup code: #include <linux/i2c-gpio.h> static struct i2c_gpio_platform_data i2c_gpio_data = { .sda_pin = GPIO_PIN_FOO, .scl_pin = GPIO_PIN_BAR, }; static struct platform_device i2c_gpio_device = { .name = "i2c-gpio", .id = 0, .dev = { .platform_data = &i2c_gpio_data, }, }; Register this platform_device, set up the I2C pins as GPIO if required and you're ready to go. This will use default values for udelay and timeout, and will work with GPIO hardware that does not support open drain mode, but allows sensing of the SDA and SCL lines even when they are being driven. Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>