twl4030.c 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * Copyright (c) 2009 Wind River Systems, Inc.
  3. * Tom Rix <Tom.Rix at windriver.com>
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License as
  7. * published by the Free Software Foundation; either version 2 of
  8. * the License, or (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  18. * MA 02111-1307 USA
  19. *
  20. * Derived from code on omapzoom, git://git.omapzoom.com/repo/u-boot.git
  21. *
  22. * Copyright (C) 2007-2009 Texas Instruments, Inc.
  23. */
  24. #include <twl4030.h>
  25. /*
  26. * Power Reset
  27. */
  28. void twl4030_power_reset_init(void)
  29. {
  30. u8 val = 0;
  31. if (twl4030_i2c_read_u8(TWL4030_CHIP_PM_MASTER, &val,
  32. TWL4030_PM_MASTER_P1_SW_EVENTS)) {
  33. printf("Error:TWL4030: failed to read the power register\n");
  34. printf("Could not initialize hardware reset\n");
  35. } else {
  36. val |= TWL4030_PM_MASTER_SW_EVENTS_STOPON_PWRON;
  37. if (twl4030_i2c_write_u8(TWL4030_CHIP_PM_MASTER, val,
  38. TWL4030_PM_MASTER_P1_SW_EVENTS)) {
  39. printf("Error:TWL4030: failed to write the power register\n");
  40. printf("Could not initialize hardware reset\n");
  41. }
  42. }
  43. }