i2c.c 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*
  2. * arch/arm/plat-iop/i2c.c
  3. *
  4. * Author: Nicolas Pitre <nico@cam.org>
  5. * Copyright (C) 2001 MontaVista Software, Inc.
  6. * Copyright (C) 2004 Intel Corporation.
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. */
  12. #include <linux/mm.h>
  13. #include <linux/init.h>
  14. #include <linux/major.h>
  15. #include <linux/fs.h>
  16. #include <linux/platform_device.h>
  17. #include <linux/serial.h>
  18. #include <linux/tty.h>
  19. #include <linux/serial_core.h>
  20. #include <linux/io.h>
  21. #include <asm/pgtable.h>
  22. #include <asm/page.h>
  23. #include <asm/mach/map.h>
  24. #include <asm/setup.h>
  25. #include <asm/system.h>
  26. #include <asm/memory.h>
  27. #include <mach/hardware.h>
  28. #include <asm/hardware/iop3xx.h>
  29. #include <asm/mach/arch.h>
  30. #ifdef CONFIG_ARCH_IOP32X
  31. #define IRQ_IOP3XX_I2C_0 IRQ_IOP32X_I2C_0
  32. #define IRQ_IOP3XX_I2C_1 IRQ_IOP32X_I2C_1
  33. #endif
  34. #ifdef CONFIG_ARCH_IOP33X
  35. #define IRQ_IOP3XX_I2C_0 IRQ_IOP33X_I2C_0
  36. #define IRQ_IOP3XX_I2C_1 IRQ_IOP33X_I2C_1
  37. #endif
  38. static struct resource iop3xx_i2c0_resources[] = {
  39. [0] = {
  40. .start = 0xfffff680,
  41. .end = 0xfffff697,
  42. .flags = IORESOURCE_MEM,
  43. },
  44. [1] = {
  45. .start = IRQ_IOP3XX_I2C_0,
  46. .end = IRQ_IOP3XX_I2C_0,
  47. .flags = IORESOURCE_IRQ,
  48. },
  49. };
  50. struct platform_device iop3xx_i2c0_device = {
  51. .name = "IOP3xx-I2C",
  52. .id = 0,
  53. .num_resources = 2,
  54. .resource = iop3xx_i2c0_resources,
  55. };
  56. static struct resource iop3xx_i2c1_resources[] = {
  57. [0] = {
  58. .start = 0xfffff6a0,
  59. .end = 0xfffff6b7,
  60. .flags = IORESOURCE_MEM,
  61. },
  62. [1] = {
  63. .start = IRQ_IOP3XX_I2C_1,
  64. .end = IRQ_IOP3XX_I2C_1,
  65. .flags = IORESOURCE_IRQ,
  66. }
  67. };
  68. struct platform_device iop3xx_i2c1_device = {
  69. .name = "IOP3xx-I2C",
  70. .id = 1,
  71. .num_resources = 2,
  72. .resource = iop3xx_i2c1_resources,
  73. };