rk3066b:add spi support
authorlw <lw@rock-chips.com>
Sat, 8 Sep 2012 06:07:13 +0000 (14:07 +0800)
committerlw <lw@rock-chips.com>
Sat, 8 Sep 2012 06:07:13 +0000 (14:07 +0800)
arch/arm/mach-rk30/devices.c
drivers/spi/spi_test.c

index fcd0d64c0c70cf41c1d4c300da42af48943ad635..44b58a8ede04b45c3d99806d2d5e3e34131ab138 100755 (executable)
@@ -824,6 +824,21 @@ static int spi_io_resume_leakage_bug(void)
  */
 #ifdef CONFIG_SPIM0_RK29
 static struct spi_cs_gpio rk29xx_spi0_cs_gpios[SPI_CHIPSELECT_NUM] = {
+#if defined(CONFIG_ARCH_RK3066B)
+       {
+               .name = "spi0 cs0",
+               .cs_gpio = RK30_PIN1_PA7,
+               .cs_iomux_name = GPIO1A7_UART1RTSN_SPI0CSN0_NAME,
+               .cs_iomux_mode = GPIO1A_SPI0CSN0,
+       },
+       {
+               .name = "spi0 cs1",
+               .cs_gpio = RK30_PIN1_PB7,
+               .cs_iomux_name = GPIO1B7_SPI0CSN1_NAME,//if no iomux,set it NULL
+               .cs_iomux_mode = GPIO1B_SPI0CSN1,
+       }
+
+#else
        {
                .name = "spi0 cs0",
                .cs_gpio = RK30_PIN1_PA4,
@@ -836,6 +851,7 @@ static struct spi_cs_gpio rk29xx_spi0_cs_gpios[SPI_CHIPSELECT_NUM] = {
                .cs_iomux_name = GPIO4B7_SPI0CSN1_NAME,//if no iomux,set it NULL
                .cs_iomux_mode = GPIO4B_SPI0_CSN1,
        }
+#endif
 };
 
 static struct rk29xx_spi_platform_data rk29xx_spi0_platdata = {
@@ -885,6 +901,21 @@ struct platform_device rk29xx_device_spi0m = {
 
 #ifdef CONFIG_SPIM1_RK29
 static struct spi_cs_gpio rk29xx_spi1_cs_gpios[SPI_CHIPSELECT_NUM] = {
+#if defined(CONFIG_ARCH_RK3066B)                       
+       {
+               .name = "spi1 cs0",
+               .cs_gpio = RK30_PIN0_PD7,
+               .cs_iomux_name = GPIO0D7_SPI1CSN0_NAME,
+               .cs_iomux_mode = GPIO0D_SPI1CSN0,
+       },
+       {
+               .name = "spi1 cs1",
+               .cs_gpio = RK30_PIN1_PB6,
+               .cs_iomux_name = GPIO1B6_SPDIFTX_SPI1CSN1_NAME,//if no iomux,set it NULL
+               .cs_iomux_mode = GPIO1B_SPI1CSN1,
+       }
+       
+#else
        {
                .name = "spi1 cs0",
                .cs_gpio = RK30_PIN2_PC4,
@@ -897,6 +928,7 @@ static struct spi_cs_gpio rk29xx_spi1_cs_gpios[SPI_CHIPSELECT_NUM] = {
                .cs_iomux_name = GPIO2C7_LCDC1DATA23_SPI1CSN1_HSADCDATA4_NAME,//if no iomux,set it NULL
                .cs_iomux_mode = GPIO2C_SPI1_CSN1,
        }
+#endif
 };
 
 static struct rk29xx_spi_platform_data rk29xx_spi1_platdata = {
index 9c7bc8fbb93eecf1073b18b6354e6337be0d9d25..cfba557f7dd2042b72ec7d6e80a8273d60eba8b9 100755 (executable)
@@ -141,7 +141,7 @@ static int __devinit spi_test_probe(struct spi_device *spi)
 \r
        g_spi_test_data = spi_test_data;\r
 \r
-       printk("%s:bus_num=%d,ok\n",__func__,spi->bus_num);\r
+       printk("%s:bus_num=%d,ok\n",__func__,spi->master->bus_num);\r
 \r
        return ret;\r
 \r