mach-pb44.c 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * Atheros PB44 reference board support
  3. *
  4. * Copyright (C) 2009-2010 Gabor Juhos <juhosg@openwrt.org>
  5. *
  6. * This program is free software; you can redistribute it and/or modify it
  7. * under the terms of the GNU General Public License version 2 as published
  8. * by the Free Software Foundation.
  9. */
  10. #include <linux/init.h>
  11. #include <linux/platform_device.h>
  12. #include <linux/i2c.h>
  13. #include <linux/i2c-gpio.h>
  14. #include <linux/i2c/pcf857x.h>
  15. #include "machtypes.h"
  16. #define PB44_GPIO_I2C_SCL 0
  17. #define PB44_GPIO_I2C_SDA 1
  18. #define PB44_GPIO_EXP_BASE 16
  19. static struct i2c_gpio_platform_data pb44_i2c_gpio_data = {
  20. .sda_pin = PB44_GPIO_I2C_SDA,
  21. .scl_pin = PB44_GPIO_I2C_SCL,
  22. };
  23. static struct platform_device pb44_i2c_gpio_device = {
  24. .name = "i2c-gpio",
  25. .id = 0,
  26. .dev = {
  27. .platform_data = &pb44_i2c_gpio_data,
  28. }
  29. };
  30. static struct pcf857x_platform_data pb44_pcf857x_data = {
  31. .gpio_base = PB44_GPIO_EXP_BASE,
  32. };
  33. static struct i2c_board_info pb44_i2c_board_info[] __initdata = {
  34. {
  35. I2C_BOARD_INFO("pcf8575", 0x20),
  36. .platform_data = &pb44_pcf857x_data,
  37. },
  38. };
  39. static void __init pb44_init(void)
  40. {
  41. i2c_register_board_info(0, pb44_i2c_board_info,
  42. ARRAY_SIZE(pb44_i2c_board_info));
  43. platform_device_register(&pb44_i2c_gpio_device);
  44. }
  45. MIPS_MACHINE(ATH79_MACH_PB44, "PB44", "Atheros PB44 reference board",
  46. pb44_init);