Commit Graph

28 Commits

Author SHA1 Message Date
Tim Crawford
51d35cb272 Remove GPH7 on IT8587E
On IT8587E, pin 3 is VBAT and not a GPIO pin.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2024-07-29 18:41:30 -06:00
Tim Crawford
d3894392d5 Replace clang-format with uncrustify
LLVM/clang is not used for any compilation due to it not supporting the
8-bit architectures we use (MCS-51, AVR). This means we are effectively
installing 250+ MiB of dependencies for a C formatting tool.

Replace it with uncrustify, which uses only ~600 KiB of space and has
more granular control of formatting (800+ options).

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2024-07-03 15:58:28 -06:00
Tim Crawford
713e1d9681 Add void to function declarations with no args
SDCC 4.3.3 complains about the declaration not matching the prototype:

    error 283: function declarator with no prototype

Add `void` to the AVR functions as well, even though no warning is
issued by GCC.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-10-19 08:02:41 -06:00
Tim Crawford
0f2ff7e540 kbscan: Switch from GPIO mode to KBS (Normal) mode
Use the default mode for reading the keyboard scan matrix when being
used as a keyboard. There should be no perceived change in behavior, but
should make the code easier to understand.

Note: `KSO[17:16]` are configured by `GPCRC` on boards that use them.
They are now set to alternate function to use in KBS mode rather than
GPIO mode, with the pull-up enabled to prevent them from floating when
configured as open-drain.

As part of this change, we now only read the hardware matrix state once
upfront, instead of on every iteration through the loop applying the
logic.

Tested by verifying that typing still works on darp9.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-07-28 20:07:24 -06:00
Jeremy Soller
86f281b410 Add ME_WE gpio for all boards 2023-04-03 13:06:16 -06:00
Tim Crawford
59c386ec12 Move gpio_debug from board to EC code
The gpio_debug() functionality depends on the ITE registers and not
anything board-specific.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-01-23 14:26:30 -07:00
Tim Crawford
e032c5f0f2 Update .clang-format and apply
Update .clang-format for LLVM 14.0, available on Ubuntu 22.04.

There is still plenty that clang-format sucks at or does wrong, so
either add some more blocks to disable it, or just put up with it.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-01-10 12:02:21 -07:00
Tim Crawford
b70a09e205 Disable clang-format for sensitive blocks
Things like macro blocks should not be auto-formatted.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2022-03-22 12:52:47 -06:00
Tim Crawford
720af4b2b0 Use BIT macro
Mostly done with the cocci script. macro.h was then added manually.
2021-05-07 11:24:25 -06:00
Tim Crawford
5fd9df0ed0 Add SPDX license identifiers
Add license information to files. Mostly automated with:

    find src/ -name '*.[c,h]' | xargs sed -i '1s,^,// SPDX-License-Identifier: GPL-3.0-only\n\n,'
    find src/ -name '*.mk' | xargs sed -i '1s,^,# SPDX-License-Identifier: GPL-3.0-only\n\n,'
2020-09-17 09:17:08 -06:00
Jeremy Soller
db6e85eb56 Add ACPI thermal interface 2020-09-03 12:06:09 -06:00
Tim Crawford
70e6476208 power: Enable Wake-on-LAN 2020-08-28 13:23:54 -06:00
Jeremy Soller
bcfa931f12 Remove unnecessary GPIO pullups 2020-02-04 12:45:13 -07:00
Jeremy Soller
5cd6f77e2a Add DAC initialization 2020-01-28 14:59:54 -07:00
Jeremy Soller
1a88f3e056 Implement airplane mode LED 2020-01-21 16:03:41 -07:00
Jeremy Soller
efa9fb7fb4 Refactor to minimize differences between galp3-c and lemp9 code 2020-01-15 15:54:43 -07:00
Jeremy Soller
c75945e943 Add support for darter keyboard 2019-12-16 16:26:42 -07:00
Jeremy Soller
9cbf9da0eb Make USB_PWR_EN_N an output 2019-12-11 10:12:23 -07:00
Jeremy Soller
620c1c2507 Better documentation for GPIO settings 2019-11-20 21:04:12 -07:00
Jeremy Soller
93e35d2cc5 Add debug levels 2019-11-18 09:22:21 -07:00
Jeremy Soller
56ae9f788c Disable debugging by default, enable wireless 2019-11-17 19:45:45 -07:00
Jeremy Soller
3fd37bd16a Enable touchpad pins 2019-11-15 19:19:14 -07:00
Jeremy Soller
8f69ece191 Fix errors and deny errors 2019-11-10 18:49:21 -07:00
Jeremy Soller
1c82fe11cd Fix GPIO dump 2019-11-07 13:59:35 -07:00
Jeremy Soller
01ef00a777 Get system to PLT_RST# assertion 2019-11-06 11:34:32 -07:00
Jeremy Soller
24e407551e Improve GPIO debug 2019-10-01 12:01:14 -06:00
Jeremy Soller
ded5181926 Organize into arch, board, and ec modules 2019-09-29 20:13:03 -06:00
Jeremy Soller
b04352cb63 Reorganize to allow compiling and running AVR firmware 2019-09-29 17:13:31 -06:00