diff options
author | Michał Barnaś <mb@semihalf.com> | 2021-01-19 18:56:55 +0100 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-02-23 19:12:33 +0000 |
commit | 9497502d59d5979d4a60abb58a67eda7a8051fa4 (patch) | |
tree | aa5fe2751ee70c2e9a833eb2a7f14c0ca5b433c6 /driver/ioexpander/tca64xxa.h | |
parent | 3a8d8b16790ea15bceec6e11d3ed091f5462ce44 (diff) | |
download | chrome-ec-9497502d59d5979d4a60abb58a67eda7a8051fa4.tar.gz |
tca64xxa: Add new ioexpander driver for TI TCA64xxA modules
Add TI TCA64xxA (TCA6416A, TCA6424A) series driver that conforms to
ioexpander_drv interface.
Driver supports 16- and 24-bits versions and is configured by
flags field in ioex_config (TCA64XXA_FLAG_VER_TCA6416A,
TCA64XXA_FLAG_VER_TCA6424A).
BUG=b:168385201
BRANCH=main
TEST=Add 'CONFIG_IO_EXPANDER_TCA64XXA' to any board.h
Execute make to any board,
ioexpander/tca64xxa.c should be visible in compiled files list
Signed-off-by: Michał Barnaś <mb@semihalf.com>
Change-Id: I5ca27df3802d900c9967684403f29c33abd96f18
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2700296
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'driver/ioexpander/tca64xxa.h')
-rw-r--r-- | driver/ioexpander/tca64xxa.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/driver/ioexpander/tca64xxa.h b/driver/ioexpander/tca64xxa.h new file mode 100644 index 0000000000..8c3448f804 --- /dev/null +++ b/driver/ioexpander/tca64xxa.h @@ -0,0 +1,25 @@ +/* Copyright 2021 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. + */ + +#ifndef __CROS_EC_DRIVER_IOEXPANDER_TCA64XXA_H_ +#define __CROS_EC_DRIVER_IOEXPANDER_TCA64XXA_H_ + +#define TCA64XXA_FLAG_VER_TCA6416A 2 +#define TCA64XXA_FLAG_VER_TCA6424A 4 +#define TCA64XXA_FLAG_VER_MASK GENMASK(2, 1) +#define TCA64XXA_FLAG_VER_OFFSET 0 + +#define TCA64XXA_REG_INPUT 0 +#define TCA64XXA_REG_OUTPUT 1 +#define TCA64XXA_REG_POLARITY_INV 2 +#define TCA64XXA_REG_CONF 3 + +#define TCA64XXA_DEFAULT_OUTPUT 0xFF +#define TCA64XXA_DEFAULT_POLARITY_INV 0x00 +#define TCA64XXA_DEFAULT_CONF 0xFF + +extern const struct ioexpander_drv tca64xxa_ioexpander_drv; + +#endif /* __CROS_EC_DRIVER_IOEXPANDER_TCA64XXA_H_ */ |