diff options
author | Vijay Hiremath <vijay.p.hiremath@intel.com> | 2018-07-03 10:16:58 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-07-04 16:16:25 -0700 |
commit | b08b87c54440ddb51fbfbcd9d5dffda5320ec09e (patch) | |
tree | 8f40d195259e7501a2deaf741a09ed8849d918bd /driver/ioexpander_it8300.h | |
parent | 2a4590d2aa85a31c4a5bf5c535584c82ed98349a (diff) | |
download | chrome-ec-b08b87c54440ddb51fbfbcd9d5dffda5320ec09e.tar.gz |
driver: Add driver header for it8300 I/O port controller
BUG=b:111107786
BRANCH=none
TEST=Manually tested on GLKRVP using ITE eval board, i2cxfer works
Change-Id: I74055a1138516e1364779fbb0758251c70792c3d
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/1123216
Commit-Ready: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Tested-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'driver/ioexpander_it8300.h')
-rw-r--r-- | driver/ioexpander_it8300.h | 106 |
1 files changed, 106 insertions, 0 deletions
diff --git a/driver/ioexpander_it8300.h b/driver/ioexpander_it8300.h new file mode 100644 index 0000000000..b457d89ddc --- /dev/null +++ b/driver/ioexpander_it8300.h @@ -0,0 +1,106 @@ +/* Copyright 2018 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. + * + * ITE IT8300 I/O Port expander driver header + */ + +#ifndef __CROS_EC_IOEXPANDER_IT8300_H +#define __CROS_EC_IOEXPANDER_IT8300_H + +#include "i2c.h" + +/* Gather Interrupt Status Register */ +#define IT8300_GISR 0x0 + +/* Interrupt Status Registers */ +#define IT8300_ISR_A 0x6 +#define IT8300_ISR_B 0x7 +#define IT8300_ISR_C 0x28 +#define IT8300_ISR_D 0x2E +#define IT8300_ISR_E 0x2F + +/* Port Data Register Groups */ +#define IT8300_PDGR_A 0x1 +#define IT8300_PDGR_B 0x2 +#define IT8300_PDGR_C 0x3 +#define IT8300_PDGR_D 0x4 +#define IT8300_PDGR_E 0x5 + +/* GPIO Port Control n Registers */ +#define IT8300_GPCR_A0 0x10 +#define IT8300_GPCR_A1 0x11 +#define IT8300_GPCR_A2 0x12 +#define IT8300_GPCR_A3 0x13 +#define IT8300_GPCR_A4 0x14 +#define IT8300_GPCR_A5 0x15 +#define IT8300_GPCR_A6 0x16 +#define IT8300_GPCR_A7 0x17 + +#define IT8300_GPCR_B0 0x18 +#define IT8300_GPCR_B1 0x19 +#define IT8300_GPCR_B2 0x1A +#define IT8300_GPCR_B3 0x1B +#define IT8300_GPCR_B4 0x1C +#define IT8300_GPCR_B5 0x1D +#define IT8300_GPCR_B6 0x1E + +#define IT8300_GPCR_C0 0x20 +#define IT8300_GPCR_C1 0x21 +#define IT8300_GPCR_C2 0x22 +#define IT8300_GPCR_C3 0x23 +#define IT8300_GPCR_C4 0x24 +#define IT8300_GPCR_C5 0x25 +#define IT8300_GPCR_C6 0x26 + +#define IT8300_GPCR_D0 0x08 +#define IT8300_GPCR_D1 0x09 +#define IT8300_GPCR_D2 0x0A +#define IT8300_GPCR_D3 0x0B +#define IT8300_GPCR_D4 0x0C +#define IT8300_GPCR_D5 0x0D + +#define IT8300_GPCR_E0 0x32 + +#define IT8300_GPCR_E2 0x34 +#define IT8300_GPCR_E3 0x35 +#define IT8300_GPCR_E4 0x36 +#define IT8300_GPCR_E5 0x37 +#define IT8300_GPCR_E6 0x38 + +#define IT8300_GPCR_GPI_MODE (1 << 7) +#define IT8300_GPCR_GP0_MODE (1 << 6) +#define IT8300_GPCR_PULL_UP_EN (1 << 2) +#define IT8300_GPCR_PULL_DN_EN (1 << 1) + +/* EXGPIO Clear Alert */ +#define IT8300_ECA 0x30 + +/* EXGPIO Alert Enable */ +#define IT8300_EAE 0x31 + +/* Port Data Mirror Registers */ +#define IT8300_PDMRA_A 0x29 +#define IT8300_PDMRA_B 0x2A +#define IT8300_PDMRA_C 0x2B +#define IT8300_PDMRA_D 0x2C +#define IT8300_PDMRA_E 0x2D + +/* Output Open-Drain Enable Registers */ +#define IT8300_OODER_A 0x39 +#define IT8300_OODER_B 0x3A +#define IT8300_OODER_C 0x3B +#define IT8300_OODER_D 0x3C +#define IT8300_OODER_E 0x3D + +/* IT83200 Port GPIOs */ +#define IT8300_GPX_0 (1 << 0) +#define IT8300_GPX_1 (1 << 1) +#define IT8300_GPX_2 (1 << 2) +#define IT8300_GPX_3 (1 << 3) +#define IT8300_GPX_4 (1 << 4) +#define IT8300_GPX_5 (1 << 5) +#define IT8300_GPX_6 (1 << 6) +#define IT8300_GPX_7 (1 << 7) + +#endif /* __CROS_EC_IOEXPANDER_IT8300_H */ |