return 0;
}
-struct rk29_bl_info rk29_bl_info = {
+static struct rk29_bl_info rk29_bl_info = {
.pwm_id = PWM_ID,
.bl_ref = PWM_EFFECT_VALUE,
.io_init = rk29_backlight_io_init,
};
-struct platform_device rk29_device_backlight = {
+static struct platform_device rk29_device_backlight = {
.name = "rk29_backlight",
.id = -1,
.dev = {
#endif
#ifdef CONFIG_FB_ROCKCHIP
-/* rk30 fb resource */
- static struct resource resource_fb[] = {
+static struct resource resource_fb[] = {
[0] = {
.name = "fb0 buf",
.start = 0,
},
};
-/*platform_device*/
-struct platform_device device_fb = {
+static struct platform_device device_fb = {
.name = "rk-fb",
.id = -1,
.num_resources = ARRAY_SIZE(resource_fb),
};
#endif
-extern struct platform_device rk30_device_lcdc;
static struct platform_device *devices[] __initdata = {
#ifdef CONFIG_BACKLIGHT_RK29_BL
&rk29_device_backlight,
#ifdef CONFIG_FB_ROCKCHIP
&device_fb,
#endif
-#ifdef CONFIG_LCDC_RK30
- &rk30_device_lcdc,
-#endif
-
};
// i2c
static void __init rk30_reserve(void)
{
+#ifdef CONFIG_FB_ROCKCHIP
resource_fb[0].start = board_mem_reserve_add("fb0",RK30_FB0_MEM_SIZE);
- resource_fb[0].end = resource_fb[0].start + RK30_FB0_MEM_SIZE - 1;
+ resource_fb[0].end = resource_fb[0].start + RK30_FB0_MEM_SIZE - 1;
+#endif
board_mem_reserved();
}
}
//end of i2c
+#if defined(CONFIG_SPIM0_RK29) || defined(CONFIG_SPIM1_RK29)
/*****************************************************************************************
* spi devices
* author: cmc@rock-chips.com
*****************************************************************************************/
#define SPI_CHIPSELECT_NUM 2
-static struct spi_cs_gpio rk29xx_spi0_cs_gpios[SPI_CHIPSELECT_NUM] = {
- {
- .name = "spi0 cs0",
- .cs_gpio = RK30_PIN1_PA4,
- .cs_iomux_name = GPIO1A4_UART1SIN_SPI0CSN0_NAME,
- .cs_iomux_mode = GPIO1A_SPI0_CSN0,
- },
- {
- .name = "spi0 cs1",
- .cs_gpio = RK30_PIN4_PB7,
- .cs_iomux_name = GPIO4B7_SPI0CSN1_NAME,//if no iomux,set it NULL
- .cs_iomux_mode = GPIO4B_SPI0_CSN1,
- }
-};
-
-static struct spi_cs_gpio rk29xx_spi1_cs_gpios[SPI_CHIPSELECT_NUM] = {
- {
- .name = "spi1 cs0",
- .cs_gpio = RK30_PIN2_PC4,
- .cs_iomux_name = GPIO2C4_LCDC1DATA20_SPI1CSN0_HSADCDATA1_NAME,
- .cs_iomux_mode = GPIO2C_SPI1_CSN0,
- },
- {
- .name = "spi1 cs1",
- .cs_gpio = RK30_PIN2_PC7,
- .cs_iomux_name = GPIO2C7_LCDC1DATA23_SPI1CSN1_HSADCDATA4_NAME,//if no iomux,set it NULL
- .cs_iomux_mode = GPIO2C_SPI1_CSN1,
- }
-};
static int spi_io_init(struct spi_cs_gpio *cs_gpios, int cs_num)
{
#endif
return 0;
}
+#endif
-struct rk29xx_spi_platform_data rk29xx_spi0_platdata = {
- .num_chipselect = SPI_CHIPSELECT_NUM,
- .chipselect_gpios = rk29xx_spi0_cs_gpios,
- .io_init = spi_io_init,
- .io_deinit = spi_io_deinit,
- .io_fix_leakage_bug = spi_io_fix_leakage_bug,
- .io_resume_leakage_bug = spi_io_resume_leakage_bug,
+/*
+ * rk29xx spi master device
+ */
+#ifdef CONFIG_SPIM0_RK29
+static struct spi_cs_gpio rk29xx_spi0_cs_gpios[SPI_CHIPSELECT_NUM] = {
+ {
+ .name = "spi0 cs0",
+ .cs_gpio = RK30_PIN1_PA4,
+ .cs_iomux_name = GPIO1A4_UART1SIN_SPI0CSN0_NAME,
+ .cs_iomux_mode = GPIO1A_SPI0_CSN0,
+ },
+ {
+ .name = "spi0 cs1",
+ .cs_gpio = RK30_PIN4_PB7,
+ .cs_iomux_name = GPIO4B7_SPI0CSN1_NAME,//if no iomux,set it NULL
+ .cs_iomux_mode = GPIO4B_SPI0_CSN1,
+ }
};
-struct rk29xx_spi_platform_data rk29xx_spi1_platdata = {
+static struct rk29xx_spi_platform_data rk29xx_spi0_platdata = {
.num_chipselect = SPI_CHIPSELECT_NUM,
- .chipselect_gpios = rk29xx_spi1_cs_gpios,
+ .chipselect_gpios = rk29xx_spi0_cs_gpios,
.io_init = spi_io_init,
.io_deinit = spi_io_deinit,
.io_fix_leakage_bug = spi_io_fix_leakage_bug,
.io_resume_leakage_bug = spi_io_resume_leakage_bug,
};
-
-
-/*
- * rk29xx spi master device
- */
-#ifdef CONFIG_SPIM0_RK29
static struct resource rk29_spi0_resources[] = {
{
.start = IRQ_SPI0,
#endif
#ifdef CONFIG_SPIM1_RK29
+static struct spi_cs_gpio rk29xx_spi1_cs_gpios[SPI_CHIPSELECT_NUM] = {
+ {
+ .name = "spi1 cs0",
+ .cs_gpio = RK30_PIN2_PC4,
+ .cs_iomux_name = GPIO2C4_LCDC1DATA20_SPI1CSN0_HSADCDATA1_NAME,
+ .cs_iomux_mode = GPIO2C_SPI1_CSN0,
+ },
+ {
+ .name = "spi1 cs1",
+ .cs_gpio = RK30_PIN2_PC7,
+ .cs_iomux_name = GPIO2C7_LCDC1DATA23_SPI1CSN1_HSADCDATA4_NAME,//if no iomux,set it NULL
+ .cs_iomux_mode = GPIO2C_SPI1_CSN1,
+ }
+};
+
+static struct rk29xx_spi_platform_data rk29xx_spi1_platdata = {
+ .num_chipselect = SPI_CHIPSELECT_NUM,
+ .chipselect_gpios = rk29xx_spi1_cs_gpios,
+ .io_init = spi_io_init,
+ .io_deinit = spi_io_deinit,
+ .io_fix_leakage_bug = spi_io_fix_leakage_bug,
+ .io_resume_leakage_bug = spi_io_resume_leakage_bug,
+};
+
static struct resource rk29_spi1_resources[] = {
{
.start = IRQ_SPI1,
#endif
}
-
#ifdef CONFIG_MTD_NAND_RK29XX
static struct resource resources_nand[] = {
{
};
#endif
+#ifdef CONFIG_LCDC_RK30
static struct resource resource_lcdc[] = {
[0] = {
.name = "lcdc0 reg",
},
};
-/*platform_device*/
-struct platform_device rk30_device_lcdc = {
+static struct platform_device device_lcdc = {
.name = "rk30-lcdc",
.id = 4,
.num_resources = ARRAY_SIZE(resource_lcdc),
.resource = resource_lcdc,
};
-
+#endif
#ifdef CONFIG_KEYS_RK29
extern struct rk29_keys_platform_data rk29_keys_pdata;
#endif
#ifdef CONFIG_KEYS_RK29
platform_device_register(&device_keys);
+#endif
+#ifdef CONFIG_LCDC_RK30
+ platform_device_register(&device_lcdc);
#endif
return 0;
}