{\r
#ifdef CONFIG_BATTERY_RK30_ADC_FAC\r
if (gpio_get_value (rk30_adc_battery_platdata.dc_det_pin) == rk30_adc_battery_platdata.dc_det_level)//if(act8931_charge_det)\r
- #endif\r
- arm_pm_restart(0, NULL);\r
+ arm_pm_restart(0, NULL);\r
+ #endif\r
+ act8931_device_shutdown();\r
}\r
#endif\r
\r
#endif
#define PM_CONTROL
+struct act8931 *g_act8931;
+
struct act8931 {
unsigned int irq;
struct device *dev;
return err;
}
+int act8931_device_shutdown(void)
+{
+ int ret;
+ int err = -1;
+ struct act8931 *act8931 = g_act8931;
+
+ printk("%s\n",__func__);
+
+ ret = act8931_reg_read(act8931,0x01);
+ ret = act8931_set_bits(act8931, 0x01,(0x1<<5) |(0x3<<0),(0x1<<5) | (0x3<<0));
+ if (ret < 0) {
+ printk("act8931 set 0x00 error!\n");
+ return err;
+ }
+ return 0;
+}
+EXPORT_SYMBOL_GPL(act8931_device_shutdown);
+
+
static irqreturn_t act8931_irq_thread(unsigned int irq, void *dev_id)
{
struct act8931 *act8931 = (struct act8931 *)dev_id;
goto err;
} else
dev_warn(act8931->dev, "No platform init data supplied\n");
+
+ ret = act8931_reg_read(act8931,0x01);
+ if (ret < 0)
+ goto err;
+ ret = act8931_set_bits(act8931, 0x01,(0x1<<0),(0x1<<0));
+ if (ret < 0) {
+ printk("act8931 set 0x01 error!\n");
+ goto err;
+ }
+
+ g_act8931 = act8931;
pdata->set_init(act8931);