blob: fd9777c8ce90d807d8e2f4336204e9d3d2311b38 [file] [log] [blame]
/********************************************************************************
* Marvell GPL License Option
*
* If you received this File from Marvell, you may opt to use, redistribute and/or
* modify this File in accordance with the terms and conditions of the General
* Public License Version 2, June 1991 (the "GPL License"), a copy of which is
* available along with the File in the license.txt file or by writing to the Free
* Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 or
* on the worldwide web at http://www.gnu.org/licenses/gpl.txt.
*
* THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE IMPLIED
* WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY
* DISCLAIMED. The GPL License provides additional details about this warranty
* disclaimer.
******************************************************************************/
#include <Galois_memmap.h>
#include <global.h>
#include "io.h"
#include "pwm_driver.h"
#include "galois_speed.h"
#include "led_pwm.h"
void set_led_backlight(int channel, int duty)
{
int pwm_freq;
PWM_SETTINGS pwm_setting ;
pwm_setting.En = 1;
pwm_setting.PreScale = 1 ;
pwm_setting.Polarity = 0 ;
pwm_freq = GaloisGetFrequency(SOC_FREQ_CFG);
pwm_freq = 100;
pwm_setting.Duty = pwm_freq*duty/100;
pwm_setting.Tcnt= pwm_freq;
pwm_write_settings(channel, &pwm_setting) ;
pwm_on_off(channel, &pwm_setting, 1) ;
return;
}