cleanup: Rename and move header files

Device-specific headers belong in driver/ or chip/.  The include/
directory should be for common interfaces.

Code should not normally need to include driver-specific headers.  If
it does, it should use the full relative path from the EC project root
(for example, drivers/charger/bq24715.h).

Change-Id: Id23db37a431e2d802a74ec601db6f69b613352ba
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/173746
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
This commit is contained in:
Randall Spangler
2013-10-17 15:05:04 -07:00
committed by chrome-internal-fetch
parent 8cf03ac056
commit 2ad076f8a0
42 changed files with 54 additions and 62 deletions

View File

@@ -1,28 +0,0 @@
/* Copyright (c) 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.
*
* TI bq24192 battery charger driver.
*/
#ifndef __CROS_EC_CHARGER_BQ24192_H
#define __CROS_EC_CHARGER_BQ24192_H
#define BQ24192_ADDR 0xd6
/* Registers */
#define BQ24192_REG_INPUT_CTRL 0x0
#define BQ24192_REG_POWER_ON_CFG 0x1
#define BQ24192_REG_CHG_CURRENT 0x2
#define BQ24192_REG_PRE_CHG_CURRENT 0x3
#define BQ24192_REG_CHG_VOLTAGE 0x4
#define BQ24192_REG_CHG_TERM_TMR 0x5
#define BQ24192_REG_IR_COMP 0x6
#define BQ24192_REG_MISC_OP 0x7
#define BQ24192_REG_STATUS 0x8
#define BQ24192_REG_FAULT 0x9
#define BQ24192_REG_ID 0xa
#define BQ24192_DEVICE_ID 0x2b
#endif /* __CROS_EC_CHARGER_BQ24192_H */

View File

@@ -1,44 +0,0 @@
/* Copyright (c) 2012 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.
*
* TI bq24707A battery charger driver.
*/
#ifndef __CROS_EC_CHARGER_BQ24707A_H
#define __CROS_EC_CHARGER_BQ24707A_H
/* Chip specific commands */
#define BQ24707_CHARGE_OPTION 0x12
#define BQ24707_INPUT_CURRENT 0x3f
#define BQ24707_MANUFACTURE_ID 0xfe
#define BQ24707_DEVICE_ID 0xff
/* ChargeOption 0x12 */
#define OPTION_CHARGE_INHIBIT (1 << 0)
#define OPTION_ACOC_THRESHOLD (3 << 1)
#define OPTION_COMPARATOR_THRESHOLD (1 << 4)
#define OPTION_IOUT_SELECTION (1 << 5)
#define OPTION_IFAULT_HI_THRESHOLD (3 << 7)
#define OPTION_EMI_FREQ_ENABLE (1 << 9)
#define OPTION_EMI_FREQ_ADJ (1 << 10)
#define OPTION_WATCHDOG_TIMER (3 << 13)
#define OPTION_AOC_DELITCH_TIME (1 << 15)
/* OPTION_ACOC_THRESHOLD */
#define ACOC_THRESHOLD_DISABLE (0 << 1)
#define ACOC_THRESHOLD_133X (1 << 1)
#define ACOC_THRESHOLD_166X_DEFAULT (2 << 1)
#define ACOC_THRESHOLD_222X (3 << 1)
/* OPTION_IFAULT_HI_THRESHOLD */
#define IFAULT_THRESHOLD_300MV (0 << 7)
#define IFAULT_THRESHOLD_500MV (1 << 7)
#define IFAULT_THRESHOLD_700MV_DEFAULT (2 << 7)
#define IFAULT_THRESHOLD_900MV (3 << 7)
/* OPTION_WATCHDOG_TIMER */
#define CHARGE_WATCHDOG_DISABLE (0 << 13)
#define CHARGE_WATCHDOG_44SEC (1 << 13)
#define CHARGE_WATCHDOG_88SEC (2 << 13)
#define CHARGE_WATCHDOG_175SEC_DEFAULT (3 << 13)
#endif /* __CROS_EC_CHARGER_BQ24707A_H */

View File

