};
#endif
+#if defined (CONFIG_BATTERY_BQ27510)
+#define DC_CHECK_PIN RK29_PIN4_PA1
+#define LI_LION_BAT_NUM 2
+static int bq27510_init_dc_check_pin(void){
+ if(gpio_request(DC_CHECK_PIN,"dc_check") != 0){
+ gpio_free(DC_CHECK_PIN);
+ printk("bq27510 init dc check pin request error\n");
+ return -EIO;
+ }
+ gpio_direction_input(DC_CHECK_PIN);
+ return 0;
+}
+
+struct bq27510_platform_data bq27510_info = {
+ .init_dc_check_pin = bq27510_init_dc_check_pin,
+ .dc_check_pin = DC_CHECK_PIN,
+ .bat_num = LI_LION_BAT_NUM,
+};
+#endif
/*****************************************************************************************
.type = "bq27510",
.addr = 0x55,
.flags = 0,
+ .platform_data = &bq27510_info,
},
#endif
#if defined (CONFIG_RTC_HYM8563)
.platform_data = &mma8452_info,
},
#endif
-#if defined (CONFIG_SENSORS_AK8973)
+#if defined (CONFIG_COMPASS_AK8973)
{
.type = "ak8973",
.addr = 0x1d,
.irq = RK29_PIN0_PA4,
},
#endif
-#if defined (CONFIG_SENSORS_AK8975)
+#if defined (CONFIG_COMPASS_AK8975)
{
.type = "ak8975",
.addr = 0x0d,
}
} else {
ret = RK29_CAM_EIO_REQUESTFAIL;
- printk("\n%s..%s..ResetPin=%d request failed!\n",__FUNCTION__,dev_name(dev),camera_reset);
+ printk("\n%s..%s..PowerPin=%d request failed!\n",__FUNCTION__,dev_name(dev),camera_reset);
}
} else {
ret = RK29_CAM_EIO_INVALID;
#define PWM_MUX_NAME GPIO1B5_PWM0_NAME
#define PWM_MUX_MODE GPIO1L_PWM0
#define PWM_MUX_MODE_GPIO GPIO1L_GPIO1B5
+#define PWM_GPIO RK29_PIN1_PB5
#define PWM_EFFECT_VALUE 1
//#define LCD_DISP_ON_PIN
rk29_mux_api_set(PWM_MUX_NAME, PWM_MUX_MODE_GPIO);
return ret;
}
+
+static int rk29_backlight_pwm_suspend(void)
+{
+ int ret = 0;
+ rk29_mux_api_set(PWM_MUX_NAME, PWM_MUX_MODE_GPIO);
+ if (ret = gpio_request(PWM_GPIO, NULL)) {
+ printk("func %s, line %d: request gpio fail\n", __FUNCTION__, __LINE__);
+ return -1;
+ }
+ gpio_direction_output(PWM_GPIO, GPIO_LOW);
+ return ret;
+}
+
+static int rk29_backlight_pwm_resume(void)
+{
+ gpio_free(PWM_GPIO);
+ rk29_mux_api_set(PWM_MUX_NAME, PWM_MUX_MODE);
+ return 0;
+}
+
struct rk29_bl_info rk29_bl_info = {
.pwm_id = PWM_ID,
.bl_ref = PWM_EFFECT_VALUE,
.io_init = rk29_backlight_io_init,
.io_deinit = rk29_backlight_io_deinit,
+ .pwm_suspend = rk29_backlight_pwm_suspend,
+ .pwm_resume = rk29_backlight_pwm_resume,
};
#endif
/*****************************************************************************************
rk29_mux_api_set(GPIO2A2_SDMMC0DETECTN_NAME, GPIO2L_SDMMC0_DETECT_N);
rk29_mux_api_set(GPIO5D5_SDMMC0PWREN_NAME, GPIO5H_GPIO5D5); ///GPIO5H_SDMMC0_PWR_EN); ///GPIO5H_GPIO5D5);
gpio_request(RK29_PIN5_PD5,"sdmmc");
+#if 0
gpio_set_value(RK29_PIN5_PD5,GPIO_HIGH);
mdelay(100);
gpio_set_value(RK29_PIN5_PD5,GPIO_LOW);
+#else
+ gpio_direction_output(RK29_PIN5_PD5,GPIO_LOW);
+#endif
return 0;
}
{
pr_info("%s: %d\n", __func__, on);
if (on){
- gpio_set_value(RK29SDK_WIFI_BT_GPIO_POWER_N, on);
+ gpio_set_value(RK29SDK_WIFI_BT_GPIO_POWER_N, GPIO_HIGH);
+ gpio_set_value(RK29SDK_WIFI_GPIO_RESET_N, GPIO_HIGH);
mdelay(100);
pr_info("wifi turn on power\n");
}else{
if (!rk29sdk_bt_power_state){
- gpio_set_value(RK29SDK_WIFI_BT_GPIO_POWER_N, on);
+ gpio_set_value(RK29SDK_WIFI_BT_GPIO_POWER_N, GPIO_LOW);
mdelay(100);
pr_info("wifi shut off power\n");
}else
{
pr_info("wifi shouldn't shut off power, bt is using it!\n");
}
+ gpio_set_value(RK29SDK_WIFI_GPIO_RESET_N, GPIO_LOW);
}
}
return 0;
- err_mem_alloc:
+err_mem_alloc:
pr_err("Failed to mem_alloc for WLAN\n");
for (j = 0 ; j < i ; j++)
- kfree(wifi_mem_array[j].mem_ptr);
+ kfree(wifi_mem_array[j].mem_ptr);
i = WLAN_SKB_BUF_NUM;
- err_skb_alloc:
+err_skb_alloc:
pr_err("Failed to skb_alloc for WLAN\n");
for (j = 0 ; j < i ; j++)
dev_kfree_skb(wlan_static_skb[j]);
[1] = {
.name = "gpu_base",
.start = RK29_GPU_PHYS,
- .end = RK29_GPU_PHYS + RK29_GPU_PHYS_SIZE,
+ .end = RK29_GPU_PHYS + RK29_GPU_SIZE,
.flags = IORESOURCE_MEM,
},
[2] = {
{
.name = "spi0 cs0",
.cs_gpio = RK29_PIN2_PC1,
- .cs_iomux_name = NULL,
+ .cs_iomux_name = GPIO2C1_SPI0CSN0_NAME,
+ .cs_iomux_mode = GPIO2H_SPI0_CSN0,
},
{
.name = "spi0 cs1",
{
.name = "spi1 cs0",
.cs_gpio = RK29_PIN2_PC5,
- .cs_iomux_name = NULL,
+ .cs_iomux_name = GPIO2C5_SPI1CSN0_NAME,
+ .cs_iomux_mode = GPIO2H_SPI1_CSN0,
},
{
.name = "spi1 cs1",
static int spi_io_init(struct spi_cs_gpio *cs_gpios, int cs_num)
{
#if 1
- int i,j,ret;
-
- //cs
+ int i;
if (cs_gpios) {
for (i=0; i<cs_num; i++) {
rk29_mux_api_set(cs_gpios[i].cs_iomux_name, cs_gpios[i].cs_iomux_mode);
- ret = gpio_request(cs_gpios[i].cs_gpio, cs_gpios[i].name);
- if (ret) {
- for (j=0;j<i;j++) {
- gpio_free(cs_gpios[j].cs_gpio);
- //rk29_mux_api_mode_resume(cs_gpios[j].cs_iomux_name);
- }
- printk("[fun:%s, line:%d], gpio request err\n", __func__, __LINE__);
- return -1;
- }
- gpio_direction_output(cs_gpios[i].cs_gpio, GPIO_HIGH);
}
}
#endif
static int spi_io_deinit(struct spi_cs_gpio *cs_gpios, int cs_num)
{
-#if 1
- int i;
-
- if (cs_gpios) {
- for (i=0; i<cs_num; i++) {
- gpio_free(cs_gpios[i].cs_gpio);
- //rk29_mux_api_mode_resume(cs_gpios[i].cs_iomux_name);
- }
- }
-#endif
return 0;
}
gpio_direction_output(POWER_ON_PIN, GPIO_HIGH);
pm_power_off = rk29_pm_power_off;
-#ifdef CONFIG_WIFI_CONTROL_FUNC
- rk29sdk_wifi_bt_gpio_control_init();
-#endif
-
platform_add_devices(devices, ARRAY_SIZE(devices));
#ifdef CONFIG_I2C0_RK29
i2c_register_board_info(default_i2c0_data.bus_num, board_i2c0_devices,
#endif
spi_register_board_info(board_spi_devices, ARRAY_SIZE(board_spi_devices));
-
- rk29sdk_init_wifi_mem();
+
+#ifdef CONFIG_WIFI_CONTROL_FUNC
+ rk29sdk_wifi_bt_gpio_control_init();
+ rk29sdk_init_wifi_mem();
+#endif
}
static void __init machine_rk29_fixup(struct machine_desc *desc, struct tag *tags,
static void __init machine_rk29_mapio(void)
{
rk29_map_common_io();
+ rk29_setup_early_printk();
rk29_sram_init();
rk29_clock_init();
rk29_iomux_init();