diff options
author | Aidan MacDonald <amachronic@protonmail.com> | 2021-06-05 00:12:01 +0100 |
---|---|---|
committer | Aidan MacDonald <amachronic@protonmail.com> | 2021-06-06 11:06:14 +0000 |
commit | e85bc74b307365e9a7b4adab51d646638db12fbd (patch) | |
tree | c45ba9079344b5cc0ea48a77b6aa77aacd71cdc5 /firmware/target/mips/ingenic_x1000/msc-x1000.h | |
parent | 695d1701cdd1bb4539f652c2204f7787097b2715 (diff) | |
download | rockbox-e85bc74b307365e9a7b4adab51d646638db12fbd.tar.gz rockbox-e85bc74b307365e9a7b4adab51d646638db12fbd.zip |
x1000: GPIO refactor
The GPIO API was pretty clunky and pin settings were decentralized,
making it hard to see what was happening and making GPIO stuff look
like a mess, frankly.
Instead of passing clunky (port, pin) pairs everywhere, GPIOs are now
identified with a single int. The extra overhead should be minimal as
GPIO configuration is generally not on a performance-critical path.
Pin assignments are now mostly consolidated in gpio-target.h and put
in various tables so gpio_init() can assign most pins at boot time.
Most drivers no longer need to touch GPIOs and basic pin I/O stuff
can happen without config since pins are put into the right state.
IRQ pins still need to be configured manually before use.
Change-Id: Ic5326284b0b2a2f613e9e76a41cb50e24af3aa47
Diffstat (limited to 'firmware/target/mips/ingenic_x1000/msc-x1000.h')
-rw-r--r-- | firmware/target/mips/ingenic_x1000/msc-x1000.h | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/firmware/target/mips/ingenic_x1000/msc-x1000.h b/firmware/target/mips/ingenic_x1000/msc-x1000.h index 53a5b301f0..70f67a70d6 100644 --- a/firmware/target/mips/ingenic_x1000/msc-x1000.h +++ b/firmware/target/mips/ingenic_x1000/msc-x1000.h | |||
@@ -83,18 +83,13 @@ | |||
83 | #define MSC_SPEED_FAST 25000000 | 83 | #define MSC_SPEED_FAST 25000000 |
84 | #define MSC_SPEED_HIGH 50000000 | 84 | #define MSC_SPEED_HIGH 50000000 |
85 | 85 | ||
86 | typedef struct msc_gpio_data { | ||
87 | int port; | ||
88 | int pin; | ||
89 | int active_level; | ||
90 | } msc_gpio_data; | ||
91 | |||
92 | typedef struct msc_config { | 86 | typedef struct msc_config { |
93 | int msc_nr; | 87 | int msc_nr; |
94 | int msc_type; | 88 | int msc_type; |
95 | int bus_width; | 89 | int bus_width; |
96 | const char* label; | 90 | const char* label; |
97 | struct msc_gpio_data cd_gpio; | 91 | int cd_gpio; |
92 | int cd_active_level; | ||
98 | } msc_config; | 93 | } msc_config; |
99 | 94 | ||
100 | typedef struct msc_req { | 95 | typedef struct msc_req { |