diff options
author | Alec Berg <alecaberg@chromium.org> | 2015-01-09 09:40:22 -0800 |
---|---|---|
committer | Alec Berg <alecaberg@chromium.org> | 2015-01-10 23:42:53 +0000 |
commit | 193e23509f8b9df44852b4581c357f2d7caed0aa (patch) | |
tree | 53bfc47162ccdcf243a4d61727dcc0450623e07a | |
parent | 0c95dc3022e65428188403715513a7d5fc77a1f1 (diff) | |
download | chrome-ec-193e23509f8b9df44852b4581c357f2d7caed0aa.tar.gz |
samus_pd: remove PWM module
Remove PWM module which is not being used in order to save flash
space.
BUG=chrome-os-partner:34489
BRANCH=samus
TEST=make -j buildall. view .map file and see we save ~760 bytes.
Change-Id: Id107fb402a60c5ac7510982f8ace6bad46fb14d0
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/239912
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r-- | board/samus_pd/board.c | 4 | ||||
-rw-r--r-- | board/samus_pd/board.h | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/board/samus_pd/board.c b/board/samus_pd/board.c index 8266e19ae8..ce87c248fd 100644 --- a/board/samus_pd/board.c +++ b/board/samus_pd/board.c @@ -403,9 +403,11 @@ static void board_init(void) } pd_comm_enable(pd_enable); +#ifdef CONFIG_PWM /* Enable ILIM PWM: initial duty cycle 0% = 500mA limit. */ pwm_enable(PWM_CH_ILIM, 1); pwm_set_duty(PWM_CH_ILIM, 0); +#endif } DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT); @@ -616,6 +618,7 @@ int board_set_active_charge_port(int charge_port) */ void board_set_charge_limit(int charge_ma) { +#ifdef CONFIG_PWM int pwm_duty = MA_TO_PWM(charge_ma); if (pwm_duty < 0) pwm_duty = 0; @@ -623,6 +626,7 @@ void board_set_charge_limit(int charge_ma) pwm_duty = 100; pwm_set_duty(PWM_CH_ILIM, pwm_duty); +#endif pd_status.curr_lim_ma = charge_ma; pd_send_ec_int(); diff --git a/board/samus_pd/board.h b/board/samus_pd/board.h index acfcc13b6e..82785aa574 100644 --- a/board/samus_pd/board.h +++ b/board/samus_pd/board.h @@ -32,7 +32,7 @@ #define CONFIG_I2C #undef CONFIG_LID_SWITCH #define CONFIG_LOW_POWER_IDLE -#define CONFIG_PWM +#undef CONFIG_PWM #define CONFIG_STM_HWTIMER32 #undef CONFIG_TASK_PROFILING #define CONFIG_USB_POWER_DELIVERY |