@@ -1,130 +0,0 @@
/* Copyright (c) 2012 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.
*
* TI bq24715 battery charger driver.
*/
#ifndef __CROS_EC_CHARGER_BQ24715_H
#define __CROS_EC_CHARGER_BQ24715_H
/* NOTES:
* If battery is not present keep charge current register (0x14) at 0.
* Max charge voltage (0x15) needs to be programmed before 0x14.
*/
/* Chip specific registers */
#define BQ24715_CHARGE_OPTION 0x12
#define BQ24715_CHARGE_CURRENT 0x14
#define BQ24715_MAX_CHARGE_VOLTAGE 0x15
#define BQ24715_MIN_SYSTEM_VOLTAGE 0x3e
#define BQ24715_INPUT_CURRENT 0x3f
#define BQ24715_MANUFACTURER_ID 0xfe
#define BQ24715_DEVICE_ID 0xff
/* ChargeOption Register - 0x12 */
#define OPT_LOWPOWER_MASK (1 << 15)
#define OPT_LOWPOWER_DSCHRG_I_MON_ON (0 << 15)
#define OPT_LOWPOWER_DSCHRG_I_MON_OFF (1 << 15)
#define OPT_WATCHDOG_MASK (3 << 13)
#define OPT_WATCHDOG_DISABLE (0 << 13)
#define OPT_WATCHDOG_44SEC (1 << 13)
#define OPT_WATCHDOG_88SEC (2 << 13)
#define OPT_WATCHDOG_175SEC (3 << 13)
#define OPT_SYSOVP_MASK (1 << 12)
#define OPT_SYSOVP_15P1_3SEC_10P1_2SEC (0 << 12)
#define OPT_SYSOVP_17P0_3SEC_11P3_2SEC (1 << 12)
#define OPT_SYSOVP_STATUS_MASK (1 << 11)
#define OPT_SYSOVP_STATUS (1 << 11)
#define OPT_AUDIO_FREQ_LIMIT_MASK (1 << 10)
#define OPT_AUDIO_FREQ_NO_LIMIT (0 << 10)
#define OPT_AUDIO_FREQ_40KHZ_LIMIT (1 << 10)
#define OPT_SWITCH_FREQ_MASK (3 << 8)
#define OPT_SWITCH_FREQ_600KHZ (0 << 8)
#define OPT_SWITCH_FREQ_800KHZ (1 << 8)
#define OPT_SWITCH_FREQ_1MHZ (2 << 8)
#define OPT_SWITCH_FREQ_800KHZ_DUP (3 << 8)
#define OPT_ACOC_MASK (1 << 7)
#define OPT_ACOC_DISABLED (0 << 7)
#define OPT_ACOC_333PCT_IPDM (1 << 7)
#define OPT_LSFET_OCP_MASK (1 << 6)
#define OPT_LSFET_OCP_250MV (0 << 6)
#define OPT_LSFET_OCP_350MV (1 << 6)
#define OPT_LEARN_MASK (1 << 5)
#define OPT_LEARN_DISABLE (0 << 5)
#define OPT_LEARN_ENABLE (1 << 5)
#define OPT_IOUT_MASK (1 << 4)
#define OPT_IOUT_40X (0 << 4)
#define OPT_IOUT_16X (1 << 4)
#define OPT_FIX_IOUT_MASK (1 << 3)
#define OPT_FIX_IOUT_IDPM_EN (0 << 3)
#define OPT_FIX_IOUT_ALWAYS (1 << 3)
#define OPT_LDO_MODE_MASK (1 << 2)
#define OPT_LDO_DISABLE (0 << 2)
#define OPT_LDO_ENABLE (1 << 2)
#define OPT_ODPM_MASK (1 << 1)
#define OPT_ODPM_DISABLE (0 << 1)
#define OPT_ODPM_ENABLE (1 << 1)
#define OPT_CHARGE_INHIBIT_MASK (1 << 0)
#define OPT_CHARGE_ENABLE (0 << 0)
#define OPT_CHARGE_DISABLE (1 << 0)
/* ChargeCurrent Register - 0x14
* The ChargeCurrent register controls a DAC. Therefore
* the below definitions are cummulative. */
#define CHARGE_I_64MA (1 << 6)
#define CHARGE_I_128MA (1 << 7)
#define CHARGE_I_256MA (1 << 8)
#define CHARGE_I_512MA (1 << 9)
#define CHARGE_I_1024MA (1 << 10)
#define CHARGE_I_2048MA (1 << 11)
#define CHARGE_I_4096MA (1 << 12)
#define CHARGE_I_OFF (0)
#define CHARGE_I_MIN (128)
#define CHARGE_I_MAX (8128)
#define CHARGE_I_STEP (64)
/* MaxChargeVoltage Register - 0x15
* The MaxChargeVoltage register controls a DAC. Therefore
* the below definitions are cummulative. */
#define CHARGE_V_16MV (1 << 4)
#define CHARGE_V_32MV (1 << 5)
#define CHARGE_V_64MV (1 << 6)
#define CHARGE_V_128MV (1 << 7)
#define CHARGE_V_256MV (1 << 8)
#define CHARGE_V_512MV (1 << 9)
#define CHARGE_V_1024MV (1 << 10)
#define CHARGE_V_2048MV (1 << 11)
#define CHARGE_V_4096MV (1 << 12)
#define CHARGE_V_8192MV (1 << 13)
#define CHARGE_V_MIN (4096)
#define CHARGE_V_MAX (0x3ff0)
#define CHARGE_V_STEP (16)
/* MinSystemVoltage Register - 0x3e
* The MinSystemVoltage register controls a DAC. Therefore
* the below definitions are cummulative. */
#define MIN_SYS_V_256MV (1 << 8)
#define MIN_SYS_V_512MV (1 << 9)
#define MIN_SYS_V_1024MV (1 << 10)
#define MIN_SYS_V_2048MV (1 << 11)
#define MIN_SYS_V_4096MV (1 << 12)
#define MIN_SYS_V_8192MV (1 << 13)
#define MIN_SYS_V_MIN (4096)
/* InputCurrent Register - 0x3f
* The InputCurrent register controls a DAC. Therefore
* the below definitions are cummulative. */
#define INPUT_I_64MA (1 << 6)
#define INPUT_I_128MA (1 << 7)
#define INPUT_I_256MA (1 << 8)
#define INPUT_I_512MA (1 << 9)
#define INPUT_I_1024MA (1 << 10)
#define INPUT_I_2048MA (1 << 11)
#define INPUT_I_4096MA (1 << 12)
#define INPUT_I_MIN (128)
#define INPUT_I_MAX (8064)
#define INPUT_I_STEP (64)
#endif /* __CROS_EC_CHARGER_BQ24715_H */

