? kernel26/arch/arm/mach-pxa/h5400/.built-in.o.cmd
? kernel26/arch/arm/mach-pxa/h5400/.h5400.o.cmd
? kernel26/arch/arm/mach-pxa/h5400/.h5400_lcd.o.cmd
? kernel26/arch/arm/mach-pxa/h5400/.h5400_wifi.o.cmd
Index: kernel26/arch/arm/mach-pxa/h5400/Kconfig
===================================================================
RCS file: /cvs/linux/kernel26/arch/arm/mach-pxa/h5400/Kconfig,v
retrieving revision 1.20
diff -u -r1.20 Kconfig
--- kernel26/arch/arm/mach-pxa/h5400/Kconfig	18 Feb 2008 18:11:39 -0000	1.20
+++ kernel26/arch/arm/mach-pxa/h5400/Kconfig	7 May 2008 22:40:42 -0000
@@ -9,10 +9,6 @@
 	tristate "HP iPAQ h5400 LCD"
 	depends on ARCH_H5400 && LCD_CLASS_DEVICE && FB_MQ1100
 
-config IPAQ_H5400_BL
-	tristate "HP iPAQ h5400 Backlight"
-	depends on ARCH_H5400 && IPAQ_H5400_LCD && BACKLIGHT_CORGI
-
 config IPAQ_H5400_WIFI
 	tristate "HP iPAQ h5400 wifi"
 	depends on ARCH_H5400 && USB && USB_OHCI_HCD
Index: kernel26/arch/arm/mach-pxa/h5400/h5400.c
===================================================================
RCS file: /cvs/linux/kernel26/arch/arm/mach-pxa/h5400/h5400.c,v
retrieving revision 1.58
diff -u -r1.58 h5400.c
--- kernel26/arch/arm/mach-pxa/h5400/h5400.c	18 Feb 2008 18:11:39 -0000	1.58
+++ kernel26/arch/arm/mach-pxa/h5400/h5400.c	7 May 2008 22:40:43 -0000
@@ -20,6 +20,7 @@
  *
  * 2002-08-23   Jamey Hicks        GPIO and IRQ support for iPAQ H5400
  * 2008-02-14   Michal Panczyk        Merge back the BT functions
+ * 2008-02-22   Michal Panczyk	      Merge Backlight support from h5400_lcd.c
  *
  */
 
@@ -44,6 +45,8 @@
 #include <linux/mtd/partitions.h>
 #include <linux/mtd/physmap.h>
 #include <linux/pda_power.h>
+#include <linux/corgi_bl.h>
+#include <linux/mfd/mq11xx.h>
 
 #include <asm/irq.h>
 #include <asm/mach-types.h>
@@ -71,6 +74,8 @@
 
 #include "../generic.h"
 
+DEFINE_LED_TRIGGER(h5400_bt_trig);
+
 /***********************************************************************************/
 /*      EGPIO, etc                                                                 */
 /***********************************************************************************/
@@ -155,13 +160,13 @@
                  */
 		mdelay(2);
 		SET_H5400_GPIO(BT_M_RESET, on);
-		led_trigger_event_shared(h5400_radio_trig, LED_FULL);
+		led_trigger_event(h5400_bt_trig, LED_FULL);
 	} else {
 		samcop_set_gpio_b(&h5400_samcop.dev,
 		                  SAMCOP_GPIO_GPB_BLUETOOTH_3V0_ON,
 		                  ~SAMCOP_GPIO_GPB_BLUETOOTH_3V0_ON);
 		SET_H5400_GPIO(BT_2V8_N, !on);
-		led_trigger_event_shared(h5400_radio_trig, LED_OFF);
+		led_trigger_event(h5400_bt_trig, LED_OFF);
 	}
 }
 
@@ -234,6 +239,57 @@
 	},
 };
 
