<commit_before>/* Copyright 2022 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.
 */

/* Physical fans. These are logically separate from pwm_channels. */

#include "common.h"
#include "compile_time_macros.h"
#include "console.h"
#include "fan_chip.h"
#include "fan.h"
#include "hooks.h"
#include "pwm.h"

#ifndef CONFIG_FANS

/*
 * TODO(b/233126129): use static fan speeds until fan and sensors are
 * tuned. for now, use:
 *
 *   AP off:  33%
 *   AP  on:  50%
 */

static void fan_slow(void)
{
	const int duty_pct = 33;

	ccprints("%s: speed %d%%", __func__, duty_pct);

	pwm_enable(PWM_CH_FAN1, 1);
	pwm_set_duty(PWM_CH_FAN1, duty_pct);
}

static void fan_max(void)
{
	const int duty_pct = 50;

	ccprints("%s: speed %d%%", __func__, duty_pct);

	pwm_enable(PWM_CH_FAN1, 1);
	pwm_set_duty(PWM_CH_FAN1, duty_pct);<commit_msg>ghost: enable second fan<commit_after>/* Copyright 2022 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.
 */

/* Physical fans. These are logically separate from pwm_channels. */

#include "common.h"
#include "compile_time_macros.h"
#include "console.h"
#include "fan_chip.h"
#include "fan.h"
#include "hooks.h"
#include "pwm.h"

#ifndef CONFIG_FANS

/*
 * TODO(b/233126129): use static fan speeds until fan and sensors are
 * tuned. for now, use:
 *
 *   AP off:  33%
 *   AP  on:  50%
 */

static void fan_slow(void)
{
	const int duty_pct = 33;

	ccprints("%s: speed %d%%", __func__, duty_pct);

	pwm_enable(PWM_CH_FAN1, 1);
	pwm_set_duty(PWM_CH_FAN1, duty_pct);
	pwm_enable(PWM_CH_FAN2, 1);
	pwm_set_duty(PWM_CH_FAN2, duty_pct);
}

static void fan_max(void)
{
	const int duty_pct = 50;

	ccprints("%s: speed %d%%", __func__, duty_pct);

	pwm_enable(PWM_CH_FAN1, 1);
	pwm_set_duty(PWM_CH_FAN1, duty_pct);
	pwm_enable(PWM_CH_FAN2, 1);
	pwm_set_duty(PWM_CH_FAN2, duty_pct);
{'fraction_non_alphanumeric': 0.127309036445332, 'fraction_numerical': 0.029955067398901646, 'mean_word_length': 4.445652173913044, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4966245', 'n_tokens_mistral': 876, 'n_tokens_neox': 817, 'n_words': 220}