xref: /openbmc/u-boot/drivers/misc/twl4030_led.c (revision 3ebd892f)
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 
20 #include <twl4030.h>
21 
22 void twl4030_led_init(unsigned char ledon_mask)
23 {
24 	/* LEDs need to have corresponding PWMs enabled */
25 	if (ledon_mask & TWL4030_LED_LEDEN_LEDAON)
26 		ledon_mask |= TWL4030_LED_LEDEN_LEDAPWM;
27 	if (ledon_mask & TWL4030_LED_LEDEN_LEDBON)
28 		ledon_mask |= TWL4030_LED_LEDEN_LEDBPWM;
29 
30 	twl4030_i2c_write_u8(TWL4030_CHIP_LED, TWL4030_LED_LEDEN,
31 			     ledon_mask);
32 
33 }
34