diff options
author | Shawn Nematbakhsh <shawnn@chromium.org> | 2015-11-30 16:30:59 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2015-12-04 01:20:33 -0800 |
commit | 743a9ea7cd39dffc4f1dc104803f767ba774372b (patch) | |
tree | a31b89a803f213a2421cbef449fff19cae5c5f5e /chip/stm32/pwm.c | |
parent | 6b75bfee7e66ff2061b3ca114ec52fada16af731 (diff) | |
download | chrome-ec-743a9ea7cd39dffc4f1dc104803f767ba774372b.tar.gz |
pwm: Add common initialization for PWM pins
Rather than having various PWM module groups initialized from various
HOOK_INIT functions, group them all into a single module and initialize
them all from a common function in pwm.c.
BUG=chromium:563708
TEST=Manual on samus / samus_pd (with CONFIG_ADC enabled). Verify that
samus fan + KB backlight control is functional and samus_pd correctly
sets PWM output.
BRANCH=None
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: I9f9b09bfa544cd9bc6b7a867e77757dff0505941
Reviewed-on: https://chromium-review.googlesource.com/314882
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Diffstat (limited to 'chip/stm32/pwm.c')
-rw-r--r-- | chip/stm32/pwm.c | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/chip/stm32/pwm.c b/chip/stm32/pwm.c index 577e984498..a457cb709d 100644 --- a/chip/stm32/pwm.c +++ b/chip/stm32/pwm.c @@ -35,22 +35,12 @@ int pwm_get_duty(enum pwm_channel ch) static void pwm_configure(enum pwm_channel ch) { const struct pwm_t *pwm = pwm_channels + ch; - const struct gpio_info *gpio = gpio_list + pwm->pin; timer_ctlr_t *tim = (timer_ctlr_t *)(pwm->tim.base); volatile unsigned *ccmr = NULL; if (using_pwm[ch]) return; -#if defined(CHIP_FAMILY_STM32F0) || defined(CHIP_FAMILY_STM32F3) - gpio_set_alternate_function(gpio->port, gpio->mask, pwm->gpio_alt_func); -#elif defined(CHIP_FAMILY_STM32L) - gpio_set_alternate_function(gpio->port, gpio->mask, - GPIO_ALT_TIM(pwm->tim.id)); -#else -#error "GPIO alternate function selection not implemented for chip family." -#endif - /* Enable timer */ __hw_timer_enable_clock(pwm->tim.id, 1); |