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