lm4: break out board-specific fan/tach pin config

The current lm4 pwm module was using board-specific
pins during this configuration. Move the implementation
of configure_fan_gpios() to the board-specific files
so that the pin configuration policy isn't a part of the
common infrastructure.

BUG=chrome-os-partner:19504
BRANCH=none
TEST=successfully booted slippy with backlight turning on in OS.

Change-Id: I325f1ac4639b4a78d8b860df7a8b688ca385b71b
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/51471
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
This commit is contained in:
Aaron Durbin
2013-05-16 08:14:25 -07:00
committed by ChromeBot
parent 89e688a332
commit d7efe5cdda
4 changed files with 23 additions and 10 deletions

View File

@@ -193,3 +193,12 @@ struct keyboard_scan_config keyscan_config = {
0xa4, 0xff, 0xf6, 0x55, 0xfa, 0xc8 /* full set */
},
};
/**
* Configure the GPIOs for the pwm module.
*/
void configure_fan_gpios(void)
{
/* PM6:7 alternate function 1 = channel 0 PWM/tach */
gpio_set_alternate_function(LM4_GPIO_M, 0xc0, 1);
}

View File

@@ -157,3 +157,12 @@ struct keyboard_scan_config keyscan_config = {
0xa4, 0xff, 0xf6, 0x55, 0xfa, 0xc8 /* full set */
},
};
/**
* Configure the GPIOs for the pwm module.
*/
void configure_fan_gpios(void)
{
/* PN2:3 alternate function 1 = channel 0 PWM/tach */
gpio_set_alternate_function(LM4_GPIO_N, 0x0c, 1);
}

View File

@@ -42,16 +42,6 @@ struct pwm_fan_state {
char pad; /* Pad to multiple of 4 bytes. */
};
/**
* Configure the GPIOs for the pwm module.
*/
static void configure_fan_gpios(void)
{
/* HEY: this is Link only. Slippy is PM2:3 */
/* PM6:7 alternate function 1 = channel 0 PWM/tach */
gpio_set_alternate_function(LM4_GPIO_M, 0xc0, 1);
}
void pwm_enable_fan(int enable)
{
if (enable)

View File

@@ -67,4 +67,9 @@ int pwm_get_keyboard_backlight(void);
*/
void pwm_set_keyboard_backlight(int percent);
/**
* Configure the GPIOs for the pwm module -- board-specific.
*/
void configure_fan_gpios(void);
#endif /* __CROS_EC_PWM_H */