View File

@@ -1,50 +0,0 @@
/* Copyright (c) 2012 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.
*
* TI bq24725 battery charger driver.
*/
#ifndef __CROS_EC_CHARGER_BQ24725_H
#define __CROS_EC_CHARGER_BQ24725_H
/* Chip specific commands */
#define BQ24725_CHARGE_OPTION 0x12
#define BQ24725_INPUT_CURRENT 0x3f
#define BQ24725_MANUFACTURE_ID 0xfe
#define BQ24725_DEVICE_ID 0xff
/* ChargeOption 0x12 */
#define OPTION_CHARGE_INHIBIT (1 << 0)
#define OPTION_ACOC_THRESHOLD (3 << 1)
#define OPTION_IOUT_SELECTION (1 << 5)
#define OPTION_LEARN_ENABLE (1 << 6)
#define OPTION_IFAULT_HI_THRESHOLD (3 << 7)
#define OPTION_EMI_FREQ_ENABLE (1 << 9)
#define OPTION_EMI_FREQ_ADJ (1 << 10)
#define OPTION_BAT_DEPLETION_THRESHOLD (3 << 11)
#define OPTION_WATCHDOG_TIMER (3 << 13)
#define OPTION_AOC_DELITCH_TIME (1 << 15)
/* OPTION_ACOC_THRESHOLD */
#define ACOC_THRESHOLD_DISABLE (0 << 1)
#define ACOC_THRESHOLD_133X (1 << 1)
#define ACOC_THRESHOLD_166X_DEFAULT (2 << 1)
#define ACOC_THRESHOLD_222X (3 << 1)
/* OPTION_IFAULT_HI_THRESHOLD */
#define IFAULT_THRESHOLD_300MV (0 << 7)
#define IFAULT_THRESHOLD_500MV (1 << 7)
#define IFAULT_THRESHOLD_700MV_DEFAULT (2 << 7)
#define IFAULT_THRESHOLD_900MV (3 << 7)
/* OPTION_BAT_DEPLETION_THRESHOLD */
#define FALLING_THRESHOLD_5919 (0 << 11)
#define FALLING_THRESHOLD_6265 (1 << 11)
#define FALLING_THRESHOLD_6655 (2 << 11)
#define FALLING_THRESHOLD_7097_DEFAULT (3 << 11)
/* OPTION_WATCHDOG_TIMER */
#define CHARGE_WATCHDOG_DISABLE (0 << 13)
#define CHARGE_WATCHDOG_44SEC (1 << 13)
#define CHARGE_WATCHDOG_88SEC (2 << 13)
#define CHARGE_WATCHDOG_175SEC_DEFAULT (3 << 13)
#endif /* __CROS_EC_CHARGER_BQ24725_H */

