Power off SD card if no voltage range support.

The goal is to handle `FIXME` within WorkerThread that of MMCBus.
[+] Extended SDHCIBus to have:
	> private PowerOff() to clear corresponding VDD1 power bit.
	> Public TerminateBus() to terminate the bus
		powering off,disabling clock and interrupts.
		Also called within the destructor.
[+] Extend `mmc_bus_interface` to encapsulate terminate_bus
	coping the same style of other interface utilities.
[+] MMCBus can its newly added private _TerminateBus() for handling sd cards
	not supporting proposed voltage range.

Testing:
- used false invokation on qemu emulated sd card to test
	the termination branch.
- Successfully built and run,SD card doesn't show up in DriveSetup
- debug Log show correct power and clock bit setting(power=0xe, clock=0x800b).

Please Guide me further on more effective test method.

Change-Id: Icc8eeac97b9c96dfbf0106871d26a41d7faea5dc
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10622
Haiku-Format: Haiku-format Bot <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
This commit is contained in:
unknown rurouni
2026-04-21 06:55:27 +00:00
committed by Adrien Destugues
parent ef2e71c652
commit aaed8a220f
7 changed files with 57 additions and 4 deletions
+2
View File
@@ -88,6 +88,8 @@ typedef struct mmc_bus_interface {
// Pass the semaphore used for device rescan to the bus controller
void (*set_bus_width)(void* controller, int width);
// Set the data bus width to 1, 4 or 8 bit mode.
void (*terminate_bus)(void* controller);
// Terminate use of the underlying sdhci bus.
} mmc_bus_interface;