1 /******************************************************************************
2 ** File Name: spi_phy_v0.c *
5 ** Copyright: 2010 Spreatrum, Incoporated. All Rights Reserved. *
6 ** Description: This file define the physical layer of SPI device. *
7 ******************************************************************************
9 ******************************************************************************
11 ** ------------------------------------------------------------------------- *
12 ** DATE NAME DESCRIPTION *
13 ** 06/28/2010 liuhao Create.
14 ******************************************************************************/
16 /**---------------------------------------------------------------------------*
18 **---------------------------------------------------------------------------*/
21 #include <linux/types.h>
22 #include <asm/arch/bits.h>
24 //#define __SPI_MODE__
25 #define mdelay(n) udelay((n) * 1000)
27 extern int modem_status(void);
29 int req_clk_status(void)
31 if(modem_status() == 2) {
35 return gpio_get_value(CP_AP_LIV);
38 /*********************************************************************************************************
39 ** Function name: req_clk_init
47 *********************************************************************************************************/
48 void req_clk_init(void)
50 //gpio_direction_output(CP_AP_LIV, 0);
53 void dump_gpio_register(void)
55 // GPIO_PRINT(("GPIO(0x%x --0x%x) = 0x%8x\n",gpio_base_for_cs+0x4,gpio_base_for_cs,REG32(gpio_base_for_cs+0x4)));
56 // GPIO_PRINT(("GPIO(0x%x -- %d) = 0x%8x\n",gpio_base_for_cs+0x8,gpio_bit_num_for_cs,REG32(gpio_base_for_cs+0x8)));