diff options
author | Vic (Chun-Ju) Yang <victoryang@chromium.org> | 2013-11-28 15:56:56 +0800 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2013-12-02 04:54:23 +0000 |
commit | d69d0166eebdcfe7cf2545765a65b7c22c7d197c (patch) | |
tree | 096e5dec4ad67e089b7c8613610fad752905959f /chip/mec1322/registers.h | |
parent | 3f02192460f5c647f6539de161e36d5b4392567b (diff) | |
download | chrome-ec-d69d0166eebdcfe7cf2545765a65b7c22c7d197c.tar.gz |
mec1322: Add PWM driver
This adds a PWM driver, which now generates 30KHz PWM output. Note that
this is different from fan control module driver.
BUG=chrome-os-partner:24107
TEST=Set GPIO136 to PWM1. Attach logic analyzer to monitor its output.
- Set to active high and 30%, see 30% duty PWM at ~29.1KHz.
- Set to active low and 20%, see 80% duty PWM at ~29.1KHz.
BRANCH=None
Change-Id: I5f1001d5a4701e19fa87c4cabfd4ae5ae7ccb30c
Signed-off-by: Vic (Chun-Ju) Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/178391
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'chip/mec1322/registers.h')
-rw-r--r-- | chip/mec1322/registers.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/chip/mec1322/registers.h b/chip/mec1322/registers.h index 159e29c230..5d6e09685e 100644 --- a/chip/mec1322/registers.h +++ b/chip/mec1322/registers.h @@ -173,6 +173,14 @@ static inline uintptr_t gpio_port_base(int port_id) #define MEC1322_MBX_IMR REG8(MEC1322_MBX_BASE + 0xc) #define MEC1322_MBX_REG(x) REG8(MEC1322_MBX_BASE + 0x10 + (x)) + +/* PWM */ +#define MEC1322_PWM_BASE(x) (0x40005800 + (x) * 0x10) +#define MEC1322_PWM_ON(x) REG32(MEC1322_PWM_BASE(x) + 0x00) +#define MEC1322_PWM_OFF(x) REG32(MEC1322_PWM_BASE(x) + 0x04) +#define MEC1322_PWM_CFG(x) REG32(MEC1322_PWM_BASE(x) + 0x08) + + /* IRQ Numbers */ #define MEC1322_IRQ_I2C_0 0 #define MEC1322_IRQ_I2C_1 1 |