From: <cri...@us...> - 2006-10-23 19:39:10
|
Revision: 643 http://svn.sourceforge.net/hackndev/?rev=643&view=rev Author: cristianop Date: 2006-10-23 12:38:29 -0700 (Mon, 23 Oct 2006) Log Message: ----------- palmtx: check also usb detect gpio to determine battery status Modified Paths: -------------- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmld_ac97.c Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmld_ac97.c =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmld_ac97.c 2006-10-23 15:52:20 UTC (rev 642) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmld_ac97.c 2006-10-23 19:38:29 UTC (rev 643) @@ -283,7 +283,7 @@ void palmld_battery_read_adc(int force) { - u16 reading; + u16 vread; if(!force && ((last_battery_update + 10 *HZ) > jiffies)) return; @@ -293,18 +293,18 @@ down(&digitiser_sem); wm97xx_set_digitiser_power(WM97XX_PRP_DET_DIG); - // todo: check if reading is valid - reading = palmld_ac97_take_reading(WM97XX_ADCSEL_BMON); + vread = palmld_ac97_take_reading(WM97XX_ADCSEL_BMON); wm97xx_set_digitiser_power(WM97XX_PRP_DET); up(&digitiser_sem); + previous_voltage = current_voltage; - current_voltage = reading & 0xfff; - //printk("wm9712: battery -> %d\n", battery_voltage); + current_voltage = vread & 0xfff; last_battery_update = jiffies; up(&battery_update_mutex); } + int palmld_battery_min_voltage(struct battery *b) { return PALMTX_BAT_MIN_VOLTAGE; @@ -317,7 +317,6 @@ } - // let's suppose AVDD=+3.3v so battV = intV * 3 * 0.80586 // note: 0.80586 = 3.3/4095 int palmld_battery_get_voltage(struct battery *b) @@ -327,7 +326,7 @@ return current_voltage * 3 * 80586 / 100000; } else{ - printk("palmld_battery: cannot get voltage -> battery driver unuregistered\n"); + printk("palmld_battery: cannot get voltage -> battery driver unregistered\n"); return 0; } } @@ -335,14 +334,13 @@ int palmld_battery_get_status(struct battery *b) { - int ac_connected = 0; + int ac_connected = GET_GPIO(GPIO_NR_PALMTX_POWER_DETECT); + int usb_connected = !GET_GPIO(GPIO_NR_PALMTX_USB_DETECT); - ac_connected = GET_GPIO(GPIO_NR_PALMTX_POWER_DETECT); - if (current_voltage <= 0) return BATTERY_STATUS_UNKNOWN; - if (ac_connected){ + if (ac_connected || usb_connected){ // TODO: ok maybe this is too stupid ... to be reviewed if ( ( current_voltage > previous_voltage ) || (current_voltage <= PALMTX_BAT_MAX_VOLTAGE) ) return BATTERY_STATUS_CHARGING; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bob...@us...> - 2006-11-17 08:44:33
|
Revision: 677 http://svn.sourceforge.net/hackndev/?rev=677&view=rev Author: bobofdoom Date: 2006-11-17 00:44:32 -0800 (Fri, 17 Nov 2006) Log Message: ----------- l4p: include/asm-arm/arch-pxa/palmld-ac97 removed in favour of sound/arm/wm9712.h Modified Paths: -------------- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmld_ac97.c Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmld_ac97.c =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmld_ac97.c 2006-11-17 08:43:31 UTC (rev 676) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmld_ac97.c 2006-11-17 08:44:32 UTC (rev 677) @@ -32,10 +32,10 @@ #include <sound/pcm.h> #include <sound/initval.h> #include <sound/ac97_codec.h> +#include <sound/wm9712.h> #include <asm/arch/palmtx-gpio.h> #include <asm/arch/palmtx-init.h> -#include <asm/arch/palmld-ac97.h> #define X_AXIS_MAX 3900 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bob...@us...> - 2006-12-01 23:15:24
|
Revision: 687 http://svn.sourceforge.net/hackndev/?rev=687&view=rev Author: bobofdoom Date: 2006-12-01 15:14:57 -0800 (Fri, 01 Dec 2006) Log Message: ----------- palmtx: WM9712 GPIOs should be configured as outputs not inputs. This was working previously due to an error in the header constants. Modified Paths: -------------- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmld_ac97.c Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmld_ac97.c =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmld_ac97.c 2006-11-29 00:33:59 UTC (rev 686) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmld_ac97.c 2006-12-01 23:14:57 UTC (rev 687) @@ -392,12 +392,12 @@ ac97->bus->ops->write(ac97, AC97_WM97XX_DIGITISER2, d2base); /* enable interrupts on codec's gpio 2 (connected to cpu gpio 27) */ - wm97xx_gpio_mode(WM97XX_GPIO_2, WM97XX_GPIO_IN, WM97XX_GPIO_POL_HIGH, + wm97xx_gpio_mode(WM97XX_GPIO_2, WM97XX_GPIO_OUT, WM97XX_GPIO_POL_HIGH, WM97XX_GPIO_NOTSTICKY, WM97XX_GPIO_NOWAKE); wm97xx_gpio_func(WM97XX_GPIO_2, 0); /* enable pen detect interrupt */ - wm97xx_gpio_mode(WM97XX_GPIO_13, WM97XX_GPIO_IN, WM97XX_GPIO_POL_HIGH, + wm97xx_gpio_mode(WM97XX_GPIO_13, WM97XX_GPIO_OUT, WM97XX_GPIO_POL_HIGH, WM97XX_GPIO_STICKY, WM97XX_GPIO_WAKE); /* turn off irq gpio inverting */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2007-02-18 12:21:52
|
Revision: 845 http://svn.sourceforge.net/hackndev/?rev=845&view=rev Author: marex_z71 Date: 2007-02-18 04:21:49 -0800 (Sun, 18 Feb 2007) Log Message: ----------- PalmTX: fix palmld_ac97.c Modified Paths: -------------- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmld_ac97.c Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmld_ac97.c =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmld_ac97.c 2007-02-18 12:12:13 UTC (rev 844) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmld_ac97.c 2007-02-18 12:21:49 UTC (rev 845) @@ -17,6 +17,7 @@ #include <linux/device.h> #include <linux/workqueue.h> #include <linux/battery.h> +#include <linux/irq.h> #include <asm/apm.h> #include <asm/delay.h> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2007-02-18 12:30:08
|
Revision: 846 http://svn.sourceforge.net/hackndev/?rev=846&view=rev Author: marex_z71 Date: 2007-02-18 04:30:02 -0800 (Sun, 18 Feb 2007) Log Message: ----------- PalmTX: yet another small fix Modified Paths: -------------- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmld_ac97.c Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmld_ac97.c =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmld_ac97.c 2007-02-18 12:21:49 UTC (rev 845) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmld_ac97.c 2007-02-18 12:30:02 UTC (rev 846) @@ -437,7 +437,7 @@ /* setup work queue */ palmld_ac97_workqueue = create_workqueue(palmld_ac97_WORK_QUEUE_NAME); - INIT_WORK(&palmld_ac97_irq_task, palmld_ac97_irq_work, dev); + INIT_WORK(&palmld_ac97_irq_task, palmld_ac97_irq_work); up(&queue_sem); return 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |