summaryrefslogtreecommitdiff
path: root/include/gpio_signal.h
Commit message (Collapse)AuthorAgeFilesLines
* Update license boilerplate text in source code filesstabilize-quickfix-15278.72.B-ishstabilize-quickfix-15183.78.B-ishstabilize-15446.B-ishstabilize-15439.B-ishstabilize-15432.B-ishstabilize-15429.B-ishstabilize-15415.B-ishstabilize-15395.B-ishstabilize-15393.48.B-ishstabilize-15381.B-ishstabilize-15364.B-ishstabilize-15361.B-ishstabilize-15359.B-ishstabilize-15359.58.B-ishstabilize-15359.50.B-ishstabilize-15359.45.B-ishstabilize-15335.B-ishstabilize-15329.59.B-ishstabilize-15329.44.B-ishstabilize-15317.B-ishstabilize-15301.B-ishstabilize-15300.B-ishstabilize-15278.64.B-ishstabilize-15251.B-ishstabilize-15245.B-ishstabilize-15236.66.B-ishstabilize-15208.B-ishstabilize-15207.B-ishstabilize-15185.B-ishstabilize-15185.7.B-ishstabilize-15183.82.B-ishstabilize-15183.69.B-ishstabilize-15183.14.B-ishstabilize-15174.B-ishstabilize-15167.B-ishstabilize-15129.B-ishstabilize-15122.B-ishstabilize-15120.B-ishstabilize-15117.86.B-ishstabilize-15117.48.B-ishstabilize-15117.111.B-ishrelease-R114-15437.B-ishrelease-R113-15393.B-ishrelease-R112-15359.B-ishrelease-R111-15329.B-ishrelease-R110-15278.B-ishrelease-R109-15237.B-ishrelease-R109-15236.B-ishrelease-R108-15183.B-ishrelease-R107-15117.B-ishishfirmware-ti50-prepvt-15315.B-ishfirmware-skyrim-15390.B-ishfirmware-skyrim-15369.B-ishfirmware-nissa-15217.B-ishfirmware-nissa-15217.45.B-ishfirmware-nissa-15217.126.B-ishfirmware-duplo-15151.B-ishfirmware-corsola-15194.B-ishfactory-trogdor-15210.B-ishfactory-skyrim-15384.B-ishfactory-nissa-15199.B-ishfactory-corsola-15197.B-ishfactory-corsola-15196.B-ishfactory-brya-15231.B-ishMike Frysinger2022-09-141-1/+1
| | | | | | | | | | | | | | Normally we don't do this, but enough changes have accumulated that we're doing a tree-wide one-off update of the name & style. BRANCH=none BUG=chromium:1098010 TEST=`repo upload` works Change-Id: I5b357b85ae9473a192b80983871bef4ae0d4b16f Signed-off-by: Mike Frysinger <vapier@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3893394 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* zephyr: rename gpio_signal.h so that we have deterministic includesJack Rosenthal2020-11-191-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Per go/zephyr-shim-how-to, the headers under zephyr/shim/include/ need to be distinct names from those under include/, as the C compiler has no defined ordering to searching the include paths. (i.e., there is no such thing as a "header override"). Make include/gpio_shim.h include zephyr_gpio_shim.h instead, and rename the zephyr header accordingly. Without this, occasionally you can get this: In file included from include/gpio_signal.h:26, from include/espi.h:11, from zephyr/shim/src/espi.c:14: include/gpio.wrap:36:2: error: #error "Your architecture must ... 36 | #error "Your architecture must define GPIO_PIN and it did not." | ^~~~~ include/gpio.wrap:40:2: error: #error "Your architecture must ... 40 | #error "Your architecture must define GPIO_PIN_MASK and it did not." | ^~~~~ include/gpio.wrap:246:10: fatal error: gpio.inc: No such file or directory 246 | #include "gpio.inc" | ^~~~~~~~~~ compilation terminated. BUG=b:173031377 BRANCH=none TEST=compile for volteer and posix-ec Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I0eb23c41ee5c2be4f0405d3fadb71d6422d0ff40 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2548303 Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Jett Rink <jettrink@chromium.org>
* GPIO/IOEX/eSPI: Give different IO signals unique valuesEdward Hill2019-10-251-2/+25
| | | | | | | | | | | | | | | | | There are 3 different IO signal types used by the EC. Ensure they each use a unique range of values so we can tell them apart. 1) Local GPIO => 0 to 0x0FFF 2) IO expander GPIO => 0x1000 to 0x1FFF 3) eSPI virtual wire signals => 0x2000 to 0x2FFF BUG=b:138600691 BRANCH=none TEST=IO expander signals still work on Trembyle Change-Id: I63fadb4bb4573ed3dd121c24e3bd40a00873e29f Signed-off-by: Edward Hill <ecgh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1854778 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* IO Expander: add the interrupt support to IOEX frameworkCHLin2019-08-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL creates interfaces which bring the IOEX framework to support interrupt feature. To declare an IOEX IO which supports the interrupt function, file its declaration in gpio.inc with the format: IOEX_INT(name, expin, flags, signal) Note: like GPIO, all IOEX IOs with interrupt handlers must be declared at the top of the IOEX's declaration in the gpio.inc The following two APIs are added to enable/disable each IOEX IO's interrupt function: 1. ioex_enable_interrupt 2. ioex_disable_interrupt BRANCH=none BUG=none TEST=No error for "make buildall" TEST=Apply this and related CLs, manually test each IO pins; make sure each pin's interrupt handler is correctly executed. Change-Id: Icbf54c09120e37b68c647c884cd6aa28d9313167 Signed-off-by: CHLin <CHLIN56@nuvoton.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1734947 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: CH Lin <chlin56@nuvoton.com> Commit-Queue: Edward Hill <ecgh@chromium.org>
* IO_Expander: introduce the common interface of IO expanderCHLin2019-07-241-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement the common code to provide a friendly interface to control the IOs of IO expander. It adopts a similar concept to GPIO. 1. Define the IO expander IO in gpio.inc by the format: IOEX(name, EXPIN(ioex, port, offset), flags) - name: the name of this IO pin - EXPIN(ioex, port, offset) - ioex: the IO expander port (defined in board.c) this IO pin belongs to. - port: the port number in the IO expander chip. - offset: the bit offset in the port above. - flags: the same as the flags of GPIO. 2. The following APIs are supported: 1. ioex_get_flags_by_mask 2. ioex_set_flags_by_mask 3. ioex_get_flags 4. ioex_set_flags 5. ioex_get_level 6. ioex_set_level 7. ioex_init 3. The following console commands are supported: 1. ioexget [IO_EXPANDER_PIN_NAME] 2. ioexset IO_EXPANDER_PIN_NAME 0/1 BRANCH=none BUG=none TEST=No error for "make buildall" TEST=Apply this and related CLs, manually test each API, make sure each function works correctly with IO expander chip (NCT3807/NCT3808.) Change-Id: I79c9813abccc67d5554e2ceb5c119dcf549b7dce Signed-off-by: CHLin <CHLIN56@nuvoton.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1657858 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: CH Lin <chlin56@nuvoton.com> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org> Tested-by: CH Lin <chlin56@nuvoton.com>
* LICENSE: remove unnecessary (c) after CopyrightTom Hughes2019-06-191-1/+1
| | | | | | | | | | | | | | | | Ran the following command: git grep -l 'Copyright (c)' | \ xargs sed -i 's/Copyright (c)/Copyright/g' BRANCH=none BUG=none TEST=make buildall -j Change-Id: I6cc4a0f7e8b30d5b5f97d53c031c299f3e164ca7 Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1663262 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* mec1322: Simplify GPIO listsSteven Jian2015-05-271-2/+2
| | | | | | | | | | | | | | | Our existing GPIO macros use port# / gpio#, but the concept of different GPIO ports does not exist on the mec1322. Therefore, add new GPIO macros for chips which do not have distinct GPIO ports. BUG=None BRANCH=None TEST=make buildall -j Change-Id: Ibda97c6563ad447d16dab39ecadab43ccb25174b Signed-off-by: Steven Jian <steven.jian@intel.com> Reviewed-on: https://chromium-review.googlesource.com/262841 Reviewed-by: Anton Staaf <robotboy@chromium.org>
* gpio: Refactor IRQ handler pointer out of gpio_listAseda Aboagye2015-04-101-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the gpio_info struct, we had a irq_handler pointer defined even though a majority of the GPIOs did not have irq handlers associated. By removing the irq_handler pointer out of the struct, we can save some space with some targets saving more than others. (For example, ~260 bytes for samus_pd). This change also brings about a new define: GPIO_INT(name, port, pin, flags, signal) And the existing GPIO macro has had the signal parameter removed since they were just NULL. GPIO(name, port, pin, flags) In each of the gpio.inc files, all the GPIOs with irq handlers must be defined at the top of the file. This is because their enum values from gpio_signal are used as the index to the gpio_irq_handlers table. BUG=chromium:471331 BRANCH=none TEST=Flashed ec to samus and samus_pd, verified lightbar tap, lid, power button, keyboard, charging, all still working. TEST=Moved a GPIO_INT declaration after a GPIO declaration and watched the build fail. TEST=make -j BOARD=peppy tests TEST=make -j BOARD=auron tests TEST=make -j BOARD=link tests Change-Id: Id6e261b0a3cd63223ca92f2e96a80c95e85cdefb Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/263973 Reviewed-by: Randall Spangler <rspangler@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org> Trybot-Ready: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Alec Berg <alecaberg@chromium.org>
* gpio: Replace duplication in gpio declarations with X-macro fileAnton Staaf2014-06-261-0/+12
Previously each board.h and board.c contained an enum and an array for gpio definitons that had to be manually kept in sync, with no compiler assistance other than that their lengths matched. This change adds a single gpio.inc file that declares all gpio's that a board uses and is used as an X-macro include file to generate both the gpio_signal enum and the gpio_list array. Signed-off-by: Anton Staaf <robotboy@chromium.org> BRANCH=none TEST=make buildall -j Change-Id: If9c9feca968619a59ff9f20701359bcb9374e4da Reviewed-on: https://chromium-review.googlesource.com/205354 Tested-by: Anton Staaf <robotboy@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Commit-Queue: Anton Staaf <robotboy@chromium.org>