+/****************************************************************************
+ * Backlight
+ ****************************************************************************/
+
+extern struct mediaq11xx_base *mq_base;
+
+static void mq1100_set_pwm(struct mediaq11xx_base *base, unsigned char chan,
+                           unsigned char level)
+{
+	unsigned long d;
+	int shift = chan ? 24 : 8;
+
+	d = base->regs->FP.pulse_width_mod_control;
+	d &= ~(0xff << shift);
+	d |= level << shift;
+	base->regs->FP.pulse_width_mod_control = d;
+
+	return;
+}
+
+static void h5400_bl_set_intensity(int intensity)
+{
+	samcop_set_gpio_b(&h5400_samcop.dev,
+	                  SAMCOP_GPIO_GPB_BACKLIGHT_POWER_ON, intensity ?
+	                  SAMCOP_GPIO_GPB_BACKLIGHT_POWER_ON : 0);
+
+	mq1100_set_pwm(mq_base, 0, (0x3ff - intensity) >> 2);
+	return;
+}
+
+static void h5400_bl_null_release(struct device *dev)
+{
+	return;
+}
+
+static struct corgibl_machinfo h5400_bl_info = {
+	.max_intensity = 0x3ff,
+	.default_intensity = 0x3ff/16,
+	.limit_mask = 0x3ff/128,
+	.set_bl_intensity = h5400_bl_set_intensity,
+};
+
+static struct platform_device corgibl_pdev = {
+	.name = "corgi-bl",
+	.id = -1,
+	.dev = {
+		.platform_data = &h5400_bl_info,
+		.release = h5400_bl_null_release,
+	},
+};
+
 /****************************************************************************/
 
 static __inline__ void 
@@ -330,8 +386,6 @@
  * LEDs
  */
 
