From 7d6e01d6177739956ae93ca131041764c6b37904 Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Fri, 12 Jul 2013 12:12:22 -0500 Subject: lm4: make configure_kblight_gpios() board dependent The configure_kblight_gpios() funciton was specific to the link board. Therefore, move the function to be defined within the board-specific file. BUG=chrome-os-partner:20372 BRANCH=None TEST=Built. Tested similar change on bolt. Change-Id: Ib5847130450024c50d6526d2c1a64d67ab501637 Signed-off-by: Aaron Durbin Reviewed-on: https://gerrit.chromium.org/gerrit/62209 --- board/link/board.c | 10 ++++++++++ chip/lm4/pwm_kblight.c | 10 ---------- include/pwm.h | 5 +++++ 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/board/link/board.c b/board/link/board.c index f93fe22313..5c5bfb942e 100644 --- a/board/link/board.c +++ b/board/link/board.c @@ -19,6 +19,7 @@ #include "lm4_adc.h" #include "peci.h" #include "power_button.h" +#include "pwm.h" #include "registers.h" #include "switch.h" #include "temp_sensor.h" @@ -229,3 +230,12 @@ void board_process_wake_events(uint32_t active_wake_events) else gpio_set_level(GPIO_PCH_WAKE_L, 1); } + +/** + * Configure the GPIOs for the pwm module. + */ +void configure_kblight_gpios(void) +{ + /* PK6 alternate function 1 = channel 1 PWM */ + gpio_set_alternate_function(LM4_GPIO_K, 0x40, 1); +} diff --git a/chip/lm4/pwm_kblight.c b/chip/lm4/pwm_kblight.c index 8710896928..df9f965bda 100644 --- a/chip/lm4/pwm_kblight.c +++ b/chip/lm4/pwm_kblight.c @@ -32,16 +32,6 @@ struct pwm_kbd_state { uint8_t pad0, pad1; /* Pad to multiple of 4 bytes. */ }; -/** - * Configure the GPIOs for the pwm module. - */ -static void configure_kblight_gpios(void) -{ - /* HEY: This for Link only */ - /* PK6 alternate function 1 = channel 1 PWM */ - gpio_set_alternate_function(LM4_GPIO_K, 0x40, 1); -} - void pwm_enable_keyboard_backlight(int enable) { if (enable) diff --git a/include/pwm.h b/include/pwm.h index 9c97ea2fda..a4fae7fc75 100644 --- a/include/pwm.h +++ b/include/pwm.h @@ -47,6 +47,11 @@ void pwm_set_fan_target_rpm(int rpm); */ void pwm_set_fan_duty(int percent); +/** + * Set up the keyboard gpios. + */ +void configure_kblight_gpios(void); + /** * Enable/disable the keyboard backlight. */ -- cgit v1.2.1