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

/* USB Power delivery port management */

#ifndef __USB_PD_TCPM_H
#define __USB_PD_TCPM_H

/* Default retry count for transmitting */
#define PD_RETRY_COUNT 3

/* Time to wait for TCPC to complete transmit */
#define PD_T_TCPC_TX_TIMEOUT  (100*MSEC)

#define TCPC_REG_VENDOR_ID         0x0
#define TCPC_REG_PRODUCT_ID        0x2
#define TCPC_REG_BCD_DEV           0x4
#define TCPC_REG_TC_REV            0x6
#define TCPC_REG_PD_REV            0x8
#define TCPC_REG_PD_INT_REV        0xa
#define TCPC_REG_DEV_CAP_1         0xc
#define TCPC_REG_DEV_CAP_2         0xd
#define TCPC_REG_DEV_CAP_3         0xe
#define TCPC_REG_DEV_CAP_4         0xf
#define TCPC_REG_ALERT1            0x10
#define TCPC_REG_ALERT1_SLEEP_EXITED (1<<7)
#define TCPC_REG_ALERT1_POWER_STATUS (1<<6)
#define TCPC_REG_ALERT1_CC_STATUS    (1<<5)
#define TCPC_REG_ALERT1_RX_STATUS    (1<<4)
#define TCPC_REG_ALERT1_RX_HARD_RST  (1<<3)
#define TCPC_REG_ALERT1_TX_SUCCESS   (1<<2)
#define TCPC_REG_ALERT1_TX_DISCARDED (1<<1)
#define TCPC_REG_ALERT1_TX_FAILED    (1<<0)
#define TCPC_REG_ALERT1_TX_COMPLETE  (TCPC_REG_ALERT1_TX_SUCCESS | \
				      TCPC_REG_ALERT1_TX_FAILED | \
				      TCPC_REG_ALERT1_TX_FAILED)

#define TCPC_REG_ALERT2            0x11
#define TCPC_REG_ALERT3            0x12
#define TCPC_REG_ALERT4            0x13
#define TCPC_REG_ALERT_MASK_1      0x14
#define TCPC_REG_ALERT_MASK_2      0x15
#define TCPC_REG_POWER_STATUS_MASK 0x16
#define TCPC_REG_CC1_STATUS        0x18
#define TCPC_REG_CC2_STATUS        0x19
#define TCPC_REG_CC_STATUS_SET(term, volt) \
		((term) << 3 | volt)
#define TCPC_REG_CC_STATUS_TERM(reg) (((reg) & 0x38) >> 3)
#define TCPC_REG_CC_STATUS_VOLT(reg) ((reg) & 0x7)
enum tcpc_cc_termination_status {
	TYPEC_CC_TERM_RA = 0,
	TYPEC_CC_TERM_RP_DEF = 1,
	TYPEC_CC_TERM_RP_1_5 = 2,
	TYPEC_CC_TERM_RP_3_0 = 3,
	TYPEC_CC_TERM_RD = 4,
	TYPEC_CC_TERM_VCONN = 5,
	TYPEC_CC_TERM_OPEN = 6
};
enum tcpc_cc_voltage_status {
	TYPEC_CC_VOLT_RA = 0,<commit_msg>tcpc: fix alert bit masks for transmit<commit_after>/* Copyright 2015 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.
 */

/* USB Power delivery port management */

#ifndef __USB_PD_TCPM_H
#define __USB_PD_TCPM_H

/* Default retry count for transmitting */
#define PD_RETRY_COUNT 3

/* Time to wait for TCPC to complete transmit */
#define PD_T_TCPC_TX_TIMEOUT  (100*MSEC)

#define TCPC_REG_VENDOR_ID         0x0
#define TCPC_REG_PRODUCT_ID        0x2
#define TCPC_REG_BCD_DEV           0x4
#define TCPC_REG_TC_REV            0x6
#define TCPC_REG_PD_REV            0x8
#define TCPC_REG_PD_INT_REV        0xa
#define TCPC_REG_DEV_CAP_1         0xc
#define TCPC_REG_DEV_CAP_2         0xd
#define TCPC_REG_DEV_CAP_3         0xe
#define TCPC_REG_DEV_CAP_4         0xf
#define TCPC_REG_ALERT1            0x10
#define TCPC_REG_ALERT1_SLEEP_EXITED (1<<7)
#define TCPC_REG_ALERT1_POWER_STATUS (1<<6)
#define TCPC_REG_ALERT1_CC_STATUS    (1<<5)
#define TCPC_REG_ALERT1_RX_STATUS    (1<<4)
#define TCPC_REG_ALERT1_RX_HARD_RST  (1<<3)
#define TCPC_REG_ALERT1_TX_SUCCESS   (1<<2)
#define TCPC_REG_ALERT1_TX_DISCARDED (1<<1)
#define TCPC_REG_ALERT1_TX_FAILED    (1<<0)
#define TCPC_REG_ALERT1_TX_COMPLETE  (TCPC_REG_ALERT1_TX_SUCCESS | \
				      TCPC_REG_ALERT1_TX_DISCARDED | \
				      TCPC_REG_ALERT1_TX_FAILED)

#define TCPC_REG_ALERT2            0x11
#define TCPC_REG_ALERT3            0x12
#define TCPC_REG_ALERT4            0x13
#define TCPC_REG_ALERT_MASK_1      0x14
#define TCPC_REG_ALERT_MASK_2      0x15
#define TCPC_REG_POWER_STATUS_MASK 0x16
#define TCPC_REG_CC1_STATUS        0x18
#define TCPC_REG_CC2_STATUS        0x19
#define TCPC_REG_CC_STATUS_SET(term, volt) \
		((term) << 3 | volt)
#define TCPC_REG_CC_STATUS_TERM(reg) (((reg) & 0x38) >> 3)
#define TCPC_REG_CC_STATUS_VOLT(reg) ((reg) & 0x7)
enum tcpc_cc_termination_status {
	TYPEC_CC_TERM_RA = 0,
	TYPEC_CC_TERM_RP_DEF = 1,
	TYPEC_CC_TERM_RP_1_5 = 2,
	TYPEC_CC_TERM_RP_3_0 = 3,
	TYPEC_CC_TERM_RD = 4,
	TYPEC_CC_TERM_VCONN = 5,
	TYPEC_CC_TERM_OPEN = 6
};
enum tcpc_cc_voltage_status {
	TYPEC_CC_VOLT_RA = 0,
{'fraction_non_alphanumeric': 0.06927710843373494, 'fraction_numerical': 0.0505097312326228, 'mean_word_length': 3.990751445086705, 'pattern_counts': {'":': 0, '<': 39, '<?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': '7110679', 'n_tokens_mistral': 1912, 'n_tokens_neox': 1848, 'n_words': 361}