mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-04 22:11:41 +00:00
The PWM clock on some chips can be configured to use different sources, which will have a dramatic effect on the actual PWM frequency. In order to support a variety of devices attached to PWM outputs add an option to select an alternate source. This is then implemented on the mec1322 chip to use the 100kHz clock source for PWM which will allow it to drive a keyboard backlight at appropriate frequencies. BUG=chrome-os-partner:47435 BRANCH=none TEST=verify that kblight brightness can be changed on chell Change-Id: Ibe93a8e029baae5a2d5f520d590b0cc4ab9a7f93 Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/312509 Reviewed-by: Alec Berg <alecaberg@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
51 lines
1.1 KiB
C
51 lines
1.1 KiB
C
/* Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
* found in the LICENSE file.
|
|
*/
|
|
|
|
#ifndef __CROS_EC_PWM_H
|
|
#define __CROS_EC_PWM_H
|
|
|
|
/* The values are defined in board.h */
|
|
enum pwm_channel;
|
|
|
|
/**
|
|
* Enable/disable a PWM channel.
|
|
*/
|
|
void pwm_enable(enum pwm_channel ch, int enabled);
|
|
|
|
/**
|
|
* Get PWM channel enabled status.
|
|
*/
|
|
int pwm_get_enabled(enum pwm_channel ch);
|
|
|
|
/**
|
|
* Set PWM channel duty cycle (0-100).
|
|
*/
|
|
void pwm_set_duty(enum pwm_channel ch, int percent);
|
|
|
|
/**
|
|
* Get PWM channel duty cycle.
|
|
*/
|
|
int pwm_get_duty(enum pwm_channel ch);
|
|
|
|
|
|
/* Flags for PWM config table */
|
|
|
|
/**
|
|
* PWM output signal is inverted, so 100% duty means always low
|
|
*/
|
|
#define PWM_CONFIG_ACTIVE_LOW (1 << 0)
|
|
/**
|
|
* PWM channel has a fan controller with a tach input and can auto-adjust
|
|
* its duty cycle to produce a given fan RPM.
|
|
*/
|
|
#define PWM_CONFIG_HAS_RPM_MODE (1 << 1)
|
|
/**
|
|
* PWM clock select alternate source. The actual clock and alternate
|
|
* source are chip dependent.
|
|
*/
|
|
#define PWM_CONFIG_ALT_CLOCK (1 << 2)
|
|
|
|
#endif /* __CROS_EC_PWM_H */
|