While looking at stuff in this thread
http://chdk.setepontos.com/index.php?topic=10385.msg102962#msg102962I noticed the "Driver.Create" registers SetSDPwrPort.
So in theory
call_event_proc('Driver.Create')
call_event_proc('SetSDPwrPort',0)
should turn the SD card off.
call_event_proc('SetSDPwrPort',1)
would theoretically turn it back on. You only have to call Driver.Create once to register the function.
I tried this on my D10, and then tried to access the card using ls in chdkptp. It worked eventually, but there was a ~1 second delay. Maybe the firmware resets the card if you try to access when powered off.
edit:
On the other hand, this function toggles the same MMIO mentioned earlier in the thread, so maybe it doesn't do what the name suggests...