blob: 2d9a8c4fbc2d9f3233fdcce4ea8406860f96172c [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Tom Rix0f2a8042009-06-28 12:52:30 -05002/*
3 * Copyright (c) 2009 Wind River Systems, Inc.
4 * Tom Rix <Tom.Rix at windriver.com>
5 *
Tom Rix0f2a8042009-06-28 12:52:30 -05006 * 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>
Tom Rix0f2a8042009-06-28 12:52:30 -050018 */
19
20#include <twl4030.h>
21
Grazvydas Ignotas17887bf2009-12-10 17:10:21 +020022void twl4030_led_init(unsigned char ledon_mask)
Tom Rix0f2a8042009-06-28 12:52:30 -050023{
Grazvydas Ignotas17887bf2009-12-10 17:10:21 +020024 /* 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;
Tom Rix0f2a8042009-06-28 12:52:30 -050029
Nishanth Menond26a1062013-03-26 05:20:49 +000030 twl4030_i2c_write_u8(TWL4030_CHIP_LED, TWL4030_LED_LEDEN,
31 ledon_mask);
Tom Rix0f2a8042009-06-28 12:52:30 -050032
33}