diff options
author | Aidan MacDonald <amachronic@protonmail.com> | 2022-12-03 16:17:43 +0000 |
---|---|---|
committer | Aidan MacDonald <amachronic@protonmail.com> | 2022-12-31 08:10:41 -0500 |
commit | 484a79fcc0bb762acc1c3a502b237a68588ab4ab (patch) | |
tree | b27aac3480ee800bd9690c7637c53af03310961a /firmware/target/mips/ingenic_x1000/gpio-x1000.c | |
parent | a980d5f86951dca03baa447fd5a58005ba47a098 (diff) | |
download | rockbox-484a79fcc0bb762acc1c3a502b237a68588ab4ab.tar.gz rockbox-484a79fcc0bb762acc1c3a502b237a68588ab4ab.zip |
x1000: Add INIT_ATTR to various target specific functions
Add INIT_ATTR to some low-hanging fruit in the X1000 code:
GPIO init, GPIO initial state tables, clock init, and DMA init.
Change-Id: Ia02b20945da1bbed103e2e01eaf60553eb5f72d4
Diffstat (limited to 'firmware/target/mips/ingenic_x1000/gpio-x1000.c')
-rw-r--r-- | firmware/target/mips/ingenic_x1000/gpio-x1000.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/firmware/target/mips/ingenic_x1000/gpio-x1000.c b/firmware/target/mips/ingenic_x1000/gpio-x1000.c index 14195359df..0ebe424566 100644 --- a/firmware/target/mips/ingenic_x1000/gpio-x1000.c +++ b/firmware/target/mips/ingenic_x1000/gpio-x1000.c | |||
@@ -21,7 +21,7 @@ | |||
21 | 21 | ||
22 | #include "gpio-x1000.h" | 22 | #include "gpio-x1000.h" |
23 | 23 | ||
24 | const struct gpio_setting gpio_settings[PIN_COUNT] = { | 24 | static const struct gpio_setting gpio_settings[PIN_COUNT] INITDATA_ATTR = { |
25 | #define DEFINE_GPIO(_name, _gpio, _func) \ | 25 | #define DEFINE_GPIO(_name, _gpio, _func) \ |
26 | {.gpio = _gpio, .func = _func}, | 26 | {.gpio = _gpio, .func = _func}, |
27 | #define DEFINE_PINGROUP(...) | 27 | #define DEFINE_PINGROUP(...) |
@@ -30,7 +30,7 @@ const struct gpio_setting gpio_settings[PIN_COUNT] = { | |||
30 | #undef DEFINE_PINGROUP | 30 | #undef DEFINE_PINGROUP |
31 | }; | 31 | }; |
32 | 32 | ||
33 | const struct pingroup_setting pingroup_settings[PINGROUP_COUNT] = { | 33 | static const struct pingroup_setting pingroup_settings[PINGROUP_COUNT] INITDATA_ATTR = { |
34 | #define DEFINE_GPIO(...) | 34 | #define DEFINE_GPIO(...) |
35 | #define DEFINE_PINGROUP(_name, _port, _pins, _func) \ | 35 | #define DEFINE_PINGROUP(_name, _port, _pins, _func) \ |
36 | {.port = _port, .pins = _pins, .func = _func}, | 36 | {.port = _port, .pins = _pins, .func = _func}, |
@@ -39,7 +39,8 @@ const struct pingroup_setting pingroup_settings[PINGROUP_COUNT] = { | |||
39 | #undef DEFINE_PINGROUP | 39 | #undef DEFINE_PINGROUP |
40 | }; | 40 | }; |
41 | 41 | ||
42 | const char* const gpio_names[PIN_COUNT] = { | 42 | #if 0 /* not needed for the time being */ |
43 | static const char* const gpio_names[PIN_COUNT] = { | ||
43 | #define DEFINE_GPIO(_name, ...) #_name, | 44 | #define DEFINE_GPIO(_name, ...) #_name, |
44 | #define DEFINE_PINGROUP(...) | 45 | #define DEFINE_PINGROUP(...) |
45 | #include "gpio-target.h" | 46 | #include "gpio-target.h" |
@@ -47,13 +48,14 @@ const char* const gpio_names[PIN_COUNT] = { | |||
47 | #undef DEFINE_PINGROUP | 48 | #undef DEFINE_PINGROUP |
48 | }; | 49 | }; |
49 | 50 | ||
50 | const char* const pingroup_names[PINGROUP_COUNT] = { | 51 | static const char* const pingroup_names[PINGROUP_COUNT] = { |
51 | #define DEFINE_GPIO(...) | 52 | #define DEFINE_GPIO(...) |
52 | #define DEFINE_PINGROUP(_name, ...) #_name, | 53 | #define DEFINE_PINGROUP(_name, ...) #_name, |
53 | #include "gpio-target.h" | 54 | #include "gpio-target.h" |
54 | #undef DEFINE_GPIO | 55 | #undef DEFINE_GPIO |
55 | #undef DEFINE_PINGROUP | 56 | #undef DEFINE_PINGROUP |
56 | }; | 57 | }; |
58 | #endif | ||
57 | 59 | ||
58 | void gpio_init(void) | 60 | void gpio_init(void) |
59 | { | 61 | { |