mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-10 17:41:54 +00:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user