-DEFINE_LED_TRIGGER_SHARED_GLOBAL(h5400_radio_trig);
-EXPORT_SYMBOL(h5400_radio_trig);
 
 static struct samcop_led h5400_leds[] = {
 	{
@@ -353,6 +407,7 @@
 	{
 		.led_cdev = {
 			.name = "h5400:red-left",
+			.default_trigger = "h5400-wifi",
 			.flags = LED_SUPPORTS_HWTIMER,
 		},
 		.hw_num = 2,
@@ -367,7 +422,7 @@
 	{
 		.led_cdev = {
 			.name = "h5400:blue",
-			.default_trigger = "h5400-radio",
+			.default_trigger = "h5400-bt",
 			.flags = LED_SUPPORTS_HWTIMER,
 		},
 		.hw_num = 4,
@@ -819,11 +874,12 @@
 static void __init
 h5400_init (void)
 {
-	led_trigger_register_shared("h5400-radio", &h5400_radio_trig);
+	led_trigger_register_hwtimer("h5400-bt", &h5400_bt_trig);	
 	h5000_fixup_power_irqs ();
 	platform_device_register (&h5000_flash[0]);
 	platform_device_register (&h5000_flash[1]);
 	platform_device_register (&h5400_samcop);
+	platform_device_register (&corgibl_pdev);
 	platform_device_register (&h5000_gpiodev_keys2);
 	pxa_set_udc_info (&h5400_udc_mach_info);
 	pxa_set_dma_needs_bounce (h5400_dma_needs_bounce);
Index: kernel26/arch/arm/mach-pxa/h5400/h5400_wifi.c
===================================================================
RCS file: /cvs/linux/kernel26/arch/arm/mach-pxa/h5400/h5400_wifi.c,v
retrieving revision 1.11
diff -u -r1.11 h5400_wifi.c
--- kernel26/arch/arm/mach-pxa/h5400/h5400_wifi.c	18 Jul 2007 13:21:02 -0000	1.11
+++ kernel26/arch/arm/mach-pxa/h5400/h5400_wifi.c	7 May 2008 22:40:43 -0000
@@ -21,110 +21,47 @@
  */
 
 #include <linux/module.h>
-#include <linux/platform_device.h>
-#include <linux/version.h>
-#include <linux/init.h>
 #include <linux/device.h>
-#include <linux/usb.h>
-#include <linux/slab.h>
-#define CONFIG_PCI
-#include <linux/pci.h> /* pci_pool defs */
 #include <linux/leds.h>
 
-#include <asm/arch/hardware.h>
-#include <asm/irq.h>
-
 #include <asm/arch-pxa/h5400.h>
 #include <asm/arch-pxa/h5400-asic.h>
-
 #include <linux/mfd/samcop_base.h>
 
-typedef struct ohci ohci_t;
-
-extern int hc_add_ohci(struct pci_dev *dev, int irq, void *mem_base, unsigned long flags,
-				 ohci_t **ohci, const char *name, const char *slot_name);
-extern void hc_remove_ohci(ohci_t *ohci);
+DEFINE_LED_TRIGGER(h5400_wifi_trig);
 
 static void 
-h5400_ohci_remove (struct device *dev)
+h5400_wifi_remove (void)
 {
-#if 0
-#warning port to kernel 2.6
-	if (dev->driver_data) {
-		hc_remove_ohci (dev->driver_data);
-		dev->driver_data = NULL;
-	}
-#endif
-
-	samcop_set_gpio_b (dev->parent, SAMCOP_GPIO_GPB_RF_POWER_ON | SAMCOP_GPIO_GPB_WLAN_POWER_ON, 0);
-	led_trigger_event_shared(h5400_radio_trig, LED_OFF);
+	printk("h5400_wlan_remove\n");
+	samcop_set_gpio_b (&h5400_samcop.dev, SAMCOP_GPIO_GPB_RF_POWER_ON | SAMCOP_GPIO_GPB_WLAN_POWER_ON, 0);
+	led_trigger_event(h5400_wifi_trig, LED_OFF);
+	led_trigger_unregister_hwtimer(h5400_wifi_trig);
 }
 
-static int 
-h5400_ohci_probe (struct device *dev)
+static void 
+h5400_wifi_start (void)
 {
-	struct platform_device *sdev;
-	int irq;
-	void *mem_base;
-	unsigned long flags = 0;
-	int result = 0;
-
-	sdev = to_platform_device (dev);
-	mem_base = (void *)sdev->resource[1].start;
-	irq = sdev->resource[2].start;
-
-	/* make sure the clocks are enabled */
-	samcop_clock_enable (dev->parent, SAMCOP_CPM_CLKCON_USBHOST_CLKEN, 1);
-	samcop_clock_enable (dev->parent, SAMCOP_CPM_CLKCON_UCLK_EN, 0);
-
+	printk("h5400_wlan_start\n");
 	/* both needed? */
-	samcop_set_gpio_b (dev->parent, SAMCOP_GPIO_GPB_RF_POWER_ON | SAMCOP_GPIO_GPB_WLAN_POWER_ON, 
+	samcop_set_gpio_b (&h5400_samcop.dev, SAMCOP_GPIO_GPB_RF_POWER_ON | SAMCOP_GPIO_GPB_WLAN_POWER_ON, 
 			   SAMCOP_GPIO_GPB_RF_POWER_ON | SAMCOP_GPIO_GPB_WLAN_POWER_ON);
+        led_trigger_register_hwtimer("h5400-wifi", &h5400_wifi_trig);
+	led_trigger_event(h5400_wifi_trig, LED_FULL);
+}	
 
-	led_trigger_event_shared(h5400_radio_trig, LED_FULL);
-#if 0
-#warning port to kernel 2.6
-	msleep (100);
-
-	result = hc_add_ohci (pcidev, irq, mem_base, flags, (ohci_t **)&dev->driver_data, "h5400-ohci", "asic");
-	if (result)
-		h5400_ohci_remove (dev);
-#endif
-
-	return result;
-}
-
-static int
-h5400_ohci_suspend (struct device *dev, pm_message_t msg)
+static void __init h5400_wifi_init(void)
 {
-	return 0;
+	h5400_wifi_start();
+	return;
+	
 }
-
-static int
-h5400_ohci_resume (struct device *dev)
-{
-	return 0;
-}
-
-struct device_driver h5400_usb_device_driver = {
-	.name     = "h5400 wifi",
-	.probe    = h5400_ohci_probe,
-	.shutdown = h5400_ohci_remove,
-	.suspend  = h5400_ohci_suspend,
-	.resume   = h5400_ohci_resume
-};
-
-static int __init
-h5400_ohci_init (void)
-{
-	return driver_register (&h5400_usb_device_driver);
-}
-
-static void __exit
-h5400_ohci_exit (void)
+static void __exit h5400_wifi_exit(void)
 {
-	driver_unregister (&h5400_usb_device_driver);
+	h5400_wifi_remove();
+	return;
 }
 
-module_init(h5400_ohci_init);
-module_exit(h5400_ohci_exit);
+module_init(h5400_wifi_init);
+module_exit(h5400_wifi_exit);
+MODULE_LICENSE("GPL");
