board-iconnect.c 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /*
  2. * arch/arm/mach-kirkwood/board-iconnect.c
  3. *
  4. * Iomega i-connect Board 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/platform_device.h>
  13. #include <linux/of.h>
  14. #include <linux/of_address.h>
  15. #include <linux/of_fdt.h>
  16. #include <linux/of_irq.h>
  17. #include <linux/of_platform.h>
  18. #include <linux/mtd/partitions.h>
  19. #include <linux/mv643xx_eth.h>
  20. #include <linux/gpio.h>
  21. #include <linux/input.h>
  22. #include <linux/gpio_keys.h>
  23. #include <asm/mach/arch.h>
  24. #include <mach/kirkwood.h>
  25. #include "common.h"
  26. #include "mpp.h"
  27. static struct mv643xx_eth_platform_data iconnect_ge00_data = {
  28. .phy_addr = MV643XX_ETH_PHY_ADDR(11),
  29. };
  30. static unsigned int iconnect_mpp_config[] __initdata = {
  31. MPP12_GPIO,
  32. MPP35_GPIO,
  33. MPP41_GPIO,
  34. MPP42_GPIO,
  35. MPP43_GPIO,
  36. MPP44_GPIO,
  37. MPP45_GPIO,
  38. MPP46_GPIO,
  39. MPP47_GPIO,
  40. MPP48_GPIO,
  41. 0
  42. };
  43. static struct mtd_partition iconnect_nand_parts[] = {
  44. {
  45. .name = "flash",
  46. .offset = 0,
  47. .size = MTDPART_SIZ_FULL,
  48. },
  49. };
  50. /* yikes... theses are the original input buttons */
  51. /* but I'm not convinced by the sw event choices */
  52. static struct gpio_keys_button iconnect_buttons[] = {
  53. {
  54. .type = EV_SW,
  55. .code = SW_LID,
  56. .gpio = 12,
  57. .desc = "Reset Button",
  58. .active_low = 1,
  59. .debounce_interval = 100,
  60. }, {
  61. .type = EV_SW,
  62. .code = SW_TABLET_MODE,
  63. .gpio = 35,
  64. .desc = "OTB Button",
  65. .active_low = 1,
  66. .debounce_interval = 100,
  67. },
  68. };
  69. static struct gpio_keys_platform_data iconnect_button_data = {
  70. .buttons = iconnect_buttons,
  71. .nbuttons = ARRAY_SIZE(iconnect_buttons),
  72. };
  73. static struct platform_device iconnect_button_device = {
  74. .name = "gpio-keys",
  75. .id = -1,
  76. .num_resources = 0,
  77. .dev = {
  78. .platform_data = &iconnect_button_data,
  79. },
  80. };
  81. void __init iconnect_init(void)
  82. {
  83. kirkwood_mpp_conf(iconnect_mpp_config);
  84. kirkwood_nand_init(ARRAY_AND_SIZE(iconnect_nand_parts), 25);
  85. kirkwood_ehci_init();
  86. kirkwood_ge00_init(&iconnect_ge00_data);
  87. platform_device_register(&iconnect_button_device);
  88. }
  89. static int __init iconnect_pci_init(void)
  90. {
  91. if (of_machine_is_compatible("iom,iconnect"))
  92. kirkwood_pcie_init(KW_PCIE0);
  93. return 0;
  94. }
  95. subsys_initcall(iconnect_pci_init);