title: Issues using mmc_power_up while compiling kernel module for using SDIO port
body: <p>I am trying to compile a kernel module for using the SD card port for communicating with another peripheral (a digital signal processor TigerSHARC) to a Colibri PXA320 board. The kernel source uses the functions <code>mmc_power_up</code> and <code>mmc_power_off</code> for controlling the port and runs using the mmc driver provided in the kernel. 
  The source code right now has the following includes </p>
  
  <pre><code>#include &lt;linux/module.h&gt;   
  #include &lt;linux/kernel.h&gt;   
  #include &lt;linux/fs.h&gt;
  #include &lt;linux/cdev.h&gt;
  #include &lt;linux/types.h&gt;
  #include &lt;linux/scatterlist.h&gt;
  #include &lt;linux/slab.h&gt;
  
  #include &lt;linux/mmc/host.h&gt;
  #include &lt;linux/mmc/card.h&gt;
  #include &lt;linux/mmc/mmc.h&gt;
  #include &lt;linux/mmc/sd.h&gt;
  #include &lt;linux/mmc/sdio.h&gt;
  #include &lt;linux/mmc/sdio_func.h&gt;
  #include &lt;linux/mmc/sdio_ids.h&gt;
  #include &lt;linux/gpio.h&gt;
  </code></pre>
  
  <p>The path variables added are </p>
  
  <pre><code>export PATH=$KSRCPATH/tools/usr/local/arm/oe/bin:$PATH
  export PATH=$KSRCPATH/tools/usr/local/arm/oe/arm-angstrom-linux-gnueabi/include:$PATH
  export PATH=$KSRCPATH/src/linux-2.6.35.9-toradex:$PATH
  export PATH=$KSRCPATH/src/linux-2.6.35.9-toradex/include/asm-arm:$PATH
  export PATH=$KSRCPATH/src/linux-2.6.35.9-toradex/drivers/mmc/core:$PATH
  export PATH=$KSRCPATH/src/u-boot-2010.09-toradex/tools:$PATH
  </code></pre>
  
  <p>where <code>$KSRCPATH</code> is the kernel source folder. </p>
  
  <p>When I compile the kernel modules I am getting the following message :</p>
  
  <pre><code>WARNING: "mmc_set_bus_width" [/mnt/hgfs/Colibri_Linux/Linux/SDIO_Driver/unet_sdio.ko] undefined!
  WARNING: "mmc_power_up" [/mnt/hgfs/Colibri_Linux/Linux/SDIO_Driver/unet_sdio.ko] undefined!
  WARNING: "mmc_power_off" [/mnt/hgfs/Colibri_Linux/Linux/SDIO_Driver/unet_sdio.ko] undefined!
  </code></pre>
  
  <p>I checked the kernel source tree and the function s are defined in the <code>core.c</code> file in <code>$KSRCPATH/src/linux-2.6.35.9-toradex/drivers/mmc/core</code> but they dont have any declarations defined in <code>core.h</code> for them. </p>
  
  <p>My makefile right now is : </p>
  
  <pre><code>KDIR = $(KSRCPATH)/src/linux-2.6.35.9-toradex
  
  obj-m += unet_sdio.o
  
  all:  
      make -C $(KDIR) M=$(PWD) modules
      make install
  
  clean:
      make -C $(KDIR) M=$(PWD) clean
  
  install:
      cp unet_sdio.ko /mnt/hgfs/Colibri_Linux/
  </code></pre>
  
  <p>I have declared the functions are extern in my source code </p>
  
  <pre><code>/*! External (MMC) Functions */
  extern void mmc_power_up(struct mmc_host *host);
  extern void mmc_power_off(struct mmc_host *host);
  </code></pre>
  
  <p>I am guessing my kernel module in not getting linked into <code>core.c</code> in <code>$KSRCPATH/src/linux-2.6.35.9-toradex/drivers/mmc/core</code> and hence the functions are marked as undefined. </p>
  
  <p>What changes do I need to make in the source code or the makefile to link the my source code and core.c together. </p>
  
  <p>EDIT: I am able to boot the colibri PXA320 device with the compiled kernel and  kallsyms does show that the mmc_power_off and mmc_power_on functions are available in the kernel on the colibri PXA320 device:</p>
  
  <pre><code>root@toradex:/home/modem# grep mmc_power* /proc/kallsyms
  c0226a50 t mmc_power_off
  c0226ce0 t mmc_power_up
  c02277ec T mmc_power_save_host
  c022796c T mmc_power_restore_host
  c0229490 t mmc_power_restore
  </code></pre>