title: Unbinding mmcblk1 driver in Linux (disable SD Card Reader)
body: <p>I'm pretty new to the Linux device tree, and I am searching for a way to disable the SD Card Interface on my Linux embedded system.</p>
  
  <p>I recently figured out how to disable my USB Interface by unbinding it's device driver, using <code>echo -n 1-0:1.0 > /sys/bus/usb/drivers/hub/unbind</code></p>
  
  <p>Now I am trying to do the same for the SD Card slot, but I am running into problems finding the correct path/driver to unbind. I believe the device is located in <code>/sys/block/mmcblk1</code>, but I'm not really sure how to go about finding the correct device id/unbind file. Any tips on disabling an SD interface?</p>
  
  <p>Edit 1: Upon further inspection, mmcblk1 doesn't even show up when there is no SD card inserted in the slot. How should I go about disabling the interface itself, not just disabling a single card?</p>
  
  <p>Edit 2: It looks like disabling hotplugging might work, but I am now struggling to understand mdev rules.</p>
  
  <p>Edit 3 (Solution): After slogging through the device tree, I was able to track down the specific device and driver combination that was running my mmc reader. <code>echo -n mmc1:aaaa > /sys/bus/mmc/drivers/mmcblk/unbind</code> is able to unbind the driver from the device (mmc1:aaaa). I also had to tweak my mdev rules, as the driver was reloaded every time I plugged in my device. The final solution was to drop the following into /etc/mdev.conf: <code>mmcblk([1-9]+) root:disk 777 @echo -n mmc1:aaaa > /sys/bus/mmc/drivers/mmcblk/unbind</code>, which runs every time an mmc device binds (excluding mmcblk0, as we are using that elsewhere) and immediately unbinds the driver.</p>