summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2013-07-12 12:12:22 -0500
committerChromeBot <chrome-bot@google.com>2013-07-16 16:40:38 -0700
commit7d6e01d6177739956ae93ca131041764c6b37904 (patch)
tree9ac6d95c36563e03056f99fdf523d84a6095c2d4
parent0c73fdae773be0d42c969e4171b0504fcf06b97a (diff)
downloadchrome-ec-7d6e01d6177739956ae93ca131041764c6b37904.tar.gz
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 <adurbin@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/62209
-rw-r--r--board/link/board.c10
-rw-r--r--chip/lm4/pwm_kblight.c10
-rw-r--r--include/pwm.h5
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
@@ -48,6 +48,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.
*/
void pwm_enable_keyboard_backlight(int enable);