board-nsa310.c 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * arch/arm/mach-kirkwood/nsa-310-setup.c
  3. *
  4. * ZyXEL NSA-310 Setup
  5. *
  6. * This file is licensed under the terms of the GNU General Public
  7. * License version 2. This program is licensed "as is" without any
  8. * warranty of any kind, whether express or implied.
  9. */
  10. #include <linux/kernel.h>
  11. #include <linux/init.h>
  12. #include <linux/i2c.h>
  13. #include <mach/kirkwood.h>
  14. #include <linux/of.h>
  15. #include "common.h"
  16. #include "mpp.h"
  17. static unsigned int nsa310_mpp_config[] __initdata = {
  18. MPP12_GPIO, /* led esata green */
  19. MPP13_GPIO, /* led esata red */
  20. MPP15_GPIO, /* led usb green */
  21. MPP16_GPIO, /* led usb red */
  22. MPP21_GPIO, /* control usb power off */
  23. MPP28_GPIO, /* led sys green */
  24. MPP29_GPIO, /* led sys red */
  25. MPP36_GPIO, /* key reset */
  26. MPP37_GPIO, /* key copy */
  27. MPP39_GPIO, /* led copy green */
  28. MPP40_GPIO, /* led copy red */
  29. MPP41_GPIO, /* led hdd green */
  30. MPP42_GPIO, /* led hdd red */
  31. MPP44_GPIO, /* ?? */
  32. MPP46_GPIO, /* key power */
  33. MPP48_GPIO, /* control power off */
  34. 0
  35. };
  36. static struct i2c_board_info __initdata nsa310_i2c_info[] = {
  37. { I2C_BOARD_INFO("adt7476", 0x2e) },
  38. };
  39. void __init nsa310_init(void)
  40. {
  41. kirkwood_mpp_conf(nsa310_mpp_config);
  42. i2c_register_board_info(0, ARRAY_AND_SIZE(nsa310_i2c_info));
  43. }
  44. static int __init nsa310_pci_init(void)
  45. {
  46. if (of_machine_is_compatible("zyxel,nsa310"))
  47. kirkwood_pcie_init(KW_PCIE0);
  48. return 0;
  49. }
  50. subsys_initcall(nsa310_pci_init);