#include "board-rk2928-sdk-camera.c"
#include "board-rk2928-sdk-key.c"
+#include <linux/irq.h>
+#include <linux/interrupt.h>
+
#ifdef CONFIG_THREE_FB_BUFFER
#define RK30_FB0_MEM_SIZE 12*SZ_1M
#else
#define V86_VERSION_1_1
#endif
-#if defined(V86_VERSION_1_1)
-#if defined(CONFIG_MFD_TPS65910)
-extern int tps65910_charge_ok ;
-#endif
-#endif
-
-
static struct spi_board_info board_spi_devices[] = {
};
#ifdef CONFIG_BATTERY_RK30_ADC_FAC
#if defined(V86_VERSION_1_0) || defined(V86_VERSION_1_1)
#define DC_DET_PIN RK2928_PIN1_PA5
+
+#if defined(V86_VERSION_1_1)
+static int tps65910_charge_ok;
+static irqreturn_t tps65910_gpio0_r_irq(int irq, void *irq_data);
+static irqreturn_t tps65910_gpio0_f_irq(int irq, void *irq_data);
+#endif
+
int rk30_battery_adc_io_init(void){
int ret = 0;
printk("failed to set gpio dc_det input\n");
return ret ;
}
-
+
+ #if defined(V86_VERSION_1_1)
+ //ÉÏÉýÑØ
+ //ret = request_irq(IRQ_BOARD_BASE+TPS65910_IRQ_GPIO_R, tps65910_gpio0_r_irq, IRQF_TRIGGER_RISING, "chg_ok", NULL);
+ ret = request_threaded_irq( IRQ_BOARD_BASE +TPS65910_IRQ_GPIO_R,
+ NULL, tps65910_gpio0_r_irq, IRQF_TRIGGER_RISING,
+ "chg_ok", NULL);
+ if (ret) {
+ printk("failed to request_irq IRQ_BOARD_BASE +TPS65910_IRQ_GPIO_R , error = %d \n",ret);
+ return ret ;
+ }
+ #endif
+
return 0;
}
+
#if defined(V86_VERSION_1_1)
-extern int tps65910_charge_ok;
+static irqreturn_t tps65910_gpio0_r_irq(int irq, void *irq_data)//ÉÏÉýÑØÖжϺ¯Êý
+{
+ //printk("-----------------chg_ok_det######### %s\n",__func__);
+ tps65910_charge_ok = 1 ;
+ int ret = request_threaded_irq( IRQ_BOARD_BASE +TPS65910_IRQ_GPIO_F,
+ NULL, tps65910_gpio0_f_irq, IRQF_TRIGGER_RISING,
+ "chg_no_ok", NULL);
+
+ return IRQ_HANDLED;
+}
+
+static irqreturn_t tps65910_gpio0_f_irq(int irq, void *irq_data)//ϽµÑØÖжϺ¯Êý
+{
+ //printk("-----------------chg_no_ok######### %s\n",__func__);
+ tps65910_charge_ok = 0 ;
+ int ret = request_threaded_irq( IRQ_BOARD_BASE +TPS65910_IRQ_GPIO_R,
+ NULL, tps65910_gpio0_r_irq, IRQF_TRIGGER_RISING,
+ "chg_ok", NULL);
+
+ return IRQ_HANDLED;
+}
+
#if defined(CONFIG_MFD_TPS65910)
int rk30_battery_adc_charging_ok( ){
-
- if( gpio_get_value(DC_DET_PIN) == GPIO_LOW){
- //printk(">>>>>>>>>> DC_DET_OK\n");
+ //printk(">>>>>>>>>>return tps65910_charge_ok = %d \n",tps65910_charge_ok);
+ if( gpio_get_value(DC_DET_PIN) == GPIO_LOW){
if( tps65910_charge_ok ){
- //printk(">>>>>>>>>>return tps65910_charge_ok = %d \n",tps65910_charge_ok);
+
return 1 ;
}
- //printk(">>>>>>>>>> tps65910_charge_ok = %d \n",tps65910_charge_ok);
}
return 0 ;
.charging_ok = rk30_battery_adc_charging_ok ,
#endif
- .reference_voltage=3200,
+ .reference_voltage=3300,
.pull_up_res = 200 ,
.pull_down_res = 200 ,
#include <linux/mfd/core.h>
#include <linux/mfd/tps65910.h>
-#if defined(CONFIG_MACH_RK2926_V86)
-#include <linux/irq.h>
-#include <linux/interrupt.h>
-int tps65910_charge_ok = 0 ;
-EXPORT_SYMBOL(tps65910_charge_ok);
-#endif
-
struct tps65910 *g_tps65910;
static struct mfd_cell tps65910s[] = {
}
EXPORT_SYMBOL_GPL(tps65910_clear_bits);
-#if defined(CONFIG_MACH_RK2926_V86)
-static irqreturn_t tps65910_gpio0_r_irq(int irq, void *irq_data)
-{
- //printk("#########chg_ok_det######### %s\n",__func__);
- tps65910_charge_ok = 1 ;
- return IRQ_HANDLED;
-}
-
-static irqreturn_t tps65910_gpio0_f_irq(int irq, void *irq_data)
-{
- //printk("#########chg_no_ok######### %s\n",__func__);
- tps65910_charge_ok = 0 ;
- return IRQ_HANDLED;
-}
-#endif
-
static int tps65910_i2c_probe(struct i2c_client *i2c,
const struct i2c_device_id *id)
{
if (ret < 0)
goto err;
- /************************* chg_ok det ******************/
- #if defined(CONFIG_MACH_RK2926_V86)
- if ( tps65910->irq_base) {
- ret = request_threaded_irq( tps65910->irq_base +
- TPS65910_IRQ_GPIO_R,
- NULL, tps65910_gpio0_r_irq, IRQF_TRIGGER_RISING,
- "chg_ok", tps65910);
- }
- if (ret < 0)
- printk( "chg_ok IRQ request failed: %d\n");
-
- if ( tps65910->irq_base) {
- ret = request_threaded_irq( tps65910->irq_base +
- TPS65910_IRQ_GPIO_F,
- NULL, tps65910_gpio0_f_irq, IRQF_TRIGGER_FALLING,
- "chg_no_ok", tps65910);
- }
- if (ret < 0)
- printk( "chg_ok IRQ request failed: %d\n");
- #endif
- /****************************************************/
-
if (pmic_plat_data && pmic_plat_data->post_init) {
ret = pmic_plat_data->post_init(tps65910);
if (ret != 0) {