i2c.c 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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 <asm/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 <asm/hardware.h>
  28. #include <asm/hardware/iop3xx.h>
  29. #include <asm/mach-types.h>
  30. #include <asm/mach/arch.h>
  31. #ifdef CONFIG_ARCH_IOP32X
  32. #define IRQ_IOP3XX_I2C_0 IRQ_IOP32X_I2C_0
  33. #define IRQ_IOP3XX_I2C_1 IRQ_IOP32X_I2C_1
  34. #endif
  35. #ifdef CONFIG_ARCH_IOP33X
  36. #define IRQ_IOP3XX_I2C_0 IRQ_IOP33X_I2C_0
  37. #define IRQ_IOP3XX_I2C_1 IRQ_IOP33X_I2C_1
  38. #endif
  39. static struct resource iop3xx_i2c0_resources[] = {
  40. [0] = {
  41. .start = 0xfffff680,
  42. .end = 0xfffff697,
  43. .flags = IORESOURCE_MEM,
  44. },
  45. [1] = {
  46. .start = IRQ_IOP3XX_I2C_0,
  47. .end = IRQ_IOP3XX_I2C_0,
  48. .flags = IORESOURCE_IRQ,
  49. },
  50. };
  51. struct platform_device iop3xx_i2c0_device = {
  52. .name = "IOP3xx-I2C",
  53. .id = 0,
  54. .num_resources = 2,
  55. .resource = iop3xx_i2c0_resources,
  56. };
  57. static struct resource iop3xx_i2c1_resources[] = {
  58. [0] = {
  59. .start = 0xfffff6a0,
  60. .end = 0xfffff6b7,
  61. .flags = IORESOURCE_MEM,
  62. },
  63. [1] = {
  64. .start = IRQ_IOP3XX_I2C_1,
  65. .end = IRQ_IOP3XX_I2C_1,
  66. .flags = IORESOURCE_IRQ,
  67. }
  68. };
  69. struct platform_device iop3xx_i2c1_device = {
  70. .name = "IOP3xx-I2C",
  71. .id = 1,
  72. .num_resources = 2,
  73. .resource = iop3xx_i2c1_resources,
  74. };