twl4030_led.c 889 B

123456789101112131415161718192021222324252627282930313233
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Copyright (c) 2009 Wind River Systems, Inc.
  4. * Tom Rix <Tom.Rix at windriver.com>
  5. *
  6. * twl4030_led_init is from cpu/omap3/common.c, power_init_r
  7. *
  8. * (C) Copyright 2004-2008
  9. * Texas Instruments, <www.ti.com>
  10. *
  11. * Author :
  12. * Sunil Kumar <sunilsaini05 at gmail.com>
  13. * Shashi Ranjan <shashiranjanmca05 at gmail.com>
  14. *
  15. * Derived from Beagle Board and 3430 SDP code by
  16. * Richard Woodruff <r-woodruff2 at ti.com>
  17. * Syed Mohammed Khasim <khasim at ti.com>
  18. */
  19. #include <twl4030.h>
  20. void twl4030_led_init(unsigned char ledon_mask)
  21. {
  22. /* LEDs need to have corresponding PWMs enabled */
  23. if (ledon_mask & TWL4030_LED_LEDEN_LEDAON)
  24. ledon_mask |= TWL4030_LED_LEDEN_LEDAPWM;
  25. if (ledon_mask & TWL4030_LED_LEDEN_LEDBON)
  26. ledon_mask |= TWL4030_LED_LEDEN_LEDBPWM;
  27. twl4030_i2c_write_u8(TWL4030_CHIP_LED, TWL4030_LED_LEDEN,
  28. ledon_mask);
  29. }