Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Tom Rix | 2c15513 | 2009-06-28 12:52:30 -0500 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (c) 2009 Wind River Systems, Inc. |
| 4 | * Tom Rix <Tom.Rix at windriver.com> |
| 5 | * |
Tom Rix | 2c15513 | 2009-06-28 12:52:30 -0500 | [diff] [blame] | 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> |
Tom Rix | 2c15513 | 2009-06-28 12:52:30 -0500 | [diff] [blame] | 18 | */ |
| 19 | |
| 20 | #include <twl4030.h> |
| 21 | |
Grazvydas Ignotas | ead39d7 | 2009-12-10 17:10:21 +0200 | [diff] [blame] | 22 | void twl4030_led_init(unsigned char ledon_mask) |
Tom Rix | 2c15513 | 2009-06-28 12:52:30 -0500 | [diff] [blame] | 23 | { |
Grazvydas Ignotas | ead39d7 | 2009-12-10 17:10:21 +0200 | [diff] [blame] | 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; |
Tom Rix | 2c15513 | 2009-06-28 12:52:30 -0500 | [diff] [blame] | 29 | |
Nishanth Menon | 0208aaf | 2013-03-26 05:20:49 +0000 | [diff] [blame] | 30 | twl4030_i2c_write_u8(TWL4030_CHIP_LED, TWL4030_LED_LEDEN, |
| 31 | ledon_mask); |
Tom Rix | 2c15513 | 2009-06-28 12:52:30 -0500 | [diff] [blame] | 32 | |
| 33 | } |