summary refs log tree commit diff
diff options
context:
space:
mode:
authorRyan <fauxpark@gmail.com>2023-07-16 23:42:56 +1000
committerGitHub <noreply@github.com>2023-07-16 23:42:56 +1000
commitda2d2f947d5c30aebea17f414fb22ad50fe5410b (patch)
treefdf2ed307ddb8f32ecb9ef7444ecfdf7ff7b4904
parentb9e5895184c6d36b46ba723d6d71e27249e70c20 (diff)
quantum: remove direct `quantum.h` includes (#21507)
-rw-r--r--keyboards/boardsource/lulu/lulu.c2
-rw-r--r--keyboards/input_club/k_type/k_type-rgbdriver.c3
-rw-r--r--keyboards/input_club/k_type/keymaps/default/keymap.c3
-rw-r--r--keyboards/system76/launch_1/rgb_matrix_kb.inc1
-rw-r--r--keyboards/system76/system76_ec.c6
-rw-r--r--platforms/avr/drivers/audio_pwm_hardware.c8
-rw-r--r--platforms/chibios/drivers/audio_dac_additive.c5
-rw-r--r--platforms/chibios/drivers/audio_dac_basic.c3
-rw-r--r--platforms/chibios/drivers/audio_pwm_hardware.c3
-rw-r--r--platforms/chibios/drivers/audio_pwm_software.c3
-rw-r--r--quantum/audio/audio.c3
-rw-r--r--quantum/audio/audio.h9
-rw-r--r--quantum/audio/muse.c2
-rw-r--r--quantum/audio/muse.h3
-rw-r--r--quantum/audio/voices.c2
-rw-r--r--quantum/bootmagic/bootmagic_lite.c7
-rw-r--r--quantum/dynamic_keymap.c12
-rw-r--r--quantum/encoder.c5
-rw-r--r--quantum/encoder.h4
-rw-r--r--quantum/encoder/tests/encoder_tests_split_role.cpp1
-rw-r--r--quantum/keyboard.c34
-rw-r--r--quantum/keyboard.h2
-rw-r--r--quantum/keymap_common.c7
-rw-r--r--quantum/led_matrix/led_matrix.c5
-rw-r--r--quantum/led_matrix/led_matrix.h2
-rw-r--r--quantum/matrix.c3
-rw-r--r--quantum/matrix_common.c2
-rw-r--r--quantum/midi/qmk_midi.c1
-rw-r--r--quantum/pointing_device/pointing_device_auto_mouse.c3
-rw-r--r--quantum/pointing_device/pointing_device_auto_mouse.h11
-rw-r--r--quantum/process_keycode/process_audio.c4
-rw-r--r--quantum/process_keycode/process_audio.h3
-rw-r--r--quantum/process_keycode/process_clicky.c4
-rw-r--r--quantum/process_keycode/process_key_override.c4
-rw-r--r--quantum/repeat_key.c1
-rw-r--r--quantum/repeat_key.h5
-rw-r--r--quantum/rgb_matrix/rgb_matrix.c5
-rw-r--r--quantum/rgb_matrix/rgb_matrix.h2
-rw-r--r--quantum/rgb_matrix/rgb_matrix_drivers.c1
-rw-r--r--quantum/split_common/split_util.c2
-rw-r--r--quantum/split_common/split_util.h1
-rw-r--r--quantum/split_common/transactions.c39
-rw-r--r--quantum/split_common/transactions.h4
-rw-r--r--quantum/split_common/transport.h4
-rw-r--r--quantum/unicode/unicode.c2
-rw-r--r--quantum/unicode/unicode.h3
-rw-r--r--quantum/via.c26
-rw-r--r--quantum/via.h1
-rw-r--r--tmk_core/protocol/arm_atsam/main_arm_atsam.c1
-rw-r--r--tmk_core/protocol/arm_atsam/md_rgb_matrix.c1
-rw-r--r--tmk_core/protocol/arm_atsam/spi_master.h2
51 files changed, 208 insertions, 62 deletions
diff --git a/keyboards/boardsource/lulu/lulu.c b/keyboards/boardsource/lulu/lulu.c
index be6d565a32..8d011268c4 100644
--- a/keyboards/boardsource/lulu/lulu.c
+++ b/keyboards/boardsource/lulu/lulu.c
@@ -1,6 +1,6 @@
 // Copyright 2022 Cole Smith <cole@boadsource.xyz>
 // SPDX-License-Identifier: GPL-2.0-or-later
-#include "encoder.h"
+#include "quantum.h"
 
 #ifdef ENCODER_ENABLE
 bool encoder_update_kb(uint8_t index, bool clockwise) {
diff --git a/keyboards/input_club/k_type/k_type-rgbdriver.c b/keyboards/input_club/k_type/k_type-rgbdriver.c
index e663c224c4..6529f98201 100644
--- a/keyboards/input_club/k_type/k_type-rgbdriver.c
+++ b/keyboards/input_club/k_type/k_type-rgbdriver.c
@@ -19,8 +19,7 @@
 #include "rgb_matrix.h"
 #include "i2c_master.h"
 #include "is31fl3733-dual.h"
-
-
+#include "gpio.h"
 
 static void init(void) {
     i2c_init(&I2CD1, I2C1_SCL_PIN, I2C1_SDA_PIN);
diff --git a/keyboards/input_club/k_type/keymaps/default/keymap.c b/keyboards/input_club/k_type/keymaps/default/keymap.c
index 790bd93290..452791b13a 100644
--- a/keyboards/input_club/k_type/keymaps/default/keymap.c
+++ b/keyboards/input_club/k_type/keymaps/default/keymap.c
@@ -1,3 +1,6 @@
+// Copyright 2023 QMK
+// SPDX-License-Identifier: GPL-2.0-or-later
+
 #include QMK_KEYBOARD_H
 
 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
diff --git a/keyboards/system76/launch_1/rgb_matrix_kb.inc b/keyboards/system76/launch_1/rgb_matrix_kb.inc
index 02de10ed50..f29183dde0 100644
--- a/keyboards/system76/launch_1/rgb_matrix_kb.inc
+++ b/keyboards/system76/launch_1/rgb_matrix_kb.inc
@@ -22,6 +22,7 @@ RGB_MATRIX_EFFECT(unlocked)
 #ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS
 
 #include "dynamic_keymap.h"
+#include "action_layer.h"
 
 static bool active_keys_initialized = false;
 static uint8_t active_keys_table[RGB_MATRIX_LED_COUNT] = {0};
diff --git a/keyboards/system76/system76_ec.c b/keyboards/system76/system76_ec.c
index 6301659072..1b7955e19b 100644
--- a/keyboards/system76/system76_ec.c
+++ b/keyboards/system76/system76_ec.c
@@ -22,6 +22,12 @@
 #include "raw_hid.h"
 #include "rgb_matrix.h"
 #include "version.h"
+#include "keyboard.h"
+#include "eeprom.h"
+#include "matrix.h"
+#include "action_layer.h"
+#include "bootloader.h"
+#include "wait.h"
 
 enum Command {
     CMD_PROBE         = 1,   // Probe for System76 EC protocol
diff --git a/platforms/avr/drivers/audio_pwm_hardware.c b/platforms/avr/drivers/audio_pwm_hardware.c
index 2fc448ea58..6799cf2fdd 100644
--- a/platforms/avr/drivers/audio_pwm_hardware.c
+++ b/platforms/avr/drivers/audio_pwm_hardware.c
@@ -15,13 +15,9 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#if defined(__AVR__)
-#    include <avr/pgmspace.h>
-#    include <avr/interrupt.h>
-#    include <avr/io.h>
-#endif
-
 #include "audio.h"
+#include "gpio.h"
+#include <avr/interrupt.h>
 
 extern bool    playing_note;
 extern bool    playing_melody;
diff --git a/platforms/chibios/drivers/audio_dac_additive.c b/platforms/chibios/drivers/audio_dac_additive.c
index d29147ca3b..9a5fe4c336 100644
--- a/platforms/chibios/drivers/audio_dac_additive.c
+++ b/platforms/chibios/drivers/audio_dac_additive.c
@@ -16,8 +16,9 @@
  */
 
 #include "audio.h"
-#include <ch.h>
-#include <hal.h>
+#include "gpio.h"
+#include <math.h>
+#include "util.h"
 
 // Need to disable GCC's "tautological-compare" warning for this file, as it causes issues when running `KEEP_INTERMEDIATES=yes`. Corresponding pop at the end of the file.
 #pragma GCC diagnostic push
diff --git a/platforms/chibios/drivers/audio_dac_basic.c b/platforms/chibios/drivers/audio_dac_basic.c
index 4ea23a2158..9a3f3fea1f 100644
--- a/platforms/chibios/drivers/audio_dac_basic.c
+++ b/platforms/chibios/drivers/audio_dac_basic.c
@@ -16,8 +16,7 @@
  */
 
 #include "audio.h"
-#include "ch.h"
-#include "hal.h"
+#include "gpio.h"
 
 // Need to disable GCC's "tautological-compare" warning for this file, as it causes issues when running `KEEP_INTERMEDIATES=yes`. Corresponding pop at the end of the file.
 #pragma GCC diagnostic push
diff --git a/platforms/chibios/drivers/audio_pwm_hardware.c b/platforms/chibios/drivers/audio_pwm_hardware.c
index 54dac46605..40d891326f 100644
--- a/platforms/chibios/drivers/audio_pwm_hardware.c
+++ b/platforms/chibios/drivers/audio_pwm_hardware.c
@@ -12,8 +12,7 @@
 // function.
 
 #include "audio.h"
-#include "ch.h"
-#include "hal.h"
+#include "gpio.h"
 
 #if !defined(AUDIO_PIN)
 #    error "Audio feature enabled, but no pin selected - see docs/feature_audio under the ARM PWM settings"
diff --git a/platforms/chibios/drivers/audio_pwm_software.c b/platforms/chibios/drivers/audio_pwm_software.c
index e01f86ea52..663a9eca16 100644
--- a/platforms/chibios/drivers/audio_pwm_software.c
+++ b/platforms/chibios/drivers/audio_pwm_software.c
@@ -25,8 +25,7 @@ this driver uses the chibios-PWM system to produce a square-wave on any given ou
 
  */
 #include "audio.h"
-#include "ch.h"
-#include "hal.h"
+#include "gpio.h"
 
 #if !defined(AUDIO_PIN)
 #    error "Audio feature enabled, but no pin selected - see docs/feature_audio under the ARM PWM settings"
diff --git a/quantum/audio/audio.c b/quantum/audio/audio.c
index 0300483a93..b9b21066cb 100644
--- a/quantum/audio/audio.c
+++ b/quantum/audio/audio.c
@@ -583,3 +583,6 @@ uint16_t audio_duration_to_ms(uint16_t duration_bpm) {
 uint16_t audio_ms_to_duration(uint16_t duration_ms) {
     return ((uint32_t)duration_ms * 2 * note_tempo) / 1875;
 }
+
+__attribute__((weak)) void audio_on_user(void) {}
+__attribute__((weak)) void audio_off_user(void) {}
diff --git a/quantum/audio/audio.h b/quantum/audio/audio.h
index 75016a1100..a4a908b43c 100644
--- a/quantum/audio/audio.h
+++ b/quantum/audio/audio.h
@@ -21,12 +21,6 @@
 #include "musical_notes.h"
 #include "song_list.h"
 #include "voices.h"
-#include "quantum.h"
-#include <math.h>
-
-#if defined(__AVR__)
-#    include <avr/io.h>
-#endif
 
 #if defined(AUDIO_DRIVER_PWM)
 #    include "audio_pwm.h"
@@ -280,3 +274,6 @@ bool audio_update_state(void);
 #define increase_tempo(t) audio_increase_tempo(t)
 #define decrease_tempo(t) audio_decrease_tempo(t)
 // vibrato functions are not used in any keyboards
+
+void audio_on_user(void);
+void audio_off_user(void);
diff --git a/quantum/audio/muse.c b/quantum/audio/muse.c
index 01b95671fd..4c23cd7348 100644
--- a/quantum/audio/muse.c
+++ b/quantum/audio/muse.c
@@ -1,5 +1,7 @@
 #include "muse.h"
 
+#include <stdbool.h>
+
 enum { MUSE_OFF, MUSE_ON, MUSE_C_1_2, MUSE_C1, MUSE_C2, MUSE_C4, MUSE_C8, MUSE_C3, MUSE_C6, MUSE_B1, MUSE_B2, MUSE_B3, MUSE_B4, MUSE_B5, MUSE_B6, MUSE_B7, MUSE_B8, MUSE_B9, MUSE_B10, MUSE_B11, MUSE_B12, MUSE_B13, MUSE_B14, MUSE_B15, MUSE_B16, MUSE_B17, MUSE_B18, MUSE_B19, MUSE_B20, MUSE_B21, MUSE_B22, MUSE_B23, MUSE_B24, MUSE_B25, MUSE_B26, MUSE_B27, MUSE_B28, MUSE_B29, MUSE_B30, MUSE_B31 };
 
 bool number_of_ones_to_bool[16] = {1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1};
diff --git a/quantum/audio/muse.h b/quantum/audio/muse.h
index ad2f96e43a..7b289cac6c 100644
--- a/quantum/audio/muse.h
+++ b/quantum/audio/muse.h
@@ -1,6 +1,5 @@
 #pragma once
 
-#include "quantum.h"
-#include "process_audio.h"
+#include <stdint.h>
 
 uint8_t muse_clock_pulse(void);
diff --git a/quantum/audio/voices.c b/quantum/audio/voices.c
index 01f257f4d4..4f511c93ba 100644
--- a/quantum/audio/voices.c
+++ b/quantum/audio/voices.c
@@ -16,7 +16,9 @@
  */
 #include "voices.h"
 #include "audio.h"
+#include "timer.h"
 #include <stdlib.h>
+#include <math.h>
 
 uint8_t note_timbre      = TIMBRE_DEFAULT;
 bool    glissando        = false;
diff --git a/quantum/bootmagic/bootmagic_lite.c b/quantum/bootmagic/bootmagic_lite.c
index f63c71fc6b..efce6bfd12 100644
--- a/quantum/bootmagic/bootmagic_lite.c
+++ b/quantum/bootmagic/bootmagic_lite.c
@@ -13,7 +13,12 @@
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-#include "quantum.h"
+#include "bootmagic.h"
+#include "matrix.h"
+#include "keyboard.h"
+#include "wait.h"
+#include "eeconfig.h"
+#include "bootloader.h"
 
 /** \brief Reset eeprom
  *
diff --git a/quantum/dynamic_keymap.c b/quantum/dynamic_keymap.c
index 2030c82a1b..4c95128337 100644
--- a/quantum/dynamic_keymap.c
+++ b/quantum/dynamic_keymap.c
@@ -14,14 +14,16 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include "keymap_introspection.h" // to get keymaps[][][]
-#include "eeprom.h"
-#include "progmem.h" // to read default from flash
-#include "quantum.h" // for send_string()
 #include "dynamic_keymap.h"
+#include "keymap_introspection.h"
+#include "action.h"
+#include "eeprom.h"
+#include "progmem.h"
+#include "send_string.h"
+#include "keycodes.h"
 
 #ifdef VIA_ENABLE
-#    include "via.h" // for VIA_EEPROM_CONFIG_END
+#    include "via.h"
 #    define DYNAMIC_KEYMAP_EEPROM_START (VIA_EEPROM_CONFIG_END)
 #else
 #    define DYNAMIC_KEYMAP_EEPROM_START (EECONFIG_SIZE)
diff --git a/quantum/encoder.c b/quantum/encoder.c
index 1046fe6cc3..7ab194ed52 100644
--- a/quantum/encoder.c
+++ b/quantum/encoder.c
@@ -16,6 +16,11 @@
  */
 
 #include "encoder.h"
+#include "keyboard.h"
+#include "action.h"
+#include "keycodes.h"
+#include "wait.h"
+
 #ifdef SPLIT_KEYBOARD
 #    include "split_util.h"
 #endif
diff --git a/quantum/encoder.h b/quantum/encoder.h
index 7644853b30..1cbac98cb5 100644
--- a/quantum/encoder.h
+++ b/quantum/encoder.h
@@ -17,7 +17,9 @@
 
 #pragma once
 
-#include "quantum.h"
+#include <stdint.h>
+#include <stdbool.h>
+#include "gpio.h"
 #include "util.h"
 
 void encoder_init(void);
diff --git a/quantum/encoder/tests/encoder_tests_split_role.cpp b/quantum/encoder/tests/encoder_tests_split_role.cpp
index 02264067f4..0ab7bfc2a7 100644
--- a/quantum/encoder/tests/encoder_tests_split_role.cpp
+++ b/quantum/encoder/tests/encoder_tests_split_role.cpp
@@ -22,6 +22,7 @@
 
 extern "C" {
 #include "encoder.h"
+#include "keyboard.h"
 #include "encoder/tests/mock_split.h"
 }
 
diff --git a/quantum/keyboard.c b/quantum/keyboard.c
index 5115709748..c2ca15d52d 100644
--- a/quantum/keyboard.c
+++ b/quantum/keyboard.c
@@ -16,8 +16,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 #include <stdint.h>
-#include "quantum.h"
 #include "keyboard.h"
+#include "keycode_config.h"
 #include "matrix.h"
 #include "keymap_introspection.h"
 #include "magic.h"
@@ -33,6 +33,12 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include "sendchar.h"
 #include "eeconfig.h"
 #include "action_layer.h"
+#ifdef AUDIO_ENABLE
+#    include "audio.h"
+#endif
+#if defined(AUDIO_ENABLE) || (defined(MIDI_ENABLE) && defined(MIDI_BASIC))
+#    include "process_music.h"
+#endif
 #ifdef BACKLIGHT_ENABLE
 #    include "backlight.h"
 #endif
@@ -54,9 +60,27 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #ifdef ENCODER_ENABLE
 #    include "encoder.h"
 #endif
+#ifdef HAPTIC_ENABLE
+#    include "haptic.h"
+#endif
+#ifdef AUTO_SHIFT_ENABLE
+#    include "process_auto_shift.h"
+#endif
+#ifdef COMBO_ENABLE
+#    include "process_combo.h"
+#endif
+#ifdef TAP_DANCE_ENABLE
+#    include "process_tap_dance.h"
+#endif
 #ifdef STENO_ENABLE
 #    include "process_steno.h"
 #endif
+#ifdef KEY_OVERRIDE_ENABLE
+#    include "process_key_override.h"
+#endif
+#ifdef SECURE_ENABLE
+#    include "secure.h"
+#endif
 #ifdef POINTING_DEVICE_ENABLE
 #    include "pointing_device.h"
 #endif
@@ -64,7 +88,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #    include "process_midi.h"
 #endif
 #ifdef JOYSTICK_ENABLE
-#    include "process_joystick.h"
+#    include "joystick.h"
 #endif
 #ifdef HD44780_ENABLE
 #    include "hd44780.h"
@@ -108,6 +132,12 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #ifdef LEADER_ENABLE
 #    include "leader.h"
 #endif
+#ifdef UNICODE_COMMON_ENABLE
+#    include "unicode.h"
+#endif
+#ifdef WPM_ENABLE
+#    include "wpm.h"
+#endif
 
 static uint32_t last_input_modification_time = 0;
 uint32_t        last_input_activity_time(void) {
diff --git a/quantum/keyboard.h b/quantum/keyboard.h
index bf1890d10b..5ea57815a7 100644
--- a/quantum/keyboard.h
+++ b/quantum/keyboard.h
@@ -20,6 +20,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include <stdbool.h>
 #include <stdint.h>
 
+#include "timer.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
diff --git a/quantum/keymap_common.c b/quantum/keymap_common.c
index 0492e6fd1c..9a67fad278 100644
--- a/quantum/keymap_common.c
+++ b/quantum/keymap_common.c
@@ -22,7 +22,12 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include "action_layer.h"
 #include "action.h"
 #include "debug.h"
-#include "quantum.h"
+#include "keycode_config.h"
+#include "quantum_keycodes.h"
+
+#ifdef ENCODER_MAP_ENABLE
+#    include "encoder.h"
+#endif
 
 #ifdef BACKLIGHT_ENABLE
 #    include "backlight.h"
diff --git a/quantum/led_matrix/led_matrix.c b/quantum/led_matrix/led_matrix.c
index 4b692d1904..1676a60aa3 100644
--- a/quantum/led_matrix/led_matrix.c
+++ b/quantum/led_matrix/led_matrix.c
@@ -20,8 +20,13 @@
 #include "led_matrix.h"
 #include "progmem.h"
 #include "eeprom.h"
+#include "eeconfig.h"
+#include "keyboard.h"
+#include "sync_timer.h"
+#include "debug.h"
 #include <string.h>
 #include <math.h>
+#include <stdlib.h>
 #include "led_tables.h"
 
 #include <lib/lib8tion/lib8tion.h>
diff --git a/quantum/led_matrix/led_matrix.h b/quantum/led_matrix/led_matrix.h
index 9091f6890b..c2533ca49c 100644
--- a/quantum/led_matrix/led_matrix.h
+++ b/quantum/led_matrix/led_matrix.h
@@ -23,7 +23,7 @@
 #include <stdint.h>
 #include <stdbool.h>
 #include "led_matrix_types.h"
-#include "quantum.h"
+#include "keyboard.h"
 
 #ifdef IS31FL3731
 #    include "is31fl3731-simple.h"
diff --git a/quantum/matrix.c b/quantum/matrix.c
index 97d41caedd..f087a215d4 100644
--- a/quantum/matrix.c
+++ b/quantum/matrix.c
@@ -20,7 +20,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include "util.h"
 #include "matrix.h"
 #include "debounce.h"
-#include "quantum.h"
+#include "atomic_util.h"
+
 #ifdef SPLIT_KEYBOARD
 #    include "split_common/split_util.h"
 #    include "split_common/transactions.h"
diff --git a/quantum/matrix_common.c b/quantum/matrix_common.c
index 3173351888..d02c527caa 100644
--- a/quantum/matrix_common.c
+++ b/quantum/matrix_common.c
@@ -1,9 +1,9 @@
-#include "quantum.h"
 #include "matrix.h"
 #include "debounce.h"
 #include "wait.h"
 #include "print.h"
 #include "debug.h"
+
 #ifdef SPLIT_KEYBOARD
 #    include "split_common/split_util.h"
 #    include "split_common/transactions.h"
diff --git a/quantum/midi/qmk_midi.c b/quantum/midi/qmk_midi.c
index 688259784c..43ebd72937 100644
--- a/quantum/midi/qmk_midi.c
+++ b/quantum/midi/qmk_midi.c
@@ -7,6 +7,7 @@
 
 #ifdef AUDIO_ENABLE
 #    include "audio.h"
+#    include <math.h>
 #endif
 
 /*******************************************************************************
diff --git a/quantum/pointing_device/pointing_device_auto_mouse.c b/quantum/pointing_device/pointing_device_auto_mouse.c
index b008d18db5..fc3106e37e 100644
--- a/quantum/pointing_device/pointing_device_auto_mouse.c
+++ b/quantum/pointing_device/pointing_device_auto_mouse.c
@@ -18,6 +18,9 @@
 #ifdef POINTING_DEVICE_AUTO_MOUSE_ENABLE
 
 #    include "pointing_device_auto_mouse.h"
+#    include "debug.h"
+#    include "action_util.h"
+#    include "quantum_keycodes.h"
 
 /* local data structure for tracking auto mouse */
 static auto_mouse_context_t auto_mouse_context = {
diff --git a/quantum/pointing_device/pointing_device_auto_mouse.h b/quantum/pointing_device/pointing_device_auto_mouse.h
index 7db63bc6b8..1343855e00 100644
--- a/quantum/pointing_device/pointing_device_auto_mouse.h
+++ b/quantum/pointing_device/pointing_device_auto_mouse.h
@@ -16,11 +16,14 @@
 
 #pragma once
 
-#include <string.h>
-
-#include "quantum.h"
+#include <stdint.h>
+#include <stdbool.h>
 #include "pointing_device.h"
-#include "print.h"
+#include "keycodes.h"
+#include "action.h"
+#include "report.h"
+#include "action_layer.h"
+#include "action_tapping.h"
 
 /* check settings and set defaults */
 #ifndef POINTING_DEVICE_AUTO_MOUSE_ENABLE
diff --git a/quantum/process_keycode/process_audio.c b/quantum/process_keycode/process_audio.c
index c189dd02b7..ef2f52c9f1 100644
--- a/quantum/process_keycode/process_audio.c
+++ b/quantum/process_keycode/process_audio.c
@@ -1,5 +1,6 @@
 #include "audio.h"
 #include "process_audio.h"
+#include <math.h>
 
 #ifndef VOICE_CHANGE_SONG
 #    define VOICE_CHANGE_SONG SONG(VOICE_CHANGE_SOUND)
@@ -61,6 +62,3 @@ void process_audio_noteoff(uint8_t note) {
 void process_audio_all_notes_off(void) {
     stop_all_notes();
 }
-
-__attribute__((weak)) void audio_on_user(void) {}
-__attribute__((weak)) void audio_off_user(void) {}
diff --git a/quantum/process_keycode/process_audio.h b/quantum/process_keycode/process_audio.h
index c80136f2c2..69e201e447 100644
--- a/quantum/process_keycode/process_audio.h
+++ b/quantum/process_keycode/process_audio.h
@@ -10,6 +10,3 @@ bool process_audio(uint16_t keycode, keyrecord_t *record);
 void process_audio_noteon(uint8_t note);
 void process_audio_noteoff(uint8_t note);
 void process_audio_all_notes_off(void);
-
-void audio_on_user(void);
-void audio_off_user(void);
diff --git a/quantum/process_keycode/process_clicky.c b/quantum/process_keycode/process_clicky.c
index b662a3f2f4..0ee58282e6 100644
--- a/quantum/process_keycode/process_clicky.c
+++ b/quantum/process_keycode/process_clicky.c
@@ -1,5 +1,7 @@
-#include "audio.h"
 #include "process_clicky.h"
+#include "audio.h"
+#include "eeconfig.h"
+#include <stdlib.h>
 
 #ifdef AUDIO_CLICKY
 
diff --git a/quantum/process_keycode/process_key_override.c b/quantum/process_keycode/process_key_override.c
index 6ce1e4d925..264e2562b8 100644
--- a/quantum/process_keycode/process_key_override.c
+++ b/quantum/process_keycode/process_key_override.c
@@ -19,6 +19,10 @@
 #include "report.h"
 #include "timer.h"
 #include "debug.h"
+#include "wait.h"
+#include "action_util.h"
+#include "quantum.h"
+#include "quantum_keycodes.h"
 
 #ifndef KEY_OVERRIDE_REPEAT_DELAY
 #    define KEY_OVERRIDE_REPEAT_DELAY 500
diff --git a/quantum/repeat_key.c b/quantum/repeat_key.c
index 0689c6d454..4567428723 100644
--- a/quantum/repeat_key.c
+++ b/quantum/repeat_key.c
@@ -13,6 +13,7 @@
 // limitations under the License.
 
 #include "repeat_key.h"
+#include "quantum_keycodes.h"
 
 // Variables saving the state of the last key press.
 static keyrecord_t last_record = {0};
diff --git a/quantum/repeat_key.h b/quantum/repeat_key.h
index 06e8364529..8084be24ad 100644
--- a/quantum/repeat_key.h
+++ b/quantum/repeat_key.h
@@ -14,7 +14,10 @@
 
 #pragma once
 
-#include "quantum.h"
+#include <stdint.h>
+#include <stdbool.h>
+#include "action.h"
+#include "keyboard.h"
 
 uint16_t get_last_keycode(void);             /**< Keycode of the last key. */
 uint8_t  get_last_mods(void);                /**< Mods active with the last key. */
diff --git a/quantum/rgb_matrix/rgb_matrix.c b/quantum/rgb_matrix/rgb_matrix.c
index 1680389793..96be615162 100644
--- a/quantum/rgb_matrix/rgb_matrix.c
+++ b/quantum/rgb_matrix/rgb_matrix.c
@@ -19,8 +19,13 @@
 #include "rgb_matrix.h"
 #include "progmem.h"
 #include "eeprom.h"
+#include "eeconfig.h"
+#include "keyboard.h"
+#include "sync_timer.h"
+#include "debug.h"
 #include <string.h>
 #include <math.h>
+#include <stdlib.h>
 
 #include <lib/lib8tion/lib8tion.h>
 
diff --git a/quantum/rgb_matrix/rgb_matrix.h b/quantum/rgb_matrix/rgb_matrix.h
index 83851d8995..38040fb0cc 100644
--- a/quantum/rgb_matrix/rgb_matrix.h
+++ b/quantum/rgb_matrix/rgb_matrix.h
@@ -22,7 +22,7 @@
 #include <stdbool.h>
 #include "rgb_matrix_types.h"
 #include "color.h"
-#include "quantum.h"
+#include "keyboard.h"
 
 #ifdef IS31FL3731
 #    include "is31fl3731.h"
diff --git a/quantum/rgb_matrix/rgb_matrix_drivers.c b/quantum/rgb_matrix/rgb_matrix_drivers.c
index 6de20ac8a5..7bd274ee99 100644
--- a/quantum/rgb_matrix/rgb_matrix_drivers.c
+++ b/quantum/rgb_matrix/rgb_matrix_drivers.c
@@ -15,6 +15,7 @@
  */
 
 #include "rgb_matrix.h"
+#include "util.h"
 
 /* Each driver needs to define the struct
  *    const rgb_matrix_driver_t rgb_matrix_driver;
diff --git a/quantum/split_common/split_util.c b/quantum/split_common/split_util.c
index a431383454..87838c3195 100644
--- a/quantum/split_common/split_util.c
+++ b/quantum/split_common/split_util.c
@@ -18,8 +18,8 @@
 #include "keyboard.h"
 #include "timer.h"
 #include "transport.h"
-#include "quantum.h"
 #include "wait.h"
+#include "debug.h"
 #include "usb_util.h"
 
 #ifdef EE_HANDS
diff --git a/quantum/split_common/split_util.h b/quantum/split_common/split_util.h
index 5c9a260a14..ab42c85e9f 100644
--- a/quantum/split_common/split_util.h
+++ b/quantum/split_common/split_util.h
@@ -2,7 +2,6 @@
 
 #include <stdbool.h>
 #include <stdint.h>
-#include <stdlib.h>
 
 #include "matrix.h"
 
diff --git a/quantum/split_common/transactions.c b/quantum/split_common/transactions.c
index 8cd018a6ec..2b9423cd63 100644
--- a/quantum/split_common/transactions.c
+++ b/quantum/split_common/transactions.c
@@ -20,13 +20,50 @@
 #include "crc.h"
 #include "debug.h"
 #include "matrix.h"
-#include "quantum.h"
+#include "host.h"
+#include "action_util.h"
+#include "sync_timer.h"
+#include "wait.h"
 #include "transactions.h"
 #include "transport.h"
 #include "transaction_id_define.h"
 #include "split_util.h"
 #include "synchronization_util.h"
 
+#ifdef BACKLIGHT_ENABLE
+#    include "backlight.h"
+#endif
+#ifdef RGBLIGHT_ENABLE
+#    include "rgblight.h"
+#endif
+#ifdef LED_MATRIX_ENABLE
+#    include "led_matrix.h"
+#endif
+#ifdef RGB_MATRIX_ENABLE
+#    include "rgb_matrix.h"
+#endif
+#ifdef OLED_ENABLE
+#    include "oled_driver.h"
+#endif
+#ifdef ST7565_ENABLE
+#    include "st7565.h"
+#endif
+#ifdef ENCODER_ENABLE
+#    include "encoder.h"
+#endif
+#ifdef HAPTIC_ENABLE
+#    include "haptic.h"
+#endif
+#ifdef POINTING_DEVICE_ENABLE
+#    include "pointing_device.h"
+#endif
+#ifdef OS_DETECTION_ENABLE
+#    include "os_detection.h"
+#endif
+#ifdef WPM_ENABLE
+#    include "wpm.h"
+#endif
+
 #define SYNC_TIMER_OFFSET 2
 
 #ifndef FORCED_SYNC_THROTTLE_MS
diff --git a/quantum/split_common/transactions.h b/quantum/split_common/transactions.h
index e38ec79ce9..af3e68a15f 100644
--- a/quantum/split_common/transactions.h
+++ b/quantum/split_common/transactions.h
@@ -16,8 +16,8 @@
 
 #pragma once
 
-#include "stdint.h"
-#include "stdbool.h"
+#include <stdint.h>
+#include <stdbool.h>
 
 #include "matrix.h"
 #include "transaction_id_define.h"
diff --git a/quantum/split_common/transport.h b/quantum/split_common/transport.h
index a3d6f1dfe9..2e2b918d45 100644
--- a/quantum/split_common/transport.h
+++ b/quantum/split_common/transport.h
@@ -16,8 +16,8 @@
 
 #pragma once
 
-#include "stdint.h"
-#include "stdbool.h"
+#include <stdint.h>
+#include <stdbool.h>
 
 #include "progmem.h"
 #include "action_layer.h"
diff --git a/quantum/unicode/unicode.c b/quantum/unicode/unicode.c
index 35cb62e700..f92ba51984 100644
--- a/quantum/unicode/unicode.c
+++ b/quantum/unicode/unicode.c
@@ -25,6 +25,8 @@
 #include "wait.h"
 #include "send_string.h"
 #include "utf8.h"
+#include "debug.h"
+#include "quantum.h"
 
 #if defined(AUDIO_ENABLE)
 #    include "audio.h"
diff --git a/quantum/unicode/unicode.h b/quantum/unicode/unicode.h
index 06505d87c0..ccf475d57c 100644
--- a/quantum/unicode/unicode.h
+++ b/quantum/unicode/unicode.h
@@ -17,8 +17,7 @@
 #pragma once
 
 #include <stdint.h>
-
-#include "quantum.h"
+#include "quantum_keycodes.h"
 
 typedef union {
     uint8_t raw;
diff --git a/quantum/via.c b/quantum/via.c
index f4293dacd4..2acd7aa90c 100644
--- a/quantum/via.c
+++ b/quantum/via.c
@@ -22,19 +22,41 @@
 #    error "DYNAMIC_KEYMAP_ENABLE is not enabled"
 #endif
 
-#include "quantum.h"
-
 #include "via.h"
 
 #include "raw_hid.h"
 #include "dynamic_keymap.h"
 #include "eeprom.h"
+#include "eeconfig.h"
+#include "matrix.h"
+#include "timer.h"
+#include "wait.h"
 #include "version.h" // for QMK_BUILDDATE used in EEPROM magic
 
+#if defined(AUDIO_ENABLE)
+#    include "audio.h"
+#endif
+
+#if defined(BACKLIGHT_ENABLE)
+#    include "backlight.h"
+#endif
+
+#if defined(RGBLIGHT_ENABLE)
+#    include "rgblight.h"
+#endif
+
 #if (defined(RGB_MATRIX_ENABLE) || defined(LED_MATRIX_ENABLE))
 #    include <lib/lib8tion/lib8tion.h>
 #endif
 
+#if defined(RGB_MATRIX_ENABLE)
+#    include "rgb_matrix.h"
+#endif
+
+#if defined(LED_MATRIX_ENABLE)
+#    include "led_matrix.h"
+#endif
+
 // Can be called in an overriding via_init_kb() to test if keyboard level code usage of
 // EEPROM is invalid and use/save defaults.
 bool via_eeprom_is_valid(void) {
diff --git a/quantum/via.h b/quantum/via.h
index 6c8465b81e..01d4c48b37 100644
--- a/quantum/via.h
+++ b/quantum/via.h
@@ -17,6 +17,7 @@
 #pragma once
 
 #include "eeconfig.h" // for EECONFIG_SIZE
+#include "action.h"
 
 // Keyboard level code can change where VIA stores the magic.
 // The magic is the build date YYMMDD encoded as BCD in 3 bytes,
diff --git a/tmk_core/protocol/arm_atsam/main_arm_atsam.c b/tmk_core/protocol/arm_atsam/main_arm_atsam.c
index 5bed9e0cf4..30817c17b6 100644
--- a/tmk_core/protocol/arm_atsam/main_arm_atsam.c
+++ b/tmk_core/protocol/arm_atsam/main_arm_atsam.c
@@ -21,6 +21,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include "report.h"
 #include "host.h"
 #include "host_driver.h"
+#include "suspend.h"
 #include "keycode_config.h"
 #include <string.h>
 
diff --git a/tmk_core/protocol/arm_atsam/md_rgb_matrix.c b/tmk_core/protocol/arm_atsam/md_rgb_matrix.c
index 6069d1e609..0f316b256c 100644
--- a/tmk_core/protocol/arm_atsam/md_rgb_matrix.c
+++ b/tmk_core/protocol/arm_atsam/md_rgb_matrix.c
@@ -24,6 +24,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #    include "led.h"
 #    include "rgb_matrix.h"
 #    include "eeprom.h"
+#    include "host.h"
 #    include <string.h>
 #    include <math.h>
 
diff --git a/tmk_core/protocol/arm_atsam/spi_master.h b/tmk_core/protocol/arm_atsam/spi_master.h
index 26c55128be..80678a5707 100644
--- a/tmk_core/protocol/arm_atsam/spi_master.h
+++ b/tmk_core/protocol/arm_atsam/spi_master.h
@@ -16,7 +16,9 @@
 
 #pragma once
 
+#include <stdint.h>
 #include <stdbool.h>
+#include "gpio.h"
 
 typedef int16_t spi_status_t;