From 5a6ed99264c704e517ac312283c58204ee38fee5 Mon Sep 17 00:00:00 2001 From: Paul Fertser Date: Sat, 13 Jun 2009 02:04:18 +0400 Subject: gta02: move debugging messages to the appropriate levels Clean up debugging messages so that we don't see any output with loglevel=4 (default for Qi). This avoids slowing down suspend/resume by slow fb output. Checkpatch barks on this patch but i guess most of that debugging would have to be changed prior to upstream submission anyway. Signed-off-by: Paul Fertser --- include/linux/resume-dependency.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/linux/resume-dependency.h b/include/linux/resume-dependency.h index 46cc1d1c6da..f84bf618205 100644 --- a/include/linux/resume-dependency.h +++ b/include/linux/resume-dependency.h @@ -38,7 +38,7 @@ struct resume_dependency { */ #define init_resume_dependency_list(_head) \ - printk(KERN_INFO "##### init_resume_dependency_list(head=%p)\n", (_head)); \ + printk(KERN_DEBUG "##### init_resume_dependency_list(head=%p)\n", (_head)); \ INIT_LIST_HEAD(&(_head)->list); @@ -52,13 +52,13 @@ struct resume_dependency { struct list_head *_pos, *_q; \ struct resume_dependency *_d; \ \ - printk(KERN_ERR "##### register_resume_dependency(head=%p, dep=%p)\n", (_head), (_dep)); \ + printk(KERN_DEBUG "##### register_resume_dependency(head=%p, dep=%p)\n", (_head), (_dep)); \ (_dep)->called_flag = 1; \ list_for_each_safe(_pos, _q, &((_head)->list)) { \ _d = list_entry(_pos, struct resume_dependency, list); \ if (_d == (_dep)) { \ list_del(_pos); \ - printk(KERN_ERR "##### duplicate dependency removed first\n"); \ + printk(KERN_DEBUG "##### duplicate dependency removed first\n"); \ } \ } \ list_add(&(_dep)->list, &(_head)->list); \ @@ -73,12 +73,12 @@ struct resume_dependency { struct list_head *_pos, *_q; \ struct resume_dependency *_dep; \ \ - printk(KERN_ERR "##### callback_all_resume_dependencies(head=%p)\n", (_head)); \ + printk(KERN_DEBUG "##### callback_all_resume_dependencies(head=%p)\n", (_head)); \ list_for_each_safe(_pos, _q, &((_head)->list)) { \ _dep = list_entry(_pos, struct resume_dependency, list); \ - printk(KERN_ERR "##### callback list entry (head=%p, dep=%p)\n", (_head), (_dep)); \ + printk(KERN_DEBUG "##### callback list entry (head=%p, dep=%p)\n", (_head), (_dep)); \ _dep->called_flag = 1; \ - printk(KERN_ERR "##### callback=%p(context=%p))\n", (_dep->callback),(_dep->context)); \ + printk(KERN_DEBUG "##### callback=%p(context=%p))\n", (_dep->callback),(_dep->context)); \ (_dep->callback)(_dep->context); \ list_del(_pos); \ } \ @@ -97,10 +97,10 @@ struct resume_dependency { struct list_head *_pos, *_q; \ struct resume_dependency *_dep; \ \ - printk(KERN_ERR "##### activate_all_resume_dependencies(head=%p)\n", (_head)); \ + printk(KERN_DEBUG "##### activate_all_resume_dependencies(head=%p)\n", (_head)); \ list_for_each_safe(_pos, _q, &((_head)->list)) { \ _dep = list_entry(_pos, struct resume_dependency, list); \ - printk(KERN_ERR "##### activating callback list entry (head=%p, dep=%p)\n", (_head), (_dep)); \ + printk(KERN_DEBUG "##### activating callback list entry (head=%p, dep=%p)\n", (_head), (_dep)); \ _dep->called_flag = 0; \ } \ } -- cgit v1.2.3 From 21658522b00d047212d7a78cb749648ff3bfeb04 Mon Sep 17 00:00:00 2001 From: Paul Fertser Date: Tue, 28 Jul 2009 00:41:15 +0400 Subject: pcf50633: use a dedicated workqueue for irq processing Using the default kernel "events" workqueue causes problems with synchronous adc readings if initiated from some task on the same workqueue. I had a deadlock trying to use pcf50633_adc_sync_read from a power_supply class driver because the reading was initiated from the workqueue and it waited for the irq processing to complete (to get the result) and that was put on the same workqueue. Signed-off-by: Paul Fertser --- include/linux/mfd/pcf50633/core.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/linux/mfd/pcf50633/core.h b/include/linux/mfd/pcf50633/core.h index af67b4e3ec6..aed1fabb068 100644 --- a/include/linux/mfd/pcf50633/core.h +++ b/include/linux/mfd/pcf50633/core.h @@ -138,6 +138,7 @@ struct pcf50633 { int irq; struct pcf50633_irq irq_handler[PCF50633_NUM_IRQ]; struct work_struct irq_work; + struct workqueue_struct *work_queue; struct mutex lock; u8 mask_regs[5]; -- cgit v1.2.3 From 1ff8185e1564c020b69eff3f222b5393f3b6c35b Mon Sep 17 00:00:00 2001 From: Paul Fertser Date: Tue, 28 Jul 2009 01:09:04 +0400 Subject: pcf50633: fix wrong define for 10bit ADC mode Signed-off-by: Paul Fertser --- include/linux/mfd/pcf50633/adc.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/mfd/pcf50633/adc.h b/include/linux/mfd/pcf50633/adc.h index 56669b4183a..b35e62801ff 100644 --- a/include/linux/mfd/pcf50633/adc.h +++ b/include/linux/mfd/pcf50633/adc.h @@ -25,7 +25,8 @@ #define PCF50633_REG_ADCS3 0x57 #define PCF50633_ADCC1_ADCSTART 0x01 -#define PCF50633_ADCC1_RES_10BIT 0x02 +#define PCF50633_ADCC1_RES_8BIT 0x02 +#define PCF50633_ADCC1_RES_10BIT 0x00 #define PCF50633_ADCC1_AVERAGE_NO 0x00 #define PCF50633_ADCC1_AVERAGE_4 0x04 #define PCF50633_ADCC1_AVERAGE_8 0x08 -- cgit v1.2.3 From c31a0fec70c7ab1f9d0a5846abb31b80274e6914 Mon Sep 17 00:00:00 2001 From: Paul Fertser Date: Wed, 29 Jul 2009 17:39:52 +0400 Subject: pcf50633: get rid of charging restart software auto-triggering After reaching Battery Full condition MBC state machine switches back into charging mode when the battery voltage falls below 96% of a battery float voltage. The voltage drop in Li-Ion batteries is marginal (1-2%) till about 80% of its capacity - which means, after a BATFULL, charging won't be restarted until 75-80%. That is a desired behaviour recommended by battery manufacturers, don't mess with it. Signed-off-by: Paul Fertser --- include/linux/mfd/pcf50633/core.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include') diff --git a/include/linux/mfd/pcf50633/core.h b/include/linux/mfd/pcf50633/core.h index aed1fabb068..c8125f2e99e 100644 --- a/include/linux/mfd/pcf50633/core.h +++ b/include/linux/mfd/pcf50633/core.h @@ -29,8 +29,6 @@ struct pcf50633_platform_data { char **batteries; int num_batteries; - int charging_restart_interval; - int chg_ref_current_ma; /* Callbacks */ -- cgit v1.2.3 From 53bbb82febf74555ee737998d761b7d8e6b1317e Mon Sep 17 00:00:00 2001 From: Paul Fertser Date: Wed, 29 Jul 2009 18:24:39 +0400 Subject: pcf50633: query charger status directly Current scheme is fragile and is likely to go off sync, especially on batfull->adapter charging automatic MBC transition. Query the status bit every time we need it instead. We need to export another function to query for USB presence because we can't read anything from PCF50633 (via I2C) inside irq context and that is needed by usb gadgets. Signed-off-by: Paul Fertser --- include/linux/mfd/pcf50633/mbc.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/linux/mfd/pcf50633/mbc.h b/include/linux/mfd/pcf50633/mbc.h index 747725b0cd0..e6328a664b3 100644 --- a/include/linux/mfd/pcf50633/mbc.h +++ b/include/linux/mfd/pcf50633/mbc.h @@ -128,5 +128,6 @@ enum pcf50633_reg_mbcs3 { int pcf50633_mbc_usb_curlim_set(struct pcf50633 *pcf, int ma); int pcf50633_mbc_get_status(struct pcf50633 *); +int pcf50633_mbc_get_usb_online_status(struct pcf50633 *); #endif -- cgit v1.2.3