summaryrefslogtreecommitdiff
path: root/driver/ps8740.h
blob: ec27a7bf504fc620ebf0223760ae958dfe0db896 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/* 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.
 *
 * Parade PS8740 USB port switch driver.
 */

#ifndef __CROS_EC_PS8740_H
#define __CROS_EC_PS8740_H

/* Mode register for setting mux */
#define PS8740_REG_MODE 0x00
#define PS8740_MODE_POLARITY_INVERTED (1 << 4)
#define PS8740_MODE_USB_ENABLED (1 << 5)
#define PS8740_MODE_DP_ENABLED (1 << 6)
#define PS8740_MODE_POWER_DOWN (1 << 7)

/* Status register for checking mux state */
#define PS8740_REG_STATUS 0x09
#define PS8740_STATUS_POLARITY_INVERTED (1 << 2)
#define PS8740_STATUS_USB_ENABLED (1 << 3)
#define PS8740_STATUS_DP_ENABLED (1 << 4)
#define PS8740_STATUS_HPD_ASSERTED (1 << 7)

/* Chip ID / revision registers and expected fused values */
#define PS8740_REG_REVISION_ID1 0xf0
#define PS8740_REVISION_ID1 0x00
#define PS8740_REG_REVISION_ID2 0xf1
#define PS8740_REVISION_ID2 0x0a
#define PS8740_REG_CHIP_ID1 0xf2
#define PS8740_CHIP_ID1 0x40
#define PS8740_REG_CHIP_ID2 0xf3
#define PS8740_CHIP_ID2 0x87

#endif /* __CROS_EC_PS8740_H */