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

#ifndef __CROS_EC_CONFIG_CHIP_H
#define __CROS_EC_CONFIG_CHIP_H

#include <devicetree.h>

/*
 * This file translates Kconfig options to platform/ec options.
 *
 * Options which are from Zephyr platform/ec module (Kconfig) start
 * with CONFIG_PLATFORM_EC_, and can be found in the Kconfig file.
 *
 * Options which are for the platform/ec configuration can be found in
 * common/config.h.
 */

#define CONFIG_ZEPHYR
#define CHROMIUM_EC

/* Chipset and power configuration */
#ifdef CONFIG_AP_X86_INTEL_TGL
#define CONFIG_CHIPSET_TIGERLAKE
#endif

/* Battery configuration */
#undef CONFIG_BATTERY
#undef CONFIG_BATTERY_FUEL_GAUGE
#ifdef CONFIG_PLATFORM_EC_BATTERY
#define CONFIG_BATTERY
#define CONFIG_BATTERY_FUEL_GAUGE

/* TODO(b/176121284): hard-coded for volteer */
enum battery_type {
	BATTERY_LGC011,
	BATTERY_TYPE_COUNT,
};
#endif /* CONFIG_PLATFORM_EC_BATTERY_FUEL_GAUGE */

#undef CONFIG_BATTERY_SMART
#ifdef CONFIG_PLATFORM_EC_BATTERY_SMART
#define CONFIG_BATTERY_SMART
#endif

#undef CONFIG_BATTERY_PRESENT_CUSTOM
#undef CONFIG_BATTERY_PRESENT_GPIO
#ifdef CONFIG_PLATFORM_EC_BATTERY_PRESENT_CUSTOM
#define CONFIG_BATTERY_PRESENT_CUSTOM
#elif defined(PLATFORM_EC_BATTERY_PRESENT_GPIO)
#define CONFIG_BATTERY_PRESENT_GPIO
#endif /* CONFIG_PLATFORM_EC_BATTERY_PRESENT_CUSTOM */

#undef CONFIG_CHARGER_ISL9241
#ifdef CONFIG_PLATFORM_EC_CHARGER_ISL9241
#define CONFIG_CHARGER_ISL9241
/* Hardware based charge ramp is broken in the ISL9241 (b/169350714) */
#define CONFIG_CHARGE_RAMP_SW

/* TODO(b/175881762): Move to devicetree? */
#define CONFIG_CHARGER_SENSE_RESISTOR		10
#define CONFIG_CHARGER_SENSE_RESISTOR_AC	10

#define CONFIG_CHARGER_DISCHARGE_ON_AC
#define CONFIG_CHARGER_INPUT_CURRENT		512
#endif<commit_msg>zephyr: Enable external power<commit_after>/* Copyright 2020 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.
 */

#ifndef __CROS_EC_CONFIG_CHIP_H
#define __CROS_EC_CONFIG_CHIP_H

#include <devicetree.h>

/*
 * This file translates Kconfig options to platform/ec options.
 *
 * Options which are from Zephyr platform/ec module (Kconfig) start
 * with CONFIG_PLATFORM_EC_, and can be found in the Kconfig file.
 *
 * Options which are for the platform/ec configuration can be found in
 * common/config.h.
 */

#define CONFIG_ZEPHYR
#define CHROMIUM_EC

/* Chipset and power configuration */
#ifdef CONFIG_AP_X86_INTEL_TGL
#define CONFIG_CHIPSET_TIGERLAKE
#endif

/* Battery configuration */
#undef CONFIG_BATTERY
#undef CONFIG_BATTERY_FUEL_GAUGE
#ifdef CONFIG_PLATFORM_EC_BATTERY
#define CONFIG_BATTERY
#define CONFIG_BATTERY_FUEL_GAUGE

/* TODO(b/176121284): hard-coded for volteer */
enum battery_type {
	BATTERY_LGC011,
	BATTERY_TYPE_COUNT,
};
#endif /* CONFIG_PLATFORM_EC_BATTERY_FUEL_GAUGE */

#undef CONFIG_BATTERY_SMART
#ifdef CONFIG_PLATFORM_EC_BATTERY_SMART
#define CONFIG_BATTERY_SMART
#endif

#undef CONFIG_BATTERY_PRESENT_CUSTOM
#undef CONFIG_BATTERY_PRESENT_GPIO
#ifdef CONFIG_PLATFORM_EC_BATTERY_PRESENT_CUSTOM
#define CONFIG_BATTERY_PRESENT_CUSTOM
#elif defined(PLATFORM_EC_BATTERY_PRESENT_GPIO)
#define CONFIG_BATTERY_PRESENT_GPIO
#endif /* CONFIG_PLATFORM_EC_BATTERY_PRESENT_CUSTOM */

#undef CONFIG_CHARGER_ISL9241
#ifdef CONFIG_PLATFORM_EC_CHARGER_ISL9241
#define CONFIG_CHARGER_ISL9241
/* Hardware based charge ramp is broken in the ISL9241 (b/169350714) */
#define CONFIG_CHARGE_RAMP_SW

/* TODO(b/175881762): Move to devicetree? */
#define CONFIG_CHARGER_SENSE_RESISTOR		10
#define CONFIG_CHARGER_SENSE_RESISTOR_AC	10

#define CONFIG_CHARGER_DISCHARGE_ON_AC
#define CONFIG_CHARGER_INPUT_CURRENT		512
#endif

#ifdef CONFIG_PLATFORM_EC_EXTPOWER_GPIO
/* This always needs to be defined for this option to work */
#define CONFIG_EXTPOWER
#endif
{'fraction_non_alphanumeric': 0.06240563663814796, 'fraction_numerical': 0.029693004529441368, 'mean_word_length': 6.4858757062146895, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5375663', 'n_tokens_mistral': 1611, 'n_tokens_neox': 1492, 'n_words': 346}