mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-27 18:25:05 +00:00
There is a logical difference between PWM controls for things like backlights and fan controls for actual fans. This change separates them into two different data structures, for better abstraction. BUG=chrome-os-partner:23530 BRANCH=none TEST=manual make runtests, make all boards, test on Link and Falco. Change-Id: Ib63f2d1518fcc2ee367f81bf5d803360c1aa5c76 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/175151
46 lines
992 B
C
46 lines
992 B
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)
|
|
|
|
#endif /* __CROS_EC_PWM_H */
|