diff options
author | Dino Li <dino.li@ite.com.tw> | 2014-10-22 19:08:18 +0800 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-10-29 03:29:17 +0000 |
commit | b5bd5ed20d576c9a4cdd64b20698aa8f3c28f6a2 (patch) | |
tree | bade8ed7ffe377f2305053fc7455989bab5d2f1e /chip/it83xx/pwm_chip.h | |
parent | 8a1f1b045a2bffc0c3bf3941709acf4ba99d32e7 (diff) | |
download | chrome-ec-b5bd5ed20d576c9a4cdd64b20698aa8f3c28f6a2.tar.gz |
it8380dev: add pwm control module
Add pwm control module for emulation board.
Signed-off-by: Dino Li <dino.li@ite.com.tw>
BRANCH=none
BUG=none
TEST=console manual test, pwm channels output correctly.
Change-Id: I6eb1a9e4fdcb9279e9d0cbd67f7a92afed21c889
Reviewed-on: https://chromium-review.googlesource.com/223921
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Dino Li <dino.li@ite.com.tw>
Tested-by: Dino Li <dino.li@ite.com.tw>
Diffstat (limited to 'chip/it83xx/pwm_chip.h')
-rw-r--r-- | chip/it83xx/pwm_chip.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/chip/it83xx/pwm_chip.h b/chip/it83xx/pwm_chip.h new file mode 100644 index 0000000000..d3c31a53fb --- /dev/null +++ b/chip/it83xx/pwm_chip.h @@ -0,0 +1,45 @@ +/* Copyright (c) 2014 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. + */ + +/* PWM control module for IT83xx. */ + +#ifndef __CROS_EC_IT83XX_PWM_H +#define __CROS_EC_IT83XX_PWM_H + +/* Data structure to define PWM channel control registers. */ +struct pwm_ctrl_t { + /* PWM channel output duty register. */ + volatile uint8_t *pwm_duty; + /* PWM channel clock source selection register. */ + volatile uint8_t *pwm_clock_source; + /* PWM channel pin control register. */ + volatile uint8_t *pwm_pin; +}; + +/* Data structure to define PWM channel control registers part 2. */ +struct pwm_ctrl_t2 { + /* PWM cycle time register. */ + volatile uint8_t *pwm_cycle_time; + /* PWM channel clock prescaler register (LSB). */ + volatile uint8_t *pwm_cpr_lsb; + /* PWM channel clock prescaler register (MSB). */ + volatile uint8_t *pwm_cpr_msb; + /* PWM prescaler clock frequency select register. */ + volatile uint8_t *pwm_pcfsr_reg; + /* PWM prescaler clock frequency select register setting. */ + uint8_t pwm_pcfsr_ctrl; +}; + +/* Data structure to define PWM channels. */ +struct pwm_t { + /* PWM channel ID */ + int channel; + /* PWM channel flags. See include/pwm.h */ + uint32_t flags; +}; + +extern const struct pwm_t pwm_channels[]; + +#endif /* __CROS_EC_IT83XX_PWM_H */ |