View File

@@ -1,60 +0,0 @@
/* Copyright (c) 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.
*
* TI bq24738 battery charger driver.
*/
#ifndef __CROS_EC_CHARGER_BQ24738_H
#define __CROS_EC_CHARGER_BQ24738_H
/* Chip specific commands */
#define BQ24738_CHARGE_OPTION 0x12
#define BQ24738_INPUT_CURRENT 0x3f
#define BQ24738_MANUFACTURE_ID 0xfe
#define BQ24738_DEVICE_ID 0xff
/* ChargeOption 0x12 */
#define OPTION_CHARGE_INHIBIT (1 << 0)
#define OPTION_ACOC_THRESHOLD (1 << 1)
#define OPTION_BOOST_MODE_STATE (1 << 2)
#define OPTION_BOOST_MODE_ENABLE (1 << 3)
#define OPTION_ACDET_STATE (1 << 4)
#define OPTION_IOUT_SELECTION (1 << 5)
#define OPTION_LEARN_ENABLE (1 << 6)
#define OPTION_IFAULT_LOW_THRESHOLD (1 << 7)
#define OPTION_IFAULT_HI_ENABLE (1 << 8)
#define OPTION_EMI_FREQ_ENABLE (1 << 9)
#define OPTION_EMI_FREQ_ADJ (1 << 10)
#define OPTION_BAT_DEPLETION_THRESHOLD (3 << 11)
#define OPTION_WATCHDOG_TIMER (3 << 13)
#define OPTION_ACPRES_DEGLITCH_TIME (1 << 15)
/* OPTION_ACOC_THRESHOLD */
#define ACOC_THRESHOLD_DISABLE (0 << 1)
#define ACOC_THRESHOLD_133X (1 << 1)
/* OPTION_IFAULT_LOW_THRESHOLD */
#define IFAULT_LOW_135MV_DEFAULT (0 << 7)
#define IFAULT_LOW_230MV (1 << 7)
/* OPTION_BAT_DEPLETION_THRESHOLD */
#define FALLING_THRESHOLD_5919 (0 << 11)
#define FALLING_THRESHOLD_6265 (1 << 11)
#define FALLING_THRESHOLD_6655 (2 << 11)
#define FALLING_THRESHOLD_7097_DEFAULT (3 << 11)
/* OPTION_WATCHDOG_TIMER */
#define CHARGE_WATCHDOG_DISABLE (0 << 13)
#define CHARGE_WATCHDOG_44SEC (1 << 13)
#define CHARGE_WATCHDOG_88SEC (2 << 13)
#define CHARGE_WATCHDOG_175SEC_DEFAULT (3 << 13)
/* OPTION_ACPRES_DEGLITCH_TIME */
#define ACPRES_DEGLITCH_150MS (0 << 15)
#define ACPRES_DEGLITCH_1300MS_DEFAULT (1 << 15)
/* Discharge battery when on AC power. */
int charger_discharge_on_ac(int enable);
#endif /* __CROS_EC_CHARGER_BQ24738_H */

View File

@@ -85,6 +85,8 @@
* Valid only if EC_MEMMAP_THERMAL_VERSION returns >= 2.
*/
#define EC_TEMP_SENSOR_B_ENTRIES 8
/* Special values for mapped temperature sensors */
#define EC_TEMP_SENSOR_NOT_PRESENT 0xff
#define EC_TEMP_SENSOR_ERROR 0xfe
#define EC_TEMP_SENSOR_NOT_POWERED 0xfd
@@ -95,6 +97,13 @@
*/
#define EC_TEMP_SENSOR_OFFSET 200
/*
* The default value a temperature sensor will return when it is present but
* has not been read this boot. This is a reasonable number to avoid
* triggering alarms on the host.
*/
#define EC_TEMP_SENSOR_DEFAULT (296 - EC_TEMP_SENSOR_OFFSET)
#define EC_FAN_SPEED_ENTRIES 4 /* Number of fans at EC_MEMMAP_FAN */
#define EC_FAN_SPEED_NOT_PRESENT 0xffff /* Entry not present */
#define EC_FAN_SPEED_STALLED 0xfffe /* Fan stalled */

