3 #include "../drivers/sdio/sdio_api.h"
4 #define mdelay(x) udelay(1000*x)
6 SDIO_HANDLE sdio_handle=NULL;
7 extern int req_clk_status(void);
8 extern void req_clk_init(void);
9 void sdio_channel_open(void)
12 status = req_clk_status();
13 printf("Clock_Req(W) = %d \n",status);
14 // do{status = req_clk_status();}while(status==0);
15 sdio_handle = sdio_open();
18 /******************************************************************************
19 ** Description: This function is used to read data from MODEM by SPI BUS.
20 ** Author: jiayong.yang
21 ** parameter: buffer is used to save data from MODEM
22 ** len is length of data to be read.
23 ******************************************************************************/
24 int sdio_channel_read(unsigned char *buffer,int len)
29 if(sdio_handle == NULL)
31 status = req_clk_status();
32 //printf("(R) = %d \n",status);
33 do{status = req_clk_status();}while(status==0);
35 ret = sdio_read (sdio_handle,buffer,len);
36 //do{status = req_clk_status();}while(status);
39 /******************************************************************************
40 ** Description: This function is used to send data to MODEM by SPI BUS.
41 ** Author: jiayong.yang
42 ** parameter: buffer is used to save data from MODEM
43 ** len is length of data to be read.
44 ******************************************************************************/
45 int sdio_channel_write(unsigned char *buffer,int len)
51 if(sdio_handle == NULL)
53 status = req_clk_status();
54 //printf("(W) = %d \n",status);
55 do{status = req_clk_status();}while(status==0);
56 ret = sdio_write (sdio_handle,buffer,len);
60 void sdio_channel_close(void)
64 sdio_close(sdio_handle);