summaryrefslogtreecommitdiff
path: root/firmware/target/mips/ingenic_x1000/sd-x1000.c
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2021-06-05 00:12:01 +0100
committerAidan MacDonald <amachronic@protonmail.com>2021-06-06 11:06:14 +0000
commite85bc74b307365e9a7b4adab51d646638db12fbd (patch)
treec45ba9079344b5cc0ea48a77b6aa77aacd71cdc5 /firmware/target/mips/ingenic_x1000/sd-x1000.c
parent695d1701cdd1bb4539f652c2204f7787097b2715 (diff)
downloadrockbox-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/sd-x1000.c')
-rw-r--r--firmware/target/mips/ingenic_x1000/sd-x1000.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/firmware/target/mips/ingenic_x1000/sd-x1000.c b/firmware/target/mips/ingenic_x1000/sd-x1000.c
index 7fba617ce3..679a25a222 100644
--- a/firmware/target/mips/ingenic_x1000/sd-x1000.c
+++ b/firmware/target/mips/ingenic_x1000/sd-x1000.c
@@ -23,6 +23,7 @@
23#include "sdmmc.h" 23#include "sdmmc.h"
24#include "sd.h" 24#include "sd.h"
25#include "msc-x1000.h" 25#include "msc-x1000.h"
26#include "gpio-x1000.h"
26#include <string.h> 27#include <string.h>
27 28
28/* #define LOGF_ENABLE */ 29/* #define LOGF_ENABLE */
@@ -201,7 +202,7 @@ bool sd_removable(IF_MD_NONVOID(int drive))
201 if(drive < 0) 202 if(drive < 0)
202 return false; 203 return false;
203 204
204 return sd_to_msc[IF_MD_DRV(drive)]->config->cd_gpio.pin != 0; 205 return sd_to_msc[IF_MD_DRV(drive)]->config->cd_gpio != GPIO_NONE;
205} 206}
206 207
207#ifndef CONFIG_STORAGE_MULTI 208#ifndef CONFIG_STORAGE_MULTI