View File

@@ -1,17 +0,0 @@
/* Copyright (c) 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.
*/
/* Unit testing for Chrome EC */
#ifndef __CROS_EC_HOST_TEST_H
#define __CROS_EC_HOST_TEST_H
/* Emulator exit codes */
#define EXIT_CODE_HIBERNATE (1 << 7)
/* Get emulator executable name */
const char *__get_prog_name(void);
#endif /* __CROS_EC_HOST_TEST_H */

View File

@@ -1,76 +0,0 @@
/* Copyright (c) 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.
*
* TI LP5562 LED driver.
*/
#ifndef LP5562_H
#define LP5562_H
#define LP5562_REG_ENABLE 0x00
#define LP5562_REG_OP_MODE 0x01
#define LP5562_REG_B_PWM 0x02
#define LP5562_REG_G_PWM 0x03
#define LP5562_REG_R_PWM 0x04
#define LP5562_REG_B_CURRENT 0x05
#define LP5562_REG_G_CURRENT 0x06
#define LP5562_REG_R_CURRENT 0x07
#define LP5562_REG_CONFIG 0x08
#define LP5562_REG_ENG1_PC 0x09
#define LP5562_REG_ENG2_PC 0x0a
#define LP5562_REG_ENG3_PC 0x0b
#define LP5562_REG_STATUS 0x0c
#define LP5562_REG_RESET 0x0d
#define LP5562_REG_W_PWM 0x0e
#define LP5562_REG_W_CURRENT 0x0f
#define LP5562_REG_LED_MAP 0x70
#define LP5562_REG_ENG_PROG(n) (0x10 + ((n)-1) * 0x20)
/* Brightness range: 0x00 - 0xff */
#define LP5562_COLOR_NONE 0x000000
#define LP5562_COLOR_RED(b) (0x010000 * (b))
#define LP5562_COLOR_GREEN(b) (0x000100 * (b))
#define LP5562_COLOR_BLUE(b) (0x000001 * (b))
#define LP5562_ENG_SEL_NONE 0x0
#define LP5562_ENG_SEL_1 0x1
#define LP5562_ENG_SEL_2 0x2
#define LP5562_ENG_SEL_3 0x3
#define LP5562_ENG_HOLD 0x0
#define LP5562_ENG_STEP 0x1
#define LP5562_ENG_RUN 0x2
/* Power on and initialize LP5562. */
int lp5562_poweron(void);
/* Power off LP5562. */
int lp5562_poweroff(void);
/*
* Set LED color.
* The parameter 'rgb' is in the format 0x00RRGGBB.
*/
int lp5562_set_color(uint32_t rgb);
/* Set lighting engine used by each color */
int lp5562_set_engine(uint8_t r, uint8_t g, uint8_t b);
/* Load lighting engine program */
int lp5562_engine_load(int engine, const uint8_t *program, int size);
/* Control lighting engine execution state */
int lp5562_engine_control(int eng1, int eng2, int eng3);
/* Get engine execution state. Return 0xee on error. */
int lp5562_get_engine_state(int engine);
/* Get current program counter. Return 0xee on error. */
int lp5562_get_pc(int engine);
/* Set program counter */
int lp5562_set_pc(int engine, int val);
#endif /* LP5562_H */

View File

@@ -1,16 +0,0 @@
/* Copyright (c) 2011 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.
*/
/* Power state machine demo module for Chrome EC */
#ifndef __CROS_EC_POWERDEMO_H
#define __CROS_EC_POWERDEMO_H
#include "common.h"
/* Initializes the module. */
int power_demo_init(void);
#endif /* __CROS_EC_POWERDEMO_H */

View File

