<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.
 */

#include <zephyr/devicetree.h>
#include <zephyr/sys/util.h>
#include "usb_pd_tcpm.h"
#include "usb_pd.h"
#include "usbc/tcpc_ccgxxf.h"
#include "usbc/tcpc_fusb302.h"
#include "usbc/tcpc_it8xxx2.h"
#include "usbc/tcpc_nct38xx.h"
#include "usbc/tcpc_ps8xxx.h"
#include "usbc/tcpci.h"
#include "usbc/utils.h"

#if DT_HAS_COMPAT_STATUS_OKAY(CCGXXF_TCPC_COMPAT) ||      \
	DT_HAS_COMPAT_STATUS_OKAY(FUSB302_TCPC_COMPAT) || \
	DT_HAS_COMPAT_STATUS_OKAY(IT8XXX2_TCPC_COMPAT) || \
	DT_HAS_COMPAT_STATUS_OKAY(PS8XXX_COMPAT) ||       \
	DT_HAS_COMPAT_STATUS_OKAY(NCT38XX_TCPC_COMPAT) || \
	DT_HAS_COMPAT_STATUS_OKAY(TCPCI_COMPAT)

#define TCPC_CONFIG(id, fn) [USBC_PORT(id)] = fn(id)

#define MAYBE_CONST \
	COND_CODE_1(CONFIG_PLATFORM_EC_USB_PD_TCPC_RUNTIME_CONFIG, (), (const))

MAYBE_CONST struct tcpc_config_t tcpc_config[] = {
	DT_FOREACH_STATUS_OKAY_VARGS(CCGXXF_TCPC_COMPAT, TCPC_CONFIG,
				     TCPC_CONFIG_CCGXXF)
		DT_FOREACH_STATUS_OKAY_VARGS(FUSB302_TCPC_COMPAT, TCPC_CONFIG,
					     TCPC_CONFIG_FUSB302)
			DT_FOREACH_STATUS_OKAY_VARGS(IT8XXX2_TCPC_COMPAT,
						     TCPC_CONFIG,
						     TCPC_CONFIG_IT8XXX2)
				DT_FOREACH_STATUS_OKAY_VARGS(PS8XXX_COMPAT,
							     TCPC_CONFIG,
							     TCPC_CONFIG_PS8XXX)
					DT_FOREACH_STATUS_OKAY_VARGS(
						NCT38XX_TCPC_COMPAT,
						TCPC_CONFIG,
						TCPC_CONFIG_NCT38XX)
						DT_FOREACH_STATUS_OKAY_VARGS(
							TCPCI_COMPAT,
							TCPC_CONFIG,
							TCPC_CONFIG_TCPCI)
};

#endif /* DT_HAS_COMPAT_STATUS_OKAY */<commit_msg>zephyr/shim/src/tcpc.c: disable clang-format<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.
 */

#include <zephyr/devicetree.h>
#include <zephyr/sys/util.h>
#include "usb_pd_tcpm.h"
#include "usb_pd.h"
#include "usbc/tcpc_ccgxxf.h"
#include "usbc/tcpc_fusb302.h"
#include "usbc/tcpc_it8xxx2.h"
#include "usbc/tcpc_nct38xx.h"
#include "usbc/tcpc_ps8xxx.h"
#include "usbc/tcpci.h"
#include "usbc/utils.h"

#if DT_HAS_COMPAT_STATUS_OKAY(CCGXXF_TCPC_COMPAT) ||      \
	DT_HAS_COMPAT_STATUS_OKAY(FUSB302_TCPC_COMPAT) || \
	DT_HAS_COMPAT_STATUS_OKAY(IT8XXX2_TCPC_COMPAT) || \
	DT_HAS_COMPAT_STATUS_OKAY(PS8XXX_COMPAT) ||       \
	DT_HAS_COMPAT_STATUS_OKAY(NCT38XX_TCPC_COMPAT) || \
	DT_HAS_COMPAT_STATUS_OKAY(TCPCI_COMPAT)

#define TCPC_CONFIG(id, fn) [USBC_PORT(id)] = fn(id)

#define MAYBE_CONST \
	COND_CODE_1(CONFIG_PLATFORM_EC_USB_PD_TCPC_RUNTIME_CONFIG, (), (const))

/* Enable clang-format when the formatted code is readable. */
/* clang-format off */
MAYBE_CONST struct tcpc_config_t tcpc_config[] = {
	DT_FOREACH_STATUS_OKAY_VARGS(CCGXXF_TCPC_COMPAT, TCPC_CONFIG,
				     TCPC_CONFIG_CCGXXF)
	DT_FOREACH_STATUS_OKAY_VARGS(FUSB302_TCPC_COMPAT, TCPC_CONFIG,
				     TCPC_CONFIG_FUSB302)
	DT_FOREACH_STATUS_OKAY_VARGS(IT8XXX2_TCPC_COMPAT, TCPC_CONFIG,
				     TCPC_CONFIG_IT8XXX2)
	DT_FOREACH_STATUS_OKAY_VARGS(PS8XXX_COMPAT, TCPC_CONFIG,
				     TCPC_CONFIG_PS8XXX)
	DT_FOREACH_STATUS_OKAY_VARGS(NCT38XX_TCPC_COMPAT, TCPC_CONFIG,
				     TCPC_CONFIG_NCT38XX)
	DT_FOREACH_STATUS_OKAY_VARGS(TCPCI_COMPAT, TCPC_CONFIG,
				     TCPC_CONFIG_TCPCI)
};
/* clang-format on */

#endif /* DT_HAS_COMPAT_STATUS_OKAY */
{'fraction_non_alphanumeric': 0.09457092819614711, 'fraction_numerical': 0.021599532983070636, 'mean_word_length': 5.044091710758377, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '3674305', 'n_tokens_mistral': 1647, 'n_tokens_neox': 1495, 'n_words': 198}