021-nslu2_i2c_gpio_driver_support.patch 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. diff --git a/arch/arm/mach-ixp4xx/nslu2-setup.c b/arch/arm/mach-ixp4xx/nslu2-setup.c
  2. index 9bf8ccb..77277d2 100644
  3. --- a/arch/arm/mach-ixp4xx/nslu2-setup.c
  4. +++ b/arch/arm/mach-ixp4xx/nslu2-setup.c
  5. @@ -18,6 +18,7 @@
  6. #include <linux/serial.h>
  7. #include <linux/serial_8250.h>
  8. #include <linux/leds.h>
  9. +#include <linux/i2c-gpio.h>
  10. #include <asm/mach-types.h>
  11. #include <asm/mach/arch.h>
  12. @@ -41,7 +42,7 @@ static struct platform_device nslu2_flash = {
  13. .resource = &nslu2_flash_resource,
  14. };
  15. -static struct ixp4xx_i2c_pins nslu2_i2c_gpio_pins = {
  16. +static struct i2c_gpio_platform_data nslu2_i2c_gpio_data = {
  17. .sda_pin = NSLU2_SDA_PIN,
  18. .scl_pin = NSLU2_SCL_PIN,
  19. };
  20. @@ -82,11 +83,12 @@ static struct platform_device nslu2_leds = {
  21. };
  22. #endif
  23. -static struct platform_device nslu2_i2c_controller = {
  24. - .name = "IXP4XX-I2C",
  25. +static struct platform_device nslu2_i2c_gpio = {
  26. + .name = "i2c-gpio",
  27. .id = 0,
  28. - .dev.platform_data = &nslu2_i2c_gpio_pins,
  29. - .num_resources = 0,
  30. + .dev = {
  31. + .platform_data = &nslu2_i2c_gpio_data,
  32. + },
  33. };
  34. static struct platform_device nslu2_beeper = {
  35. @@ -139,7 +141,7 @@ static struct platform_device nslu2_uart = {
  36. };
  37. static struct platform_device *nslu2_devices[] __initdata = {
  38. - &nslu2_i2c_controller,
  39. + &nslu2_i2c_gpio,
  40. &nslu2_flash,
  41. &nslu2_beeper,
  42. #ifdef CONFIG_LEDS_IXP4XX