@@ -1,70 +0,0 @@
/* Copyright (c) 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.
*/
/* G781 temperature sensor module for Chrome EC */
#ifndef __CROS_EC_TEMP_SENSOR_G781_H
#define __CROS_EC_TEMP_SENSOR_G781_H
#define G781_I2C_ADDR 0x98 /* 7-bit address is 0x4C */
#define G781_IDX_INTERNAL 0
#define G781_IDX_EXTERNAL 1
/* Chip-specific commands */
#define G781_TEMP_LOCAL 0x00
#define G781_TEMP_REMOTE 0x01
#define G781_STATUS 0x02
#define G781_CONFIGURATION_R 0x03
#define G781_CONVERSION_RATE_R 0x04
#define G781_LOCAL_TEMP_HIGH_LIMIT_R 0x05
#define G781_LOCAL_TEMP_LOW_LIMIT_R 0x06
#define G781_REMOTE_TEMP_HIGH_LIMIT_R 0x07
#define G781_REMOTE_TEMP_LOW_LIMIT_R 0x08
#define G781_CONFIGURATION_W 0x09
#define G781_CONVERSION_RATE_W 0x0a
#define G781_LOCAL_TEMP_HIGH_LIMIT_W 0x0b
#define G781_LOCAL_TEMP_LOW_LIMIT_W 0x0c
#define G781_REMOTE_TEMP_HIGH_LIMIT_W 0x0d
#define G781_REMOTE_TEMP_LOW_LIMIT_W 0x0e
#define G781_ONESHOT 0x0f
#define G781_REMOTE_TEMP_EXTENDED 0x10
#define G781_REMOTE_TEMP_OFFSET_HIGH 0x11
#define G781_REMOTE_TEMP_OFFSET_EXTD 0x12
#define G781_REMOTE_T_HIGH_LIMIT_EXTD 0x13
#define G781_REMOTE_T_LOW_LIMIT_EXTD 0x14
#define G781_REMOTE_TEMP_THERM_LIMIT 0x19
#define G781_LOCAL_TEMP_THERM_LIMIT 0x20
#define G781_THERM_HYSTERESIS 0x21
#define G781_ALERT_FAULT_QUEUE_CODE 0x22
#define G781_MANUFACTURER_ID 0xFE
#define G781_DEVICE_ID 0xFF
/* Config register bits */
#define G781_CONFIGURATION_STANDBY (1 << 6)
#define G781_CONFIGURATION_ALERT_MASK (1 << 7)
/* Status register bits */
#define G781_STATUS_LOCAL_TEMP_THERM_ALARM (1 << 0)
#define G781_STATUS_REMOTE_TEMP_THERM_ALARM (1 << 1)
#define G781_STATUS_REMOTE_TEMP_FAULT (1 << 2)
#define G781_STATUS_REMOTE_TEMP_LOW_ALARM (1 << 3)
#define G781_STATUS_REMOTE_TEMP_HIGH_ALARM (1 << 4)
#define G781_STATUS_LOCAL_TEMP_LOW_ALARM (1 << 5)
#define G781_STATUS_LOCAL_TEMP_HIGH_ALARM (1 << 6)
#define G781_STATUS_BUSY (1 << 7)
/**
* Get the last polled value of a sensor.
*
* @param idx Index to read. Idx indicates whether to read die
* temperature or external temperature.
* @param temp_ptr Destination for temperature in K.
*
* @return EC_SUCCESS if successful, non-zero if error.
*/
int g781_get_val(int idx, int *temp_ptr);
#endif /* __CROS_EC_TEMP_SENSOR_G781_H */

View File

@@ -1,32 +0,0 @@
/* Copyright (c) 2012 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.
*/
/* TMP006 temperature sensor module for Chrome EC */
#ifndef __CROS_EC_TMP006_H
#define __CROS_EC_TMP006_H
#define TMP006_ADDR(PORT,REG) ((PORT << 16) + REG)
#define TMP006_PORT(ADDR) (ADDR >> 16)
#define TMP006_REG(ADDR) (ADDR & 0xffff)
struct tmp006_t {
const char* name;
int addr; /* I2C address formed by TMP006_ADDR macro. */
};
/**
* Get the last polled value of a sensor.
*
* @param idx Index to read. The low bit in idx indicates whether
* to read die temperature or object temperature. The
* other bits serve as internal index to tmp006 module.
* @param temp_ptr Destination for temperature in K.
*
* @return EC_SUCCESS if successful, non-zero if error.
*/
int tmp006_get_val(int idx, int *temp_ptr);
#endif /* __CROS_EC_TMP006_H */

View File

