summaryrefslogtreecommitdiff
path: root/chip/lm4/pwm.c
diff options
context:
space:
mode:
authorTom Hughes <tomhughes@chromium.org>2022-01-07 11:30:28 -0800
committerCommit Bot <commit-bot@chromium.org>2022-01-22 00:31:16 +0000
commit3b7724a3d3b6612a7d0f17ca70a47b6ff2f5bcfe (patch)
treef9629a5e4bd8408ab32e1ba62ae07d90825e776f /chip/lm4/pwm.c
parentf6cf98cdf979fb6d291fa021ed84f1958569a335 (diff)
downloadchrome-ec-3b7724a3d3b6612a7d0f17ca70a47b6ff2f5bcfe.tar.gz
tree: Delete chip/lm4 and board/bds
While working on https://crrev.com/c/3373621, I noticed that either the comment or code was wrong in chip/lm4/clock.c. chip/lm4 is only used by the "bds" board, which doesn't appear to be used anymore, so just delete it. BRANCH=none BUG=b:200828093 TEST=make buildall -j Cq-Depend: chromium:3378222 Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I444a9a6e2c853dc4f9f3d799182daaeb110b1277 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3373622 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Diffstat (limited to 'chip/lm4/pwm.c')
-rw-r--r--chip/lm4/pwm.c70
1 files changed, 0 insertions, 70 deletions
diff --git a/chip/lm4/pwm.c b/chip/lm4/pwm.c
deleted file mode 100644
index 38ce61714d..0000000000
--- a/chip/lm4/pwm.c
+++ /dev/null
@@ -1,70 +0,0 @@
-/* Copyright 2013 The Chromium OS Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-/* PWM control module for LM4.
- *
- * On this chip, the PWM logic is implemented by the hardware FAN modules.
- */
-
-#include "clock.h"
-#include "fan.h"
-#include "gpio.h"
-#include "hooks.h"
-#include "pwm.h"
-#include "pwm_chip.h"
-#include "registers.h"
-#include "util.h"
-
-void pwm_enable(enum pwm_channel ch, int enabled)
-{
- fan_set_enabled(pwm_channels[ch].channel, enabled);
-}
-
-int pwm_get_enabled(enum pwm_channel ch)
-{
- return fan_get_enabled(pwm_channels[ch].channel);
-}
-
-void pwm_set_duty(enum pwm_channel ch, int percent)
-{
- if (percent < 0)
- percent = 0;
- else if (percent > 100)
- percent = 100;
-
- /* Assume the fan control is active high and invert it ourselves */
- if (pwm_channels[ch].flags & PWM_CONFIG_ACTIVE_LOW)
- percent = 100 - percent;
-
- /* Always enable the channel */
- pwm_enable(ch, 1);
-
- /* Set the duty cycle */
- fan_set_duty(pwm_channels[ch].channel, percent);
-}
-
-int pwm_get_duty(enum pwm_channel ch)
-{
- int percent = fan_get_duty(pwm_channels[ch].channel);
-
- if (pwm_channels[ch].flags & PWM_CONFIG_ACTIVE_LOW)
- percent = 100 - percent;
-
- return percent;
-}
-
-static void pwm_init(void)
-{
- int i;
-
- for (i = 0; i < PWM_CH_COUNT; ++i)
- fan_channel_setup(pwm_channels[i].channel,
- (pwm_channels[i].flags &
- PWM_CONFIG_HAS_RPM_MODE)
- ? FAN_USE_RPM_MODE : 0);
-}
-
-/* The chip-specific fan module initializes before this. */
-DECLARE_HOOK(HOOK_INIT, pwm_init, HOOK_PRIO_INIT_PWM);