Tom Rix | 2c15513 | 2009-06-28 12:52:30 -0500 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2009 Wind River Systems, Inc. |
| 3 | * Tom Rix <Tom.Rix at windriver.com> |
| 4 | * |
Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 5 | * SPDX-License-Identifier: GPL-2.0+ |
Tom Rix | 2c15513 | 2009-06-28 12:52:30 -0500 | [diff] [blame] | 6 | * |
| 7 | * twl4030_led_init is from cpu/omap3/common.c, power_init_r |
| 8 | * |
| 9 | * (C) Copyright 2004-2008 |
| 10 | * Texas Instruments, <www.ti.com> |
| 11 | * |
| 12 | * Author : |
| 13 | * Sunil Kumar <sunilsaini05 at gmail.com> |
| 14 | * Shashi Ranjan <shashiranjanmca05 at gmail.com> |
| 15 | * |
| 16 | * Derived from Beagle Board and 3430 SDP code by |
| 17 | * Richard Woodruff <r-woodruff2 at ti.com> |
| 18 | * Syed Mohammed Khasim <khasim at ti.com> |
Tom Rix | 2c15513 | 2009-06-28 12:52:30 -0500 | [diff] [blame] | 19 | */ |
| 20 | |
| 21 | #include <twl4030.h> |
| 22 | |
Grazvydas Ignotas | ead39d7 | 2009-12-10 17:10:21 +0200 | [diff] [blame] | 23 | void twl4030_led_init(unsigned char ledon_mask) |
Tom Rix | 2c15513 | 2009-06-28 12:52:30 -0500 | [diff] [blame] | 24 | { |
Grazvydas Ignotas | ead39d7 | 2009-12-10 17:10:21 +0200 | [diff] [blame] | 25 | /* LEDs need to have corresponding PWMs enabled */ |
| 26 | if (ledon_mask & TWL4030_LED_LEDEN_LEDAON) |
| 27 | ledon_mask |= TWL4030_LED_LEDEN_LEDAPWM; |
| 28 | if (ledon_mask & TWL4030_LED_LEDEN_LEDBON) |
| 29 | ledon_mask |= TWL4030_LED_LEDEN_LEDBPWM; |
Tom Rix | 2c15513 | 2009-06-28 12:52:30 -0500 | [diff] [blame] | 30 | |
Nishanth Menon | 0208aaf | 2013-03-26 05:20:49 +0000 | [diff] [blame] | 31 | twl4030_i2c_write_u8(TWL4030_CHIP_LED, TWL4030_LED_LEDEN, |
| 32 | ledon_mask); |
Tom Rix | 2c15513 | 2009-06-28 12:52:30 -0500 | [diff] [blame] | 33 | |
| 34 | } |