dev-i2c-hdmiphy.c 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * Copyright (c) 2011 Samsung Electronics Co., Ltd.
  3. * http://www.samsung.com/
  4. *
  5. * S5P series device definition for i2c for hdmiphy device
  6. *
  7. * Based on plat-samsung/dev-i2c7.c
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License version 2 as
  11. * published by the Free Software Foundation.
  12. */
  13. #include <linux/gfp.h>
  14. #include <linux/kernel.h>
  15. #include <linux/string.h>
  16. #include <linux/platform_device.h>
  17. #include <mach/irqs.h>
  18. #include <mach/map.h>
  19. #include <mach/i2c-hdmiphy.h>
  20. #include <plat/regs-iic.h>
  21. #include <plat/devs.h>
  22. #include <plat/cpu.h>
  23. #include <plat/iic.h>
  24. static struct resource s5p_i2c_resource[] = {
  25. [0] = {
  26. .start = S5P_PA_IIC_HDMIPHY,
  27. .end = S5P_PA_IIC_HDMIPHY + SZ_4K - 1,
  28. .flags = IORESOURCE_MEM,
  29. },
  30. [1] = {
  31. .start = IRQ_IIC_HDMIPHY,
  32. .end = IRQ_IIC_HDMIPHY,
  33. .flags = IORESOURCE_IRQ,
  34. },
  35. };
  36. struct platform_device s5p_device_i2c_hdmiphy = {
  37. .name = "s3c2440-hdmiphy-i2c",
  38. .id = -1,
  39. .num_resources = ARRAY_SIZE(s5p_i2c_resource),
  40. .resource = s5p_i2c_resource,
  41. };
  42. void __init s5p_i2c_hdmiphy_set_platdata(struct s3c2410_platform_i2c *pd)
  43. {
  44. struct s3c2410_platform_i2c *npd;
  45. if (!pd) {
  46. pd = &default_i2c_data;
  47. pd->bus_num = S5P_I2C_HDMIPHY_BUS_NUM;
  48. }
  49. npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c),
  50. &s5p_device_i2c_hdmiphy);
  51. }