@@ -1,111 +0,0 @@
/* Copyright (c) 2012 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.
*
* TI TSU6721 USB port switch.
*/
#ifndef TSU6721_H
#define TSU6721_H
#define TSU6721_REG_DEV_ID 0x01
#define TSU6721_REG_CONTROL 0x02
#define TSU6721_REG_INT1 0x03
#define TSU6721_REG_INT2 0x04
#define TSU6721_REG_INT_MASK1 0x05
#define TSU6721_REG_INT_MASK2 0x06
#define TSU6721_REG_ADC 0x07
#define TSU6721_REG_TIMING1 0x08
#define TSU6721_REG_TIMING2 0x09
#define TSU6721_REG_DEV_TYPE1 0x0A
#define TSU6721_REG_DEV_TYPE2 0x0B
#define TSU6721_REG_BUTTON1 0x0C
#define TSU6721_REG_BUTTON2 0x0D
#define TSU6721_REG_MANUAL1 0x13
#define TSU6721_REG_MANUAL2 0x14
#define TSU6721_REG_DEV_TYPE3 0x15
#define TSU6721_REG_RESET 0x1B
#define TSU6721_REG_TIMER 0x20
#define TSU6721_REG_OCP1 0x21
#define TSU6721_REG_OCP2 0x22
#define TSU6721_CTRL_AUTO (1 << 2)
enum tsu6721_mux {
TSU6721_MUX_AUTO = 0x00,
TSU6721_MUX_USB = 0x24,
TSU6721_MUX_AUDIO = 0x48,
TSU6721_MUX_UART = 0x6C,
};
#define TSU6721_INT_ATTACH 0x0001
#define TSU6721_INT_DETACH 0x0002
#define TSU6721_INT_KP 0x0004
#define TSU6721_INT_LKP 0x0008
#define TSU6721_INT_LKR 0x0010
#define TSU6721_INT_OVP_EN 0x0020
#define TSU6721_INT_OCP_EN 0x0040
#define TSU6721_INT_OVP_OCP_OTP_DIS 0x0080
#define TSU6721_INT_AV_CHANGE 0x0100
#define TSU6721_INT_RES_ATTACH 0x0200
#define TSU6721_INT_ADC_CHANGE 0x0400
#define TSU6721_INT_STUCK_KEY 0x0800
#define TSU6721_INT_STUCK_KEY_RCV 0x1000
#define TSU6721_INT_CONNECT 0x2000
#define TSU6721_INT_OTP_EN 0x4000
#define TSU6721_INT_VBUS 0x8000
#define TSU6721_TYPE_NONE 0x000000
#define TSU6721_TYPE_OTG 0x000080
#define TSU6721_TYPE_DCP 0x000040
#define TSU6721_TYPE_CDP 0x000020
#define TSU6721_TYPE_CHG12 0x000010
#define TSU6721_TYPE_UART 0x000008
#define TSU6721_TYPE_USB_HOST 0x000004
#define TSU6721_TYPE_AUDIO2 0x000002
#define TSU6721_TYPE_AUDIO1 0x000001
#define TSU6721_TYPE_AUDIO3 0x008000
#define TSU6721_TYPE_JIG_UART_ON 0x000400
#define TSU6721_TYPE_U200_CHG 0x400000
#define TSU6721_TYPE_APPLE_CHG 0x200000
#define TSU6721_TYPE_NON_STD_CHG 0x040000
/* VBUS_DEBOUNCED might show up together with other type */
#define TSU6721_TYPE_VBUS_DEBOUNCED 0x020000
/* Initialize TSU6721. */
int tsu6721_init(void);
/* Read TSU6721 register. */
uint8_t tsu6721_read(uint8_t reg);
/* Write TSU6721 register. */
int tsu6721_write(uint8_t reg, uint8_t val);
/* Enable interrupts. */
int tsu6721_enable_interrupts(void);
/* Disable all interrupts. */
int tsu6721_disable_interrupts(void);
/* Set interrupt mask. */
int tsu6721_set_interrupt_mask(uint16_t mask);
/* Get and clear current interrupt status. Return value is a combination of
* TSU6721_INT_* */
int tsu6721_get_interrupts(void);
/* Get but keep interrupt status. Return value is a combination of
* TSU6721_INT_* */
int tsu6721_peek_interrupts(void);
/* Get attached device type. Return value is one or a combination of
* TSU6721_TYPE_* */
int tsu6721_get_device_type(void);
/* Control TSU6721 mux. */
int tsu6721_mux(enum tsu6721_mux sel);
/* Reset TSU6721. */
void tsu6721_reset(void);
#endif /* TSU6721_H */