You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(26) |
Sep
(22) |
Oct
(55) |
Nov
(24) |
Dec
(30) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
(68) |
Feb
(85) |
Mar
(54) |
Apr
(12) |
May
(52) |
Jun
(75) |
Jul
(116) |
Aug
(71) |
Sep
(54) |
Oct
|
Nov
(2) |
Dec
|
|
From: <z7...@us...> - 2007-11-05 12:28:22
|
Revision: 1350
http://hackndev.svn.sourceforge.net/hackndev/?rev=1350&view=rev
Author: z72ka
Date: 2007-11-05 04:28:17 -0800 (Mon, 05 Nov 2007)
Log Message:
-----------
palmz72: MMC_POWER GPIO found and used for pxamci .setpower function -> extended battery life in suspend
Modified Paths:
--------------
linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/gpio_map.txt
linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72.c
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/gpio_map.txt
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/gpio_map.txt 2007-11-05 12:26:26 UTC (rev 1349)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/gpio_map.txt 2007-11-05 12:28:17 UTC (rev 1350)
@@ -97,7 +97,7 @@
GPIO_95 0 O 00 USB_POWER
GPIO_96 1 O 00 LCD_POWER (LCD OFF when 0)
GPIO_97 0 I 03 KP_MKIN3
-GPIO_98 1 O 00
+GPIO_98 0 O 00 MMC_SETPOWER (MMC OFF when 1)
GPIO_99 1 I 00
GPIO100 0 I 01 KP_MKIN0
GPIO101 0 I 01 KP_MKIN1
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72.c
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72.c 2007-11-05 12:26:26 UTC (rev 1349)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72.c 2007-11-05 12:28:17 UTC (rev 1350)
@@ -85,10 +85,25 @@
free_irq(IRQ_GPIO_PALMZ72_SD_DETECT_N, data);
}
+static void palmz72_mci_setpower(struct device *dev, unsigned int vdd)
+{
+ struct pxamci_platform_data* p_d = dev->platform_data;
+
+ if (( 1 << vdd) & p_d->ocr_mask)
+ {
+ SET_GPIO(GPIO_NR_PALMZ72_MMC_POWER, 0);
+ }
+ else
+ {
+ SET_GPIO(GPIO_NR_PALMZ72_MMC_POWER, 1);
+ }
+}
+
+
static struct pxamci_platform_data palmz72_mci_platform_data = {
.ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
.init = palmz72_mci_init,
- /* .setpower = palmz72_mci_setpower, */
+ .setpower = palmz72_mci_setpower,
.exit = palmz72_mci_exit,
};
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <z7...@us...> - 2007-11-05 12:26:30
|
Revision: 1349
http://hackndev.svn.sourceforge.net/hackndev/?rev=1349&view=rev
Author: z72ka
Date: 2007-11-05 04:26:26 -0800 (Mon, 05 Nov 2007)
Log Message:
-----------
palmz72: Include new MMC_POWER GPIO
Modified Paths:
--------------
linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmz72-gpio.h
Modified: linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmz72-gpio.h
===================================================================
--- linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmz72-gpio.h 2007-09-27 13:25:21 UTC (rev 1348)
+++ linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmz72-gpio.h 2007-11-05 12:26:26 UTC (rev 1349)
@@ -83,7 +83,8 @@
/* SD/MMC */
#define GPIO_NR_PALMZ72_SD_DETECT_N 14
-#define IRQ_GPIO_PALMZ72_SD_DETECT_N IRQ_GPIO(GPIO_NR_PALMZ72_SD_DETECT_N)
+#define IRQ_GPIO_PALMZ72_SD_DETECT_N IRQ_GPIO(GPIO_NR_PALMZ72_SD_DETECT_N)
+#define GPIO_NR_PALMZ72_MMC_POWER 98
/* Backlight */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mar...@us...> - 2007-09-27 13:26:09
|
Revision: 1348
http://hackndev.svn.sourceforge.net/hackndev/?rev=1348&view=rev
Author: marex_z71
Date: 2007-09-27 06:25:21 -0700 (Thu, 27 Sep 2007)
Log Message:
-----------
PalmLD: migrate to new battery driver, thanks |miska|
Modified Paths:
--------------
linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/Kconfig
linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/Makefile
linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld.c
linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmld-gpio.h
Removed Paths:
-------------
linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld_battery.c
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/Kconfig
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/Kconfig 2007-09-27 13:12:35 UTC (rev 1347)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/Kconfig 2007-09-27 13:25:21 UTC (rev 1348)
@@ -18,16 +18,6 @@
tristate "Palm LifeDrive IDE driver"
depends on MACH_XSCALE_PALMLD
-config PALMLD_BATTERY
- tristate "Palm LifeDrive Battery support"
- select TOUCHSCREEN_WM97XX
- select POWER_SUPPLY
- depends on MACH_XSCALE_PALMLD
- default m
- help
- Enable support for PalmOne LifeDrive battery to APM.
- ATM use it only as module, otherwise it hangs.
-
config PALMLD_PM
tristate "Palm LifeDrive Power Management support"
depends on MACH_XSCALE_PALMLD
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/Makefile
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/Makefile 2007-09-27 13:12:35 UTC (rev 1347)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/Makefile 2007-09-27 13:25:21 UTC (rev 1348)
@@ -6,4 +6,3 @@
obj-$(CONFIG_PALMLD_PCMCIA) += palmld_pcmcia.o
obj-$(CONFIG_PALMLD_IDE) += palmld_ide.o
obj-$(CONFIG_PALMLD_PM) += palmld_pm.o
-obj-$(CONFIG_PALMLD_BATTERY) += palmld_battery.o
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld.c
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld.c 2007-09-27 13:12:35 UTC (rev 1347)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld.c 2007-09-27 13:25:21 UTC (rev 1348)
@@ -35,6 +35,7 @@
#include <asm/arch/pxa-pm_ll.h>
#include <asm/arch/serial.h>
#include <asm/arch/palmlcd-border.h>
+#include <asm/arch/palm-battery.h>
#include <sound/driver.h>
#include <sound/core.h>
@@ -224,6 +225,26 @@
};
/*********************************************************
+ * Battery
+ *********************************************************/
+
+int palmld_ac_is_connected (void){
+ /* when charger is plugged in and USB is not connected,
+ then status is ONLINE */
+ return ((GET_PALMLD_GPIO(POWER_DETECT)) &&
+ !(GET_PALMLD_GPIO(USB_DETECT_N)));
+}
+
+static struct palm_battery_data palm_battery_info = {
+ .bat_min_voltage = PALMLD_BAT_MIN_VOLTAGE,
+ .bat_max_voltage = PALMLD_BAT_MAX_VOLTAGE,
+ .bat_max_life_mins = PALMLD_MAX_LIFE_MINS,
+ .ac_connected = &palmld_ac_is_connected,
+};
+
+EXPORT_SYMBOL_GPL(palm_battery_info);
+
+/*********************************************************
* Backlight
*********************************************************/
Deleted: linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld_battery.c
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld_battery.c 2007-09-27 13:12:35 UTC (rev 1347)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld_battery.c 2007-09-27 13:25:21 UTC (rev 1348)
@@ -1,278 +0,0 @@
-/************************************************************************
- * linux/arch/arm/mach-pxa/palmld/palmld_battery.c *
- * *
- * Touchscreen/battery driver for WM9712 AC97 codec *
- * Authros: Jan Herman <2h...@se...> *
- * Sergey Lapin <sl...@ha...> *
- * Changes for PalmLD: Marek Vasut <mar...@gm...> *
- * *
- ************************************************************************/
-
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/init.h>
-#include <linux/interrupt.h>
-#include <linux/input.h>
-#include <linux/device.h>
-#include <linux/workqueue.h>
-#include <linux/power_supply.h>
-#include <linux/apm-emulation.h>
-#include <linux/wm97xx.h>
-
-#include <asm/delay.h>
-#include <asm/mach-types.h>
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-#include <asm/arch/hardware.h>
-#include <asm/arch/pxa-regs.h>
-#include <asm/arch/irqs.h>
-#include <asm/arch/palmld-gpio.h>
-#include <asm/arch/palmld-init.h>
-
-#include <sound/driver.h>
-#include <sound/core.h>
-#include <sound/pcm.h>
-#include <sound/initval.h>
-
-struct palmld_battery_dev
-{
- struct wm97xx *wm;
- int battery_registered;
- int current_voltage;
- int previous_voltage;
- u32 last_battery_update;
-};
-
-struct palmld_battery_dev bat;
-
-#if defined(CONFIG_APM_EMULATION) || defined(CONFIG_APM_MODULE)
-/* original APM hook */
-static void (*apm_get_power_status_orig)(struct apm_power_info *info);
-#endif
-
-int palmld_battery_min_voltage(struct power_supply *b)
-{
- return PALMLD_BAT_MIN_VOLTAGE;
-}
-
-
-int palmld_battery_max_voltage(struct power_supply *b)
-{
- return PALMLD_BAT_MAX_VOLTAGE; /* mV */
-}
-
-/*
- This formula is based on battery life of my battery 1100mAh. Original battery in Zire72 is Li-On 920mAh
- V_batt = ADCSEL_BMON * 1,889 + 767,8 [mV]
-*/
-
-int palmld_battery_get_voltage(struct power_supply *b)
-{
- if (bat.battery_registered) {
- bat.previous_voltage = bat.current_voltage;
- bat.current_voltage = wm97xx_read_aux_adc(bat.wm, WM97XX_AUX_ID3);
- bat.last_battery_update = jiffies;
- return bat.current_voltage * 1889/1000 + 7678/10;
- }
-
- printk("palmld_battery: cannot get voltage -> battery driver unregistered\n");
- return 0;
-}
-
-int palmld_battery_get_capacity(struct power_supply *b)
-{
- if (bat.battery_registered)
- return (((palmld_battery_get_voltage(b)-palmld_battery_min_voltage(b))/
- (palmld_battery_max_voltage(b)-palmld_battery_min_voltage(b)))*100);
-
- printk("palmld_battery: cannot get capacity -> battery driver unregistered\n");
- return 0;
-}
-
-int palmld_battery_get_status(struct power_supply *b)
-{
- int ac_connected = GET_PALMLD_GPIO(POWER_DETECT);
- int usb_connected = !GET_PALMLD_GPIO(USB_DETECT);
-
- if ( (ac_connected || usb_connected) &&
- ( ( bat.current_voltage > bat.previous_voltage ) ||
- (bat.current_voltage <= PALMLD_BAT_MAX_VOLTAGE) ) )
- return POWER_SUPPLY_STATUS_CHARGING;
- else
- return POWER_SUPPLY_STATUS_NOT_CHARGING;
-}
-
-static int palmld_battery_get_property(struct power_supply *b,
- enum power_supply_property psp,
- union power_supply_propval *val)
-{
- switch (psp) {
- case POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN:
- val->intval = palmld_battery_max_voltage(b);
- break;
- case POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN:
- val->intval = palmld_battery_min_voltage(b);
- break;
- case POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN:
- val->intval = 100;
- break;
- case POWER_SUPPLY_PROP_CHARGE_EMPTY_DESIGN:
- val->intval = 0;
- break;
- case POWER_SUPPLY_PROP_CHARGE_NOW:
- val->intval = palmld_battery_get_capacity(b);
- break;
- case POWER_SUPPLY_PROP_VOLTAGE_NOW:
- val->intval = palmld_battery_get_voltage(b);
- break;
- case POWER_SUPPLY_PROP_STATUS:
- val->intval = palmld_battery_get_status(b);
- break;
- default:
- break;
- };
-
- return 0;
-}
-
-static enum power_supply_property palmld_battery_props[] = {
- POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN,
- POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN,
- POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN,
- POWER_SUPPLY_PROP_CHARGE_EMPTY_DESIGN,
- POWER_SUPPLY_PROP_CHARGE_NOW,
- POWER_SUPPLY_PROP_VOLTAGE_NOW,
- POWER_SUPPLY_PROP_STATUS,
-};
-
-struct power_supply palmld_battery = {
- .name = "palmld_battery",
- .get_property = palmld_battery_get_property,
- .properties = palmld_battery_props,
- .num_properties = ARRAY_SIZE(palmld_battery_props),
-};
-
-static int palmld_wm97xx_probe(struct device *dev)
-{
- struct wm97xx *wm = dev->driver_data;
- bat.wm = wm;
- return 0;
-}
-
-static int palmld_wm97xx_remove(struct device *dev)
-{
- return 0;
-}
-
-static void
-palmld_wm97xx_shutdown(struct device *dev)
-{
-#if defined(CONFIG_APM_EMULATION) || defined(CONFIG_APM_MODULE)
- apm_get_power_status = apm_get_power_status_orig;
-#endif
-}
-
-static int
-palmld_wm97xx_suspend(struct device *dev, pm_message_t state)
-{
- return 0;
-}
-
-static int
-palmld_wm97xx_resume(struct device *dev)
-{
- return 0;
-}
-
-
-static struct device_driver palmld_wm97xx_driver = {
- .name = "wm97xx-touchscreen",
- .bus = &wm97xx_bus_type,
- .owner = THIS_MODULE,
- .probe = palmld_wm97xx_probe,
- .remove = palmld_wm97xx_remove,
- .suspend = palmld_wm97xx_suspend,
- .resume = palmld_wm97xx_resume,
- .shutdown = palmld_wm97xx_shutdown
-};
-
-#if defined(CONFIG_APM_EMULATION) || defined(CONFIG_APM_MODULE)
-
-/* APM status query callback implementation */
-static void palmld_apm_get_power_status(struct apm_power_info *info)
-{
- int min, max, curr, percent;
-
- curr = palmld_battery_get_voltage(&palmld_battery);
- min = palmld_battery_min_voltage(&palmld_battery);
- max = palmld_battery_max_voltage(&palmld_battery);
-
- curr = curr - min;
- if (curr < 0) curr = 0;
- max = max - min;
-
- percent = curr*100/max;
-
- info->battery_life = percent;
-
- info->ac_line_status = (GET_PALMLD_GPIO(POWER_DETECT)
- ? APM_AC_ONLINE : APM_AC_OFFLINE);
-
- if (info->ac_line_status) {
- info->battery_status = APM_BATTERY_STATUS_CHARGING;
- } else {
- if (percent > 50)
- info->battery_status = APM_BATTERY_STATUS_HIGH;
- else if (percent < 5)
- info->battery_status = APM_BATTERY_STATUS_CRITICAL;
- else
- info->battery_status = APM_BATTERY_STATUS_LOW;
- }
-
- info->time = percent * PALMLD_MAX_LIFE_MINS/100;
- info->units = APM_UNITS_MINS;
-}
-#endif
-static int __init palmld_wm97xx_init(void)
-{
-#ifndef MODULE
- int ret;
-#endif
-
- /* register battery to APM layer */
- bat.battery_registered = 0;
- if(power_supply_register(NULL, &palmld_battery))
- printk(KERN_ERR "palmld_ac97_probe: could not register battery class\n");
- else {
- bat.battery_registered = 1;
- printk("Battery registered\n");
- }
-#if defined(CONFIG_APM_EMULATION) || defined(CONFIG_APM_MODULE)
- apm_get_power_status_orig = apm_get_power_status;
- apm_get_power_status = palmld_apm_get_power_status;
-#endif
-#ifndef MODULE
- /* If we're in kernel, we could accidentally be run before wm97xx
- and thus have panic */
- if((ret = bus_register(&wm97xx_bus_type)) < 0)
- return ret;
-#endif
- return driver_register(&palmld_wm97xx_driver);
-}
-
-static void __exit palmld_wm97xx_exit(void)
-{
-/* TODO - recover APM callback to original state */
- power_supply_unregister(&palmld_battery);
- driver_unregister(&palmld_wm97xx_driver);
-}
-
-module_init(palmld_wm97xx_init);
-module_exit(palmld_wm97xx_exit);
-
-/* Module information */
-MODULE_AUTHOR("Sergey Lapin <sl...@ha...> Jan Herman <2h...@se...>"
- "Marek Vasut <mar...@gm...");
-MODULE_DESCRIPTION("wm97xx battery driver");
-MODULE_LICENSE("GPL");
Modified: linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmld-gpio.h
===================================================================
--- linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmld-gpio.h 2007-09-27 13:12:35 UTC (rev 1347)
+++ linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmld-gpio.h 2007-09-27 13:25:21 UTC (rev 1348)
@@ -77,7 +77,7 @@
#define IRQ_GPIO_PALMLD_IDE_IRQ IRQ_GPIO(GPIO_NR_PALMLD_IDE_IRQ)
/* USB */
-#define GPIO_NR_PALMLD_USB_DETECT 3
+#define GPIO_NR_PALMLD_USB_DETECT_N 3
#define GPIO_NR_PALMLD_USB_READY 86
#define GPIO_NR_PALMLD_USB_RESET 88
#define GPIO_NR_PALMLD_USB_INT 106
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <z7...@us...> - 2007-09-27 13:12:39
|
Revision: 1347
http://hackndev.svn.sourceforge.net/hackndev/?rev=1347&view=rev
Author: z72ka
Date: 2007-09-27 06:12:35 -0700 (Thu, 27 Sep 2007)
Log Message:
-----------
palmz72: removed old palmz72_battery driver
Removed Paths:
-------------
linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_battery.c
Deleted: linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_battery.c
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_battery.c 2007-09-27 13:02:11 UTC (rev 1346)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_battery.c 2007-09-27 13:12:35 UTC (rev 1347)
@@ -1,298 +0,0 @@
-/************************************************************************
- * linux/arch/arm/mach-pxa/palmz72/palmz72_battery.c *
- * *
- * Touchscreen/battery driver for Palm Zire 72 WM9712 AC97 codec *
- * Authos: Jan Herman <2h...@se...> *
- * Sergey Lapin <sl...@ha...> *
- * *
- ************************************************************************/
-
-
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/init.h>
-#include <linux/interrupt.h>
-#include <linux/input.h>
-#include <linux/device.h>
-#include <linux/workqueue.h>
-#include <linux/power_supply.h>
-#include <linux/apm-emulation.h>
-#include <linux/wm97xx.h>
-
-#include <asm/delay.h>
-#include <asm/mach-types.h>
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-#include <asm/arch/hardware.h>
-#include <asm/arch/pxa-regs.h>
-#include <asm/arch/irqs.h>
-#include <asm/arch/palmz72-gpio.h>
-#include <asm/arch/palmz72-init.h>
-
-#include <sound/driver.h>
-#include <sound/core.h>
-#include <sound/pcm.h>
-#include <sound/initval.h>
-#include <linux/wm97xx.h>
-#include <asm/arch/palmz72-gpio.h>
-#include <asm/arch/palmz72-init.h>
-
-
-struct palmz72_battery_dev
-{
- struct wm97xx * wm;
- int battery_registered;
- int current_voltage;
- int previous_voltage;
- u32 last_battery_update;
-};
-
-struct palmz72_battery_dev bat;
-
-#if defined(CONFIG_APM_EMULATION) || defined(CONFIG_APM_MODULE)
-/* original APM hook */
-static void (*apm_get_power_status_orig)(struct apm_power_info *info);
-#endif
-
-int palmz72_battery_min_voltage(struct power_supply *b)
-{
- return PALMZ72_BAT_MIN_VOLTAGE;
-}
-
-
-int palmz72_battery_max_voltage(struct power_supply *b)
-{
- return PALMZ72_BAT_MAX_VOLTAGE; /* mV */
-}
-
-/*
- This formula is based on battery life of my battery 1100mAh. Original battery in Zire72 is Li-On 920mAh
- V_batt = ADCSEL_BMON * 1,889 + 767,8 [mV]
-*/
-
-int palmz72_battery_get_voltage(struct power_supply *b)
-{
- if (bat.battery_registered){
- bat.previous_voltage = bat.current_voltage;
- bat.current_voltage = wm97xx_read_aux_adc(bat.wm, WM97XX_AUX_ID3);
- bat.last_battery_update = jiffies;
- return bat.current_voltage * 1889/1000 + 7678/10;
- }
- else{
- printk("palmz72_battery: cannot get voltage -> battery driver unregistered\n");
- return 0;
- }
-}
-
-int palmz72_battery_get_capacity(struct power_supply *b)
-{
- if (bat.battery_registered){
- return (((palmz72_battery_get_voltage(b)-palmz72_battery_min_voltage(b))
- /(palmz72_battery_max_voltage(b)-palmz72_battery_min_voltage(b)))*100);
- }
- else{
- printk("palmz72_battery: cannot get capacity -> battery driver unregistered\n");
- return 0;
- }
-}
-
-int palmz72_battery_get_status(struct power_supply *b)
-{
- int ac_connected = GET_PALMZ72_GPIO(POWER_DETECT);
- int usb_connected = !GET_PALMZ72_GPIO(USB_DETECT);
-
- if ( (ac_connected || usb_connected) &&
- ( ( bat.current_voltage > bat.previous_voltage ) ||
- (bat.current_voltage <= PALMZ72_BAT_MAX_VOLTAGE) ) )
- return POWER_SUPPLY_STATUS_CHARGING;
- else
- return POWER_SUPPLY_STATUS_NOT_CHARGING;
-}
-
-int tmp;
-
-static int palmz72_battery_get_property(struct power_supply *b,
- enum power_supply_property psp,
- union power_supply_propval *val)
-{
- switch (psp) {
- case POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN:
- val->intval = palmz72_battery_max_voltage(b);
- break;
- case POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN:
- val->intval = palmz72_battery_min_voltage(b);
- break;
- case POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN:
- val->intval = 100;
- break;
- case POWER_SUPPLY_PROP_CHARGE_EMPTY_DESIGN:
- val->intval = 0;
- break;
- case POWER_SUPPLY_PROP_CHARGE_NOW:
- val->intval = palmz72_battery_get_capacity(b);
- break;
- case POWER_SUPPLY_PROP_VOLTAGE_NOW:
- val->intval = palmz72_battery_get_voltage(b);
- break;
- case POWER_SUPPLY_PROP_STATUS:
- val->intval = palmz72_battery_get_status(b);
- break;
- default:
- break;
- };
-
- return 0;
-}
-
-static enum power_supply_property palmz72_battery_props[] = {
- POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN,
- POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN,
- POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN,
- POWER_SUPPLY_PROP_CHARGE_EMPTY_DESIGN,
- POWER_SUPPLY_PROP_CHARGE_NOW,
- POWER_SUPPLY_PROP_VOLTAGE_NOW,
- POWER_SUPPLY_PROP_STATUS,
-};
-
-struct power_supply palmz72_battery = {
- .name = "palmz72_battery",
- .get_property = palmz72_battery_get_property,
- .properties = palmz72_battery_props,
- .num_properties = ARRAY_SIZE(palmz72_battery_props),
-};
-
-static int palmz72_wm97xx_probe(struct device *dev)
-{
- struct wm97xx *wm = dev->driver_data;
- bat.wm = wm;
- return 0;
-}
-
-static int palmz72_wm97xx_remove(struct device *dev)
-{
- return 0;
-}
-
-static void
-palmz72_wm97xx_shutdown(struct device *dev)
-{
-#if defined(CONFIG_APM_EMULATION) || defined(CONFIG_APM_MODULE)
- apm_get_power_status = apm_get_power_status_orig;
-#endif
-}
-
-static int
-palmz72_wm97xx_suspend(struct device *dev, pm_message_t state)
-{
- return 0;
-}
-
-static int
-palmz72_wm97xx_resume(struct device *dev)
-{
- return 0;
-}
-
-
-static struct device_driver palmz72_wm97xx_driver = {
- .name = "wm97xx-touchscreen",
- .bus = &wm97xx_bus_type,
- .owner = THIS_MODULE,
- .probe = palmz72_wm97xx_probe,
- .remove = palmz72_wm97xx_remove,
- .suspend = palmz72_wm97xx_suspend,
- .resume = palmz72_wm97xx_resume,
- .shutdown = palmz72_wm97xx_shutdown
-};
-
-static int palmz72_ac_is_connected (void){
- /* when charger is plugged in and USB is not connected, then status is ONLINE */
- int ret = (!(GET_GPIO(GPIO_NR_PALMZ72_USB_PULLUP)) && !(GET_GPIO(GPIO_NR_PALMZ72_USB_DETECT)));;
- if (ret)
- ret = 1;
- else
- ret = 0;
-
- return ret;
-}
-
-#if defined(CONFIG_APM_EMULATION) || defined(CONFIG_APM_MODULE)
-
-/* APM status query callback implementation */
-static void palmz72_apm_get_power_status(struct apm_power_info *info)
-{
- int min, max, curr, percent;
-
- curr = palmz72_battery_get_voltage(&palmz72_battery);
- min = palmz72_battery_min_voltage(&palmz72_battery);
- max = palmz72_battery_max_voltage(&palmz72_battery);
-
- curr = curr - min;
- if (curr < 0) curr = 0;
- max = max - min;
-
- percent = curr*100/max;
-
- info->battery_life = percent;
-
- info->ac_line_status = palmz72_ac_is_connected() ? APM_AC_ONLINE : APM_AC_OFFLINE;
-
- if (info->ac_line_status) {
- info->battery_status = APM_BATTERY_STATUS_CHARGING;
- } else {
- if (percent > 50)
- info->battery_status = APM_BATTERY_STATUS_HIGH;
- else if (percent < 5)
- info->battery_status = APM_BATTERY_STATUS_CRITICAL;
- else
- info->battery_status = APM_BATTERY_STATUS_LOW;
- }
-
- info->time = percent * PALMZ72_MAX_LIFE_MINS/100;
- info->units = APM_UNITS_MINS;
-}
-#endif
-static int __init palmz72_wm97xx_init(void)
-{
-#ifndef MODULE
- int ret;
-#endif
-
- /* register battery to APM layer */
- bat.battery_registered = 0;
-
- if(power_supply_register(NULL, &palmz72_battery)) {
- printk(KERN_ERR "palmz72_ac97_probe: could not register battery class\n");
- }
- else {
- bat.battery_registered = 1;
- printk("Battery registered\n");
- }
-#if defined(CONFIG_APM_EMULATION) || defined(CONFIG_APM_MODULE)
- apm_get_power_status_orig = apm_get_power_status;
- apm_get_power_status = palmz72_apm_get_power_status;
-#endif
-#ifndef MODULE
- /* If we're in kernel, we could accidentally be run before wm97xx
- and thus have panic */
- if((ret = bus_register(&wm97xx_bus_type)) < 0)
- return ret;
-#endif
- return driver_register(&palmz72_wm97xx_driver);
-}
-
-static void __exit palmz72_wm97xx_exit(void)
-{
-/* TODO - recover APM callback to original state */
- power_supply_unregister(&palmz72_battery);
- driver_unregister(&palmz72_wm97xx_driver);
-}
-
-module_init(palmz72_wm97xx_init);
-module_exit(palmz72_wm97xx_exit);
-
-/* Module information */
-MODULE_AUTHOR("Sergey Lapin <sl...@ha...> Jan Herman <2h...@se...>");
-MODULE_DESCRIPTION("wm97xx battery driver for Palm Zire 72");
-MODULE_LICENSE("GPL");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <z7...@us...> - 2007-09-27 13:02:16
|
Revision: 1346
http://hackndev.svn.sourceforge.net/hackndev/?rev=1346&view=rev
Author: z72ka
Date: 2007-09-27 06:02:11 -0700 (Thu, 27 Sep 2007)
Log Message:
-----------
palmz72: migrate to universal palm_battery driver
palm_battery.h: fixed compilation warning
palmz72: updated defconfig to new palm battery driver, added userinput support, pxaficp as module
Modified Paths:
--------------
linux4palm/linux/trunk/arch/arm/configs/palmz72_defconfig
linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/Kconfig
linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/Makefile
linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72.c
linux4palm/linux/trunk/include/asm-arm/arch-pxa/palm-battery.h
Modified: linux4palm/linux/trunk/arch/arm/configs/palmz72_defconfig
===================================================================
--- linux4palm/linux/trunk/arch/arm/configs/palmz72_defconfig 2007-09-26 20:02:39 UTC (rev 1345)
+++ linux4palm/linux/trunk/arch/arm/configs/palmz72_defconfig 2007-09-27 13:02:11 UTC (rev 1346)
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.21-hnd3
-# Wed Sep 12 11:26:32 2007
+# Thu Sep 27 14:33:48 2007
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -183,8 +183,6 @@
CONFIG_GPIOEDNG=m
CONFIG_MACH_PALMZ72=y
CONFIG_PALMZ72_PM=y
-CONFIG_PALMZ72_BATTERY=m
-CONFIG_PALMZ72_BORDER=m
# CONFIG_MACH_XSCALE_PALMTREO650 is not set
# CONFIG_MACH_XSCALE_TREO680 is not set
# CONFIG_MACH_T700WX is not set
@@ -421,7 +419,7 @@
#
# FIR device drivers
#
-CONFIG_PXA_FICP=y
+CONFIG_PXA_FICP=m
CONFIG_BT=y
CONFIG_BT_L2CAP=m
CONFIG_BT_SCO=m
@@ -626,7 +624,7 @@
# CONFIG_GPIODEV_DIAGONAL is not set
CONFIG_KEYBOARD_PXA27x=y
# CONFIG_KEYBOARD_PALMIR is not set
-CONFIG_KEYBOARD_PALMWK=m
+# CONFIG_KEYBOARD_PALMWK is not set
CONFIG_KEYBOARD_GPIO=y
# CONFIG_INPUT_MOUSE is not set
# CONFIG_INPUT_JOYSTICK is not set
@@ -646,7 +644,8 @@
CONFIG_TOUCHSCREEN_WM9712=y
# CONFIG_TOUCHSCREEN_WM9713 is not set
# CONFIG_TOUCHSCREEN_WM97XX_PXA is not set
-# CONFIG_INPUT_MISC is not set
+CONFIG_INPUT_MISC=y
+CONFIG_INPUT_UINPUT=y
#
# Hardware I/O ports
@@ -677,7 +676,7 @@
CONFIG_SERIAL_PXA=y
# CONFIG_SERIAL_PXA_CONSOLE is not set
CONFIG_SERIAL_PXA_COUNT=4
-# CONFIG_SERIAL_PXA_IR is not set
+CONFIG_SERIAL_PXA_IR=y
CONFIG_SERIAL_CORE=y
# CONFIG_RS232_SERIAL is not set
CONFIG_UNIX98_PTYS=y
@@ -822,6 +821,7 @@
# CONFIG_POWER_SUPPLY_DEBUG is not set
CONFIG_PDA_POWER=y
CONFIG_APM_POWER=y
+CONFIG_BATTERY_PALM=m
# CONFIG_BATTERY_DS2760 is not set
#
@@ -833,6 +833,7 @@
# Misc devices
#
# CONFIG_BATTCHARGE_MONITOR is not set
+# CONFIG_PALMLCD_BORDER is not set
#
# Multimedia Capabilities Port drivers
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/Kconfig
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/Kconfig 2007-09-26 20:02:39 UTC (rev 1345)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/Kconfig 2007-09-27 13:02:11 UTC (rev 1346)
@@ -12,12 +12,3 @@
help
Enable support for suspend/resume the PalmOne Zire 72 PDA.
-config PALMZ72_BATTERY
- tristate "Palm Zire 72 Battery support"
- select TOUCHSCREEN_WM97XX
- select POWER_SUPPLY
- depends on MACH_PALMZ72
- default m
- help
- Enable support for PalmOne Zire 72 battery to APM.
- ATM use it only as module, otherwise it hangs.
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/Makefile
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/Makefile 2007-09-26 20:02:39 UTC (rev 1345)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/Makefile 2007-09-27 13:02:11 UTC (rev 1346)
@@ -4,4 +4,3 @@
obj-$(CONFIG_MACH_PALMZ72) += palmz72.o
obj-$(CONFIG_PALMZ72_PM) += palmz72_pm.o
-obj-$(CONFIG_PALMZ72_BATTERY) += palmz72_battery.o
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72.c
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72.c 2007-09-26 20:02:39 UTC (rev 1345)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72.c 2007-09-27 13:02:11 UTC (rev 1346)
@@ -43,6 +43,7 @@
#include <asm/arch/pxa_camera.h>
#include <asm/arch/pxa2xx_udc_gpio.h>
#include <asm/arch/palmlcd-border.h>
+#include <asm/arch/palm-battery.h>
#include <sound/driver.h>
#include <sound/core.h>
@@ -330,6 +331,24 @@
};
/*************
+ * Batery *
+ *************/
+
+int palmz72_ac_is_connected (void){
+ /* when charger is plugged in and USB is not connected, then status is ONLINE */
+ return (!(GET_GPIO(GPIO_NR_PALMZ72_USB_PULLUP)) && !(GET_GPIO(GPIO_NR_PALMZ72_USB_DETECT)));
+}
+
+static struct palm_battery_data palm_battery_info = {
+ .bat_min_voltage = PALMZ72_BAT_MIN_VOLTAGE,
+ .bat_max_voltage = PALMZ72_BAT_MAX_VOLTAGE,
+ .bat_max_life_mins = PALMZ72_MAX_LIFE_MINS,
+ .ac_connected = &palmz72_ac_is_connected,
+};
+
+EXPORT_SYMBOL_GPL(palm_battery_info);
+
+/*************
* Backlight *
*************/
Modified: linux4palm/linux/trunk/include/asm-arm/arch-pxa/palm-battery.h
===================================================================
--- linux4palm/linux/trunk/include/asm-arm/arch-pxa/palm-battery.h 2007-09-26 20:02:39 UTC (rev 1345)
+++ linux4palm/linux/trunk/include/asm-arm/arch-pxa/palm-battery.h 2007-09-27 13:02:11 UTC (rev 1346)
@@ -6,5 +6,5 @@
int bat_min_voltage;
int bat_max_voltage;
int bat_max_life_mins;
- int (*ac_connected)();
+ int (*ac_connected)(void);
};
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mis...@us...> - 2007-09-26 20:02:41
|
Revision: 1345
http://hackndev.svn.sourceforge.net/hackndev/?rev=1345&view=rev
Author: miska_tx
Date: 2007-09-26 13:02:39 -0700 (Wed, 26 Sep 2007)
Log Message:
-----------
PalmTT5: Migration to the universal battery driver.
Signed-off-by: Michal Hrusecky <Mic...@se...>
Modified Paths:
--------------
linux4palm/linux/trunk/arch/arm/mach-pxa/palmtt5/Kconfig
linux4palm/linux/trunk/arch/arm/mach-pxa/palmtt5/Makefile
linux4palm/linux/trunk/arch/arm/mach-pxa/palmtt5/palmtt5.c
Removed Paths:
-------------
linux4palm/linux/trunk/arch/arm/mach-pxa/palmtt5/palmtt5_battery.c
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmtt5/Kconfig
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtt5/Kconfig 2007-09-26 16:10:59 UTC (rev 1344)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmtt5/Kconfig 2007-09-26 20:02:39 UTC (rev 1345)
@@ -4,15 +4,6 @@
help
This enables support for Palm Tungsten|T5 handheld.
-config PALMTT5_BATTERY
- tristate "Palm Tungsten|T5 Battery support"
- select TOUCHSCREEN_WM97XX
- select POWER_SUPPLY
- depends on MACH_XSCALE_PALMTT5
- default m
- help
- Enable support for Palm Tungsten|T5 battery to APM.
-
config PALMTT5_PM
tristate "Palm Tungsten|T5 Power Management support"
depends on MACH_XSCALE_PALMTT5
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmtt5/Makefile
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtt5/Makefile 2007-09-26 16:10:59 UTC (rev 1344)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmtt5/Makefile 2007-09-26 20:02:39 UTC (rev 1345)
@@ -3,5 +3,4 @@
#
#
obj-$(CONFIG_MACH_XSCALE_PALMTT5) += palmtt5.o
-obj-$(CONFIG_PALMTT5_BATTERY) += palmtt5_battery.o
obj-$(CONFIG_PALMTT5_PM) += palmtt5_pm.o
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmtt5/palmtt5.c
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtt5/palmtt5.c 2007-09-26 16:10:59 UTC (rev 1344)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmtt5/palmtt5.c 2007-09-26 20:02:39 UTC (rev 1345)
@@ -40,6 +40,7 @@
#include <asm/arch/irda.h>
#include <asm/arch/pxa27x_keyboard.h>
#include <asm/arch/serial.h>
+#include <asm/arch/palm-battery.h>
#include "../generic.h"
@@ -144,7 +145,26 @@
},
};
+/*************
+ * Battery *
+ *************/
+int palmtt5_ac_is_connected (void){
+ /* when charger is plugged in, then status is ONLINE */
+ return GET_PALMTT5_GPIO(POWER_DETECT)||(!GET_PALMTT5_GPIO(USB_DETECT));
+}
+
+static struct palm_battery_data palm_battery_info = {
+ .bat_min_voltage = PALMTT5_BAT_MIN_VOLTAGE,
+ .bat_max_voltage = PALMTT5_BAT_MAX_VOLTAGE,
+ .bat_max_life_mins = PALMTT5_MAX_LIFE_MINS,
+ .ac_connected = &palmtt5_ac_is_connected,
+};
+
+EXPORT_SYMBOL_GPL(palm_battery_info);
+
+
+
/*************
* Backlight *
*************/
Deleted: linux4palm/linux/trunk/arch/arm/mach-pxa/palmtt5/palmtt5_battery.c
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtt5/palmtt5_battery.c 2007-09-26 16:10:59 UTC (rev 1344)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmtt5/palmtt5_battery.c 2007-09-26 20:02:39 UTC (rev 1345)
@@ -1,293 +0,0 @@
-/************************************************************************
- * linux/arch/arm/mach-pxa/palmtt5/palmtt5_battery.c *
- * Battery driver for Palm Tungsten|T5 *
- * *
- * Author: Marek Vasut <mar...@gm...> *
- * *
- ************************************************************************/
-
-
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/init.h>
-#include <linux/interrupt.h>
-#include <linux/input.h>
-#include <linux/device.h>
-#include <linux/workqueue.h>
-#include <linux/power_supply.h>
-#include <linux/apm-emulation.h>
-#include <linux/wm97xx.h>
-
-#include <asm/delay.h>
-#include <asm/mach-types.h>
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-#include <asm/arch/hardware.h>
-#include <asm/arch/pxa-regs.h>
-#include <asm/arch/irqs.h>
-#include <asm/arch/palmtt5-gpio.h>
-#include <asm/arch/palmtt5-init.h>
-
-#include <sound/driver.h>
-#include <sound/core.h>
-#include <sound/pcm.h>
-#include <sound/initval.h>
-
-struct palmtt5_battery_dev
-{
- struct wm97xx * wm;
- int battery_registered;
- int current_voltage;
- int previous_voltage;
- u32 last_battery_update;
-};
-
-struct palmtt5_battery_dev bat;
-
-#if defined(CONFIG_APM_EMULATION) || defined(CONFIG_APM_MODULE)
-/* original APM hook */
-static void (*apm_get_power_status_orig)(struct apm_power_info *info);
-#endif
-
-int palmtt5_battery_min_voltage(struct power_supply *b)
-{
- return PALMTT5_BAT_MIN_VOLTAGE;
-}
-
-
-int palmtt5_battery_max_voltage(struct power_supply *b)
-{
- return PALMTT5_BAT_MAX_VOLTAGE; /* mV */
-}
-
-/*
- This formula is based on battery life of my battery 1100mAh. Original battery in Zire72 is Li-On 920mAh
- V_batt = ADCSEL_BMON * 1,889 + 767,8 [mV]
-*/
-
-int palmtt5_battery_get_voltage(struct power_supply *b)
-{
- if (bat.battery_registered){
- bat.previous_voltage = bat.current_voltage;
- bat.current_voltage = wm97xx_read_aux_adc(bat.wm, WM97XX_AUX_ID3);
- bat.last_battery_update = jiffies;
- return bat.current_voltage * 1889/1000 + 7678/10;
- }
- else{
- printk("palmtt5_battery: cannot get voltage -> battery driver unregistered\n");
- return 0;
- }
-}
-
-int palmtt5_battery_get_capacity(struct power_supply *b)
-{
- if (bat.battery_registered){
- return (((palmtt5_battery_get_voltage(b)-palmtt5_battery_min_voltage(b))
- /(palmtt5_battery_max_voltage(b)-palmtt5_battery_min_voltage(b)))*100);
- }
- else{
- printk("palmtt5_battery: cannot get capacity -> battery driver unregistered\n");
- return 0;
- }
-}
-
-int palmtt5_battery_get_status(struct power_supply *b)
-{
- int ac_connected = GET_PALMTT5_GPIO(POWER_DETECT);
- int usb_connected = !GET_PALMTT5_GPIO(USB_DETECT);
-
- if ( (ac_connected || usb_connected) &&
- ( ( bat.current_voltage > bat.previous_voltage ) ||
- (bat.current_voltage <= PALMTT5_BAT_MAX_VOLTAGE) ) )
- return POWER_SUPPLY_STATUS_CHARGING;
- else
- return POWER_SUPPLY_STATUS_NOT_CHARGING;
-}
-
-int tmp;
-
-static int palmtt5_battery_get_property(struct power_supply *b,
- enum power_supply_property psp,
- union power_supply_propval *val)
-{
- switch (psp) {
- case POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN:
- val->intval = palmtt5_battery_max_voltage(b);
- break;
- case POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN:
- val->intval = palmtt5_battery_min_voltage(b);
- break;
- case POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN:
- val->intval = 100;
- break;
- case POWER_SUPPLY_PROP_CHARGE_EMPTY_DESIGN:
- val->intval = 0;
- break;
- case POWER_SUPPLY_PROP_CHARGE_NOW:
- val->intval = palmtt5_battery_get_capacity(b);
- break;
- case POWER_SUPPLY_PROP_VOLTAGE_NOW:
- val->intval = palmtt5_battery_get_voltage(b);
- break;
- case POWER_SUPPLY_PROP_STATUS:
- val->intval = palmtt5_battery_get_status(b);
- break;
- default:
- break;
- };
-
- return 0;
-}
-
-static enum power_supply_property palmtt5_battery_props[] = {
- POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN,
- POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN,
- POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN,
- POWER_SUPPLY_PROP_CHARGE_EMPTY_DESIGN,
- POWER_SUPPLY_PROP_CHARGE_NOW,
- POWER_SUPPLY_PROP_VOLTAGE_NOW,
- POWER_SUPPLY_PROP_STATUS,
-};
-
-struct power_supply palmtt5_battery = {
- .name = "palmtt5_battery",
- .get_property = palmtt5_battery_get_property,
- .properties = palmtt5_battery_props,
- .num_properties = ARRAY_SIZE(palmtt5_battery_props),
-};
-
-static int palmtt5_wm97xx_probe(struct device *dev)
-{
- struct wm97xx *wm = dev->driver_data;
- bat.wm = wm;
- return 0;
-}
-
-static int palmtt5_wm97xx_remove(struct device *dev)
-{
- return 0;
-}
-
-static void
-palmtt5_wm97xx_shutdown(struct device *dev)
-{
-#if defined(CONFIG_APM_EMULATION) || defined(CONFIG_APM_MODULE)
- apm_get_power_status = apm_get_power_status_orig;
-#endif
-}
-
-static int
-palmtt5_wm97xx_suspend(struct device *dev, pm_message_t state)
-{
- return 0;
-}
-
-static int
-palmtt5_wm97xx_resume(struct device *dev)
-{
- return 0;
-}
-
-
-static struct device_driver palmtt5_wm97xx_driver = {
- .name = "wm97xx-touchscreen",
- .bus = &wm97xx_bus_type,
- .owner = THIS_MODULE,
- .probe = palmtt5_wm97xx_probe,
- .remove = palmtt5_wm97xx_remove,
- .suspend = palmtt5_wm97xx_suspend,
- .resume = palmtt5_wm97xx_resume,
- .shutdown = palmtt5_wm97xx_shutdown
-};
-
-static int palmtt5_ac_is_connected (void){
- /* when charger is plugged in, then status is ONLINE */
- int ret = ((GET_GPIO(GPIO_NR_PALMTT5_POWER_DETECT)));;
- if (ret)
- ret = 1;
- else
- ret = 0;
-
- return ret;
-}
-
-#if defined(CONFIG_APM_EMULATION) || defined(CONFIG_APM_MODULE)
-
-/* APM status query callback implementation */
-static void palmtt5_apm_get_power_status(struct apm_power_info *info)
-{
- int min, max, curr, percent;
-
- curr = palmtt5_battery_get_voltage(&palmtt5_battery);
- min = palmtt5_battery_min_voltage(&palmtt5_battery);
- max = palmtt5_battery_max_voltage(&palmtt5_battery);
-
- curr = curr - min;
- if (curr < 0) curr = 0;
- max = max - min;
-
- percent = curr*100/max;
-
- info->battery_life = percent;
-
- info->ac_line_status = palmtt5_ac_is_connected() ? APM_AC_ONLINE : APM_AC_OFFLINE;
-
- if (info->ac_line_status) {
- info->battery_status = APM_BATTERY_STATUS_CHARGING;
- } else {
- if (percent > 50)
- info->battery_status = APM_BATTERY_STATUS_HIGH;
- else if (percent < 5)
- info->battery_status = APM_BATTERY_STATUS_CRITICAL;
- else
- info->battery_status = APM_BATTERY_STATUS_LOW;
- }
-
- info->time = percent * PALMTT5_MAX_LIFE_MINS/100;
- info->units = APM_UNITS_MINS;
-}
-#endif
-static int __init palmtt5_wm97xx_init(void)
-{
-#ifndef MODULE
- int ret;
-#endif
-
- /* register battery to APM layer */
- bat.battery_registered = 0;
-
- if(power_supply_register(NULL, &palmtt5_battery)) {
- printk(KERN_ERR "palmtt5_ac97_probe: could not register battery class\n");
- }
- else {
- bat.battery_registered = 1;
- printk("Battery registered\n");
- }
-#if defined(CONFIG_APM_EMULATION) || defined(CONFIG_APM_MODULE)
- apm_get_power_status_orig = apm_get_power_status;
- apm_get_power_status = palmtt5_apm_get_power_status;
-#endif
-#ifndef MODULE
- /* If we're in kernel, we could accidentally be run before wm97xx
- and thus have panic */
- if((ret = bus_register(&wm97xx_bus_type)) < 0)
- return ret;
-#endif
- return driver_register(&palmtt5_wm97xx_driver);
-}
-
-static void __exit palmtt5_wm97xx_exit(void)
-{
-/* TODO - recover APM callback to original state */
- power_supply_unregister(&palmtt5_battery);
- driver_unregister(&palmtt5_wm97xx_driver);
-}
-
-module_init(palmtt5_wm97xx_init);
-module_exit(palmtt5_wm97xx_exit);
-
-/* Module information */
-MODULE_AUTHOR("Marek Vasut <mar...@gm...>");
-MODULE_DESCRIPTION("wm97xx battery driver for Palm Tungsten|T5");
-MODULE_LICENSE("GPL");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mis...@us...> - 2007-09-26 16:11:03
|
Revision: 1344
http://hackndev.svn.sourceforge.net/hackndev/?rev=1344&view=rev
Author: miska_tx
Date: 2007-09-26 09:10:59 -0700 (Wed, 26 Sep 2007)
Log Message:
-----------
PalmTX: Updated defconfig.
Signed-off-by: Michal Hrusecky <Mic...@se...>
Modified Paths:
--------------
linux4palm/linux/trunk/arch/arm/configs/palmtx_defconfig
Modified: linux4palm/linux/trunk/arch/arm/configs/palmtx_defconfig
===================================================================
--- linux4palm/linux/trunk/arch/arm/configs/palmtx_defconfig 2007-09-26 14:49:51 UTC (rev 1343)
+++ linux4palm/linux/trunk/arch/arm/configs/palmtx_defconfig 2007-09-26 16:10:59 UTC (rev 1344)
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.21-hnd3
-# Sat Aug 25 00:55:16 2007
+# Wed Sep 26 18:05:22 2007
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -178,10 +178,8 @@
# CONFIG_MACH_XSCALE_PALMTT5 is not set
CONFIG_MACH_XSCALE_PALMTX=y
# CONFIG_PALMTX_DEBUG is not set
-CONFIG_PALMTX_BATTERY=m
CONFIG_PALMTX_PM=y
CONFIG_PALMTX_PCMCIA=m
-CONFIG_PALMTX_BORDER=m
# CONFIG_MACH_XSCALE_PALMLD is not set
# CONFIG_MACH_ZIRE31 is not set
CONFIG_GPIOED=m
@@ -571,7 +569,6 @@
# Wireless LAN (non-hamradio)
#
# CONFIG_NET_RADIO is not set
-# CONFIG_LIBERTAS is not set
#
# PCMCIA network device support
@@ -761,6 +758,7 @@
# CONFIG_POWER_SUPPLY_DEBUG is not set
CONFIG_PDA_POWER=m
CONFIG_APM_POWER=m
+CONFIG_BATTERY_PALM=m
# CONFIG_BATTERY_DS2760 is not set
#
@@ -772,6 +770,7 @@
# Misc devices
#
# CONFIG_BATTCHARGE_MONITOR is not set
+CONFIG_PALMLCD_BORDER=m
#
# Multimedia Capabilities Port drivers
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mis...@us...> - 2007-09-26 14:49:55
|
Revision: 1343
http://hackndev.svn.sourceforge.net/hackndev/?rev=1343&view=rev
Author: miska_tx
Date: 2007-09-26 07:49:51 -0700 (Wed, 26 Sep 2007)
Log Message:
-----------
PalmTX: Forgoten include in battery migration.
Signed-off-by: Michal Hrusecky <Mic...@se...>
Modified Paths:
--------------
linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmtx.c
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmtx.c
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmtx.c 2007-09-26 14:44:58 UTC (rev 1342)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmtx.c 2007-09-26 14:49:51 UTC (rev 1343)
@@ -46,6 +46,7 @@
#include <asm/arch/palmtx-gpio.h>
#include <asm/arch/pxa2xx_udc_gpio.h>
#include <asm/arch/palmlcd-border.h>
+#include <asm/arch/palm-battery.h>
#include "../generic.h"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mis...@us...> - 2007-09-26 14:45:09
|
Revision: 1342
http://hackndev.svn.sourceforge.net/hackndev/?rev=1342&view=rev
Author: miska_tx
Date: 2007-09-26 07:44:58 -0700 (Wed, 26 Sep 2007)
Log Message:
-----------
PalmTX: Migration to the universal batery driver
Signed-off-by: Michal Hrusecky <Mic...@se...>
Modified Paths:
--------------
linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/Kconfig
linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/Makefile
linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmtx.c
Removed Paths:
-------------
linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmtx_battery.c
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/Kconfig
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/Kconfig 2007-09-26 14:42:12 UTC (rev 1341)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/Kconfig 2007-09-26 14:44:58 UTC (rev 1342)
@@ -11,16 +11,6 @@
help
Enable core debug output for Palm TX modules.
-config PALMTX_BATTERY
- tristate "Palm TX Battery support"
- select TOUCHSCREEN_WM97XX
- select POWER_SUPPLY
- depends on MACH_XSCALE_PALMTX
- default m
- help
- Enable support for Palm TX battery to APM.
- ATM use it only as module, otherwise it hangs.
-
config PALMTX_PM
tristate "Palm TX Power Management support"
depends on MACH_XSCALE_PALMTX
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/Makefile
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/Makefile 2007-09-26 14:42:12 UTC (rev 1341)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/Makefile 2007-09-26 14:44:58 UTC (rev 1342)
@@ -3,6 +3,5 @@
#
#
obj-$(CONFIG_MACH_XSCALE_PALMTX) += palmtx.o
-obj-$(CONFIG_PALMTX_BATTERY) += palmtx_battery.o
obj-$(CONFIG_PALMTX_PM) += palmtx_pm.o
obj-$(CONFIG_PALMTX_PCMCIA) += palmtx_pcmcia.o
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmtx.c
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmtx.c 2007-09-26 14:42:12 UTC (rev 1341)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmtx.c 2007-09-26 14:44:58 UTC (rev 1342)
@@ -169,6 +169,25 @@
};
/*************
+ * Batery *
+ *************/
+
+int palmtx_ac_is_connected (void){
+ /* when charger is plugged in, then status is ONLINE */
+ return GET_PALMTX_GPIO(POWER_DETECT)||(!GET_PALMTX_GPIO(USB_DETECT_N));
+}
+
+static struct palm_battery_data palm_battery_info = {
+ .bat_min_voltage = PALMTX_BAT_MIN_VOLTAGE,
+ .bat_max_voltage = PALMTX_BAT_MAX_VOLTAGE,
+ .bat_max_life_mins = PALMTX_MAX_LIFE_MINS,
+ .ac_connected = &palmtx_ac_is_connected,
+};
+
+EXPORT_SYMBOL_GPL(palm_battery_info);
+
+
+/*************
* Backlight *
*************/
Deleted: linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmtx_battery.c
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmtx_battery.c 2007-09-26 14:42:12 UTC (rev 1341)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmtx_battery.c 2007-09-26 14:44:58 UTC (rev 1342)
@@ -1,285 +0,0 @@
-/************************************************************************
- * linux/arch/arm/mach-pxa/palmztx/palmtx_battery.c *
- * Battery driver for Palm TX *
- * *
- * Author: Jan Herman <2h...@se...> *
- * *
- * Based on code for Palm Zire 72 by *
- * *
- * Authors: Jan Herman <2h...@se...> *
- * Sergey Lapin <sl...@ha...> *
- * *
- ************************************************************************/
-
-
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/init.h>
-#include <linux/interrupt.h>
-#include <linux/input.h>
-#include <linux/device.h>
-#include <linux/workqueue.h>
-#include <linux/power_supply.h>
-#include <linux/apm-emulation.h>
-#include <linux/wm97xx.h>
-
-#include <asm/delay.h>
-#include <asm/mach-types.h>
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-#include <asm/arch/hardware.h>
-#include <asm/arch/pxa-regs.h>
-#include <asm/arch/irqs.h>
-#include <asm/arch/palmtx-gpio.h>
-#include <asm/arch/palmtx-init.h>
-
-#include <sound/driver.h>
-#include <sound/core.h>
-#include <sound/pcm.h>
-#include <sound/initval.h>
-
-struct palmtx_battery_dev
-{
- struct wm97xx * wm;
- int battery_registered;
- int current_voltage;
- int previous_voltage;
- u32 last_battery_update;
-};
-
-struct palmtx_battery_dev bat;
-
-#if defined(CONFIG_APM_EMULATION) || defined(CONFIG_APM_MODULE)
-/* original APM hook */
-static void (*apm_get_power_status_orig)(struct apm_power_info *info);
-#endif
-
-int palmtx_battery_min_voltage(struct power_supply *b)
-{
- return PALMTX_BAT_MIN_VOLTAGE;
-}
-
-
-int palmtx_battery_max_voltage(struct power_supply *b)
-{
- return PALMTX_BAT_MAX_VOLTAGE; /* mV */
-}
-
-static int palmtx_ac_is_connected (void){
- /* when charger is plugged in, then status is ONLINE */
- return GET_PALMTX_GPIO(POWER_DETECT)||(!GET_PALMTX_GPIO(USB_DETECT_N));
-}
-
-/*
- This formula is based on battery life of my battery 1100mAh. Original battery in Zire72 is Li-On 920mAh
- V_batt = ADCSEL_BMON * 1,889 + 767,8 [mV]
-*/
-
-int palmtx_battery_get_voltage(struct power_supply *b)
-{
- if (bat.battery_registered) {
- bat.previous_voltage = bat.current_voltage;
- bat.current_voltage = wm97xx_read_aux_adc(bat.wm, WM97XX_AUX_ID3);
- bat.last_battery_update = jiffies;
- return bat.current_voltage * 1889/1000 + 7678/10;
- } else {
- printk("palmtx_battery: cannot get voltage -> battery driver unregistered\n");
- return 0;
- }
-}
-
-int palmtx_battery_get_capacity(struct power_supply *b)
-{
- if (bat.battery_registered)
- return (((palmtx_battery_get_voltage(b)-palmtx_battery_min_voltage(b))
- /(palmtx_battery_max_voltage(b)-palmtx_battery_min_voltage(b)))*100);
- else{
- printk("palmtx_battery: cannot get capacity -> battery driver unregistered\n");
- return 0;
- }
-}
-
-int palmtx_battery_get_status(struct power_supply *b)
-{
- if ( palmtx_ac_is_connected() &&
- ( ( bat.current_voltage > bat.previous_voltage ) ||
- (bat.current_voltage <= palmtx_battery_max_voltage(b)) ) )
- return POWER_SUPPLY_STATUS_CHARGING;
- else
- return POWER_SUPPLY_STATUS_NOT_CHARGING;
-}
-
-static int palmtx_battery_get_property(struct power_supply *b,
- enum power_supply_property psp,
- union power_supply_propval *val)
-{
- switch (psp) {
- case POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN:
- val->intval = palmtx_battery_max_voltage(b);
- break;
- case POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN:
- val->intval = palmtx_battery_min_voltage(b);
- break;
- case POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN:
- val->intval = 100;
- break;
- case POWER_SUPPLY_PROP_CHARGE_EMPTY_DESIGN:
- val->intval = 0;
- break;
- case POWER_SUPPLY_PROP_CHARGE_NOW:
- val->intval = palmtx_battery_get_capacity(b);
- break;
- case POWER_SUPPLY_PROP_VOLTAGE_NOW:
- val->intval = palmtx_battery_get_voltage(b);
- break;
- case POWER_SUPPLY_PROP_STATUS:
- val->intval = palmtx_battery_get_status(b);
- break;
- default:
- break;
- };
-
- return 0;
-}
-
-static enum power_supply_property palmtx_battery_props[] = {
- POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN,
- POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN,
- POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN,
- POWER_SUPPLY_PROP_CHARGE_EMPTY_DESIGN,
- POWER_SUPPLY_PROP_CHARGE_NOW,
- POWER_SUPPLY_PROP_VOLTAGE_NOW,
- POWER_SUPPLY_PROP_STATUS,
-};
-
-struct power_supply palmtx_battery = {
- .name = "palmtx_battery",
- .get_property = palmtx_battery_get_property,
- .properties = palmtx_battery_props,
- .num_properties = ARRAY_SIZE(palmtx_battery_props),
-};
-
-static int palmtx_wm97xx_probe(struct device *dev)
-{
- struct wm97xx *wm = dev->driver_data;
- bat.wm = wm;
- return 0;
-}
-
-static int palmtx_wm97xx_remove(struct device *dev)
-{
- return 0;
-}
-
-static void
-palmtx_wm97xx_shutdown(struct device *dev)
-{
-#if defined(CONFIG_APM_EMULATION) || defined(CONFIG_APM_MODULE)
- apm_get_power_status = apm_get_power_status_orig;
-#endif
-}
-
-static int
-palmtx_wm97xx_suspend(struct device *dev, pm_message_t state)
-{
- return 0;
-}
-
-static int
-palmtx_wm97xx_resume(struct device *dev)
-{
- return 0;
-}
-
-
-static struct device_driver palmtx_wm97xx_driver = {
- .name = "wm97xx-touchscreen",
- .bus = &wm97xx_bus_type,
- .owner = THIS_MODULE,
- .probe = palmtx_wm97xx_probe,
- .remove = palmtx_wm97xx_remove,
- .suspend = palmtx_wm97xx_suspend,
- .resume = palmtx_wm97xx_resume,
- .shutdown = palmtx_wm97xx_shutdown
-};
-
-
-#if defined(CONFIG_APM_EMULATION) || defined(CONFIG_APM_MODULE)
-
-/* APM status query callback implementation */
-static void palmtx_apm_get_power_status(struct apm_power_info *info)
-{
- int min, max, curr, percent;
-
- curr = palmtx_battery_get_voltage(&palmtx_battery);
- min = palmtx_battery_min_voltage(&palmtx_battery);
- max = palmtx_battery_max_voltage(&palmtx_battery);
-
- curr = curr - min;
- if (curr < 0) curr = 0;
- max = max - min;
-
- percent = curr*100/max;
-
- info->battery_life = percent;
-
- info->ac_line_status = palmtx_ac_is_connected() ? APM_AC_ONLINE : APM_AC_OFFLINE;
-
- if (info->ac_line_status)
- info->battery_status = APM_BATTERY_STATUS_CHARGING;
- else {
- if (percent > 50)
- info->battery_status = APM_BATTERY_STATUS_HIGH;
- else if (percent < 5)
- info->battery_status = APM_BATTERY_STATUS_CRITICAL;
- else
- info->battery_status = APM_BATTERY_STATUS_LOW;
- }
-
- info->time = percent * PALMTX_MAX_LIFE_MINS/100;
- info->units = APM_UNITS_MINS;
-}
-#endif
-static int __init palmtx_wm97xx_init(void)
-{
-#ifndef MODULE
- int ret;
-#endif
-
- /* register battery to APM layer */
- bat.battery_registered = 0;
-
- if(power_supply_register(NULL, &palmtx_battery))
- printk(KERN_ERR "palmtx_ac97_probe: could not register battery class\n");
- else {
- bat.battery_registered = 1;
- printk("Battery registered\n");
- }
-#if defined(CONFIG_APM_EMULATION) || defined(CONFIG_APM_MODULE)
- apm_get_power_status_orig = apm_get_power_status;
- apm_get_power_status = palmtx_apm_get_power_status;
-#endif
-#ifndef MODULE
- /* If we're in kernel, we could accidentally be run before wm97xx
- and thus have panic */
- if((ret = bus_register(&wm97xx_bus_type)) < 0)
- return ret;
-#endif
- return driver_register(&palmtx_wm97xx_driver);
-}
-
-static void __exit palmtx_wm97xx_exit(void)
-{
-/* TODO - recover APM callback to original state */
- power_supply_unregister(&palmtx_battery);
- driver_unregister(&palmtx_wm97xx_driver);
-}
-
-module_init(palmtx_wm97xx_init);
-module_exit(palmtx_wm97xx_exit);
-
-/* Module information */
-MODULE_AUTHOR("Jan Herman <2h...@se...>");
-MODULE_DESCRIPTION("wm97xx battery driver for Palm TX");
-MODULE_LICENSE("GPL");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mis...@us...> - 2007-09-26 14:42:20
|
Revision: 1341
http://hackndev.svn.sourceforge.net/hackndev/?rev=1341&view=rev
Author: miska_tx
Date: 2007-09-26 07:42:12 -0700 (Wed, 26 Sep 2007)
Log Message:
-----------
All: Model independent Palm battery driver
Signed-off-by: Michal Hrusecky <Mic...@se...>
Modified Paths:
--------------
linux4palm/linux/trunk/drivers/power/Kconfig
linux4palm/linux/trunk/drivers/power/Makefile
Added Paths:
-----------
linux4palm/linux/trunk/drivers/power/palm_battery.c
linux4palm/linux/trunk/include/asm-arm/arch-pxa/palm-battery.h
Modified: linux4palm/linux/trunk/drivers/power/Kconfig
===================================================================
--- linux4palm/linux/trunk/drivers/power/Kconfig 2007-09-24 18:33:52 UTC (rev 1340)
+++ linux4palm/linux/trunk/drivers/power/Kconfig 2007-09-26 14:42:12 UTC (rev 1341)
@@ -28,6 +28,14 @@
Say Y here to enable support APM status emulation using
battery class devices.
+config BATTERY_PALM
+ tristate "Palm battery driver"
+ select TOUCHSCREEN_WM97XX
+ depends on APM_POWER
+ default m
+ help
+ Say Y here to enable support for batteries in Palm devices.
+
config BATTERY_DS2760
tristate "DS2760 battery driver (HP iPAQ & others)"
select W1
Modified: linux4palm/linux/trunk/drivers/power/Makefile
===================================================================
--- linux4palm/linux/trunk/drivers/power/Makefile 2007-09-24 18:33:52 UTC (rev 1340)
+++ linux4palm/linux/trunk/drivers/power/Makefile 2007-09-26 14:42:12 UTC (rev 1341)
@@ -18,6 +18,7 @@
obj-$(CONFIG_APM_POWER) += apm_power.o
obj-$(CONFIG_BATTERY_DS2760) += ds2760_battery.o
+obj-$(CONFIG_BATTERY_PALM) += palm_battery.o
obj-$(CONFIG_BATTERY_PMU) += pmu_battery.o
obj-$(CONFIG_BATTERY_OLPC) += olpc_battery.o
Added: linux4palm/linux/trunk/drivers/power/palm_battery.c
===================================================================
--- linux4palm/linux/trunk/drivers/power/palm_battery.c (rev 0)
+++ linux4palm/linux/trunk/drivers/power/palm_battery.c 2007-09-26 14:42:12 UTC (rev 1341)
@@ -0,0 +1,269 @@
+/************************************************************************
+ * drivers/power/palm_battery.c *
+ * Battery driver for Palm devices *
+ * *
+ * Author: Michal Hrusecky <Mic...@se...> *
+ * *
+ * Based on code for Palm TX by *
+ * *
+ * Authors: Jan Herman <2h...@se...> *
+ * *
+ ************************************************************************/
+
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/input.h>
+#include <linux/device.h>
+#include <linux/workqueue.h>
+#include <linux/power_supply.h>
+#include <linux/apm-emulation.h>
+#include <linux/wm97xx.h>
+
+#include <asm/delay.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <asm/arch/hardware.h>
+#include <asm/arch/pxa-regs.h>
+#include <asm/arch/irqs.h>
+
+#include <sound/driver.h>
+#include <sound/core.h>
+#include <sound/pcm.h>
+#include <sound/initval.h>
+#include <asm/arch/palm-battery.h>
+
+extern struct palm_battery_data palm_battery_info;
+
+struct palm_battery_dev
+{
+ struct wm97xx * wm;
+ int battery_registered;
+ int current_voltage;
+ int previous_voltage;
+ u32 last_battery_update;
+};
+
+struct palm_battery_dev bat;
+
+#if defined(CONFIG_APM_EMULATION) || defined(CONFIG_APM_MODULE)
+/* original APM hook */
+static void (*apm_get_power_status_orig)(struct apm_power_info *info);
+#endif
+
+/*
+ This formula is based on battery life of my battery 1100mAh. Original battery in Zire72 is Li-On 920mAh
+ V_batt = ADCSEL_BMON * 1,889 + 767,8 [mV]
+*/
+
+int palm_battery_get_voltage(struct power_supply *b)
+{
+ if (bat.battery_registered) {
+ bat.previous_voltage = bat.current_voltage;
+ bat.current_voltage = wm97xx_read_aux_adc(bat.wm, WM97XX_AUX_ID3);
+ bat.last_battery_update = jiffies;
+ return bat.current_voltage * 1889/1000 + 7678/10;
+ } else {
+ printk("palm_battery: cannot get voltage -> battery driver unregistered\n");
+ return 0;
+ }
+}
+
+int palm_battery_get_capacity(struct power_supply *b)
+{
+ if (bat.battery_registered)
+ return (((palm_battery_get_voltage(b)-palm_battery_info.bat_min_voltage)
+ /(palm_battery_info.bat_max_voltage-palm_battery_info.bat_min_voltage))*100);
+ else{
+ printk("palm_battery: cannot get capacity -> battery driver unregistered\n");
+ return 0;
+ }
+}
+
+int palm_battery_get_status(struct power_supply *b)
+{
+ if ( palm_battery_info.ac_connected() &&
+ ( ( bat.current_voltage > bat.previous_voltage ) ||
+ (bat.current_voltage <= palm_battery_info.bat_max_voltage) ) )
+ return POWER_SUPPLY_STATUS_CHARGING;
+ else
+ return POWER_SUPPLY_STATUS_NOT_CHARGING;
+}
+
+static int palm_battery_get_property(struct power_supply *b,
+ enum power_supply_property psp,
+ union power_supply_propval *val)
+{
+ switch (psp) {
+ case POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN:
+ val->intval = palm_battery_info.bat_max_voltage;
+ break;
+ case POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN:
+ val->intval = palm_battery_info.bat_min_voltage;
+ break;
+ case POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN:
+ val->intval = 100;
+ break;
+ case POWER_SUPPLY_PROP_CHARGE_EMPTY_DESIGN:
+ val->intval = 0;
+ break;
+ case POWER_SUPPLY_PROP_CHARGE_NOW:
+ val->intval = palm_battery_get_capacity(b);
+ break;
+ case POWER_SUPPLY_PROP_VOLTAGE_NOW:
+ val->intval = palm_battery_get_voltage(b);
+ break;
+ case POWER_SUPPLY_PROP_STATUS:
+ val->intval = palm_battery_get_status(b);
+ break;
+ default:
+ break;
+ };
+
+ return 0;
+}
+
+static enum power_supply_property palm_battery_props[] = {
+ POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN,
+ POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN,
+ POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN,
+ POWER_SUPPLY_PROP_CHARGE_EMPTY_DESIGN,
+ POWER_SUPPLY_PROP_CHARGE_NOW,
+ POWER_SUPPLY_PROP_VOLTAGE_NOW,
+ POWER_SUPPLY_PROP_STATUS,
+};
+
+struct power_supply palm_battery = {
+ .name = "palm_battery",
+ .get_property = palm_battery_get_property,
+ .properties = palm_battery_props,
+ .num_properties = ARRAY_SIZE(palm_battery_props),
+};
+
+static int palm_wm97xx_probe(struct device *dev)
+{
+ struct wm97xx *wm = dev->driver_data;
+ bat.wm = wm;
+ return 0;
+}
+
+static int palm_wm97xx_remove(struct device *dev)
+{
+ return 0;
+}
+
+static void
+palm_wm97xx_shutdown(struct device *dev)
+{
+#if defined(CONFIG_APM_EMULATION) || defined(CONFIG_APM_MODULE)
+ apm_get_power_status = apm_get_power_status_orig;
+#endif
+}
+
+static int
+palm_wm97xx_suspend(struct device *dev, pm_message_t state)
+{
+ return 0;
+}
+
+static int
+palm_wm97xx_resume(struct device *dev)
+{
+ return 0;
+}
+
+
+static struct device_driver palm_wm97xx_driver = {
+ .name = "wm97xx-touchscreen",
+ .bus = &wm97xx_bus_type,
+ .owner = THIS_MODULE,
+ .probe = palm_wm97xx_probe,
+ .remove = palm_wm97xx_remove,
+ .suspend = palm_wm97xx_suspend,
+ .resume = palm_wm97xx_resume,
+ .shutdown = palm_wm97xx_shutdown
+};
+
+
+#if defined(CONFIG_APM_EMULATION) || defined(CONFIG_APM_MODULE)
+
+/* APM status query callback implementation */
+static void palm_apm_get_power_status(struct apm_power_info *info)
+{
+ int min, max, curr, percent;
+
+ curr = palm_battery_get_voltage(&palm_battery);
+ min = palm_battery_info.bat_min_voltage;
+ max = palm_battery_info.bat_max_voltage;
+
+ curr = curr - min;
+ if (curr < 0) curr = 0;
+ max = max - min;
+
+ percent = curr*100/max;
+
+ info->battery_life = percent;
+
+ info->ac_line_status = palm_battery_info.ac_connected() ? APM_AC_ONLINE : APM_AC_OFFLINE;
+
+ if (info->ac_line_status)
+ info->battery_status = APM_BATTERY_STATUS_CHARGING;
+ else {
+ if (percent > 50)
+ info->battery_status = APM_BATTERY_STATUS_HIGH;
+ else if (percent < 5)
+ info->battery_status = APM_BATTERY_STATUS_CRITICAL;
+ else
+ info->battery_status = APM_BATTERY_STATUS_LOW;
+ }
+
+ info->time = percent * palm_battery_info.bat_max_life_mins/100;
+ info->units = APM_UNITS_MINS;
+}
+#endif
+static int __init palm_wm97xx_init(void)
+{
+#ifndef MODULE
+ int ret;
+#endif
+
+ /* register battery to APM layer */
+ bat.battery_registered = 0;
+
+ if(power_supply_register(NULL, &palm_battery))
+ printk(KERN_ERR "palm_ac97_probe: could not register battery class\n");
+ else {
+ bat.battery_registered = 1;
+ printk("Battery registered\n");
+ }
+#if defined(CONFIG_APM_EMULATION) || defined(CONFIG_APM_MODULE)
+ apm_get_power_status_orig = apm_get_power_status;
+ apm_get_power_status = palm_apm_get_power_status;
+#endif
+#ifndef MODULE
+ /* If we're in kernel, we could accidentally be run before wm97xx
+ and thus have panic */
+ if((ret = bus_register(&wm97xx_bus_type)) < 0)
+ return ret;
+#endif
+ return driver_register(&palm_wm97xx_driver);
+}
+
+static void __exit palm_wm97xx_exit(void)
+{
+ /* TODO - recover APM callback to original state */
+ power_supply_unregister(&palm_battery);
+ driver_unregister(&palm_wm97xx_driver);
+}
+
+module_init(palm_wm97xx_init);
+module_exit(palm_wm97xx_exit);
+
+/* Module information */
+MODULE_AUTHOR("Michal Hrusecky <Mic...@se...>");
+MODULE_DESCRIPTION("Universal battery driver for Palm devices");
+MODULE_LICENSE("GPL");
Added: linux4palm/linux/trunk/include/asm-arm/arch-pxa/palm-battery.h
===================================================================
--- linux4palm/linux/trunk/include/asm-arm/arch-pxa/palm-battery.h (rev 0)
+++ linux4palm/linux/trunk/include/asm-arm/arch-pxa/palm-battery.h 2007-09-26 14:42:12 UTC (rev 1341)
@@ -0,0 +1,10 @@
+/*
+ * Palm battery info structure.
+ */
+
+struct palm_battery_data {
+ int bat_min_voltage;
+ int bat_max_voltage;
+ int bat_max_life_mins;
+ int (*ac_connected)();
+};
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mar...@us...> - 2007-09-24 18:33:54
|
Revision: 1340
http://hackndev.svn.sourceforge.net/hackndev/?rev=1340&view=rev
Author: marex_z71
Date: 2007-09-24 11:33:52 -0700 (Mon, 24 Sep 2007)
Log Message:
-----------
PalmZ72: align to 80 characters and simplify code
Modified Paths:
--------------
linux4palm/linux/trunk/drivers/leds/led-palmz72.c
Modified: linux4palm/linux/trunk/drivers/leds/led-palmz72.c
===================================================================
--- linux4palm/linux/trunk/drivers/leds/led-palmz72.c 2007-09-24 15:59:23 UTC (rev 1339)
+++ linux4palm/linux/trunk/drivers/leds/led-palmz72.c 2007-09-24 18:33:52 UTC (rev 1340)
@@ -21,13 +21,10 @@
#include <asm/arch/pxa-regs.h>
#include <asm/hardware/scoop.h>
-
-static void palmz72led_green_set(struct led_classdev *led_cdev, enum led_brightness value)
+static void palmz72led_green_set(struct led_classdev *led_cdev,
+ enum led_brightness value)
{
- if (value)
- SET_PALMZ72_GPIO(LED,1);
- else
- SET_PALMZ72_GPIO(LED,0);
+ SET_PALMZ72_GPIO(LED, value ? 1 : 0);
}
static struct led_classdev palmz72_green_led = {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mis...@us...> - 2007-09-24 15:59:29
|
Revision: 1339
http://hackndev.svn.sourceforge.net/hackndev/?rev=1339&view=rev
Author: miska_tx
Date: 2007-09-24 08:59:23 -0700 (Mon, 24 Sep 2007)
Log Message:
-----------
PalmTX: Battery cleanups.
Signed-off-by: Michal Hrusecky <Mic...@se...>
Modified Paths:
--------------
linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmtx_battery.c
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmtx_battery.c
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmtx_battery.c 2007-09-24 15:12:00 UTC (rev 1338)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmtx_battery.c 2007-09-24 15:59:23 UTC (rev 1339)
@@ -66,6 +66,11 @@
return PALMTX_BAT_MAX_VOLTAGE; /* mV */
}
+static int palmtx_ac_is_connected (void){
+ /* when charger is plugged in, then status is ONLINE */
+ return GET_PALMTX_GPIO(POWER_DETECT)||(!GET_PALMTX_GPIO(USB_DETECT_N));
+}
+
/*
This formula is based on battery life of my battery 1100mAh. Original battery in Zire72 is Li-On 920mAh
V_batt = ADCSEL_BMON * 1,889 + 767,8 [mV]
@@ -97,19 +102,14 @@
int palmtx_battery_get_status(struct power_supply *b)
{
- int ac_connected = GET_PALMTX_GPIO(POWER_DETECT);
- int usb_connected = !GET_PALMTX_GPIO(USB_DETECT_N);
-
- if ( (ac_connected || usb_connected) &&
+ if ( palmtx_ac_is_connected() &&
( ( bat.current_voltage > bat.previous_voltage ) ||
- (bat.current_voltage <= PALMTX_BAT_MAX_VOLTAGE) ) )
+ (bat.current_voltage <= palmtx_battery_max_voltage(b)) ) )
return POWER_SUPPLY_STATUS_CHARGING;
else
return POWER_SUPPLY_STATUS_NOT_CHARGING;
}
-int tmp;
-
static int palmtx_battery_get_property(struct power_supply *b,
enum power_supply_property psp,
union power_supply_propval *val)
@@ -204,10 +204,6 @@
.shutdown = palmtx_wm97xx_shutdown
};
-static int palmtx_ac_is_connected (void){
- /* when charger is plugged in, then status is ONLINE */
- return GET_PALMTX_GPIO(POWER_DETECT)||(!GET_PALMTX_GPIO(USB_DETECT_N));
-}
#if defined(CONFIG_APM_EMULATION) || defined(CONFIG_APM_MODULE)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mar...@us...> - 2007-09-24 15:12:03
|
Revision: 1338
http://hackndev.svn.sourceforge.net/hackndev/?rev=1338&view=rev
Author: marex_z71
Date: 2007-09-24 08:12:00 -0700 (Mon, 24 Sep 2007)
Log Message:
-----------
PalmLD: stupid formating changes
Modified Paths:
--------------
linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld_battery.c
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld_battery.c
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld_battery.c 2007-09-21 15:22:10 UTC (rev 1337)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld_battery.c 2007-09-24 15:12:00 UTC (rev 1338)
@@ -186,15 +186,15 @@
}
-static struct device_driver palmld_wm97xx_driver = {
- .name = "wm97xx-touchscreen",
- .bus = &wm97xx_bus_type,
- .owner = THIS_MODULE,
- .probe = palmld_wm97xx_probe,
- .remove = palmld_wm97xx_remove,
- .suspend = palmld_wm97xx_suspend,
- .resume = palmld_wm97xx_resume,
- .shutdown = palmld_wm97xx_shutdown
+static struct device_driver palmld_wm97xx_driver = {
+ .name = "wm97xx-touchscreen",
+ .bus = &wm97xx_bus_type,
+ .owner = THIS_MODULE,
+ .probe = palmld_wm97xx_probe,
+ .remove = palmld_wm97xx_remove,
+ .suspend = palmld_wm97xx_suspend,
+ .resume = palmld_wm97xx_resume,
+ .shutdown = palmld_wm97xx_shutdown
};
#if defined(CONFIG_APM_EMULATION) || defined(CONFIG_APM_MODULE)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mar...@us...> - 2007-09-21 15:23:20
|
Revision: 1337
http://hackndev.svn.sourceforge.net/hackndev/?rev=1337&view=rev
Author: marex_z71
Date: 2007-09-21 08:22:10 -0700 (Fri, 21 Sep 2007)
Log Message:
-----------
PalmLD: improved coding style of battery driver and added few fallback security measurements
Modified Paths:
--------------
linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld_battery.c
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld_battery.c
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld_battery.c 2007-09-21 14:42:29 UTC (rev 1336)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld_battery.c 2007-09-21 15:22:10 UTC (rev 1337)
@@ -69,28 +69,25 @@
int palmld_battery_get_voltage(struct power_supply *b)
{
- if (bat.battery_registered){
+ if (bat.battery_registered) {
bat.previous_voltage = bat.current_voltage;
bat.current_voltage = wm97xx_read_aux_adc(bat.wm, WM97XX_AUX_ID3);
bat.last_battery_update = jiffies;
return bat.current_voltage * 1889/1000 + 7678/10;
}
- else{
- printk("palmld_battery: cannot get voltage -> battery driver unregistered\n");
- return 0;
- }
+
+ printk("palmld_battery: cannot get voltage -> battery driver unregistered\n");
+ return 0;
}
int palmld_battery_get_capacity(struct power_supply *b)
{
- if (bat.battery_registered){
- return (((palmld_battery_get_voltage(b)-palmld_battery_min_voltage(b))
- /(palmld_battery_max_voltage(b)-palmld_battery_min_voltage(b)))*100);
- }
- else{
- printk("palmld_battery: cannot get capacity -> battery driver unregistered\n");
- return 0;
- }
+ if (bat.battery_registered)
+ return (((palmld_battery_get_voltage(b)-palmld_battery_min_voltage(b))/
+ (palmld_battery_max_voltage(b)-palmld_battery_min_voltage(b)))*100);
+
+ printk("palmld_battery: cannot get capacity -> battery driver unregistered\n");
+ return 0;
}
int palmld_battery_get_status(struct power_supply *b)
@@ -106,8 +103,6 @@
return POWER_SUPPLY_STATUS_NOT_CHARGING;
}
-int tmp;
-
static int palmld_battery_get_property(struct power_supply *b,
enum power_supply_property psp,
union power_supply_propval *val)
@@ -247,9 +242,8 @@
/* register battery to APM layer */
bat.battery_registered = 0;
- if(power_supply_register(NULL, &palmld_battery)) {
+ if(power_supply_register(NULL, &palmld_battery))
printk(KERN_ERR "palmld_ac97_probe: could not register battery class\n");
- }
else {
bat.battery_registered = 1;
printk("Battery registered\n");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mar...@us...> - 2007-09-21 14:42:32
|
Revision: 1336
http://hackndev.svn.sourceforge.net/hackndev/?rev=1336&view=rev
Author: marex_z71
Date: 2007-09-21 07:42:29 -0700 (Fri, 21 Sep 2007)
Log Message:
-----------
PalmLD: coding style improvement
Modified Paths:
--------------
linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld.c
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld.c
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld.c 2007-09-21 00:53:12 UTC (rev 1335)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld.c 2007-09-21 14:42:29 UTC (rev 1336)
@@ -98,20 +98,14 @@
void bcm2035_bt_reset(int on)
{
printk(KERN_NOTICE "Switch BT reset %d\n", on);
- if (on)
- SET_PALMLD_GPIO( BT_RESET, 1 );
- else
- SET_PALMLD_GPIO( BT_RESET, 0 );
+ SET_PALMLD_GPIO( BT_RESET, on ? 1 : 0 );
}
EXPORT_SYMBOL(bcm2035_bt_reset);
void bcm2035_bt_power(int on)
{
printk(KERN_NOTICE "Switch BT power %d\n", on);
- if (on)
- SET_PALMLD_GPIO( BT_POWER, 1 );
- else
- SET_PALMLD_GPIO( BT_POWER, 0 );
+ SET_PALMLD_GPIO( BT_POWER, on ? 1 : 0 );
}
EXPORT_SYMBOL(bcm2035_bt_power);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mar...@us...> - 2007-09-21 00:53:22
|
Revision: 1335
http://hackndev.svn.sourceforge.net/hackndev/?rev=1335&view=rev
Author: marex_z71
Date: 2007-09-20 17:53:12 -0700 (Thu, 20 Sep 2007)
Log Message:
-----------
PalmZ72: migrate to universal LCD border driver - palmlcd_border
Modified Paths:
--------------
linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/Kconfig
linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/Makefile
linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72.c
Removed Paths:
-------------
linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_border.c
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/Kconfig
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/Kconfig 2007-09-21 00:51:33 UTC (rev 1334)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/Kconfig 2007-09-21 00:53:12 UTC (rev 1335)
@@ -21,9 +21,3 @@
help
Enable support for PalmOne Zire 72 battery to APM.
ATM use it only as module, otherwise it hangs.
-
-config PALMZ72_BORDER
- tristate "Palm Zire 72 Display border switch"
- depends on MACH_PALMZ72
- help
- Enable support for turning LCD border on/off
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/Makefile
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/Makefile 2007-09-21 00:51:33 UTC (rev 1334)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/Makefile 2007-09-21 00:53:12 UTC (rev 1335)
@@ -5,4 +5,3 @@
obj-$(CONFIG_MACH_PALMZ72) += palmz72.o
obj-$(CONFIG_PALMZ72_PM) += palmz72_pm.o
obj-$(CONFIG_PALMZ72_BATTERY) += palmz72_battery.o
-obj-$(CONFIG_PALMZ72_BORDER) += palmz72_border.o
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72.c
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72.c 2007-09-21 00:51:33 UTC (rev 1334)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72.c 2007-09-21 00:53:12 UTC (rev 1335)
@@ -42,6 +42,7 @@
#include <asm/arch/palmz72-init.h>
#include <asm/arch/pxa_camera.h>
#include <asm/arch/pxa2xx_udc_gpio.h>
+#include <asm/arch/palmlcd-border.h>
#include <sound/driver.h>
#include <sound/core.h>
@@ -315,9 +316,17 @@
/**************
* LCD Border *
**************/
+static struct palmlcd_border_pdata border_machinfo = {
+ .select_gpio = GPIO_NR_PALMZ72_BORDER_SELECT,
+ .switch_gpio = GPIO_NR_PALMZ72_BORDER_SWITCH,
+};
+
struct platform_device palmz72_border = {
- .name = "palmz72-border",
- .id = -1,
+ .name = "palmlcd-border",
+ .id = -1,
+ .dev = {
+ .platform_data = &border_machinfo,
+ },
};
/*************
Deleted: linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_border.c
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_border.c 2007-09-21 00:51:33 UTC (rev 1334)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_border.c 2007-09-21 00:53:12 UTC (rev 1335)
@@ -1,115 +0,0 @@
-/*
- * PalmOne Zire 72 LCD Border switch
- * (Based on Palm LD LCD border switch)
- *
- * Author: Marek Vasut <mar...@gm...>
- * Modification for Palm Zire 72: Jan Herman <z7...@ha...>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- */
-
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/platform_device.h>
-#include <linux/delay.h>
-
-#include <asm/arch/hardware.h>
-#include <asm/arch/palmz72-gpio.h>
-
-static ssize_t palmz72_border_write(struct device *dev, struct device_attribute *attr,
- const char *buf, size_t count)
-{
- signed long state = simple_strtol(buf, NULL, 10);
-
- if ( state >= 1 )
- SET_PALMZ72_GPIO(BORDER_SELECT, 1);
- else
- SET_PALMZ72_GPIO(BORDER_SELECT, 0);
-
- msleep(50);
- SET_PALMZ72_GPIO(BORDER_SWITCH, 1);
-
- if ((state == 1) || (state == 0)) /* default - switch border on/off */
- msleep(200);
- else { /* hidden functionality - colored border */
- if (state >= 0)
- msleep(state);
- else
- msleep(-state);
- }
-
- SET_PALMZ72_GPIO(BORDER_SWITCH, 0);
-
- return count;
-}
-
-static ssize_t palmz72_border_read(struct device *dev,
- struct device_attribute *attr,
- char *buf)
-{
- return strlcpy(buf, GET_PALMZ72_GPIO(BORDER_SELECT) ? "1\n" : "0\n", 3);
-}
-
-static DEVICE_ATTR(border_power, 0644, palmz72_border_read, palmz72_border_write);
-
-static struct attribute *palmz72_border_attrs[] = {
- &dev_attr_border_power.attr,
- NULL
-};
-
-static struct attribute_group palmz72_border_attr_group = {
- .attrs = palmz72_border_attrs,
-};
-
-static int __devinit palmz72_border_probe(struct platform_device *pdev)
-{
- return sysfs_create_group(&pdev->dev.kobj, &palmz72_border_attr_group);
-}
-
-static int palmz72_border_remove(struct platform_device *pdev)
-{
- sysfs_remove_group(&pdev->dev.kobj, &palmz72_border_attr_group);
- return 0;
-}
-
-static struct platform_driver palmz72_border_driver = {
- .probe = palmz72_border_probe,
- .remove = palmz72_border_remove,
- .suspend = NULL,
- .resume = NULL,
- .driver = {
- .name = "palmz72-border",
- }
-};
-
-static int __init palmz72_border_init(void)
-{
- printk(KERN_INFO "LCD border driver registered\n");
- return platform_driver_register(&palmz72_border_driver);
-}
-
-static void palmz72_border_exit(void)
-{
- printk(KERN_INFO "LCD border driver unregistered\n");
- platform_driver_unregister(&palmz72_border_driver);
-}
-
-module_init(palmz72_border_init);
-module_exit(palmz72_border_exit);
-
-MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Jan Herman <z7...@ha...>");
-MODULE_DESCRIPTION("PalmOne Zire72 Border switch");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mar...@us...> - 2007-09-21 00:51:34
|
Revision: 1334
http://hackndev.svn.sourceforge.net/hackndev/?rev=1334&view=rev
Author: marex_z71
Date: 2007-09-20 17:51:33 -0700 (Thu, 20 Sep 2007)
Log Message:
-----------
PalmZ72: make i2c-ov96xx.c compile cleanly without warnings
Modified Paths:
--------------
linux4palm/linux/trunk/drivers/i2c/chips/i2c-ov96xx.c
Modified: linux4palm/linux/trunk/drivers/i2c/chips/i2c-ov96xx.c
===================================================================
--- linux4palm/linux/trunk/drivers/i2c/chips/i2c-ov96xx.c 2007-09-21 00:40:32 UTC (rev 1333)
+++ linux4palm/linux/trunk/drivers/i2c/chips/i2c-ov96xx.c 2007-09-21 00:51:33 UTC (rev 1334)
@@ -102,7 +102,6 @@
{
struct i2c_client *new_client;
int err = 0;
- char res = -1;
struct ov96xx_data *data;
if (g_client != NULL) {
@@ -158,7 +157,8 @@
printk("trying to attach the client\n");
/* Tell the i2c layer a new client has arrived */
- if (err = i2c_attach_client(new_client))
+ err = i2c_attach_client(new_client);
+ if (err)
goto ERROR3;
/* This function can write default values to the client registers, if
@@ -184,7 +184,8 @@
int err;
/* Try to detach the client from i2c space */
- if (err = i2c_detach_client(client)) {
+ err = i2c_detach_client(client);
+ if (err) {
DPRINTK("i2c-ov96xx.o: Client deregistration failed, client not detached.\n");
return err;
}
@@ -211,6 +212,17 @@
.detach_client = &i2c_ov96xx_detach_client,
};
+void i2c_ov96xx_cleanup(void)
+{
+ if (ov96xx_initialized == 1) {
+ if (i2c_del_driver(&ov96xx_i2c_driver)) {
+ DPRINTK("i2c-ov96xx: Driver registration failed, module not removed.\n");
+ return;
+ }
+ ov96xx_initialized --;
+ }
+}
+
int i2c_ov96xx_init(void)
{
int res;
@@ -219,8 +231,9 @@
return 0;
DPRINTK("I2C: driver for device ov96xx.\n");
-
- if (res = i2c_add_driver(&ov96xx_i2c_driver)) {
+
+ res = i2c_add_driver(&ov96xx_i2c_driver);
+ if (res) {
DPRINTK("i2c-ov96xx: Driver registration failed, module not inserted.\n");
i2c_ov96xx_cleanup();
return res;
@@ -234,17 +247,6 @@
return 0;
}
-void i2c_ov96xx_cleanup(void)
-{
- if (ov96xx_initialized == 1) {
- if (i2c_del_driver(&ov96xx_i2c_driver)) {
- DPRINTK("i2c-ov96xx: Driver registration failed, module not removed.\n");
- return;
- }
- ov96xx_initialized --;
- }
-}
-
EXPORT_SYMBOL(i2c_ov96xx_read);
EXPORT_SYMBOL(i2c_ov96xx_write);
EXPORT_SYMBOL(i2c_ov96xx_init);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mar...@us...> - 2007-09-21 00:40:35
|
Revision: 1333
http://hackndev.svn.sourceforge.net/hackndev/?rev=1333&view=rev
Author: marex_z71
Date: 2007-09-20 17:40:32 -0700 (Thu, 20 Sep 2007)
Log Message:
-----------
PalmTX: migrate to palmlcd_border
Modified Paths:
--------------
linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld.c
linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/Kconfig
linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/Makefile
linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmtx.c
Removed Paths:
-------------
linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmtx_border.c
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld.c
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld.c 2007-09-21 00:12:29 UTC (rev 1332)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld.c 2007-09-21 00:40:32 UTC (rev 1333)
@@ -223,7 +223,7 @@
struct platform_device palmld_border = {
.name = "palmlcd-border",
- .id = 0,
+ .id = -1,
.dev = {
.platform_data = &border_machinfo,
},
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/Kconfig
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/Kconfig 2007-09-21 00:12:29 UTC (rev 1332)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/Kconfig 2007-09-21 00:40:32 UTC (rev 1333)
@@ -33,9 +33,3 @@
depends on MACH_XSCALE_PALMTX
help
This driver handles the CF/PCCARD/PCMCIA bus.
-
-config PALMTX_BORDER
- tristate "Palm TX Display border switch"
- depends on MACH_XSCALE_PALMTX
- help
- Enable support for turning LCD border on/off
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/Makefile
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/Makefile 2007-09-21 00:12:29 UTC (rev 1332)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/Makefile 2007-09-21 00:40:32 UTC (rev 1333)
@@ -6,4 +6,3 @@
obj-$(CONFIG_PALMTX_BATTERY) += palmtx_battery.o
obj-$(CONFIG_PALMTX_PM) += palmtx_pm.o
obj-$(CONFIG_PALMTX_PCMCIA) += palmtx_pcmcia.o
-obj-$(CONFIG_PALMTX_BORDER) += palmtx_border.o
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmtx.c
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmtx.c 2007-09-21 00:12:29 UTC (rev 1332)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmtx.c 2007-09-21 00:40:32 UTC (rev 1333)
@@ -45,6 +45,7 @@
#include <asm/arch/palmtx-init.h>
#include <asm/arch/palmtx-gpio.h>
#include <asm/arch/pxa2xx_udc_gpio.h>
+#include <asm/arch/palmlcd-border.h>
#include "../generic.h"
@@ -154,12 +155,16 @@
/**************
* LCD Border *
**************/
+static struct palmlcd_border_pdata border_machinfo = {
+ .select_gpio = GPIO_NR_PALMTX_BORDER_SELECT,
+ .switch_gpio = GPIO_NR_PALMTX_BORDER_SWITCH,
+};
struct platform_device palmtx_border = {
- .name = "palmtx-border",
+ .name = "palmlcd-border",
.id = -1,
.dev = {
- .platform_data = NULL,
+ .platform_data = &border_machinfo,
},
};
Deleted: linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmtx_border.c
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmtx_border.c 2007-09-21 00:12:29 UTC (rev 1332)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmtx_border.c 2007-09-21 00:40:32 UTC (rev 1333)
@@ -1,100 +0,0 @@
-/*
- * Palm T|X LCD Border switch
- *
- * Copyright (C) 2007 Marek Vasut <mar...@gm...>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/platform_device.h>
-#include <linux/delay.h>
-
-#include <asm/arch/hardware.h>
-#include <asm/arch/palmtx-gpio.h>
-
-static ssize_t palmtx_border_write(struct device *dev, struct device_attribute *attr,
- const char *buf, size_t count)
-{
- signed long state = simple_strtol(buf, NULL, 10);
-
- if ( state >= 1 )
- SET_PALMTX_GPIO(BORDER_SELECT, 1);
- else
- SET_PALMTX_GPIO(BORDER_SELECT, 0);
-
- msleep(50);
- SET_PALMTX_GPIO(BORDER_SWITCH, 1);
-
- if ((state == 1) || (state == 0)) /* default - switch border on/off */
- msleep(200);
- else { /* hidden functionality - colored border */
- if (state >= 0)
- msleep(state);
- else
- msleep(-state);
- }
-
- SET_PALMTX_GPIO(BORDER_SWITCH, 0);
-
- return count;
-}
-
-static ssize_t palmtx_border_read(struct device *dev,
- struct device_attribute *attr,
- char *buf)
-{
- return strlcpy(buf, GET_PALMTX_GPIO(BORDER_SELECT) ? "1\n" : "0\n", 3);
-}
-
-static DEVICE_ATTR(border_power, 0644, palmtx_border_read, palmtx_border_write);
-
-static struct attribute *palmtx_border_attrs[] = {
- &dev_attr_border_power.attr,
- NULL
-};
-
-static struct attribute_group palmtx_border_attr_group = {
- .attrs = palmtx_border_attrs,
-};
-
-static int __devinit palmtx_border_probe(struct platform_device *pdev)
-{
- return sysfs_create_group(&pdev->dev.kobj, &palmtx_border_attr_group);
-}
-
-static int palmtx_border_remove(struct platform_device *pdev)
-{
- sysfs_remove_group(&pdev->dev.kobj, &palmtx_border_attr_group);
- return 0;
-}
-
-static struct platform_driver palmtx_border_driver = {
- .probe = palmtx_border_probe,
- .remove = palmtx_border_remove,
- .suspend = NULL,
- .resume = NULL,
- .driver = {
- .name = "palmtx-border",
- }
-};
-
-static int __init palmtx_border_init(void)
-{
- return platform_driver_register(&palmtx_border_driver);
-}
-
-static void palmtx_border_exit(void)
-{
- platform_driver_unregister(&palmtx_border_driver);
-}
-
-module_init(palmtx_border_init);
-module_exit(palmtx_border_exit);
-
-MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Marek Vasut <mar...@gm...>");
-MODULE_DESCRIPTION("Palm T|X Border switch");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mar...@us...> - 2007-09-21 00:12:32
|
Revision: 1332
http://hackndev.svn.sourceforge.net/hackndev/?rev=1332&view=rev
Author: marex_z71
Date: 2007-09-20 17:12:29 -0700 (Thu, 20 Sep 2007)
Log Message:
-----------
PalmLD: add general lcd border driver and migrate palmld to it
Modified Paths:
--------------
linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/Kconfig
linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/Makefile
linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld.c
linux4palm/linux/trunk/drivers/misc/Kconfig
linux4palm/linux/trunk/drivers/misc/Makefile
Added Paths:
-----------
linux4palm/linux/trunk/drivers/misc/palmlcd_border.c
linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmlcd-border.h
Removed Paths:
-------------
linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld_border.c
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/Kconfig
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/Kconfig 2007-09-17 20:13:33 UTC (rev 1331)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/Kconfig 2007-09-21 00:12:29 UTC (rev 1332)
@@ -34,9 +34,3 @@
default y if MACH_XSCALE_PALMLD
help
Enable support for suspend/resume the PalmOne LifeDrive PDA.
-
-config PALMLD_BORDER
- tristate "Palm LifeDrive Display border switch"
- depends on MACH_XSCALE_PALMLD
- help
- Enable support for turning LCD border on/off
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/Makefile
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/Makefile 2007-09-17 20:13:33 UTC (rev 1331)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/Makefile 2007-09-21 00:12:29 UTC (rev 1332)
@@ -7,4 +7,3 @@
obj-$(CONFIG_PALMLD_IDE) += palmld_ide.o
obj-$(CONFIG_PALMLD_PM) += palmld_pm.o
obj-$(CONFIG_PALMLD_BATTERY) += palmld_battery.o
-obj-$(CONFIG_PALMLD_BORDER) += palmld_border.o
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld.c
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld.c 2007-09-17 20:13:33 UTC (rev 1331)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld.c 2007-09-21 00:12:29 UTC (rev 1332)
@@ -34,6 +34,7 @@
#include <asm/arch/pxa27x_keyboard.h>
#include <asm/arch/pxa-pm_ll.h>
#include <asm/arch/serial.h>
+#include <asm/arch/palmlcd-border.h>
#include <sound/driver.h>
#include <sound/core.h>
@@ -215,9 +216,17 @@
/*********************************************************
* LCD Border
*********************************************************/
+static struct palmlcd_border_pdata border_machinfo = {
+ .select_gpio = GPIO_NR_PALMLD_BORDER_SELECT,
+ .switch_gpio = GPIO_NR_PALMLD_BORDER_SWITCH,
+};
+
struct platform_device palmld_border = {
- .name = "palmld-border",
- .id = -1,
+ .name = "palmlcd-border",
+ .id = 0,
+ .dev = {
+ .platform_data = &border_machinfo,
+ },
};
/*********************************************************
Deleted: linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld_border.c
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld_border.c 2007-09-17 20:13:33 UTC (rev 1331)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld_border.c 2007-09-21 00:12:29 UTC (rev 1332)
@@ -1,100 +0,0 @@
-/*
- * Palm LifeDrive LCD Border switch
- *
- * Copyright (C) 2007 Marek Vasut <mar...@gm...>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/platform_device.h>
-#include <linux/delay.h>
-
-#include <asm/arch/hardware.h>
-#include <asm/arch/palmld-gpio.h>
-
-static ssize_t palmld_border_write(struct device *dev, struct device_attribute *attr,
- const char *buf, size_t count)
-{
- signed long state = simple_strtol(buf, NULL, 10);
-
- if ( state >= 1 )
- SET_PALMLD_GPIO(BORDER_SELECT, 1);
- else
- SET_PALMLD_GPIO(BORDER_SELECT, 0);
-
- msleep(50);
- SET_PALMLD_GPIO(BORDER_SWITCH, 1);
-
- if ((state == 1) || (state == 0)) /* default - switch border on/off */
- msleep(200);
- else { /* hidden functionality - colored border */
- if (state >= 0)
- msleep(state);
- else
- msleep(-state);
- }
-
- SET_PALMLD_GPIO(BORDER_SWITCH, 0);
-
- return count;
-}
-
-static ssize_t palmld_border_read(struct device *dev,
- struct device_attribute *attr,
- char *buf)
-{
- return strlcpy(buf, GET_PALMLD_GPIO(BORDER_SELECT) ? "1\n" : "0\n", 3);
-}
-
-static DEVICE_ATTR(border_power, 0644, palmld_border_read, palmld_border_write);
-
-static struct attribute *palmld_border_attrs[] = {
- &dev_attr_border_power.attr,
- NULL
-};
-
-static struct attribute_group palmld_border_attr_group = {
- .attrs = palmld_border_attrs,
-};
-
-static int __devinit palmld_border_probe(struct platform_device *pdev)
-{
- return sysfs_create_group(&pdev->dev.kobj, &palmld_border_attr_group);
-}
-
-static int palmld_border_remove(struct platform_device *pdev)
-{
- sysfs_remove_group(&pdev->dev.kobj, &palmld_border_attr_group);
- return 0;
-}
-
-static struct platform_driver palmld_border_driver = {
- .probe = palmld_border_probe,
- .remove = palmld_border_remove,
- .suspend = NULL,
- .resume = NULL,
- .driver = {
- .name = "palmld-border",
- }
-};
-
-static int __init palmld_border_init(void)
-{
- return platform_driver_register(&palmld_border_driver);
-}
-
-static void palmld_border_exit(void)
-{
- platform_driver_unregister(&palmld_border_driver);
-}
-
-module_init(palmld_border_init);
-module_exit(palmld_border_exit);
-
-MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Marek Vasut <mar...@gm...>");
-MODULE_DESCRIPTION("Palm LifeDrive Border switch");
Modified: linux4palm/linux/trunk/drivers/misc/Kconfig
===================================================================
--- linux4palm/linux/trunk/drivers/misc/Kconfig 2007-09-17 20:13:33 UTC (rev 1331)
+++ linux4palm/linux/trunk/drivers/misc/Kconfig 2007-09-21 00:12:29 UTC (rev 1332)
@@ -48,6 +48,12 @@
help
Gpioed-ng: only for debuging and testing!
+config PALMLCD_BORDER
+ tristate "Palm LCD Display border switch"
+ depends on ARCH_PXA
+ help
+ Enable support for turning LCD border on/off
+
menu "Multimedia Capabilities Port drivers"
config MCP_UCB1x00_AUDIO
Modified: linux4palm/linux/trunk/drivers/misc/Makefile
===================================================================
--- linux4palm/linux/trunk/drivers/misc/Makefile 2007-09-17 20:13:33 UTC (rev 1331)
+++ linux4palm/linux/trunk/drivers/misc/Makefile 2007-09-21 00:12:29 UTC (rev 1332)
@@ -17,6 +17,7 @@
obj-$(CONFIG_BATTCHARGE_MONITOR) += battchargemon.o
obj-$(CONFIG_GPIOED) += gpioed.o
obj-$(CONFIG_GPIOEDNG) += gpioed-ng.o
+obj-$(CONFIG_PALMLCD_BORDER) += palmlcd_border.o
obj-$(CONFIG_MCP_UCB1x00_AUDIO) += ucb1x00-audio.o
obj-$(CONFIG_MCP_UCB1x00_SIMPAD_SWITCHES) += simpad-switches.o
Added: linux4palm/linux/trunk/drivers/misc/palmlcd_border.c
===================================================================
--- linux4palm/linux/trunk/drivers/misc/palmlcd_border.c (rev 0)
+++ linux4palm/linux/trunk/drivers/misc/palmlcd_border.c 2007-09-21 00:12:29 UTC (rev 1332)
@@ -0,0 +1,107 @@
+/*
+ * Palm LCD Border switch
+ *
+ * Copyright (C) 2007 Marek Vasut <mar...@gm...>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/platform_device.h>
+#include <linux/delay.h>
+
+#include <asm/arch/palmlcd-border.h>
+#include <asm/arch/gpio.h>
+
+struct palmlcd_border_pdata *pdata;
+
+static ssize_t palmlcd_border_write(struct device *dev, struct device_attribute *attr,
+ const char *buf, size_t count)
+{
+ signed long state = simple_strtol(buf, NULL, 10);
+
+ if ( state >= 1 )
+ __gpio_set_value(pdata->select_gpio, 1);
+ else
+ __gpio_set_value(pdata->select_gpio, 0);
+
+ msleep(50);
+ __gpio_set_value(pdata->switch_gpio, 1);
+
+ if ((state == 1) || (state == 0)) /* default - switch border on/off */
+ msleep(200);
+ else { /* hidden functionality - colored border */
+ if (state >= 0)
+ msleep(state);
+ else
+ msleep(-state);
+ }
+
+ __gpio_set_value(pdata->switch_gpio, 0);
+
+ return count;
+}
+
+static ssize_t palmlcd_border_read(struct device *dev,
+ struct device_attribute *attr,
+ char *buf)
+{
+ return strlcpy(buf, __gpio_get_value(pdata->select_gpio) ? "1\n" : "0\n", 3);
+}
+
+static DEVICE_ATTR(border_power, 0644, palmlcd_border_read, palmlcd_border_write);
+
+static struct attribute *palmlcd_border_attrs[] = {
+ &dev_attr_border_power.attr,
+ NULL
+};
+
+static struct attribute_group palmlcd_border_attr_group = {
+ .attrs = palmlcd_border_attrs,
+};
+
+static int __devinit palmlcd_border_probe(struct platform_device *pdev)
+{
+ if(!pdev->dev.platform_data)
+ return -ENODEV;
+
+ pdata = pdev->dev.platform_data;
+
+ return sysfs_create_group(&pdev->dev.kobj, &palmlcd_border_attr_group);
+}
+
+static int palmlcd_border_remove(struct platform_device *pdev)
+{
+ sysfs_remove_group(&pdev->dev.kobj, &palmlcd_border_attr_group);
+ return 0;
+}
+
+static struct platform_driver palmlcd_border_driver = {
+ .probe = palmlcd_border_probe,
+ .remove = palmlcd_border_remove,
+ .suspend = NULL,
+ .resume = NULL,
+ .driver = {
+ .name = "palmlcd-border",
+ }
+};
+
+static int __init palmlcd_border_init(void)
+{
+ return platform_driver_register(&palmlcd_border_driver);
+}
+
+static void palmlcd_border_exit(void)
+{
+ platform_driver_unregister(&palmlcd_border_driver);
+}
+
+module_init(palmlcd_border_init);
+module_exit(palmlcd_border_exit);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Marek Vasut <mar...@gm...>");
+MODULE_DESCRIPTION("Palm LCD Border switch");
Added: linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmlcd-border.h
===================================================================
--- linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmlcd-border.h (rev 0)
+++ linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmlcd-border.h 2007-09-21 00:12:29 UTC (rev 1332)
@@ -0,0 +1,8 @@
+/*
+ * Palm LCD Border info structure
+ */
+
+struct palmlcd_border_pdata {
+ unsigned char select_gpio;
+ unsigned char switch_gpio;
+};
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <hap...@us...> - 2007-09-17 20:13:36
|
Revision: 1331
http://hackndev.svn.sourceforge.net/hackndev/?rev=1331&view=rev
Author: happy-slapin
Date: 2007-09-17 13:13:33 -0700 (Mon, 17 Sep 2007)
Log Message:
-----------
cleanup: remove unimportant changes to hh.org-derived files
Modified Paths:
--------------
linux4palm/linux/branches/cleanup-branch-never-commit/arch/arm/tools/mach-types
Added Paths:
-----------
linux4palm/linux/branches/cleanup-branch-never-commit/drivers/mfd/htc-bbkeys.c
linux4palm/linux/branches/cleanup-branch-never-commit/usr/.gitignore
Removed Paths:
-------------
linux4palm/linux/branches/cleanup-branch-never-commit/drivers/leds/leds-magician.c
Modified: linux4palm/linux/branches/cleanup-branch-never-commit/arch/arm/tools/mach-types
===================================================================
--- linux4palm/linux/branches/cleanup-branch-never-commit/arch/arm/tools/mach-types 2007-09-17 19:54:28 UTC (rev 1330)
+++ linux4palm/linux/branches/cleanup-branch-never-commit/arch/arm/tools/mach-types 2007-09-17 20:13:33 UTC (rev 1331)
@@ -12,7 +12,7 @@
#
# http://www.arm.linux.org.uk/developer/machines/?action=new
#
-# Last update: Wed Aug 29 03:11:21 2007
+# Last update: Mon Mar 19 13:59:12 2007
#
# machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number
#
@@ -217,7 +217,8 @@
ceiva ARCH_CEIVA CEIVA 200
fret SA1100_FRET FRET 201
emailphone SA1100_EMAILPHONE EMAILPHONE 202
-h3900 ARCH_H3900 H3900 203
+#h3900 ARCH_H3900 H3900 203
+h3900 MACH_H3900 H3900 203
pxa1 ARCH_PXA1 PXA1 204
koan369 SA1100_KOAN369 KOAN369 205
cogent ARCH_COGENT COGENT 206
@@ -266,7 +267,7 @@
wismo SA1100_WISMO WISMO 249
ezlinx ARCH_EZLINX EZLINX 250
at91rm9200 ARCH_AT91RM9200 AT91RM9200 251
-adtech_orion ARCH_ADTECH_ORION ADTECH_ORION 252
+orion ARCH_ORION ORION 252
neptune ARCH_NEPTUNE NEPTUNE 253
hackkit SA1100_HACKKIT HACKKIT 254
pxa_wins30 ARCH_PXA_WINS30 PXA_WINS30 255
@@ -353,7 +354,7 @@
icarus SA1100_ICARUS ICARUS 336
h1900 ARCH_H1900 H1900 337
gemini SA1100_GEMINI GEMINI 338
-axim ARCH_AXIM AXIM 339
+aximx5 ARCH_AXIMX5 AXIMX5 339
audiotron ARCH_AUDIOTRON AUDIOTRON 340
h2200 ARCH_H2200 H2200 341
loox600 ARCH_LOOX600 LOOX600 342
@@ -1148,7 +1149,7 @@
rema MACH_REMA REMA 1135
bps1000 MACH_BPS1000 BPS1000 1136
hw90350 MACH_HW90350 HW90350 1137
-omap_3430sdp MACH_OMAP_3430SDP OMAP_3430SDP 1138
+omap_sdp3430 MACH_OMAP_SDP3430 OMAP_SDP3430 1138
bluetouch MACH_BLUETOUCH BLUETOUCH 1139
vstms MACH_VSTMS VSTMS 1140
xsbase270 MACH_XSBASE270 XSBASE270 1141
@@ -1299,7 +1300,7 @@
h4300 MACH_H4300 H4300 1291
goramo_mlr MACH_GORAMO_MLR GORAMO_MLR 1292
mxc30020evb MACH_MXC30020EVB MXC30020EVB 1293
-adsbitsyg5 MACH_ADSBITSIMX ADSBITSIMX 1294
+adsbitsimx MACH_ADSBITSIMX ADSBITSIMX 1294
adsportalplus MACH_ADSPORTALPLUS ADSPORTALPLUS 1295
mmsp2plus MACH_MMSP2PLUS MMSP2PLUS 1296
em_x270 MACH_EM_X270 EM_X270 1297
@@ -1473,3 +1474,10 @@
add_wsc2 MACH_ADD_WSC2 ADD_WSC2 1465
add_medinet MACH_ADD_MEDINET ADD_MEDINET 1466
bboard MACH_BBOARD BBOARD 1467
+cambria MACH_CAMBRIA CAMBRIA 1468
+mt7xxx MACH_MT7XXX MT7XXX 1469
+matrix512 MACH_MATRIX512 MATRIX512 1470
+matrix522 MACH_MATRIX522 MATRIX522 1471
+ipac5010 MACH_IPAC5010 IPAC5010 1472
+sakura MACH_SAKURA SAKURA 1473
+grocx MACH_GROCX GROCX 1474
Deleted: linux4palm/linux/branches/cleanup-branch-never-commit/drivers/leds/leds-magician.c
===================================================================
--- linux4palm/linux/branches/cleanup-branch-never-commit/drivers/leds/leds-magician.c 2007-09-17 19:54:28 UTC (rev 1330)
+++ linux4palm/linux/branches/cleanup-branch-never-commit/drivers/leds/leds-magician.c 2007-09-17 20:13:33 UTC (rev 1331)
@@ -1,116 +0,0 @@
-/*
- * HTC Magician GPIO LED driver
- *
- * Copyright (c) 2006 Philipp Zabel <phi...@gm...>
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License. See the file COPYING in the main directory of this archive for
- * more details.
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/leds.h>
-
-#include <asm/io.h>
-#include <asm/gpio.h>
-
-#include <asm/arch/magician.h>
-
-static void magician_led_keys_set(struct led_classdev *led_cdev,
- enum led_brightness value)
-{
- gpio_set_value(GPIO103_MAGICIAN_LED_KP, value);
-}
-
-static void magician_led_vibra_set(struct led_classdev *led_cdev,
- enum led_brightness value)
-{
- gpio_set_value(GPIO22_MAGICIAN_VIBRA_EN, value);
-}
-
-static struct led_classdev magician_keys_led = {
- .name = "magician:keys",
- .default_trigger = "backlight",
- .brightness_set = magician_led_keys_set,
-};
-
-static struct led_classdev magician_vibra_led = {
- .name = "magician:vibra",
- .default_trigger = "none",
- .brightness_set = magician_led_vibra_set,
-};
-
-#ifdef CONFIG_PM
-static int magician_led_suspend(struct platform_device *dev, pm_message_t state)
-{
- led_classdev_suspend(&magician_keys_led);
- led_classdev_suspend(&magician_vibra_led);
-
- return 0;
-}
-
-static int magician_led_resume(struct platform_device *dev)
-{
- int i;
-
- led_classdev_resume(&magician_keys_led);
- led_classdev_resume(&magician_vibra_led);
-
- return 0;
-}
-#else
-#define magician_led_suspend NULL
-#define magician_led_resume NULL
-#endif
-
-static int magician_led_probe(struct platform_device *pdev)
-{
- int ret;
-
- ret = led_classdev_register(&pdev->dev, &magician_keys_led);
- if (ret < 0)
- return ret;
-
- ret = led_classdev_register(&pdev->dev, &magician_vibra_led);
- if (ret < 0)
- led_classdev_unregister(&magician_keys_led);
-
- return ret;
-}
-
-static int magician_led_remove(struct platform_device *pdev)
-{
- led_classdev_unregister(&magician_vibra_led);
- led_classdev_unregister(&magician_keys_led);
-
- return 0;
-}
-
-static struct platform_driver magician_led_driver = {
- .probe = magician_led_probe,
- .remove = magician_led_remove,
- .suspend = magician_led_suspend,
- .resume = magician_led_resume,
- .driver = {
- .name = "magician-led",
- },
-};
-
-static int __init magician_led_init (void)
-{
- return platform_driver_register(&magician_led_driver);
-}
-
-static void __exit magician_led_exit (void)
-{
- platform_driver_unregister(&magician_led_driver);
-}
-
-module_init (magician_led_init);
-module_exit (magician_led_exit);
-
-MODULE_AUTHOR("Philipp Zabel <phi...@gm...>");
-MODULE_DESCRIPTION("HTC Magician LED driver");
-MODULE_LICENSE("GPL");
Added: linux4palm/linux/branches/cleanup-branch-never-commit/drivers/mfd/htc-bbkeys.c
===================================================================
--- linux4palm/linux/branches/cleanup-branch-never-commit/drivers/mfd/htc-bbkeys.c (rev 0)
+++ linux4palm/linux/branches/cleanup-branch-never-commit/drivers/mfd/htc-bbkeys.c 2007-09-17 20:13:33 UTC (rev 1331)
@@ -0,0 +1,429 @@
+/*
+ * Support for the "mysterious" micro-controller that does "bit
+ * banging" on a pair of gpio pins. This is known to be present on
+ * HTC Apache and HTC Hermes phones. This controller controls the lcd
+ * power, the front keypad, and front LEDs.
+ *
+ * (c) Copyright 2007 Kevin O'Connor <ke...@ko...>
+ *
+ * This file may be distributed under the terms of the GNU GPL license.
+ */
+
+#include <linux/kernel.h>
+#include <linux/platform_device.h> /* struct platform_device */
+#include <linux/interrupt.h> /* irqreturn_t */
+#include <linux/input.h> /* input_report_key */
+#include <linux/spinlock.h> /* spinlock_t */
+
+#include <asm/gpio.h> /* gpio_set_value */
+#include <linux/mfd/htc-bbkeys.h>
+
+/* Some HTC phones have a device attached to gpio pins that appears to
+ * follow the i2c system with some minor deviations. It uses a 4bit
+ * register number instead of a 7 bit device-id address. */
+
+#define dprintf1(fmt, args...) printk(KERN_DEBUG fmt "\n" , ##args)
+#define dprintf(fmt, args...)
+
+struct bbkeys_info {
+ spinlock_t lock;
+ int sda_gpio, scl_gpio;
+ int irq;
+ struct input_dev *input;
+ u8 outcache[8];
+};
+
+
+/****************************************************************
+ * Chip register access
+ ****************************************************************/
+
+/* Wrappers around gpio functions */
+static inline int get_sda(struct bbkeys_info *bb)
+{
+ return gpio_get_value(bb->sda_gpio);
+}
+static inline void set_sda(struct bbkeys_info *bb, int value)
+{
+ gpio_set_value(bb->sda_gpio, value);
+}
+static inline void set_scl(struct bbkeys_info *bb, int value)
+{
+ gpio_set_value(bb->scl_gpio, value);
+}
+static inline void set_sda_input(struct bbkeys_info *bb)
+{
+ gpio_direction_input(bb->sda_gpio);
+}
+static inline void set_sda_output(struct bbkeys_info *bb)
+{
+ gpio_direction_output(bb->sda_gpio);
+}
+
+/* Read 'count' bits from SDA pin. The caller must ensure the SDA pin
+ * is set to input mode before calling. The SCL pin must be low. */
+static inline u32 read_bits(struct bbkeys_info *bb, int count)
+{
+ u32 data = 0;
+ int i = count;
+
+ for (; i>0; i--) {
+ data <<= 1;
+
+ set_scl(bb, 1);
+
+ if (get_sda(bb))
+ data |= 1;
+ dprintf(2, "Read bit of %d", data & 1);
+
+ set_scl(bb, 0);
+ }
+ dprintf(1, "Read %d bits: 0x%08x", count, data);
+ return data;
+}
+
+/* Write 'count' bits to SDA pin. The caller must ensure the SDA pin
+ * is set to output mode before calling. The SCL pin must be low. */
+static inline void write_bits(struct bbkeys_info *bb, u32 data, int count)
+{
+ u32 bit = 1<<(count-1);
+ dprintf(1, "Writing %d bits: 0x%08x", count, data);
+
+ for (; count>0; count--) {
+ set_sda(bb, data & bit);
+ dprintf(2, "Write bit of %d", !!(data & bit));
+
+ set_scl(bb, 1);
+ set_scl(bb, 0);
+
+ data <<= 1;
+ }
+}
+
+/* Init the gpio lines and send a stop followed by a start. */
+static inline void stopstart(struct bbkeys_info *bb)
+{
+ dprintf(1, "Stop Start");
+
+ /* Init lines */
+ set_sda_output(bb);
+ set_scl(bb, 0);
+ set_sda(bb, 0);
+
+ /* Send stop */
+ set_scl(bb, 1);
+ set_sda(bb, 1);
+
+ /* Send start */
+ set_sda(bb, 0);
+ set_scl(bb, 0);
+}
+
+/* Read a register from the bit-banging interface. */
+static u32 __bbkeys_read(struct bbkeys_info *bb, u32 reg)
+{
+ u32 val;
+ stopstart(bb);
+
+ /* Set read indicator as low order bit. */
+ val = reg << 1;
+ val |= 1;
+
+ /* Send register */
+ write_bits(bb, val, 5);
+
+ /* Get ack. */
+ set_sda_input(bb);
+ val = read_bits(bb, 1);
+ if (! val)
+ goto fail;
+
+ /* Read register value. */
+ val = read_bits(bb, 9);
+ if (!(val & 1))
+ goto fail;
+ val >>= 1;
+
+ return val;
+fail:
+ printk(KERN_WARNING "BBKEYS - Missing ack\n");
+ return 0;
+}
+
+static u32 bbkeys_read(struct bbkeys_info *bb, u32 reg)
+{
+ u32 ret;
+ unsigned long flag;
+ spin_lock_irqsave(&bb->lock, flag);
+ ret = __bbkeys_read(bb, reg);
+ spin_unlock_irqrestore(&bb->lock, flag);
+ return ret;
+}
+
+/* Write a register on the bit-banging interface. */
+static void __bbkeys_write(struct bbkeys_info *bb, u32 reg, u32 data)
+{
+ stopstart(bb);
+
+ /* Set write indicator as low order bit. */
+ reg <<= 1;
+
+ /* Send register */
+ write_bits(bb, reg, 5);
+
+ /* Get ack. */
+ set_sda_input(bb);
+ reg = read_bits(bb, 1);
+ if (! reg)
+ goto fail;
+ set_sda_output(bb);
+
+ /* write register value. */
+ write_bits(bb, data, 8);
+ set_sda_input(bb);
+ reg = read_bits(bb, 1);
+ if (!reg)
+ goto fail;
+ return;
+fail:
+ printk(KERN_WARNING "BBKEYS - Missing ack\n");
+}
+
+static void bbkeys_write(struct bbkeys_info *bb, u32 reg, u32 data)
+{
+ unsigned long flag;
+ spin_lock_irqsave(&bb->lock, flag);
+ __bbkeys_write(bb, reg, data);
+ spin_unlock_irqrestore(&bb->lock, flag);
+}
+
+
+/****************************************************************
+ * Keypad
+ ****************************************************************/
+
+static irqreturn_t bbkeys_isr(int irq, void *dev_id)
+{
+ int i;
+ struct platform_device *pdev = dev_id;
+ struct htc_bbkeys_platform_data *pdata = pdev->dev.platform_data;
+ struct bbkeys_info *bb = platform_get_drvdata(pdev);
+ u32 regs;
+
+ /* Ack the interrupt. */
+ bbkeys_write(bb, pdata->ackreg, 0);
+
+ /* Read the key status registers */
+ regs = ~(bbkeys_read(bb, pdata->key1reg)
+ | (bbkeys_read(bb, pdata->key2reg) << 8));
+
+ /* Register the state of the keys */
+ for (i = 0; i < BBKEYS_MAXKEY; i++) {
+ int key = pdata->buttons[i];
+ int state = !!(regs & (1<<i));
+ if (key < 0)
+ continue;
+ input_report_key(bb->input, key, state);
+ input_sync(bb->input);
+ }
+
+ return IRQ_HANDLED;
+}
+
+/* Delayed input driver data. */
+static int InputReady;
+static struct platform_device *Early_pdev;
+
+static int key_setup(struct platform_device *pdev)
+{
+ struct bbkeys_info *bb = platform_get_drvdata(pdev);
+ struct htc_bbkeys_platform_data *pdata = pdev->dev.platform_data;
+ struct input_dev *input;
+ struct resource *res;
+ int i, ret;
+
+ if (! InputReady) {
+ printk("Delaying registration of bbkeys input driver\n");
+ Early_pdev = pdev;
+ return 0;
+ }
+
+ /* Find keyboard irq */
+ res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
+ if (!res)
+ return -EINVAL;
+ bb->irq = res->start;
+
+ input = input_allocate_device();
+ if (!input)
+ return -ENOMEM;
+
+ set_bit(EV_KEY, input->evbit);
+
+ input->name = pdev->name;
+ bb->input = input;
+
+ for (i = 0; i < BBKEYS_MAXKEY; i++) {
+ int code = pdata->buttons[i];
+ if (code >= 0)
+ set_bit(code, input->keybit);
+ }
+
+ ret = input_register_device(input);
+ if (ret < 0) {
+ printk(KERN_ERR "Unable to register bbkeys input device\n");
+ goto fail;
+ }
+
+ ret = request_irq(bb->irq, bbkeys_isr
+ , IRQF_DISABLED | IRQF_TRIGGER_RISING
+ | IRQF_SAMPLE_RANDOM
+ , pdev->name, pdev);
+ if (ret)
+ goto fail;
+
+ /* Clear any queued up key events. */
+ bbkeys_write(bb, pdata->ackreg, 0);
+
+ return 0;
+
+fail:
+ input_free_device(input);
+ return ret;
+}
+
+
+/****************************************************************
+ * GPIOs
+ ****************************************************************/
+
+static inline int u8pos(unsigned gpio) {
+ return (gpio & GPIO_BASE_MASK) / 8;
+}
+static inline int u8bit(unsigned gpio) {
+ return 1<<(gpio & (8-1));
+}
+
+/* Check an input pin to see if it is active. */
+static int bbkeys_get(struct device *dev, unsigned gpio)
+{
+ struct bbkeys_info *bb = dev_get_drvdata(dev);
+ u32 readval = bbkeys_read(bb, u8pos(gpio));
+ return !!(readval & u8bit(gpio));
+}
+
+/* Set the direction of an output pin. */
+static void bbkeys_set(struct device *dev, unsigned gpio, int val)
+{
+ struct bbkeys_info *bb = dev_get_drvdata(dev);
+ int pos = u8pos(gpio);
+ unsigned long flag;
+
+ spin_lock_irqsave(&bb->lock, flag);
+ if (val)
+ bb->outcache[pos] |= u8bit(gpio);
+ else
+ bb->outcache[pos] &= ~u8bit(gpio);
+ __bbkeys_write(bb, pos, bb->outcache[pos]);
+ spin_unlock_irqrestore(&bb->lock, flag);
+}
+
+/* Dummy handler - this device doesn't support irqs. */
+static int bbkeys_to_irq(struct device *dev, unsigned gpio_no)
+{
+ return -ENODEV;
+}
+
+
+/****************************************************************
+ * Setup
+ ****************************************************************/
+
+static int bbkeys_probe(struct platform_device *pdev)
+{
+ struct htc_bbkeys_platform_data *pdata = pdev->dev.platform_data;
+ struct bbkeys_info *bb;
+ int ret;
+ struct gpio_ops ops;
+
+ /* Initialize bb data structure. */
+ bb = kzalloc(sizeof(*bb), GFP_KERNEL);
+ if (!bb)
+ return -ENOMEM;
+
+ spin_lock_init(&bb->lock);
+
+ bb->sda_gpio = pdata->sda_gpio;
+ bb->scl_gpio = pdata->scl_gpio;
+
+ platform_set_drvdata(pdev, bb);
+
+ /* Setup input handling */
+ ret = key_setup(pdev);
+ if (ret)
+ goto fail;
+
+ ops.get_value = bbkeys_get;
+ ops.set_value = bbkeys_set;
+ ops.to_irq = bbkeys_to_irq;
+ gpiodev_register(pdata->gpio_base, &pdev->dev, &ops);
+
+ return 0;
+fail:
+ printk(KERN_NOTICE "BBKEYS failed to setup\n");
+ kfree(bb);
+ return ret;
+}
+
+static int bbkeys_remove(struct platform_device *pdev)
+{
+ struct bbkeys_info *bb = platform_get_drvdata(pdev);
+ free_irq(bb->irq, pdev);
+ input_unregister_device(bb->input);
+ kfree(bb);
+ return 0;
+}
+
+static struct platform_driver bbkeys_driver = {
+ .driver = {
+ .name = "htc-bbkeys",
+ },
+ .probe = bbkeys_probe,
+ .remove = bbkeys_remove,
+};
+
+static int __init bbkeys_init(void)
+{
+ return platform_driver_register(&bbkeys_driver);
+}
+
+static void __exit bbkeys_exit(void)
+{
+ platform_driver_unregister(&bbkeys_driver);
+}
+
+/* Ugh. The input subsystem comes up later in the boot process, but
+ * several devices need the bbkeys gpio driver earlier. So, if this
+ * driver comes up early, we delay input registration until later in
+ * the boot. */
+static int __init bbkeys_late_init(void)
+{
+ InputReady = 1;
+ if (Early_pdev) {
+ printk("Registering delayed bbkeys input driver\n");
+ key_setup(Early_pdev);
+ }
+ Early_pdev = NULL;
+ return 0;
+}
+
+module_init(bbkeys_late_init)
+#ifdef MODULE
+module_init(bbkeys_init);
+#else /* start early for dependencies */
+subsys_initcall(bbkeys_init);
+#endif
+module_exit(bbkeys_exit)
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Kevin O'Connor <ke...@ko...>");
Added: linux4palm/linux/branches/cleanup-branch-never-commit/usr/.gitignore
===================================================================
--- linux4palm/linux/branches/cleanup-branch-never-commit/usr/.gitignore (rev 0)
+++ linux4palm/linux/branches/cleanup-branch-never-commit/usr/.gitignore 2007-09-17 20:13:33 UTC (rev 1331)
@@ -0,0 +1,7 @@
+#
+# Generated files
+#
+gen_init_cpio
+initramfs_data.cpio
+initramfs_data.cpio.gz
+initramfs_list
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <hap...@us...> - 2007-09-17 19:54:42
|
Revision: 1330
http://hackndev.svn.sourceforge.net/hackndev/?rev=1330&view=rev
Author: happy-slapin
Date: 2007-09-17 12:54:28 -0700 (Mon, 17 Sep 2007)
Log Message:
-----------
cleanup: getting from hh.org
Modified Paths:
--------------
linux4palm/linux/branches/cleanup-branch-never-commit/arch/arm/configs/htcuniversal_defconfig
linux4palm/linux/branches/cleanup-branch-never-commit/arch/arm/configs/magician_defconfig
linux4palm/linux/branches/cleanup-branch-never-commit/drivers/usb/gadget/zero.c
Modified: linux4palm/linux/branches/cleanup-branch-never-commit/arch/arm/configs/htcuniversal_defconfig
===================================================================
--- linux4palm/linux/branches/cleanup-branch-never-commit/arch/arm/configs/htcuniversal_defconfig 2007-09-17 19:41:58 UTC (rev 1329)
+++ linux4palm/linux/branches/cleanup-branch-never-commit/arch/arm/configs/htcuniversal_defconfig 2007-09-17 19:54:28 UTC (rev 1330)
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
-# Linux kernel version: 2.6.21-hh2
-# Wed May 16 19:58:40 2007
+# Linux kernel version: 2.6.21-hh16
+# Sun Sep 16 14:03:47 2007
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -28,20 +28,20 @@
#
CONFIG_EXPERIMENTAL=y
CONFIG_BROKEN_ON_SMP=y
+CONFIG_LOCK_KERNEL=y
CONFIG_INIT_ENV_ARG_LIMIT=32
#
# General setup
#
CONFIG_LOCALVERSION=""
-# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_LOCALVERSION_AUTO=y
CONFIG_SWAP=y
CONFIG_SYSVIPC=y
# CONFIG_IPC_NS is not set
CONFIG_SYSVIPC_SYSCTL=y
-CONFIG_POSIX_MQUEUE=y
-CONFIG_BSD_PROCESS_ACCT=y
-CONFIG_BSD_PROCESS_ACCT_V3=y
+# CONFIG_POSIX_MQUEUE is not set
+# CONFIG_BSD_PROCESS_ACCT is not set
# CONFIG_TASKSTATS is not set
# CONFIG_UTS_NS is not set
# CONFIG_AUDIT is not set
@@ -50,10 +50,10 @@
CONFIG_SYSFS_DEPRECATED=y
# CONFIG_RELAY is not set
# CONFIG_BLK_DEV_INITRD is not set
-# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
CONFIG_SYSCTL=y
CONFIG_EMBEDDED=y
-CONFIG_UID16=y
+# CONFIG_UID16 is not set
CONFIG_SYSCTL_SYSCALL=y
CONFIG_KALLSYMS=y
# CONFIG_KALLSYMS_EXTRA_PASS is not set
@@ -96,12 +96,12 @@
CONFIG_IOSCHED_NOOP=y
CONFIG_IOSCHED_AS=y
CONFIG_IOSCHED_DEADLINE=y
-CONFIG_IOSCHED_CFQ=y
-# CONFIG_DEFAULT_AS is not set
+# CONFIG_IOSCHED_CFQ is not set
+CONFIG_DEFAULT_AS=y
# CONFIG_DEFAULT_DEADLINE is not set
-CONFIG_DEFAULT_CFQ=y
+# CONFIG_DEFAULT_CFQ is not set
# CONFIG_DEFAULT_NOOP is not set
-CONFIG_DEFAULT_IOSCHED="cfq"
+CONFIG_DEFAULT_IOSCHED="anticipatory"
#
# System Type
@@ -175,6 +175,10 @@
# CONFIG_MACH_MAGICIAN is not set
# CONFIG_MACH_HTCAPACHE is not set
# CONFIG_MACH_BLUEANGEL is not set
+
+#
+# HTC_HW6X00
+#
# CONFIG_MACH_HTCBEETLES is not set
# CONFIG_MACH_HW6900 is not set
# CONFIG_MACH_HTCATHENA is not set
@@ -187,9 +191,13 @@
# CONFIG_MACH_XSCALE_PALMLD is not set
# CONFIG_MACH_T3XSCALE is not set
# CONFIG_MACH_RECON is not set
+# CONFIG_MACH_GHI270HG is not set
+# CONFIG_MACH_GHI270 is not set
+# CONFIG_MACH_LOOXC550 is not set
# CONFIG_PXA_SHARPSL is not set
# CONFIG_MACH_TRIZEPS4 is not set
CONFIG_PXA27x=y
+# CONFIG_PXA27x_VOLTAGE is not set
#
# Linux As Bootloader
@@ -211,7 +219,7 @@
#
# Processor Features
#
-# CONFIG_ARM_THUMB is not set
+CONFIG_ARM_THUMB=y
# CONFIG_CPU_DCACHE_DISABLE is not set
# CONFIG_OUTER_CACHE is not set
CONFIG_IWMMXT=y
@@ -229,8 +237,8 @@
#
# Kernel Features
#
-# CONFIG_PREEMPT is not set
-# CONFIG_NO_IDLE_HZ is not set
+CONFIG_PREEMPT=y
+CONFIG_NO_IDLE_HZ=y
CONFIG_HZ=100
CONFIG_AEABI=y
CONFIG_OABI_COMPAT=y
@@ -254,12 +262,26 @@
CONFIG_ZBOOT_ROM_BSS=0x0
CONFIG_CMDLINE=""
# CONFIG_XIP_KERNEL is not set
-# CONFIG_KEXEC is not set
+CONFIG_KEXEC=y
+# CONFIG_TXTOFFSET_DELTA is not set
#
# CPU Frequency scaling
#
-# CONFIG_CPU_FREQ is not set
+CONFIG_CPU_FREQ=y
+CONFIG_CPU_FREQ_TABLE=y
+CONFIG_CPU_FREQ_DEBUG=y
+CONFIG_CPU_FREQ_STAT=y
+CONFIG_CPU_FREQ_STAT_DETAILS=y
+# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
+CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
+CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
+# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
+CONFIG_CPU_FREQ_GOV_USERSPACE=y
+# CONFIG_CPU_FREQ_GOV_ONDEMAND is not set
+CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
+CONFIG_CPU_FREQ_PXA=y
+CONFIG_PXA25x_ALTERNATE_FREQS=y
#
# Floating point emulation
@@ -284,10 +306,9 @@
#
CONFIG_PM=y
# CONFIG_PM_LEGACY is not set
-CONFIG_PM_DEBUG=y
-# CONFIG_DPM_DEBUG is not set
-# CONFIG_DISABLE_CONSOLE_SUSPEND is not set
-# CONFIG_PM_SYSFS_DEPRECATED is not set
+# CONFIG_PM_DEBUG is not set
+CONFIG_DPM_DEBUG=y
+CONFIG_PM_SYSFS_DEPRECATED=y
CONFIG_APM_EMULATION=y
#
@@ -302,10 +323,6 @@
CONFIG_PACKET=y
CONFIG_PACKET_MMAP=y
CONFIG_UNIX=y
-CONFIG_XFRM=y
-# CONFIG_XFRM_USER is not set
-# CONFIG_XFRM_SUB_POLICY is not set
-# CONFIG_XFRM_MIGRATE is not set
# CONFIG_NET_KEY is not set
CONFIG_INET=y
CONFIG_IP_MULTICAST=y
@@ -325,9 +342,9 @@
# CONFIG_INET_IPCOMP is not set
# CONFIG_INET_XFRM_TUNNEL is not set
# CONFIG_INET_TUNNEL is not set
-CONFIG_INET_XFRM_MODE_TRANSPORT=y
-CONFIG_INET_XFRM_MODE_TUNNEL=y
-CONFIG_INET_XFRM_MODE_BEET=y
+# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
+# CONFIG_INET_XFRM_MODE_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_BEET is not set
# CONFIG_INET_DIAG is not set
# CONFIG_TCP_CONG_ADVANCED is not set
CONFIG_TCP_CONG_CUBIC=y
@@ -467,9 +484,81 @@
#
# Memory Technology Devices (MTD)
#
-# CONFIG_MTD is not set
+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+CONFIG_MTD_CONCAT=y
+CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_REDBOOT_PARTS is not set
+# CONFIG_MTD_CMDLINE_PARTS is not set
+# CONFIG_MTD_AFS_PARTS is not set
#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLKDEVS=y
+CONFIG_MTD_BLOCK=y
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set
+# CONFIG_INFTL is not set
+# CONFIG_RFD_FTL is not set
+# CONFIG_SSFDC is not set
+
+#
+# RAM/ROM/Flash chip drivers
+#
+# CONFIG_MTD_CFI is not set
+# CONFIG_MTD_JEDECPROBE is not set
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+# CONFIG_MTD_RAM is not set
+# CONFIG_MTD_ROM is not set
+# CONFIG_MTD_ABSENT is not set
+# CONFIG_MTD_OBSOLETE_CHIPS is not set
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+# CONFIG_MTD_SHARP_SL is not set
+# CONFIG_MTD_PLATRAM is not set
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_DATAFLASH is not set
+# CONFIG_MTD_M25P80 is not set
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_PHRAM is not set
+# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_BLOCK2MTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+# CONFIG_MTD_DOC2000 is not set
+# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOC2001PLUS is not set
+
+#
+# NAND Flash Device Drivers
+#
+# CONFIG_MTD_NAND is not set
+
+#
+# OneNAND Flash Device Drivers
+#
+# CONFIG_MTD_ONENAND is not set
+
+#
# Parallel port support
#
# CONFIG_PARPORT is not set
@@ -487,7 +576,10 @@
# CONFIG_BLK_DEV_CRYPTOLOOP is not set
# CONFIG_BLK_DEV_NBD is not set
# CONFIG_BLK_DEV_UB is not set
-# CONFIG_BLK_DEV_RAM is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=4096
+CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
# CONFIG_CDROM_PKTCDVD is not set
# CONFIG_ATA_OVER_ETH is not set
@@ -500,45 +592,10 @@
# SCSI device support
#
# CONFIG_RAID_ATTRS is not set
-CONFIG_SCSI=y
-# CONFIG_SCSI_TGT is not set
+# CONFIG_SCSI is not set
# CONFIG_SCSI_NETLINK is not set
-# CONFIG_SCSI_PROC_FS is not set
#
-# SCSI support type (disk, tape, CD-ROM)
-#
-# CONFIG_BLK_DEV_SD is not set
-# CONFIG_CHR_DEV_ST is not set
-# CONFIG_CHR_DEV_OSST is not set
-# CONFIG_BLK_DEV_SR is not set
-# CONFIG_CHR_DEV_SG is not set
-# CONFIG_CHR_DEV_SCH is not set
-
-#
-# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
-#
-# CONFIG_SCSI_MULTI_LUN is not set
-# CONFIG_SCSI_CONSTANTS is not set
-# CONFIG_SCSI_LOGGING is not set
-# CONFIG_SCSI_SCAN_ASYNC is not set
-
-#
-# SCSI Transports
-#
-# CONFIG_SCSI_SPI_ATTRS is not set
-# CONFIG_SCSI_FC_ATTRS is not set
-# CONFIG_SCSI_ISCSI_ATTRS is not set
-# CONFIG_SCSI_SAS_ATTRS is not set
-# CONFIG_SCSI_SAS_LIBSAS is not set
-
-#
-# SCSI low-level drivers
-#
-# CONFIG_ISCSI_TCP is not set
-# CONFIG_SCSI_DEBUG is not set
-
-#
# Serial ATA (prod) and Parallel ATA (experimental) drivers
#
# CONFIG_ATA is not set
@@ -606,6 +663,7 @@
CONFIG_ACX=m
# CONFIG_ACX_USB is not set
CONFIG_ACX_MEM=y
+# CONFIG_ACX_CS is not set
CONFIG_ACX_HTCUNIVERSAL=m
#
@@ -647,6 +705,7 @@
# CONFIG_INPUT_TSDEV is not set
CONFIG_INPUT_EVDEV=y
# CONFIG_INPUT_EVBUG is not set
+# CONFIG_INPUT_LED_TRIGGER is not set
#
# Input Device Drivers
@@ -659,6 +718,7 @@
# CONFIG_KEYBOARD_NEWTON is not set
# CONFIG_KEYBOARD_STOWAWAY is not set
# CONFIG_GPIODEV_KEYS is not set
+# CONFIG_GPIODEV_KEYS2 is not set
# CONFIG_GPIODEV_DIAGONAL is not set
CONFIG_KEYBOARD_ASIC3=y
CONFIG_KEYBOARD_PXA27x=y
@@ -666,7 +726,8 @@
# CONFIG_INPUT_MOUSE is not set
# CONFIG_INPUT_JOYSTICK is not set
# CONFIG_INPUT_TOUCHSCREEN is not set
-# CONFIG_INPUT_MISC is not set
+CONFIG_INPUT_MISC=y
+CONFIG_INPUT_UINPUT=m
#
# Hardware I/O ports
@@ -760,10 +821,10 @@
# CONFIG_SENSORS_PCF8591 is not set
# CONFIG_SENSORS_RTC8564 is not set
# CONFIG_SENSORS_MAX6875 is not set
-CONFIG_I2C_DEBUG_CORE=y
-CONFIG_I2C_DEBUG_ALGO=y
-CONFIG_I2C_DEBUG_BUS=y
-CONFIG_I2C_DEBUG_CHIP=y
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
#
# SPI support
@@ -792,7 +853,7 @@
#
# CONFIG_W1_MASTER_DS2490 is not set
# CONFIG_W1_MASTER_DS2482 is not set
-# CONFIG_W1_MASTER_DS1WM is not set
+CONFIG_W1_MASTER_DS1WM=y
#
# 1-wire Slaves
@@ -800,7 +861,7 @@
# CONFIG_W1_SLAVE_THERM is not set
# CONFIG_W1_SLAVE_SMEM is not set
# CONFIG_W1_SLAVE_DS2433 is not set
-CONFIG_W1_DS2760=y
+CONFIG_W1_SLAVE_DS2760=y
#
# Hardware Monitoring support
@@ -849,15 +910,11 @@
# CONFIG_SENSORS_W83627HF is not set
# CONFIG_SENSORS_W83627EHF is not set
# CONFIG_HWMON_DEBUG_CHIP is not set
-
-#
-# Hardware Monitoring - external power and batteries
-#
-CONFIG_EXTERNAL_POWER=y
-CONFIG_BATTERY=y
+CONFIG_POWER_SUPPLY=y
+# CONFIG_POWER_SUPPLY_DEBUG is not set
CONFIG_PDA_POWER=y
-CONFIG_DS2760_BATTERY=y
CONFIG_APM_POWER=y
+CONFIG_BATTERY_DS2760=y
#
# L3 serial bus support
@@ -865,21 +922,6 @@
# CONFIG_L3 is not set
#
-# SoC drivers
-#
-# CONFIG_SOC_MQ11XX is not set
-# CONFIG_SOC_T7L66XB is not set
-# CONFIG_SOC_TC6387XB is not set
-# CONFIG_SOC_TC6393XB is not set
-# CONFIG_SOC_SAMCOP is not set
-# CONFIG_SOC_HAMCOP is not set
-# CONFIG_HTC_ASIC2 is not set
-CONFIG_HTC_ASIC3=y
-CONFIG_HTC_ASIC3_DS1WM=y
-# CONFIG_SOC_TSC2101 is not set
-# CONFIG_SOC_TSC2200 is not set
-
-#
# Misc devices
#
@@ -889,9 +931,33 @@
# CONFIG_ADC is not set
#
+# Compaq/iPAQ Drivers
+#
+
+#
+# Compaq/HP iPAQ Drivers
+#
+# CONFIG_IPAQ_SLEEVE is not set
+# CONFIG_SLEEVE_DEBUG is not set
+
+#
# Multifunction device drivers
#
# CONFIG_MFD_SM501 is not set
+# CONFIG_HTC_ASIC2 is not set
+CONFIG_HTC_ASIC3=y
+# CONFIG_HTC_PASIC3 is not set
+# CONFIG_HTC_EGPIO is not set
+# CONFIG_HTC_BBKEYS is not set
+CONFIG_HTC_ASIC3_DS1WM=y
+# CONFIG_SOC_SAMCOP is not set
+# CONFIG_SOC_HAMCOP is not set
+# CONFIG_SOC_MQ11XX is not set
+# CONFIG_SOC_T7L66XB is not set
+# CONFIG_SOC_TC6387XB is not set
+# CONFIG_SOC_TC6393XB is not set
+# CONFIG_SOC_TSC2101 is not set
+# CONFIG_SOC_TSC2200 is not set
#
# LED devices
@@ -903,15 +969,17 @@
# LED drivers
#
CONFIG_LEDS_ASIC3=y
+# CONFIG_LEDS_GPIO is not set
#
# LED Triggers
#
CONFIG_LEDS_TRIGGERS=y
-# CONFIG_LEDS_TRIGGER_TIMER is not set
-CONFIG_LEDS_TRIGGER_HWTIMER=m
+CONFIG_LEDS_TRIGGER_TIMER=y
+CONFIG_LEDS_TRIGGER_HWTIMER=y
+CONFIG_LEDS_TRIGGER_BACKLIGHT=y
# CONFIG_LEDS_TRIGGER_HEARTBEAT is not set
-# CONFIG_LEDS_TRIGGER_SHARED is not set
+CONFIG_LEDS_TRIGGER_SHARED=y
#
# Multimedia devices
@@ -976,10 +1044,7 @@
#
# Logo configuration
#
-CONFIG_LOGO=y
-# CONFIG_LOGO_LINUX_MONO is not set
-# CONFIG_LOGO_LINUX_VGA16 is not set
-CONFIG_LOGO_LINUX_CLUT224=y
+# CONFIG_LOGO is not set
#
# Sound
@@ -1000,10 +1065,8 @@
# CONFIG_SND_DYNAMIC_MINORS is not set
CONFIG_SND_SUPPORT_OLD_API=y
CONFIG_SND_VERBOSE_PROCFS=y
-CONFIG_SND_VERBOSE_PRINTK=y
-CONFIG_SND_DEBUG=y
-CONFIG_SND_DEBUG_DETECT=y
-# CONFIG_SND_PCM_XRUN_DEBUG is not set
+# CONFIG_SND_VERBOSE_PRINTK is not set
+# CONFIG_SND_DEBUG is not set
#
# Generic devices
@@ -1082,7 +1145,6 @@
#
# may also be needed; see USB_STORAGE Help for more information
#
-# CONFIG_USB_STORAGE is not set
# CONFIG_USB_LIBUSUAL is not set
#
@@ -1113,7 +1175,6 @@
# USB Imaging devices
#
# CONFIG_USB_MDC800 is not set
-# CONFIG_USB_MICROTEK is not set
#
# USB Network Adapters
@@ -1123,16 +1184,7 @@
# CONFIG_USB_PEGASUS is not set
# CONFIG_USB_RTL8150 is not set
# CONFIG_USB_USBNET_MII is not set
-CONFIG_USB_USBNET=y
-CONFIG_USB_NET_CDCETHER=y
-# CONFIG_USB_NET_DM9601 is not set
-# CONFIG_USB_NET_GL620A is not set
-# CONFIG_USB_NET_NET1080 is not set
-# CONFIG_USB_NET_PLUSB is not set
-# CONFIG_USB_NET_MCS7830 is not set
-# CONFIG_USB_NET_RNDIS_HOST is not set
-# CONFIG_USB_NET_CDC_SUBSET is not set
-# CONFIG_USB_NET_ZAURUS is not set
+# CONFIG_USB_USBNET is not set
# CONFIG_USB_MON is not set
#
@@ -1142,7 +1194,44 @@
#
# USB Serial Converter support
#
-# CONFIG_USB_SERIAL is not set
+CONFIG_USB_SERIAL=m
+CONFIG_USB_SERIAL_GENERIC=y
+# CONFIG_USB_SERIAL_AIRCABLE is not set
+# CONFIG_USB_SERIAL_AIRPRIME is not set
+# CONFIG_USB_SERIAL_ARK3116 is not set
+# CONFIG_USB_SERIAL_BELKIN is not set
+# CONFIG_USB_SERIAL_WHITEHEAT is not set
+# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
+# CONFIG_USB_SERIAL_CP2101 is not set
+# CONFIG_USB_SERIAL_CYPRESS_M8 is not set
+# CONFIG_USB_SERIAL_EMPEG is not set
+# CONFIG_USB_SERIAL_FTDI_SIO is not set
+# CONFIG_USB_SERIAL_FUNSOFT is not set
+# CONFIG_USB_SERIAL_VISOR is not set
+# CONFIG_USB_SERIAL_IPAQ is not set
+# CONFIG_USB_SERIAL_IR is not set
+# CONFIG_USB_SERIAL_EDGEPORT is not set
+# CONFIG_USB_SERIAL_EDGEPORT_TI is not set
+# CONFIG_USB_SERIAL_GARMIN is not set
+# CONFIG_USB_SERIAL_IPW is not set
+# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
+# CONFIG_USB_SERIAL_KEYSPAN is not set
+# CONFIG_USB_SERIAL_KLSI is not set
+# CONFIG_USB_SERIAL_KOBIL_SCT is not set
+# CONFIG_USB_SERIAL_MCT_U232 is not set
+# CONFIG_USB_SERIAL_MOS7720 is not set
+# CONFIG_USB_SERIAL_MOS7840 is not set
+# CONFIG_USB_SERIAL_NAVMAN is not set
+# CONFIG_USB_SERIAL_PL2303 is not set
+# CONFIG_USB_SERIAL_HP4X is not set
+# CONFIG_USB_SERIAL_SAFE is not set
+# CONFIG_USB_SERIAL_SIERRAWIRELESS is not set
+# CONFIG_USB_SERIAL_TI is not set
+# CONFIG_USB_SERIAL_CYBERJACK is not set
+# CONFIG_USB_SERIAL_XIRCOM is not set
+# CONFIG_USB_SERIAL_OPTION is not set
+# CONFIG_USB_SERIAL_OMNINET is not set
+# CONFIG_USB_SERIAL_DEBUG is not set
#
# USB Miscellaneous drivers
@@ -1192,13 +1281,13 @@
# CONFIG_USB_GADGET_DUALSPEED is not set
# CONFIG_USB_ZERO is not set
CONFIG_USB_ETH=y
-# CONFIG_USB_ETH_RNDIS is not set
+CONFIG_USB_ETH_RNDIS=y
# CONFIG_USB_GADGETFS is not set
# CONFIG_USB_FILE_STORAGE is not set
# CONFIG_USB_G_SERIAL is not set
# CONFIG_USB_MIDI_GADGET is not set
# CONFIG_USB_G_CHAR is not set
-# CONFIG_USB_PXA2XX_GPIO is not set
+CONFIG_USB_PXA2XX_GPIO=y
#
# MMC/SD Card support
@@ -1215,14 +1304,17 @@
# Real Time Clock
#
CONFIG_RTC_LIB=y
-CONFIG_RTC_CLASS=m
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_HCTOSYS=y
+CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
+CONFIG_RTC_DEBUG=y
#
# RTC interfaces
#
-CONFIG_RTC_INTF_SYSFS=m
-CONFIG_RTC_INTF_PROC=m
-CONFIG_RTC_INTF_DEV=m
+CONFIG_RTC_INTF_SYSFS=y
+CONFIG_RTC_INTF_PROC=y
+CONFIG_RTC_INTF_DEV=y
# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
#
@@ -1235,11 +1327,11 @@
# CONFIG_RTC_DRV_ISL1208 is not set
# CONFIG_RTC_DRV_DS1672 is not set
# CONFIG_RTC_DRV_DS1742 is not set
-CONFIG_RTC_DRV_PCF8563=m
+# CONFIG_RTC_DRV_PCF8563 is not set
# CONFIG_RTC_DRV_RS5C348 is not set
# CONFIG_RTC_DRV_RS5C372 is not set
# CONFIG_RTC_DRV_M48T86 is not set
-CONFIG_RTC_DRV_SA1100=m
+CONFIG_RTC_DRV_SA1100=y
# CONFIG_RTC_DRV_TEST is not set
# CONFIG_RTC_DRV_MAX6902 is not set
# CONFIG_RTC_DRV_V3020 is not set
@@ -1262,14 +1354,14 @@
# CONFIG_GFS2_FS is not set
# CONFIG_OCFS2_FS is not set
# CONFIG_MINIX_FS is not set
-CONFIG_ROMFS_FS=y
+# CONFIG_ROMFS_FS is not set
CONFIG_INOTIFY=y
CONFIG_INOTIFY_USER=y
# CONFIG_QUOTA is not set
CONFIG_DNOTIFY=y
# CONFIG_AUTOFS_FS is not set
# CONFIG_AUTOFS4_FS is not set
-CONFIG_FUSE_FS=m
+# CONFIG_FUSE_FS is not set
#
# CD-ROM/DVD Filesystems
@@ -1309,7 +1401,19 @@
# CONFIG_BEFS_FS is not set
# CONFIG_BFS_FS is not set
# CONFIG_EFS_FS is not set
-CONFIG_CRAMFS=y
+CONFIG_JFFS2_FS=y
+CONFIG_JFFS2_FS_DEBUG=0
+CONFIG_JFFS2_FS_WRITEBUFFER=y
+# CONFIG_JFFS2_SUMMARY is not set
+# CONFIG_JFFS2_FS_XATTR is not set
+CONFIG_JFFS2_COMPRESSION_OPTIONS=y
+CONFIG_JFFS2_ZLIB=y
+CONFIG_JFFS2_RTIME=y
+# CONFIG_JFFS2_RUBIN is not set
+# CONFIG_JFFS2_CMODE_NONE is not set
+CONFIG_JFFS2_CMODE_PRIORITY=y
+# CONFIG_JFFS2_CMODE_SIZE is not set
+# CONFIG_CRAMFS is not set
# CONFIG_VXFS_FS is not set
# CONFIG_HPFS_FS is not set
# CONFIG_QNX4FS_FS is not set
@@ -1322,8 +1426,8 @@
CONFIG_NFS_FS=m
CONFIG_NFS_V3=y
CONFIG_NFS_V3_ACL=y
-CONFIG_NFS_V4=y
-CONFIG_NFS_DIRECTIO=y
+# CONFIG_NFS_V4 is not set
+# CONFIG_NFS_DIRECTIO is not set
# CONFIG_NFSD is not set
CONFIG_LOCKD=m
CONFIG_LOCKD_V4=y
@@ -1365,7 +1469,7 @@
# CONFIG_NLS_CODEPAGE_862 is not set
# CONFIG_NLS_CODEPAGE_863 is not set
# CONFIG_NLS_CODEPAGE_864 is not set
-# CONFIG_NLS_CODEPAGE_865 is not set
+CONFIG_NLS_CODEPAGE_865=y
# CONFIG_NLS_CODEPAGE_866 is not set
# CONFIG_NLS_CODEPAGE_869 is not set
# CONFIG_NLS_CODEPAGE_936 is not set
@@ -1405,7 +1509,7 @@
#
# Kernel hacking
#
-# CONFIG_PRINTK_TIME is not set
+CONFIG_PRINTK_TIME=y
CONFIG_ENABLE_MUST_CHECK=y
# CONFIG_MAGIC_SYSRQ is not set
# CONFIG_UNUSED_SYMBOLS is not set
@@ -1428,38 +1532,37 @@
#
CONFIG_CRYPTO=y
CONFIG_CRYPTO_ALGAPI=y
-CONFIG_CRYPTO_BLKCIPHER=m
-CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_BLKCIPHER=y
CONFIG_CRYPTO_MANAGER=y
-CONFIG_CRYPTO_HMAC=y
+# CONFIG_CRYPTO_HMAC is not set
# CONFIG_CRYPTO_XCBC is not set
# CONFIG_CRYPTO_NULL is not set
# CONFIG_CRYPTO_MD4 is not set
CONFIG_CRYPTO_MD5=y
-CONFIG_CRYPTO_SHA1=y
+# CONFIG_CRYPTO_SHA1 is not set
# CONFIG_CRYPTO_SHA256 is not set
# CONFIG_CRYPTO_SHA512 is not set
# CONFIG_CRYPTO_WP512 is not set
# CONFIG_CRYPTO_TGR192 is not set
# CONFIG_CRYPTO_GF128MUL is not set
-CONFIG_CRYPTO_ECB=m
-CONFIG_CRYPTO_CBC=m
-CONFIG_CRYPTO_PCBC=m
+CONFIG_CRYPTO_ECB=y
+CONFIG_CRYPTO_CBC=y
+# CONFIG_CRYPTO_PCBC is not set
# CONFIG_CRYPTO_LRW is not set
CONFIG_CRYPTO_DES=y
# CONFIG_CRYPTO_FCRYPT is not set
# CONFIG_CRYPTO_BLOWFISH is not set
# CONFIG_CRYPTO_TWOFISH is not set
# CONFIG_CRYPTO_SERPENT is not set
-CONFIG_CRYPTO_AES=y
+# CONFIG_CRYPTO_AES is not set
# CONFIG_CRYPTO_CAST5 is not set
# CONFIG_CRYPTO_CAST6 is not set
# CONFIG_CRYPTO_TEA is not set
-CONFIG_CRYPTO_ARC4=y
+# CONFIG_CRYPTO_ARC4 is not set
# CONFIG_CRYPTO_KHAZAD is not set
# CONFIG_CRYPTO_ANUBIS is not set
-CONFIG_CRYPTO_DEFLATE=y
-CONFIG_CRYPTO_MICHAEL_MIC=y
+# CONFIG_CRYPTO_DEFLATE is not set
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
# CONFIG_CRYPTO_CRC32C is not set
# CONFIG_CRYPTO_CAMELLIA is not set
# CONFIG_CRYPTO_TEST is not set
Modified: linux4palm/linux/branches/cleanup-branch-never-commit/arch/arm/configs/magician_defconfig
===================================================================
--- linux4palm/linux/branches/cleanup-branch-never-commit/arch/arm/configs/magician_defconfig 2007-09-17 19:41:58 UTC (rev 1329)
+++ linux4palm/linux/branches/cleanup-branch-never-commit/arch/arm/configs/magician_defconfig 2007-09-17 19:54:28 UTC (rev 1330)
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
-# Linux kernel version: 2.6.21-hh8
-# Mon Jun 18 14:21:10 2007
+# Linux kernel version: 2.6.21-hh16
+# Sat Sep 15 11:20:21 2007
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -49,7 +49,8 @@
CONFIG_IKCONFIG_PROC=y
# CONFIG_SYSFS_DEPRECATED is not set
# CONFIG_RELAY is not set
-# CONFIG_BLK_DEV_INITRD is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
CONFIG_SYSCTL=y
CONFIG_EMBEDDED=y
@@ -169,6 +170,10 @@
CONFIG_MAGICIAN_PHONE=m
# CONFIG_MACH_HTCAPACHE is not set
# CONFIG_MACH_BLUEANGEL is not set
+
+#
+# HTC_HW6X00
+#
# CONFIG_MACH_HTCBEETLES is not set
# CONFIG_MACH_HW6900 is not set
# CONFIG_MACH_HTCATHENA is not set
@@ -182,6 +187,7 @@
# CONFIG_MACH_RECON is not set
# CONFIG_MACH_GHI270HG is not set
# CONFIG_MACH_GHI270 is not set
+# CONFIG_MACH_LOOXC550 is not set
# CONFIG_PXA_SHARPSL is not set
# CONFIG_MACH_TRIZEPS4 is not set
CONFIG_PXA27x=y
@@ -549,7 +555,7 @@
# CONFIG_MTD_COMPLEX_MAPPINGS is not set
CONFIG_MTD_PHYSMAP=m
CONFIG_MTD_PHYSMAP_START=0x8000000
-CONFIG_MTD_PHYSMAP_LEN=0
+CONFIG_MTD_PHYSMAP_LEN=0x0
CONFIG_MTD_PHYSMAP_BANKWIDTH=2
# CONFIG_MTD_ARM_INTEGRATOR is not set
# CONFIG_MTD_IPAQ is not set
@@ -561,7 +567,9 @@
#
# CONFIG_MTD_SLRAM is not set
# CONFIG_MTD_PHRAM is not set
-# CONFIG_MTD_MTDRAM is not set
+CONFIG_MTD_MTDRAM=m
+CONFIG_MTDRAM_TOTAL_SIZE=0
+CONFIG_MTDRAM_ERASE_SIZE=256
# CONFIG_MTD_BLOCK2MTD is not set
#
@@ -595,7 +603,8 @@
# Block devices
#
# CONFIG_BLK_DEV_COW_COMMON is not set
-# CONFIG_BLK_DEV_LOOP is not set
+CONFIG_BLK_DEV_LOOP=m
+# CONFIG_BLK_DEV_CRYPTOLOOP is not set
# CONFIG_BLK_DEV_NBD is not set
# CONFIG_BLK_DEV_UB is not set
# CONFIG_BLK_DEV_RAM is not set
@@ -723,7 +732,7 @@
# CONFIG_KEYBOARD_XTKBD is not set
# CONFIG_KEYBOARD_NEWTON is not set
# CONFIG_KEYBOARD_STOWAWAY is not set
-CONFIG_GPIODEV_KEYS=y
+# CONFIG_GPIODEV_KEYS is not set
# CONFIG_GPIODEV_DIAGONAL is not set
# CONFIG_KEYBOARD_PXA27x is not set
CONFIG_KEYBOARD_GPIO=y
@@ -892,6 +901,16 @@
# CONFIG_ADC_AD7877 is not set
#
+# Compaq/iPAQ Drivers
+#
+
+#
+# Compaq/HP iPAQ Drivers
+#
+# CONFIG_IPAQ_SLEEVE is not set
+# CONFIG_SLEEVE_DEBUG is not set
+
+#
# Multifunction device drivers
#
# CONFIG_MFD_SM501 is not set
@@ -899,6 +918,7 @@
# CONFIG_HTC_ASIC3 is not set
CONFIG_HTC_PASIC3=y
CONFIG_HTC_EGPIO=y
+# CONFIG_HTC_BBKEYS is not set
# CONFIG_HTC_ASIC3_DS1WM is not set
# CONFIG_SOC_SAMCOP is not set
# CONFIG_SOC_HAMCOP is not set
@@ -918,8 +938,8 @@
#
# LED drivers
#
-CONFIG_LEDS_MAGICIAN=y
CONFIG_LEDS_PASIC3=y
+CONFIG_LEDS_GPIO=y
#
# LED Triggers
@@ -927,6 +947,7 @@
CONFIG_LEDS_TRIGGERS=y
CONFIG_LEDS_TRIGGER_TIMER=y
CONFIG_LEDS_TRIGGER_HWTIMER=y
+CONFIG_LEDS_TRIGGER_BACKLIGHT=y
# CONFIG_LEDS_TRIGGER_HEARTBEAT is not set
CONFIG_LEDS_TRIGGER_SHARED=y
@@ -1321,9 +1342,9 @@
#
# DOS/FAT/NT Filesystems
#
-CONFIG_FAT_FS=y
-CONFIG_MSDOS_FS=y
-CONFIG_VFAT_FS=y
+CONFIG_FAT_FS=m
+CONFIG_MSDOS_FS=m
+CONFIG_VFAT_FS=m
CONFIG_FAT_DEFAULT_CODEPAGE=437
CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
# CONFIG_NTFS_FS is not set
@@ -1402,7 +1423,7 @@
# Native Language Support
#
CONFIG_NLS=y
-CONFIG_NLS_DEFAULT="iso8859-1"
+CONFIG_NLS_DEFAULT="utf8"
CONFIG_NLS_CODEPAGE_437=y
# CONFIG_NLS_CODEPAGE_737 is not set
# CONFIG_NLS_CODEPAGE_775 is not set
@@ -1424,8 +1445,8 @@
# CONFIG_NLS_CODEPAGE_949 is not set
# CONFIG_NLS_CODEPAGE_874 is not set
# CONFIG_NLS_ISO8859_8 is not set
-CONFIG_NLS_CODEPAGE_1250=y
-CONFIG_NLS_CODEPAGE_1251=y
+# CONFIG_NLS_CODEPAGE_1250 is not set
+CONFIG_NLS_CODEPAGE_1251=m
# CONFIG_NLS_ASCII is not set
CONFIG_NLS_ISO8859_1=y
# CONFIG_NLS_ISO8859_2 is not set
@@ -1499,16 +1520,15 @@
# Cryptographic options
#
CONFIG_CRYPTO=y
-CONFIG_CRYPTO_ALGAPI=y
+CONFIG_CRYPTO_ALGAPI=m
CONFIG_CRYPTO_BLKCIPHER=m
-CONFIG_CRYPTO_HASH=y
-CONFIG_CRYPTO_MANAGER=y
-CONFIG_CRYPTO_HMAC=y
+CONFIG_CRYPTO_MANAGER=m
+# CONFIG_CRYPTO_HMAC is not set
# CONFIG_CRYPTO_XCBC is not set
# CONFIG_CRYPTO_NULL is not set
# CONFIG_CRYPTO_MD4 is not set
-CONFIG_CRYPTO_MD5=y
-CONFIG_CRYPTO_SHA1=y
+# CONFIG_CRYPTO_MD5 is not set
+CONFIG_CRYPTO_SHA1=m
# CONFIG_CRYPTO_SHA256 is not set
# CONFIG_CRYPTO_SHA512 is not set
# CONFIG_CRYPTO_WP512 is not set
@@ -1518,7 +1538,7 @@
# CONFIG_CRYPTO_CBC is not set
CONFIG_CRYPTO_PCBC=m
# CONFIG_CRYPTO_LRW is not set
-CONFIG_CRYPTO_DES=y
+# CONFIG_CRYPTO_DES is not set
# CONFIG_CRYPTO_FCRYPT is not set
# CONFIG_CRYPTO_BLOWFISH is not set
# CONFIG_CRYPTO_TWOFISH is not set
@@ -1530,7 +1550,7 @@
CONFIG_CRYPTO_ARC4=m
# CONFIG_CRYPTO_KHAZAD is not set
# CONFIG_CRYPTO_ANUBIS is not set
-CONFIG_CRYPTO_DEFLATE=y
+# CONFIG_CRYPTO_DEFLATE is not set
# CONFIG_CRYPTO_MICHAEL_MIC is not set
# CONFIG_CRYPTO_CRC32C is not set
# CONFIG_CRYPTO_CAMELLIA is not set
@@ -1548,8 +1568,8 @@
# CONFIG_CRC16 is not set
CONFIG_CRC32=y
# CONFIG_LIBCRC32C is not set
-CONFIG_ZLIB_INFLATE=y
-CONFIG_ZLIB_DEFLATE=y
+CONFIG_ZLIB_INFLATE=m
+CONFIG_ZLIB_DEFLATE=m
CONFIG_PLIST=y
CONFIG_HAS_IOMEM=y
CONFIG_HAS_IOPORT=y
Modified: linux4palm/linux/branches/cleanup-branch-never-commit/drivers/usb/gadget/zero.c
===================================================================
--- linux4palm/linux/branches/cleanup-branch-never-commit/drivers/usb/gadget/zero.c 2007-09-17 19:41:58 UTC (rev 1329)
+++ linux4palm/linux/branches/cleanup-branch-never-commit/drivers/usb/gadget/zero.c 2007-09-17 19:54:28 UTC (rev 1330)
@@ -66,7 +66,6 @@
#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/ioport.h>
-#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/smp_lock.h>
#include <linux/errno.h>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <hap...@us...> - 2007-09-17 19:42:02
|
Revision: 1329
http://hackndev.svn.sourceforge.net/hackndev/?rev=1329&view=rev
Author: happy-slapin
Date: 2007-09-17 12:41:58 -0700 (Mon, 17 Sep 2007)
Log Message:
-----------
cleanup: getting from hh.org
Modified Paths:
--------------
linux4palm/linux/branches/cleanup-branch-never-commit/drivers/char/Kconfig
linux4palm/linux/branches/cleanup-branch-never-commit/drivers/char/sa1100-rtc.c
linux4palm/linux/branches/cleanup-branch-never-commit/drivers/mfd/htc-egpio.c
linux4palm/linux/branches/cleanup-branch-never-commit/drivers/mfd/pasic3_base.c
linux4palm/linux/branches/cleanup-branch-never-commit/drivers/mfd/samcop_base.c
Modified: linux4palm/linux/branches/cleanup-branch-never-commit/drivers/char/Kconfig
===================================================================
--- linux4palm/linux/branches/cleanup-branch-never-commit/drivers/char/Kconfig 2007-09-17 15:37:25 UTC (rev 1328)
+++ linux4palm/linux/branches/cleanup-branch-never-commit/drivers/char/Kconfig 2007-09-17 19:41:58 UTC (rev 1329)
@@ -810,23 +810,19 @@
via the file /proc/rtc and its behaviour is set by various ioctls on
/dev/rtc.
-#
-# This is a weird duplicate copy of the driver, please update your config to use
-# RTC_DRV_SA1100 instead!
-#
-#config SA1100_RTC
-# tristate "SA11x0/PXA2xx RTC support"
-# depends on ARCH_SA1100 || ARCH_PXA
-# help
-# If you say Y here and create a character special file /dev/rtc with
-# major number 10 and minor number 135 using mknod ("man mknod"), you
-# will get access to the real time clock built into your SA11x0 or
-# PXA2xx CPU. It reports status information via the file /proc/rtc
-# and its behaviour is set by various ioctls on /dev/rtc.
-#
-# To compile this driver as a module, choose M here: the
-# module will be called sa1100-rtc.
+config SA1100_RTC
+ tristate "SA11x0/PXA2xx RTC support"
+ depends on ARCH_SA1100 || ARCH_PXA
+ help
+ If you say Y here and create a character special file /dev/rtc with
+ major number 10 and minor number 135 using mknod ("man mknod"), you
+ will get access to the real time clock built into your SA11x0 or
+ PXA2xx CPU. It reports status information via the file /proc/rtc
+ and its behaviour is set by various ioctls on /dev/rtc.
+ To compile this driver as a module, choose M here: the
+ module will be called sa1100-rtc.
+
config GEN_RTC
tristate "Generic /dev/rtc emulation"
depends on RTC!=y && !IA64 && !ARM && !M32R && !SPARC && !FRV
Modified: linux4palm/linux/branches/cleanup-branch-never-commit/drivers/char/sa1100-rtc.c
===================================================================
--- linux4palm/linux/branches/cleanup-branch-never-commit/drivers/char/sa1100-rtc.c 2007-09-17 15:37:25 UTC (rev 1328)
+++ linux4palm/linux/branches/cleanup-branch-never-commit/drivers/char/sa1100-rtc.c 2007-09-17 19:41:58 UTC (rev 1329)
@@ -1,16 +1,4 @@
/*
- *
- * NOTE: The file you're looking for is in drivers/rtc, please don't use this one
- * it'll be removed eventually.
- *
- *
- *
- *
- */
-#error This is a weird duplicate copy of the driver, please update your config to use \
-RTC_DRV_SA1100 instead!
-
-/*
* linux/drivers/char/sa1100-rtc.c
*
* Real Time Clock interface for Linux on StrongARM SA1x00
Modified: linux4palm/linux/branches/cleanup-branch-never-commit/drivers/mfd/htc-egpio.c
===================================================================
--- linux4palm/linux/branches/cleanup-branch-never-commit/drivers/mfd/htc-egpio.c 2007-09-17 15:37:25 UTC (rev 1328)
+++ linux4palm/linux/branches/cleanup-branch-never-commit/drivers/mfd/htc-egpio.c 2007-09-17 19:41:58 UTC (rev 1329)
@@ -11,6 +11,7 @@
#include <linux/errno.h> /* ENODEV */
#include <linux/interrupt.h> /* enable_irq_wake */
#include <linux/spinlock.h> /* spinlock_t */
+#include <linux/platform_device.h> /* platform_device */
#include <linux/module.h>
#include <linux/gpiodev2.h>
#include <linux/mfd/htc-egpio.h>
@@ -138,12 +139,9 @@
for (i=0; i<pdata->nr_pins; i++) {
struct htc_egpio_pinInfo *pi = &pdata->pins[i];
if (pi->type == HTC_EGPIO_TYPE_INPUT
- && pi->pin_nr == (gpio_no & GPIO_BASE_MASK)
+ && pi->gpio == gpio_no
&& pi->input_irq >= 0)
- return pi->input_irq + ei->irqStart;
- if (pi->type == HTC_EGPIO_TYPE_IRQ
- && pi->pin_nr == (gpio_no & GPIO_BASE_MASK))
- return pi->pin_nr + ei->irqStart;
+ return (pi->input_irq & 0xf) + ei->irqStart;
}
return -ENODEV;
}
@@ -181,10 +179,10 @@
static void setup_pin(struct egpio_info *ei, struct htc_egpio_pinInfo *pi)
{
- struct htc_egpio_pinInfo dummy;
+ int pin = pi->gpio & GPIO_BASE_MASK;
- if (pi->pin_nr < 0 || pi->pin_nr > 16*MAX_EGPIO_REGS) {
- printk(KERN_ERR "EGPIO invalid pin %d\n", pi->pin_nr);
+ if (pi->gpio < 0 || pin > 16*MAX_EGPIO_REGS) {
+ printk(KERN_ERR "EGPIO invalid pin %d\n", pi->gpio);
return;
}
@@ -192,24 +190,19 @@
case HTC_EGPIO_TYPE_INPUT:
if (pi->input_irq < 0)
break;
- dummy.pin_nr = pi->input_irq;
- pi = &dummy;
- /* NO BREAK */
- case HTC_EGPIO_TYPE_IRQ:
- if (ei->ackRegister != u16pos(pi->pin_nr)) {
+ pin = pi->input_irq & GPIO_BASE_MASK;
+ if (ei->ackRegister != u16pos(pin)) {
printk(KERN_ERR "EGPIO irq conflict %d vs %d\n"
- , ei->ackRegister, u16pos(pi->pin_nr));
+ , ei->ackRegister, u16pos(pin));
return;
}
break;
- case HTC_EGPIO_TYPE_OUTPUT: {
- int pin = pi->pin_nr;
+ case HTC_EGPIO_TYPE_OUTPUT:
if (ei->maxRegs < u16pos(pin))
ei->maxRegs = u16pos(pin);
if (pi->output_initial)
ei->cached_values[u16pos(pin)] |= u16bit(pin);
break;
- }
default:
printk(KERN_ERR "EGPIO unknown type %d\n", pi->type);
}
@@ -221,6 +214,7 @@
struct resource *res;
struct egpio_info *ei;
int irq, i, ret;
+ struct gpio_ops ops;
/* Initialize ei data structure. */
ei = kzalloc(sizeof(*ei), GFP_KERNEL);
@@ -247,18 +241,12 @@
, res->start, ei->addrBase);
ei->bus_shift = pdata->bus_shift;
- pdata->ops.get = egpio_get;
- pdata->ops.set = egpio_set;
- pdata->ops.to_irq = egpio_to_irq;
platform_set_drvdata(pdev, ei);
- {
- struct gpio_ops ops;
ops.get_value = egpio_get;
ops.set_value = egpio_set;
ops.to_irq = egpio_to_irq;
gpiodev_register(pdata->gpio_base, &pdev->dev, &ops);
- }
/* Go through list of pins. */
ei->irqStart = pdata->irq_base;
Modified: linux4palm/linux/branches/cleanup-branch-never-commit/drivers/mfd/pasic3_base.c
===================================================================
--- linux4palm/linux/branches/cleanup-branch-never-commit/drivers/mfd/pasic3_base.c 2007-09-17 15:37:25 UTC (rev 1328)
+++ linux4palm/linux/branches/cleanup-branch-never-commit/drivers/mfd/pasic3_base.c 2007-09-17 19:41:58 UTC (rev 1329)
@@ -94,13 +94,10 @@
struct device *dev = ds1wm_dev->dev.parent;
int c;
- /* FIXME: use this to detect magician/pasic3 for now */
- if (ds1wm_clk.rate == 4000000) {
- c = pasic3_read_register(dev, 0x28);
- pasic3_write_register(dev, 0x28, c & 0x7f);
+ c = pasic3_read_register(dev, 0x28);
+ pasic3_write_register(dev, 0x28, c & 0x7f);
- pr_debug ("pasic3: DS1WM OWM_EN low (active) %02x\n", c & 0x7f);
- }
+ pr_debug ("pasic3: DS1WM OWM_EN low (active) %02x\n", c & 0x7f);
}
static void ds1wm_disable(struct platform_device *ds1wm_dev)
@@ -108,13 +105,10 @@
struct device *dev = ds1wm_dev->dev.parent;
int c;
- /* FIXME: use this to detect magician/pasic3 for now */
- if (ds1wm_clk.rate == 4000000) {
- c = pasic3_read_register(dev, 0x28);
- pasic3_write_register(dev, 0x28, c | 0x80);
+ c = pasic3_read_register(dev, 0x28);
+ pasic3_write_register(dev, 0x28, c | 0x80);
- pr_debug ("pasic3: DS1WM OWM_EN high (inactive) %02x\n", c | 0x80);
- }
+ pr_debug ("pasic3: DS1WM OWM_EN high (inactive) %02x\n", c | 0x80);
}
static struct ds1wm_platform_data __devinit ds1wm_platform_data = {
Modified: linux4palm/linux/branches/cleanup-branch-never-commit/drivers/mfd/samcop_base.c
===================================================================
--- linux4palm/linux/branches/cleanup-branch-never-commit/drivers/mfd/samcop_base.c 2007-09-17 15:37:25 UTC (rev 1328)
+++ linux4palm/linux/branches/cleanup-branch-never-commit/drivers/mfd/samcop_base.c 2007-09-17 19:41:58 UTC (rev 1329)
@@ -54,9 +54,11 @@
#include <asm/hardware/ipaq-samcop.h>
#include <linux/mfd/samcop_base.h>
#include <asm/hardware/samcop-sdi.h>
+#include <asm/hardware/samcop-fsi.h>
#include <asm/hardware/samcop-dma.h>
#include <asm/arch/pxa-dmabounce.h>
#include "../mmc/samcop_sdi.h"
+#include "../misc/samcop_fsi.h"
#include <asm/arch/irq.h>
#include <asm/arch/clock.h>
@@ -581,7 +583,31 @@
set_irq_chained_handler(samcop->irq_nr, samcop_irq_demux);
}
+
/*************************************************************
+ * SAMCOP FS interface hooks and initialization
+ *************************************************************/
+
+static u32 samcop_fsi_read_register(struct device *dev, u32 reg)
+{
+ struct samcop_data *samcop = dev->parent->driver_data;
+
+ return samcop_read_register(samcop, _SAMCOP_FSI_Base + reg);
+}
+
+static void samcop_fsi_write_register(struct device *dev, u32 reg, u32 val)
+{
+ struct samcop_data *samcop = dev->parent->driver_data;
+
+ samcop_write_register(samcop, _SAMCOP_FSI_Base + reg, val);
+}
+
+static struct samcop_fsi_data samcop_fsi_data = {
+ .read_reg = samcop_fsi_read_register,
+ .write_reg = samcop_fsi_write_register,
+};
+
+/*************************************************************
* SAMCOP SD interface hooks and initialization
*************************************************************/
int samcop_dma_needs_bounce(struct device *dev, dma_addr_t addr, size_t size)
@@ -1125,6 +1151,7 @@
.start = _SAMCOP_FSI_Base,
.end = _SAMCOP_FSI_Base + 0x1f,
.irq = _IRQ_SAMCOP_FCD,
+ .platform_data = &samcop_fsi_data,
},
{
.id = { -1 },
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <hap...@us...> - 2007-09-17 15:42:09
|
Revision: 1328
http://hackndev.svn.sourceforge.net/hackndev/?rev=1328&view=rev
Author: happy-slapin
Date: 2007-09-17 08:37:25 -0700 (Mon, 17 Sep 2007)
Log Message:
-----------
cleanup: update from hh.org
Added Paths:
-----------
linux4palm/linux/branches/cleanup-branch-never-commit/drivers/input/keyboard/gpiodev_keys2.c
linux4palm/linux/branches/cleanup-branch-never-commit/include/linux/gpiodev_keys2.h
linux4palm/linux/branches/cleanup-branch-never-commit/include/linux/mfd/htc-bbkeys.h
Removed Paths:
-------------
linux4palm/linux/branches/cleanup-branch-never-commit/include/asm-arm/arch-pxa/i2c-pxa.h
Added: linux4palm/linux/branches/cleanup-branch-never-commit/drivers/input/keyboard/gpiodev_keys2.c
===================================================================
--- linux4palm/linux/branches/cleanup-branch-never-commit/drivers/input/keyboard/gpiodev_keys2.c (rev 0)
+++ linux4palm/linux/branches/cleanup-branch-never-commit/drivers/input/keyboard/gpiodev_keys2.c 2007-09-17 15:37:25 UTC (rev 1328)
@@ -0,0 +1,336 @@
+/*
+ * Driver for diagonal joypads on GPIO lines capable of generating interrupts.
+ *
+ * Copyright 2007 Milan Plzik, based on gpio-keys.c (c) Phil Blundell 2005
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/module.h>
+#include <linux/version.h>
+
+#include <linux/init.h>
+#include <linux/fs.h>
+#include <linux/interrupt.h>
+#include <linux/irq.h>
+#include <linux/sched.h>
+#include <linux/pm.h>
+#include <linux/delay.h>
+#include <linux/platform_device.h>
+#include <linux/input.h>
+#include <linux/irq.h>
+#include <linux/sort.h>
+#include <linux/gpiodev.h>
+#include <linux/gpiodev_keys2.h>
+
+struct gpiodev_keys2_drvdata {
+ struct input_dev *input;
+ struct timer_list debounce_timer;
+ struct gpiodev_keys2_gpio ***button_gpios;
+ int *gpio_delays;
+ struct gpiodev_keys2_button **buttons_by_prio;
+ int *gpio_used_prio;
+};
+
+
+static struct gpiodev_keys2_gpio *lookup_gpio (struct gpiodev_keys2_platform_data *pdata,
+ const char *name)
+{
+ int i;
+
+ for (i = 0; i < pdata->ngpios; i++) {
+ if (!strcmp (name, pdata->gpios[i].name))
+ return &pdata->gpios[i];
+ }
+
+ return NULL;
+}
+
+static int count_gpios (struct gpiodev_keys2_button *btn)
+{
+ int i = 0;
+ const char **gpio = btn->gpio_names;
+
+ while (gpio[i]) i++;
+
+ return i;
+}
+
+
+static irqreturn_t gpiodev_keys2_isr(int irq, void *data)
+{
+ int i;
+ struct platform_device *pdev = data;
+ struct gpiodev_keys2_platform_data *pdata = pdev->dev.platform_data;
+ struct gpiodev_keys2_drvdata *drvdata = platform_get_drvdata(pdev);
+
+ /* Find out which GPIO has been asserted and the corresponding delay for
+ * debouncing. */
+ for (i = 0; i < pdata->ngpios; i++)
+ if (irq == gpiodev_to_irq(&pdata->gpios[i].gpio)) {
+ break;
+ };
+
+ /* Prepare delayed call of debounce handler */
+ if (time_before(drvdata->debounce_timer.expires, jiffies +
+ msecs_to_jiffies(drvdata->gpio_delays[i])) ||
+ !timer_pending(&drvdata->debounce_timer))
+ mod_timer(&drvdata->debounce_timer,
+ jiffies + msecs_to_jiffies(drvdata->gpio_delays[i]));
+
+ return IRQ_HANDLED;
+}
+
+static void debounce_handler(unsigned long data)
+{
+ struct platform_device *pdev = (void*)data;
+ struct gpiodev_keys2_platform_data *pdata = pdev->dev.platform_data;
+ struct gpiodev_keys2_drvdata *drvdata = platform_get_drvdata(pdev);
+ struct gpiodev_keys2_button *button;
+ struct gpiodev_keys2_gpio **gpio;
+ int i;
+
+ memset(drvdata->gpio_used_prio, 0, sizeof(drvdata->gpio_used_prio[0])*pdata->ngpios);
+
+ /* Clear reported buttons */
+ for (i = 0; i < pdata->nbuttons; i++)
+ input_report_key(drvdata->input, pdata->buttons[i].keycode, 0);
+
+ for (i = 0; i < pdata->nbuttons; i++) {
+ int button_idx = drvdata->buttons_by_prio[i] - &pdata->buttons[0];
+ button = drvdata->buttons_by_prio[i];
+ gpio = drvdata->button_gpios[button_idx];
+
+ /* are all required GPIOs asserted? */
+ do {
+ int gpio_idx = gpio[0] - pdata->gpios; /* index in pdata->gpios */
+ if (((gpiodev_get_value(&gpio[0]->gpio) ? 1 : 0) ^ (gpio[0]->active_low)) &&
+ /* this is only true when gpio prio is 0,
+ * because the buttons are ordered descending by
+ * priority */
+ drvdata->gpio_used_prio[gpio_idx]<=button->priority)
+ continue;
+ else
+ break;
+ } while ((++gpio)[0] != NULL);
+
+ if (gpio[0] == NULL) {
+ /* all gpios are asserted and unused otherwise, so key
+ * can be pressed and GPIOs will be marked as used. */
+ gpio = drvdata->button_gpios[button_idx];
+ do {
+ int gpio_idx = gpio[0] - pdata->gpios;
+ drvdata->gpio_used_prio[gpio_idx] = button->priority;
+ } while (((++gpio)[0]) != NULL);
+ if (button->keycode != -1)
+ input_report_key(drvdata->input, button->keycode, 1);
+ }
+ };
+ input_sync(drvdata->input);
+}
+
+
+static int btnprio_cmp (const void *a, const void *b)
+{
+ const struct gpiodev_keys2_button *b1, *b2;
+
+ b1 = *((const struct gpiodev_keys2_button**)a);
+ b2 = *((const struct gpiodev_keys2_button**)b);
+
+ return b2->priority - b1->priority;
+}
+
+/* Builds array, which on i-th position contains pointers to all GPIOs used by
+ * i-th button in pdata->buttons, and also finds maximal debounce time for each
+ * gpio.
+ */
+
+static int gpiodev_keys2_init_drvdata(struct platform_device *pdev)
+{
+ struct gpiodev_keys2_platform_data *pdata = pdev->dev.platform_data;
+ struct gpiodev_keys2_drvdata *drvdata = platform_get_drvdata(pdev);
+ struct gpiodev_keys2_gpio *gpio;
+ int i, j;
+ int button_gpios;
+
+ if (drvdata->button_gpios) {
+ printk (KERN_ERR "gpiodev-keys2: Attempting to re-create drvdata\n");
+ return -EBUSY;
+ };
+
+ drvdata->button_gpios = kzalloc(
+ pdata->nbuttons*sizeof(*drvdata->button_gpios),
+ GFP_KERNEL);
+ drvdata->gpio_delays = kzalloc(pdata->ngpios*sizeof(*drvdata->gpio_delays), GFP_KERNEL);
+ drvdata->buttons_by_prio = kzalloc(pdata->nbuttons*sizeof(*drvdata->buttons_by_prio), GFP_KERNEL);
+ drvdata->gpio_used_prio = kzalloc(pdata->ngpios*sizeof(*drvdata->gpio_used_prio), GFP_KERNEL);
+
+ for (i = 0; i < pdata->nbuttons; i++) {
+ button_gpios = count_gpios(&pdata->buttons[i]);
+ drvdata->button_gpios[i] = kzalloc((button_gpios+1)*sizeof(drvdata->button_gpios[i]), GFP_KERNEL);
+
+ /* Put all GPIOs used by i-th button into button_gpios[i] */
+ for (j = 0; j < button_gpios; j++) {
+ gpio = lookup_gpio(pdata, pdata->buttons[i].gpio_names[j]);
+ if (!gpio) {
+ printk(KERN_WARNING "gpiodev-keys2: Unknown gpio '%s'\n", pdata->buttons[i].gpio_names[j]);
+ continue;
+ };
+
+ /* See whether actual button has delay, which is bigger
+ * than delay GPIO. If so, update GPIOs delay.
+ */
+ drvdata->gpio_delays[gpio - pdata->gpios] = max(
+ drvdata->gpio_delays[gpio - pdata->gpios],
+ pdata->buttons[i].debounce_ms);
+
+ drvdata->button_gpios[i][j] = gpio;
+ };
+
+
+ };
+
+ /* Create list of buttons sorted descending by priority */
+ for (i = 0; i < pdata->nbuttons; i++)
+ drvdata->buttons_by_prio[i] = &pdata->buttons[i];
+
+ sort(drvdata->buttons_by_prio, pdata->nbuttons, sizeof(drvdata->buttons_by_prio[0]), btnprio_cmp, NULL);
+ for (i = 0; i <pdata->nbuttons; i++)
+ printk (KERN_INFO "- button '%s', prio %d\n", drvdata->buttons_by_prio[i]->gpio_names[0], drvdata->buttons_by_prio[i]->priority);
+
+ return 0;
+}
+
+static void gpiodev_keys2_free_mapping(struct platform_device *pdev)
+{
+ struct gpiodev_keys2_platform_data *pdata = pdev->dev.platform_data;
+ struct gpiodev_keys2_drvdata *drvdata = platform_get_drvdata(pdev);
+ int i;
+
+ if (!drvdata)
+ return;
+
+ for (i = 0; i < pdata->nbuttons; i++)
+ kfree(drvdata->button_gpios[i]);
+
+ kfree(drvdata->button_gpios);
+ kfree(drvdata->gpio_delays);
+ kfree(drvdata->buttons_by_prio);
+ kfree(drvdata->gpio_used_prio);
+}
+
+
+static int __devinit gpiodev_keys2_probe(struct platform_device *pdev)
+{
+ struct gpiodev_keys2_drvdata *drvdata;
+ struct gpiodev_keys2_platform_data *pdata = pdev->dev.platform_data;
+ struct input_dev *input;
+ int i, error;
+
+ input = input_allocate_device();
+ if (!input)
+ return -ENOMEM;
+
+ input->evbit[0] = BIT(EV_KEY) | BIT(EV_REP);
+ input->name = pdev->name;
+ input->phys = "gpiodev-keys2/input0";
+ input->cdev.dev = &pdev->dev;
+ // input->private // do we need this?
+ input->id.bustype = BUS_HOST;
+ input->id.vendor = 0x0001;
+ input->id.product = 0x0001;
+ input->id.version = 0x0100;
+
+ drvdata = kzalloc(sizeof(struct gpiodev_keys2_drvdata), GFP_KERNEL);
+ drvdata->input = input;
+ platform_set_drvdata(pdev, drvdata);
+
+ setup_timer(&drvdata->debounce_timer, debounce_handler, (unsigned long) pdev);
+
+ for (i = 0; i < pdata->nbuttons; i++)
+ set_bit(pdata->buttons[i].keycode, input->keybit);
+
+ error = input_register_device(input);
+ if (error) {
+ printk(KERN_ERR "Unable to register gpiodev-keys2 input device\n");
+ goto fail;
+ }
+
+ gpiodev_keys2_init_drvdata(pdev);
+
+
+ for (i = 0; i < pdata->ngpios; i++) {
+ int irq = gpiodev_to_irq(&(pdata->gpios[i].gpio));
+
+ set_irq_type(irq, IRQ_TYPE_EDGE_BOTH);
+ error = request_irq(irq, gpiodev_keys2_isr,
+ IRQF_SAMPLE_RANDOM | IRQF_SHARED,
+ pdata->gpios[i].name ?
+ pdata->gpios[i].name : "gpiodev_keys2", pdev);
+
+ if (error) {
+ printk(KERN_ERR "gpiodev-keys: unable to claim irq %d; error %d\n", irq, error);
+ goto fail;
+ }
+ }
+
+
+ return 0;
+
+fail:
+ for (i = i - 1; i >= 0; i--)
+ free_irq(gpiodev_to_irq(&pdata->gpios[i].gpio),pdev);
+
+ input_free_device(input);
+
+ del_timer_sync(&drvdata->debounce_timer);
+
+ return error;
+}
+
+static int __devexit gpiodev_keys2_remove(struct platform_device *pdev)
+{
+ struct gpiodev_keys2_drvdata *drvdata = platform_get_drvdata(pdev);
+ struct gpiodev_keys2_platform_data *pdata = pdev->dev.platform_data;
+ int i;
+
+ del_timer_sync(&drvdata->debounce_timer);
+
+ for (i = 0; i < pdata->ngpios; i++)
+ free_irq(gpiodev_to_irq(&pdata->gpios[i].gpio), pdev);
+
+ input_unregister_device(drvdata->input);
+ input_free_device(drvdata->input);
+ gpiodev_keys2_free_mapping(pdev);
+ kfree(drvdata);
+
+ return 0;
+}
+
+
+struct platform_driver gpiodev_keys2_device_driver = {
+ .probe = gpiodev_keys2_probe,
+ .remove = __devexit_p(gpiodev_keys2_remove),
+ .driver = {
+ .name = "gpiodev-keys2",
+ }
+};
+
+static int __init gpiodev_keys2_init(void)
+{
+ return platform_driver_register(&gpiodev_keys2_device_driver);
+}
+
+static void __exit gpiodev_keys2_exit(void)
+{
+ platform_driver_unregister(&gpiodev_keys2_device_driver);
+}
+
+module_init(gpiodev_keys2_init);
+module_exit(gpiodev_keys2_exit);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Milan Plzik <mil...@gm...>");
+MODULE_DESCRIPTION("Keyboard driver for GPIO");
Deleted: linux4palm/linux/branches/cleanup-branch-never-commit/include/asm-arm/arch-pxa/i2c-pxa.h
===================================================================
--- linux4palm/linux/branches/cleanup-branch-never-commit/include/asm-arm/arch-pxa/i2c-pxa.h 2007-09-17 15:12:45 UTC (rev 1327)
+++ linux4palm/linux/branches/cleanup-branch-never-commit/include/asm-arm/arch-pxa/i2c-pxa.h 2007-09-17 15:37:25 UTC (rev 1328)
@@ -1,76 +0,0 @@
-/*
- * i2c_pxa.h
- *
- * Copyright (C) 2002 Intrinsyc Software Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- */
-#ifndef _I2C_PXA_H_
-#define _I2C_PXA_H_
-
-struct i2c_algo_pxa_data
-{
- void (*write_byte) (u8 value);
- u8 (*read_byte) (void);
- void (*start) (void);
- void (*repeat_start) (void);
- void (*stop) (void);
- void (*abort) (void);
- int (*wait_bus_not_busy) (void);
- int (*wait_for_interrupt) (int wait_type);
- void (*transfer) (int lastbyte, int receive, int midbyte);
- void (*reset) (void);
-
- int udelay;
- int timeout;
-};
-
-#define DEF_TIMEOUT 3
-#define BUS_ERROR (-EREMOTEIO)
-#define ACK_DELAY 0 /* time to delay before checking bus error */
-#define MAX_MESSAGES 65536 /* maximum number of messages to send */
-
-#define I2C_SLEEP_TIMEOUT 2 /* time to sleep for on i2c transactions */
-#define I2C_RETRY (-2000) /* an error has occurred retry transmit */
-#define I2C_TRANSMIT 1
-#define I2C_RECEIVE 0
-#define I2C_PXA_SLAVE_ADDR 0x1 /* slave pxa unit address */
-#define I2C_ICR_INIT (ICR_BEIE | ICR_IRFIE | ICR_ITEIE | ICR_GCD | ICR_SCLE) /* ICR initialization value */
-/* ICR initialize bit values
-*
-* 15. FM 0 (100 Khz operation)
-* 14. UR 0 (No unit reset)
-* 13. SADIE 0 (Disables the unit from interrupting on slave addresses
-* matching its slave address)
-* 12. ALDIE 0 (Disables the unit from interrupt when it loses arbitration
-* in master mode)
-* 11. SSDIE 0 (Disables interrupts from a slave stop detected, in slave mode)
-* 10. BEIE 1 (Enable interrupts from detected bus errors, no ACK sent)
-* 9. IRFIE 1 (Enable interrupts from full buffer received)
-* 8. ITEIE 1 (Enables the I2C unit to interrupt when transmit buffer empty)
-* 7. GCD 1 (Disables i2c unit response to general call messages as a slave)
-* 6. IUE 0 (Disable unit until we change settings)
-* 5. SCLE 1 (Enables the i2c clock output for master mode (drives SCL)
-* 4. MA 0 (Only send stop with the ICR stop bit)
-* 3. TB 0 (We are not transmitting a byte initially)
-* 2. ACKNAK 0 (Send an ACK after the unit receives a byte)
-* 1. STOP 0 (Do not send a STOP)
-* 0. START 0 (Do not send a START)
-*
-*/
-
-#define I2C_ISR_INIT 0x7FF /* status register init */
-/* I2C status register init values
- *
- * 10. BED 1 (Clear bus error detected)
- * 9. SAD 1 (Clear slave address detected)
- * 7. IRF 1 (Clear IDBR Receive Full)
- * 6. ITE 1 (Clear IDBR Transmit Empty)
- * 5. ALD 1 (Clear Arbitration Loss Detected)
- * 4. SSD 1 (Clear Slave Stop Detected)
- */
-
-#endif
Added: linux4palm/linux/branches/cleanup-branch-never-commit/include/linux/gpiodev_keys2.h
===================================================================
--- linux4palm/linux/branches/cleanup-branch-never-commit/include/linux/gpiodev_keys2.h (rev 0)
+++ linux4palm/linux/branches/cleanup-branch-never-commit/include/linux/gpiodev_keys2.h 2007-09-17 15:37:25 UTC (rev 1328)
@@ -0,0 +1,37 @@
+#ifndef __GPIODEV_KEYS2_H
+#define __GPIODEV_KEYS2_H
+
+#include <linux/gpiodev.h>
+
+#define MAX_GPIOS_PER_BUTTON 5
+
+struct gpiodev_keys2_gpio {
+ const char *name; /* GPIO identifier */
+ struct gpio gpio; /* gpiodev descriptor */
+ int active_low;
+};
+
+struct gpiodev_keys2_button {
+ int keycode; /* key code for the button */
+
+ const char *gpio_names[MAX_GPIOS_PER_BUTTON];
+ /* which GPIOs have to be asserted in order
+ * to emit keypress. This is NULL-terminated
+ * array of string GPIO identifiers */
+
+ int debounce_ms; /* Value for this button's debounce will be at
+ * least this number of milliseconds. */
+
+ int priority; /* If more buttons are likely to be pressed,
+ * only those with highest priority will
+ * generate keypress, others will be released */
+};
+
+struct gpiodev_keys2_platform_data {
+ struct gpiodev_keys2_gpio *gpios;
+ int ngpios;
+ struct gpiodev_keys2_button *buttons;
+ int nbuttons;
+};
+
+#endif
Added: linux4palm/linux/branches/cleanup-branch-never-commit/include/linux/mfd/htc-bbkeys.h
===================================================================
--- linux4palm/linux/branches/cleanup-branch-never-commit/include/linux/mfd/htc-bbkeys.h (rev 0)
+++ linux4palm/linux/branches/cleanup-branch-never-commit/include/linux/mfd/htc-bbkeys.h 2007-09-17 15:37:25 UTC (rev 1328)
@@ -0,0 +1,20 @@
+#ifndef _HTC_BBKEYS_H
+#define _HTC_BBKEYS_H
+
+/* Maximum number of keys available */
+enum { BBKEYS_MAXKEY = 16 };
+
+struct htc_bbkeys_platform_data {
+ /* Beginning of available gpios (eg, GPIO_BASE_INCREMENT) */
+ int gpio_base;
+
+ /* Main interface gpios */
+ int sda_gpio, scl_gpio;
+
+ /* Registers for working with keypad */
+ int ackreg, key1reg, key2reg;
+ /* Keycodes for buttons */
+ int buttons[BBKEYS_MAXKEY];
+};
+
+#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <hap...@us...> - 2007-09-17 14:34:40
|
Revision: 1326
http://hackndev.svn.sourceforge.net/hackndev/?rev=1326&view=rev
Author: happy-slapin
Date: 2007-09-17 07:34:36 -0700 (Mon, 17 Sep 2007)
Log Message:
-----------
cleanup: update from hh.org
Modified Paths:
--------------
linux4palm/linux/branches/cleanup-branch-never-commit/include/linux/i2c-id.h
linux4palm/linux/branches/cleanup-branch-never-commit/include/linux/leds.h
Modified: linux4palm/linux/branches/cleanup-branch-never-commit/include/linux/i2c-id.h
===================================================================
--- linux4palm/linux/branches/cleanup-branch-never-commit/include/linux/i2c-id.h 2007-09-17 14:11:49 UTC (rev 1325)
+++ linux4palm/linux/branches/cleanup-branch-never-commit/include/linux/i2c-id.h 2007-09-17 14:34:36 UTC (rev 1326)
@@ -159,7 +159,6 @@
#define I2C_DRIVERID_FSCHER 1046
#define I2C_DRIVERID_W83L785TS 1047
#define I2C_DRIVERID_OV7670 1048 /* Omnivision 7670 camera */
-#define I2C_DRIVERID_OV96xx 1050 /* Omnivision 9640, 9650 camera */
#define I2C_DRIVERID_AK4641 1051
/*
Modified: linux4palm/linux/branches/cleanup-branch-never-commit/include/linux/leds.h
===================================================================
--- linux4palm/linux/branches/cleanup-branch-never-commit/include/linux/leds.h 2007-09-17 14:11:49 UTC (rev 1325)
+++ linux4palm/linux/branches/cleanup-branch-never-commit/include/linux/leds.h 2007-09-17 14:34:36 UTC (rev 1326)
@@ -174,6 +174,20 @@
#else
#define ledtrig_ide_activity() do {} while(0)
#endif
+
+/* For the leds-gpio driver */
+struct gpio_led {
+ const char *name;
+ char *default_trigger;
+ unsigned gpio;
+ u8 active_low;
+};
+
+struct gpio_led_platform_data {
+ int num_leds;
+ struct gpio_led *leds;
+};
+
#if defined(CONFIG_LEDS_TRIGGER_MMC_CARD) || defined(CONFIG_LEDS_TRIGGER_MMC_CARD_MODULE)
extern void ledtrig_mmc_activity(void);
#else
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <hap...@us...> - 2007-09-17 14:11:51
|
Revision: 1325
http://hackndev.svn.sourceforge.net/hackndev/?rev=1325&view=rev
Author: happy-slapin
Date: 2007-09-17 07:11:49 -0700 (Mon, 17 Sep 2007)
Log Message:
-----------
cleanup: drivers/misc: update from hh.org
Modified Paths:
--------------
linux4palm/linux/branches/cleanup-branch-never-commit/drivers/input/keyboard/Kconfig
linux4palm/linux/branches/cleanup-branch-never-commit/drivers/misc/fsi_drv.c
linux4palm/linux/branches/cleanup-branch-never-commit/drivers/misc/samcop_fsi.c
linux4palm/linux/branches/cleanup-branch-never-commit/drivers/misc/samcop_fsi.h
linux4palm/linux/branches/cleanup-branch-never-commit/drivers/pcmcia/pxa2xx_base.c
linux4palm/linux/branches/cleanup-branch-never-commit/drivers/video/backlight/Makefile
Modified: linux4palm/linux/branches/cleanup-branch-never-commit/drivers/input/keyboard/Kconfig
===================================================================
--- linux4palm/linux/branches/cleanup-branch-never-commit/drivers/input/keyboard/Kconfig 2007-09-17 13:32:07 UTC (rev 1324)
+++ linux4palm/linux/branches/cleanup-branch-never-commit/drivers/input/keyboard/Kconfig 2007-09-17 14:11:49 UTC (rev 1325)
@@ -200,6 +200,12 @@
This is more generic version of gpio_keys driver, supporting
GPIOs across different chips.
+config GPIODEV_KEYS2
+ tristate "Buttons on GPIOs, version 2"
+ help
+ GPIO keyboard driver supportting multiple GPIOs per button,
+ as well as button priorities.
+
config GPIODEV_DIAGONAL
tristate "Diagonal joypad on GPIO"
help
Modified: linux4palm/linux/branches/cleanup-branch-never-commit/drivers/misc/fsi_drv.c
===================================================================
--- linux4palm/linux/branches/cleanup-branch-never-commit/drivers/misc/fsi_drv.c 2007-09-17 13:32:07 UTC (rev 1324)
+++ linux4palm/linux/branches/cleanup-branch-never-commit/drivers/misc/fsi_drv.c 2007-09-17 14:11:49 UTC (rev 1325)
@@ -26,24 +26,26 @@
#include <asm/arch/irqs.h>
#include <asm/arch/fsi.h>
+#include <asm/arch/pxa-regs.h>
+#include <asm/arch/h5400-gpio.h>
#include "samcop_fsi.h"
-atomic_t fsi_in_use;
-DECLARE_WAIT_QUEUE_HEAD(fsi_rqueue);
-struct timer_list fsi_temp_timer;
+static atomic_t fsi_in_use;
+static DECLARE_WAIT_QUEUE_HEAD(fsi_rqueue);
+static struct timer_list fsi_temp_timer;
-unsigned int fsi_prescale = 19;
-unsigned int fsi_dmi = 1124;
-unsigned int fsi_treshold_on = 20;
-unsigned int fsi_treshold_off = 4;
-unsigned int fsi_buffer_size = FSI_FRAME_SIZE * (sizeof(unsigned long)) * 3;
+static unsigned int fsi_prescale = 19;
+static unsigned int fsi_dmi = 1124;
+static unsigned int fsi_treshold_on = 20;
+static unsigned int fsi_treshold_off = 4;
+static unsigned int fsi_buffer_size = FSI_FRAME_SIZE * (sizeof(unsigned long)) * 3;
volatile unsigned char fsi_lfrm = 0;
static struct samcop_fsi *fsi_ = NULL;
-void fsi_set_mode(unsigned int cmd)
+static void fsi_set_mode(unsigned int cmd)
{
static unsigned int current_mode = 0;
static unsigned long control_register = 0;
@@ -107,14 +109,14 @@
}
}
-void fsi_timer_temp_callback(unsigned long input)
+static void fsi_timer_temp_callback(unsigned long input)
{
printk(KERN_DEBUG "%s: stopping temperature increase (status=%d)\n", __FUNCTION__,
samcop_fsi_get_control(fsi_) & FSI_CONTROL_TEMP);
fsi_set_mode(FSI_CMD_STOP_TEMP);
}
-inline int fsi_analyze_column(struct fsi_read_state *read_state, unsigned int data)
+static inline int fsi_analyze_column(struct fsi_read_state *read_state, unsigned int data)
{
if ((data & 0xEFEF) == 0xE0E0) { /* sync column */
read_state->frame_number++;
@@ -158,7 +160,7 @@
return 0;
}
-void fsi_run_tasklet(unsigned long state_ptr)
+static void fsi_run_tasklet(unsigned long state_ptr)
{
unsigned int i;
unsigned long data;
@@ -202,14 +204,14 @@
DECLARE_TASKLET_DISABLED(fsi_tasklet,fsi_run_tasklet,0);
-int fsi_irq_handler(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t fsi_irq_handler(int irq, void *dev_id)
{
unsigned int fifo_status;
fifo_status = samcop_fsi_get_status(fsi_);
- if (fifo_status & 1) {
+ if (fifo_status & 1) { /* FIFO trigger */
fsi_set_mode(FSI_CMD_STOP_ACQ_INT);
tasklet_schedule(&fsi_tasklet);
}
@@ -226,10 +228,10 @@
fsi_lfrm = 1;
tasklet_schedule(&fsi_tasklet);
}
- return 0;
+ return IRQ_HANDLED;
}
-int fsi_copy_to_user(struct fsi_read_state *read_state, char *buf)
+static int fsi_copy_to_user(struct fsi_read_state *read_state, char *buf)
{
unsigned int avail_words;
@@ -240,7 +242,14 @@
else
avail_words = read_state->write_pos - read_state->read_pos;
- if (copy_to_user(buf+read_state->word_count*4,read_state->buffer+read_state->read_pos,avail_words*4))
+ /* 'buf' is 'char*', but word_count denotes count in array of 'unsigned
+ * long'. To get proper destination address, we need to multiple it by
+ * sizeof(unsigned long).
+ */
+
+ if (copy_to_user(buf+read_state->word_count*sizeof(unsigned long),
+ read_state->buffer+read_state->read_pos,
+ avail_words*sizeof(unsigned long)))
return -EFAULT;
read_state->word_count += avail_words;
@@ -284,10 +293,13 @@
filp->private_data = read_state;
-#if 0
+#if 1
/* GPIO61 turns out to be serial power, not fingerchip power.
Any other guesses? */
- SET_GPIO(POWER_FP_N, 0); /* power on */
+ /* it _IS_ this GPIO. No idea what else it powers, but without it, ATMEL
+ * chip returns zeroes. */
+ //SET_GPIO(POWER_FP_N, 0); /* power on */
+ SET_H5400_GPIO(POWER_RS232_N_OR_FS, 0);
#endif
/* init hardware */
samcop_fsi_up(fsi_);
@@ -295,18 +307,19 @@
return 0;
}
-int fsi_release(struct inode *inode, struct file *filp)
+static int fsi_release(struct inode *inode, struct file *filp)
{
/* put scanner to sleep before we exit */
samcop_fsi_down(fsi_);
kfree(filp->private_data);
atomic_inc(&fsi_in_use);
+ SET_H5400_GPIO(POWER_RS232_N_OR_FS, 1);
return 0;
}
-ssize_t fsi_read(struct file *filp, char *buf, size_t count, loff_t *offp)
+static ssize_t fsi_read(struct file *filp, char *buf, size_t count, loff_t *offp)
{
int errval = 0;
struct fsi_read_state *read_state;
@@ -321,6 +334,7 @@
/* allocate buffer and initialize state */
read_state->buffer_size = fsi_buffer_size;
read_state->buffer = kmalloc(read_state->buffer_size,GFP_KERNEL);
+ read_state->buffer_size = fsi_buffer_size/sizeof(unsigned long);
if (read_state->buffer == NULL)
return -ENOMEM;
@@ -347,6 +361,7 @@
/* gather data */
while (read_state->word_count < read_state->word_dest) {
+ //printk (KERN_INFO "word_count: %d, word_dest: %d\n", read_state->word_count, read_state->word_dest);
interruptible_sleep_on(&fsi_rqueue);
if (signal_pending(current)) {
errval = -ERESTARTSYS;
@@ -380,7 +395,7 @@
return count;
}
-int fsi_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg)
+static int fsi_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg)
{
struct fsi_read_state *read_state;
@@ -474,15 +489,20 @@
return 0;
}
-void
+int
fsi_detach(void)
{
+ if (atomic_dec_and_test(&fsi_in_use)) {
+ atomic_inc(&fsi_in_use);
+ /* someone is using FSI at the moment, we can't quit */
+ return -EBUSY;
+ }
fsi_set_mode(FSI_CMD_STOP_TEMP);
del_timer(&fsi_temp_timer);
- samcop_fsi_down(fsi_); /* Stop h/w */
free_irq(fsi_->irq, NULL);
fsi_ = NULL;
misc_deregister(&fsi_miscdev);
+ return 0;
}
MODULE_AUTHOR("J\xB0rgen Andreas Michaelsen <jor...@if...>");
Modified: linux4palm/linux/branches/cleanup-branch-never-commit/drivers/misc/samcop_fsi.c
===================================================================
--- linux4palm/linux/branches/cleanup-branch-never-commit/drivers/misc/samcop_fsi.c 2007-09-17 13:32:07 UTC (rev 1324)
+++ linux4palm/linux/branches/cleanup-branch-never-commit/drivers/misc/samcop_fsi.c 2007-09-17 14:11:49 UTC (rev 1325)
@@ -9,6 +9,7 @@
*
*/
+
#include <linux/module.h>
#include <linux/init.h>
#include <linux/kernel.h>
@@ -18,24 +19,24 @@
#include <linux/clk.h>
#include <asm/hardware.h>
#include <asm/io.h>
-#include <asm/arch/ipaq.h>
#include <asm/hardware/ipaq-samcop.h>
-#include <asm/hardware/samcop_base.h>
+#include <linux/mfd/samcop_base.h>
#include <asm/hardware/samcop-fsi.h>
#include "samcop_fsi.h"
static inline void
-samcop_fsi_write_register (struct samcop_fsi *fsi, u32 reg, u16 val)
+samcop_fsi_write_register (struct samcop_fsi *fsi, u32 reg, u32 val)
{
- __raw_writew (val, reg + fsi->map);
+ fsi->fsi_data->write_reg (fsi->me, reg, val);
}
-static inline u16
+static inline u32
samcop_fsi_read_register (struct samcop_fsi *fsi, u32 reg)
{
- return __raw_readw (reg + fsi->map);
+ return fsi->fsi_data->read_reg (fsi->me, reg);
}
+
/*
* Helper functions that provide samcop access to the fcd and fsi parts of the
* fingerprint scanner
@@ -44,6 +45,7 @@
void
samcop_fsi_set_control (struct samcop_fsi *fsi, u32 val)
{
+ val &= 0xff;
samcop_fsi_write_register (fsi, _SAMCOP_FSI_Control, val);
}
@@ -100,7 +102,7 @@
/* tell scanner to sleep */
u32 control_register = 0;
control_register = samcop_fsi_get_control(fsi);
- control_register |= ~SAMCOP_FSI_CONTROL_TEMP_PWR_ON;
+ control_register &= ~SAMCOP_FSI_CONTROL_TEMP_PWR_ON; // |= was here originally
samcop_fsi_set_control(fsi, control_register);
/* disable PCLK */
@@ -110,40 +112,69 @@
void
samcop_fsi_set_status (struct samcop_fsi *fsi, u32 val)
{
- samcop_fsi_write_register (fsi, SAMCOP_FSI_STA, val);
+ samcop_fsi_write_register (fsi, _SAMCOP_FSI_STA, val);
}
u32
samcop_fsi_get_status (struct samcop_fsi *fsi)
{
- return samcop_fsi_read_register (fsi, SAMCOP_FSI_STA);
+ return samcop_fsi_read_register (fsi, _SAMCOP_FSI_STA);
}
u32
samcop_fsi_read_data (struct samcop_fsi *fsi)
{
- return samcop_fsi_read_register (fsi, SAMCOP_FSI_DAT);
+ return samcop_fsi_read_register (fsi, _SAMCOP_FSI_DAT);
}
static int
-samcop_fsi_probe (struct device *dev)
+samcop_fsi_probe (struct platform_device *pdev)
{
int result = 0;
struct samcop_fsi *fsi;
- struct platform_device *sdev = to_platform_device (dev);
fsi = kmalloc (sizeof (*fsi), GFP_KERNEL);
if (!fsi)
return -ENOMEM;
memset (fsi, 0, sizeof (*fsi));
- fsi->parent = dev->parent;
- dev->driver_data = fsi;
+ fsi->parent = pdev->dev.parent;
+ platform_set_drvdata(pdev, fsi);
- fsi->map = (void *)sdev->resource[1].start;
- fsi->irq = sdev->resource[2].start;
+ /* Is this really correct? Some other drivers use this approach, but
+ * this was already once ioremapped by samcop_base, so we could possibly
+ * use that mapping and not create new one (approach similar to
+ * samcop_sdi).
+ */
- fsi->clk = clk_get(dev, "fsi");
+ fsi->map = ioremap(pdev->resource[0].start,
+ pdev->resource[0].end - pdev->resource[0].start + 1);
+ fsi->irq = pdev->resource[1].start;
+ pr_debug("FSI at 0x%p, IRQ %d\n", fsi->map, fsi->irq);
+
+ fsi->clk = clk_get(&pdev->dev, "fsi");
+ if (!fsi->clk) {
+ printk(KERN_ERR "samcop_fsi: Could not get fsi clock");
+ iounmap(fsi->map);
+ kfree(fsi);
+ result = -EBUSY;
+ };
+
+ fsi->fsi_data = pdev->dev.platform_data;
+ fsi->me = &pdev->dev;
+/*
+ fsi->set_control = samcop_fsi_set_control;
+ fsi->get_control = samcop_fsi_get_control;
+ fsi->set_status = samcop_fsi_set_status;
+ fsi->get_status = samcop_fsi_get_status;
+ fsi->read_data = samcop_fsi_read_data;
+ fsi->up = samcop_fsi_up;
+ fsi->down = samcop_fsi_down;
+ fsi->set_fifo_control = samcop_fsi_set_fifo_control;
+ fsi->set_prescaler = samcop_fsi_set_prescaler;
+ fsi->set_dmc = samcop_fsi_set_dmc;
+*/
+
if (IS_ERR(fsi->clk)) {
printk(KERN_ERR "failed to get fsi clock\n");
kfree (fsi);
@@ -154,33 +185,40 @@
printk("couldn't attach fsi driver: error %d\n", result);
kfree (fsi);
}
+
return result;
}
static int
-samcop_fsi_remove (struct device *dev)
+samcop_fsi_remove (struct platform_device *dev)
{
- struct samcop_fsi *fsi = dev->driver_data;
- fsi_detach();
+ struct samcop_fsi *fsi = platform_get_drvdata(dev);
+ int result = 0;
+ result = fsi_detach();
+ if (result != 0)
+ return result;
+ iounmap(fsi->map);
kfree (fsi);
- return 0;
+ return result;
}
static int
-samcop_fsi_suspend (struct device *dev, pm_message_t state)
+samcop_fsi_suspend (struct platform_device *dev, pm_message_t state)
{
return 0;
}
static int
-samcop_fsi_resume (struct device *dev)
+samcop_fsi_resume (struct platform_device *dev)
{
return 0;
}
-struct device_driver samcop_fsi_device_driver = {
- .name = "samcop fsi",
+struct platform_driver samcop_fsi_device_driver = {
+ .driver = {
+ .name = "samcop fsi",
+ },
.probe = samcop_fsi_probe,
.remove = samcop_fsi_remove,
.suspend = samcop_fsi_suspend,
@@ -189,12 +227,12 @@
static int samcop_fsi_init (void)
{
- return driver_register (&samcop_fsi_device_driver);
+ return platform_driver_register (&samcop_fsi_device_driver);
}
static void samcop_fsi_cleanup (void)
{
- driver_unregister (&samcop_fsi_device_driver);
+ platform_driver_unregister (&samcop_fsi_device_driver);
}
module_init(samcop_fsi_init);
Modified: linux4palm/linux/branches/cleanup-branch-never-commit/drivers/misc/samcop_fsi.h
===================================================================
--- linux4palm/linux/branches/cleanup-branch-never-commit/drivers/misc/samcop_fsi.h 2007-09-17 13:32:07 UTC (rev 1324)
+++ linux4palm/linux/branches/cleanup-branch-never-commit/drivers/misc/samcop_fsi.h 2007-09-17 14:11:49 UTC (rev 1325)
@@ -10,14 +10,26 @@
#ifndef _SAMCOP_FSI_H_
#define _SAMCOP_FSI_H_
+
+struct samcop_fsi_data {
+ u32 (*read_reg)(struct device *dev, u32 reg);
+ void (*write_reg)(struct device *dev, u32 reg, u32 val);
+};
+
+
struct samcop_fsi {
struct device *parent; // parent struct for access to
// samcop registers
+ struct device *me;
void *map; // fsi register map
int irq; // data ready irq
struct clk *clk; // samcop fsi clk
+
+ struct samcop_fsi_data *fsi_data;
};
+
+
extern void samcop_fsi_set_control (struct samcop_fsi *fsi, u32 val);
extern u32 samcop_fsi_get_control (struct samcop_fsi *fsi);
extern void samcop_fsi_set_status (struct samcop_fsi *fsi, u32 val);
@@ -29,7 +41,8 @@
extern void samcop_fsi_set_prescaler (struct samcop_fsi *fsi, u32 val);
extern void samcop_fsi_set_dmc (struct samcop_fsi *fsi, u32 val);
+
extern int fsi_attach (struct samcop_fsi *fsi);
-extern void fsi_detach (void);
+extern int fsi_detach (void);
#endif /* _SAMCOP_FSI_H_ */
Modified: linux4palm/linux/branches/cleanup-branch-never-commit/drivers/pcmcia/pxa2xx_base.c
===================================================================
--- linux4palm/linux/branches/cleanup-branch-never-commit/drivers/pcmcia/pxa2xx_base.c 2007-09-17 13:32:07 UTC (rev 1324)
+++ linux4palm/linux/branches/cleanup-branch-never-commit/drivers/pcmcia/pxa2xx_base.c 2007-09-17 14:11:49 UTC (rev 1325)
@@ -59,7 +59,12 @@
u_int mem_clk_10khz)
{
u_int code = pcmcia_cycle_ns * mem_clk_10khz;
+// FIXME: There shouldn't be such #ifdef, added 20070803, resolve max in 6months
+#ifdef CONFIG_ARCH_H5400
+ return (code / 300000) + ((code % 300000) ? 1 : 0) + 1;
+#else
return (code / 300000) + ((code % 300000) ? 1 : 0) - 1;
+#endif
}
static inline u_int pxa2xx_mcxx_setup(u_int pcmcia_cycle_ns,
Modified: linux4palm/linux/branches/cleanup-branch-never-commit/drivers/video/backlight/Makefile
===================================================================
--- linux4palm/linux/branches/cleanup-branch-never-commit/drivers/video/backlight/Makefile 2007-09-17 13:32:07 UTC (rev 1324)
+++ linux4palm/linux/branches/cleanup-branch-never-commit/drivers/video/backlight/Makefile 2007-09-17 14:11:49 UTC (rev 1325)
@@ -1,13 +1,13 @@
# Backlight & LCD drivers
-obj-$(CONFIG_LCD_CLASS_DEVICE) += lcd.o
-obj-$(CONFIG_BACKLIGHT_CLASS_DEVICE) += backlight.o
-obj-$(CONFIG_BACKLIGHT_CORGI) += corgi_bl.o
-obj-$(CONFIG_BACKLIGHT_HP680) += hp680_bl.o
-obj-$(CONFIG_BACKLIGHT_LOCOMO) += locomolcd.o
-obj-$(CONFIG_BACKLIGHT_PROGEAR) += progear_bl.o
-obj-$(CONFIG_BACKLIGHT_HX2750) += hx2750_bl.o
-obj-$(CONFIG_BACKLIGHT_H2200) += h2200_bl.o
-obj-$(CONFIG_LCD_H2200) += h2200_lcd.o
-obj-$(CONFIG_BACKLIGHT_S3C2410) += s3c2410_lcd.o
+obj-$(CONFIG_LCD_CLASS_DEVICE) += lcd.o
+obj-$(CONFIG_BACKLIGHT_CLASS_DEVICE) += backlight.o
+obj-$(CONFIG_BACKLIGHT_CORGI) += corgi_bl.o
+obj-$(CONFIG_BACKLIGHT_HP680) += hp680_bl.o
+obj-$(CONFIG_BACKLIGHT_LOCOMO) += locomolcd.o
+obj-$(CONFIG_BACKLIGHT_PROGEAR) += progear_bl.o
+obj-$(CONFIG_BACKLIGHT_HX2750) += hx2750_bl.o
+obj-$(CONFIG_BACKLIGHT_H2200) += h2200_bl.o
+obj-$(CONFIG_LCD_H2200) += h2200_lcd.o
+obj-$(CONFIG_BACKLIGHT_S3C2410) += s3c2410_lcd.o
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|