twl-common.c 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * twl-common.c
  3. *
  4. * Copyright (C) 2011 Texas Instruments, Inc..
  5. * Author: Peter Ujfalusi <peter.ujfalusi@ti.com>
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License
  9. * version 2 as published by the Free Software Foundation.
  10. *
  11. * This program is distributed in the hope that it will be useful, but
  12. * WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  19. * 02110-1301 USA
  20. *
  21. */
  22. #include <linux/i2c.h>
  23. #include <linux/i2c/twl.h>
  24. #include <linux/gpio.h>
  25. #include <plat/i2c.h>
  26. #include "twl-common.h"
  27. static struct i2c_board_info __initdata pmic_i2c_board_info = {
  28. .addr = 0x48,
  29. .flags = I2C_CLIENT_WAKE,
  30. };
  31. void __init omap_pmic_init(int bus, u32 clkrate,
  32. const char *pmic_type, int pmic_irq,
  33. struct twl4030_platform_data *pmic_data)
  34. {
  35. strncpy(pmic_i2c_board_info.type, pmic_type,
  36. sizeof(pmic_i2c_board_info.type));
  37. pmic_i2c_board_info.irq = pmic_irq;
  38. pmic_i2c_board_info.platform_data = pmic_data;
  39. omap_register_i2c_bus(bus, clkrate, &pmic_i2c_board_info, 1);
  40. }