Index: arch/arm/mach-pxa/Kconfig
===================================================================
RCS file: /cvs/linux/kernel26/arch/arm/mach-pxa/Kconfig,v
retrieving revision 1.83
diff -u -r1.83 Kconfig
--- arch/arm/mach-pxa/Kconfig	10 Sep 2007 16:25:55 -0000	1.83
+++ arch/arm/mach-pxa/Kconfig	12 Dec 2007 20:51:12 -0000
@@ -46,6 +46,7 @@
 source "arch/arm/mach-pxa/palmld/Kconfig"
 source "arch/arm/mach-pxa/palmt3/Kconfig"
 source "arch/arm/mach-pxa/plat-recon/Kconfig"
+source "arch/arm/mach-pxa/looxn560/Kconfig"
 
 config MACH_GHI270HG
 	bool "Grayhill Duramax HG"
Index: arch/arm/mach-pxa/Makefile
===================================================================
RCS file: /cvs/linux/kernel26/arch/arm/mach-pxa/Makefile,v
retrieving revision 1.82
diff -u -r1.82 Makefile
--- arch/arm/mach-pxa/Makefile	10 Sep 2007 16:36:43 -0000	1.82
+++ arch/arm/mach-pxa/Makefile	12 Dec 2007 20:51:12 -0000
@@ -50,6 +50,7 @@
 obj-$(CONFIG_MACH_XSCALE_PALMLD)	+= palmld/
 obj-$(CONFIG_MACH_RECON)        += plat-recon/
 obj-$(CONFIG_MACH_LOOXC550)	+= looxc550/
+obj-$(CONFIG_MACH_LOOXN560)	+= looxn560/
 
 # Support for blinky lights
 led-y := leds.o
Index: arch/arm/mach-pxa/looxn560/Kconfig
===================================================================
RCS file: arch/arm/mach-pxa/looxn560/Kconfig
diff -N arch/arm/mach-pxa/looxn560/Kconfig
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ arch/arm/mach-pxa/looxn560/Kconfig	12 Dec 2007 20:51:12 -0000
@@ -0,0 +1,8 @@
+menuconfig MACH_LOOXN560
+	bool "FSC Loox N560"
+	select PXA27x
+	select KEYBOARD_PXA27x
+	help
+		Say Y here if you intend to run this kernel on a
+		Fujitsu-Siemens PocketLOOX N560. Currently there
+		is only basic support for this PDA.
Index: arch/arm/mach-pxa/looxn560/Makefile
===================================================================
RCS file: arch/arm/mach-pxa/looxn560/Makefile
diff -N arch/arm/mach-pxa/looxn560/Makefile
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ arch/arm/mach-pxa/looxn560/Makefile	12 Dec 2007 20:51:12 -0000
@@ -0,0 +1,7 @@
+#
+# /arch/arm/mach-pxa/looxn560/Makefile.c
+#
+# Copyright (C) 2007 Marek Vasut <marek.vasut@gmail.com>
+#
+
+obj-$(CONFIG_MACH_LOOXN560) += looxn560.o looxn560_buttons.o
Index: arch/arm/mach-pxa/looxn560/looxn560.c
===================================================================
RCS file: arch/arm/mach-pxa/looxn560/looxn560.c
diff -N arch/arm/mach-pxa/looxn560/looxn560.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ arch/arm/mach-pxa/looxn560/looxn560.c	12 Dec 2007 20:51:12 -0000
@@ -0,0 +1,246 @@
+/*
+ *  linux/arch/arm/mach-pxa/looxn560/looxn560.c
+ *
+ *  Hardware definitions for FSC LOOX N560
+ *  
+ *  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/init.h>
+#include <linux/platform_device.h>
+#include <linux/fb.h>
+
+#include <asm/types.h>
+#include <asm/setup.h>
+#include <asm/mach-types.h>
+#include <asm/hardware.h>
+#include <asm/irq.h>
+#include <asm/sizes.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach/irq.h>
+
+#include <asm/arch/gpio.h>
+#include <asm/arch/pxa-regs.h>
+#include <asm/arch/pxafb.h>
+#include <asm/arch/mmc.h>
+#include <asm/arch/udc.h>
+
+#include <linux/ads7846.h>
+#include <linux/touchscreen-adc.h>
+#include <linux/pda_power.h>
+
+#include <asm/arch/looxn560.h>
+
+#include "../generic.h"
+
+
+/**************************** MCI **********************************/
+
+static int looxn560_mci_init(struct device *dev, irq_handler_t looxn560_detect_int, void *data)
+{
+	int err;
+
+	/*
+	 * setup GPIO for PXA27x MMC controller
+	 */
+
+	pxa_gpio_mode(GPIO32_MMCCLK_MD);
+	pxa_gpio_mode(GPIO92_MMCDAT0_MD);
+	pxa_gpio_mode(GPIO109_MMCDAT1_MD);
+	pxa_gpio_mode(GPIO110_MMCDAT2_MD);
+	pxa_gpio_mode(GPIO111_MMCDAT3_MD);
+	pxa_gpio_mode(GPIO112_MMCCMD_MD);
+
+	set_irq_type(gpio_to_irq(GPIO_NR_LOOXN560_SD_DETECT)
+			, IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING);
+	err = request_irq(gpio_to_irq(GPIO_NR_LOOXN560_SD_DETECT)
+			, looxn560_detect_int, IRQF_DISABLED
+			, "MMC card detect", data);
+	if (err) {
+		printk(KERN_ERR "looxn560_mci_init: MMC/SD: can't request MMC card detect IRQ\n");
+		return -1;
+	}
+
+	return 0;
+}
+
+static void looxn560_mci_setpower(struct device *dev, unsigned int vdd)
+{
+	struct pxamci_platform_data* p_d = dev->platform_data;
+
+	gpio_set_value(GPIO_NR_LOOXN560_SD_POWER, ( 1 << vdd) & p_d->ocr_mask);
+}
+
+static void looxn560_mci_exit(struct device *dev, void *data)
+{
+	free_irq(gpio_to_irq(GPIO_NR_LOOXN560_SD_DETECT), data);
+}
+
+static int looxn560_mci_get_ro(struct device* dev)
+{
+	return gpio_get_value(GPIO_NR_LOOXN560_SD_RO);
+}
+
+static struct pxamci_platform_data looxn560_mci_platform_data = {
+	.ocr_mask       = MMC_VDD_32_33|MMC_VDD_33_34,
+	.init 		= looxn560_mci_init,
+	.setpower 	= looxn560_mci_setpower,
+	.exit		= looxn560_mci_exit,
+	.get_ro		= looxn560_mci_get_ro
+};
+
+/****************************     UDC     **************************/
+
+static struct pxa2xx_udc_mach_info looxn560_udc_info __initdata = {
+	.gpio_pullup	= GPIO_NR_LOOXN560_USB_PULLUP
+};
+
+/*************************** Power driver **************************/
+
+static int looxn560_is_ac_online(void)
+{
+	return !gpio_get_value(GPIO_NR_LOOXN560_AC_IN_N);
+}
+
+static int looxn560_is_usb_online(void)
+{
+	return !gpio_get_value(GPIO_NR_LOOXN560_USB_DETECT_N);
+}
+
+static void looxn560_set_charge(int flags)
+{
+	gpio_set_value(GPIO_NR_LOOXN560_CHARGE_EN_N
+			, !(flags & PDA_POWER_CHARGE_AC));
+
+	gpio_set_value(GPIO_NR_LOOXN560_USB_CHARGE_RATE_N
+			, !(flags & PDA_POWER_CHARGE_USB));
+};
+
+static struct pda_power_pdata looxn560_power_data = {
+	.is_ac_online = looxn560_is_ac_online,
+	.is_usb_online = looxn560_is_usb_online,
+	.set_charge = looxn560_set_charge
+};
+
+static struct resource looxn560_power_resources[] = {
+	[0] = {
+		.name = "ac",
+		.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE |
+		         IORESOURCE_IRQ_LOWEDGE,
+	},
+	[1] = {
+		.name = "usb",
+		.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE |
+		         IORESOURCE_IRQ_LOWEDGE,
+	},
+};
+
+static struct platform_device looxn560_power = {
+	.name = "pda-power",
+	.id = -1,
+	.resource = looxn560_power_resources,
+	.num_resources = ARRAY_SIZE(looxn560_power_resources),
+	.dev = {
+		.platform_data = &looxn560_power_data
+	},
+};
+
+/**************************** Entry point **************************/
+struct ads7846_ssp_platform_data looxn560_ssp_params = {
+	.port = 1,
+	.pd_bits = 1,
+	.freq = 720000,
+};
+static struct platform_device ads7846_ssp = { 
+	.name = "ads7846-ssp", 
+	.id = -1,
+	.dev = {
+		.platform_data = &looxn560_ssp_params,
+	}
+};
+
+struct tsadc_platform_data looxn560_ts_params = {
+	.pen_gpio = GPIO_NR_LOOXN560_TOUCHPANEL_IRQ_N,
+	.x_pin = "ads7846-ssp:x",
+	.y_pin = "ads7846-ssp:y",
+	.z1_pin = "ads7846-ssp:z1",
+	.z2_pin = "ads7846-ssp:z2",
+	.pressure_factor = 100000,
+	.min_pressure = 2,
+	.max_jitter = 8,
+};
+static struct resource looxn560_pen_irq = {
+	.start = gpio_to_irq(GPIO_NR_LOOXN560_TOUCHPANEL_IRQ_N),
+	.end = gpio_to_irq(GPIO_NR_LOOXN560_TOUCHPANEL_IRQ_N),
+	.flags = IORESOURCE_IRQ,
+};
+static struct platform_device ads7846_ts = {
+	.name = "ts-adc",
+	.id = -1,
+	.resource = &looxn560_pen_irq,
+	.num_resources = 1,
+	.dev = {
+		.platform_data = &looxn560_ts_params,
+	}
+};
+
+static struct platform_device looxn560_keyboard = {
+	.name = "looxn560-buttons"
+};
+
+static struct platform_device *devices[] __initdata = {
+	&ads7846_ssp,
+	&ads7846_ts,
+	&looxn560_power,
+	&looxn560_keyboard
+};
+
+/*
+ * PXA27x framebuffer
+ */
+
+static struct pxafb_mode_info looxn560_pxafb_mode_info[] = {
+    {
+	.pixclock		= 0,
+	.xres			= 480,
+	.yres			= 640,
+	.bpp			= 16,
+	.hsync_len		= 8,
+	.vsync_len		= 2,
+
+	.left_margin		= 8,
+	.right_margin		= 124,
+	.upper_margin		= 3,
+	.lower_margin		= 25,
+
+	.sync			= 0,
+    },
+};
+
+static struct pxafb_mach_info looxn560_pxafb_info = {
+	.modes			= looxn560_pxafb_mode_info,
+	.num_modes      	= ARRAY_SIZE(looxn560_pxafb_mode_info),
+	.lccr0			= LCCR0_Act | LCCR0_Sngl | LCCR0_Color,
+	.lccr3			= LCCR3_OutEnH | LCCR3_PixRsEdg,
+};
+
+static void __init looxn560_init(void)
+{
+	set_pxa_fb_info(&looxn560_pxafb_info);
+	pxa_set_mci_info(&looxn560_mci_platform_data);
+	pxa_set_udc_info(&looxn560_udc_info);
+	platform_add_devices(devices, ARRAY_SIZE(devices));
+}
+
+MACHINE_START(LOOXN560, "FSC Loox N560")
+	.phys_io	= 0x40000000,
+	.boot_params	= 0xa0000100,	/* BLOB boot parameter setting */
+	.io_pg_offst	= (io_p2v(0x40000000) >> 18) & 0xfffc,
+	.map_io		= pxa_map_io,
+	.init_irq	= pxa_init_irq,
+	.timer		= &pxa_timer,
+	.init_machine	= looxn560_init,
+MACHINE_END
Index: arch/arm/mach-pxa/looxn560/looxn560_buttons.c
===================================================================
RCS file: arch/arm/mach-pxa/looxn560/looxn560_buttons.c
diff -N arch/arm/mach-pxa/looxn560/looxn560_buttons.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ arch/arm/mach-pxa/looxn560/looxn560_buttons.c	12 Dec 2007 20:51:12 -0000
@@ -0,0 +1,118 @@
+/*
+ *  linux/arch/arm/mach-pxa/looxn560/looxn560_buttons.c
+ *
+ *  Keyboard definitions for FSC LOOX N560
+ *
+ *  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/input.h>
+#include <linux/input_pda.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/irq.h>
+#include <linux/platform_device.h>
+#include <linux/gpio_keys.h>
+
+#include <asm/mach-types.h>
+#include <asm/arch/pxa27x_keyboard.h>
+#include <asm/arch/looxn560.h>
+
+
+/**************************** Keyboard **************************/
+
+static struct pxa27x_keyboard_platform_data looxn560_buttons = {
+    .nr_rows = 5,
+    .nr_cols = 2,
+    .keycodes = {
+	{	_KEY_RECORD,
+		KEY_UP
+	},
+	{	_KEY_CALENDAR,
+		KEY_DOWN
+        },
+	{	KEY_RIGHT,
+		_KEY_MAIL
+	},
+	{	_KEY_CONTACTS,
+		KEY_LEFT
+        },
+	{	_KEY_HOMEPAGE,
+		KEY_ENTER
+        },
+    },
+    .gpio_modes = {
+	GPIO_NR_LOOXN560_KP_MKIN0_MD,
+	GPIO_NR_LOOXN560_KP_MKIN1_MD,
+	GPIO_NR_LOOXN560_KP_MKIN2_MD,
+	GPIO_NR_LOOXN560_KP_MKIN3_MD,
+	GPIO_NR_LOOXN560_KP_MKIN4_MD,
+	GPIO_NR_LOOXN560_KP_MKOUT0_MD,
+	GPIO_NR_LOOXN560_KP_MKOUT1_MD,
+    }
+};
+
+static struct platform_device looxn560_pxa_keyboard = {
+	.name	= "pxa27x-keyboard",
+	.id	= -1,
+	.dev	= {
+		.platform_data = &looxn560_buttons
+	}
+};
+
+/*
+Power button connected to GPIO 0, so we need use gpio-keys
+*/
+
+static struct gpio_keys_button looxn560_gpio_buttons[] = {
+	{ KEY_POWER, GPIO_NR_LOOXN560_KEYPWR, 0, "Power button"}
+};
+
+static struct gpio_keys_platform_data looxn560_gpio_keys_data = {
+	.buttons = looxn560_gpio_buttons,
+	.nbuttons = ARRAY_SIZE(looxn560_gpio_buttons)
+};
+
+static struct platform_device looxn560_gpio_keys = {
+	.name = "gpio-keys",
+	.dev = {
+		.platform_data = &looxn560_gpio_keys_data
+	}
+};
+
+/*********************************************************************/
+
+static int __devinit looxn560_buttons_probe(struct platform_device *dev)
+{
+	platform_device_register(&looxn560_pxa_keyboard);
+	platform_device_register(&looxn560_gpio_keys);
+        return 0;
+}
+
+static struct platform_driver looxn560_buttons_driver = {
+	.driver	= {
+	    .name= "looxn560-buttons",
+	},
+	.probe	= looxn560_buttons_probe
+};
+
+static int __init looxn560_buttons_init(void)
+{
+	if (!machine_is_looxn560())
+	    return -ENODEV;
+	return platform_driver_register(&looxn560_buttons_driver);
+}
+
+static void __exit looxn560_buttons_exit(void)
+{
+	platform_driver_unregister(&looxn560_buttons_driver);
+}
+
+module_init(looxn560_buttons_init);
+module_exit(looxn560_buttons_exit);
+
+MODULE_DESCRIPTION ("Buttons support for FSC Loox N560");
+MODULE_LICENSE ("GPL");
Index: include/asm-arm/arch-pxa/looxn560.h
===================================================================
RCS file: include/asm-arm/arch-pxa/looxn560.h
diff -N include/asm-arm/arch-pxa/looxn560.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ include/asm-arm/arch-pxa/looxn560.h	12 Dec 2007 20:51:13 -0000
@@ -0,0 +1,45 @@
+/*
+ * FSC Loox N560 GPIO definitions
+ */
+
+#include <asm/arch/pxa-regs.h>
+
+#define GPIO_NR_LOOXN560_KEYPWR			0
+
+#define GPIO_NR_LOOXN560_BATTCOVER		4
+
+#define GPIO_NR_LOOXN560_AC_IN_N		9
+
+#define GPIO_NR_LOOXN560_USB_DETECT_N		13
+
+#define GPIO_NR_LOOXN560_SD_RO			15
+
+#define GPIO_NR_LOOXN560_USB_PULLUP		57
+
+#define GPIO_NR_LOOXN560_SD_DETECT		78
+
+#define GPIO_NR_LOOXN560_HP_JACK		93
+#define GPIO_NR_LOOXN560_TOUCHPANEL_IRQ_N	94
+
+#define GPIO_NR_LOOXN560_KP_MKIN3		97
+#define GPIO_NR_LOOXN560_KP_MKIN4		98
+#define GPIO_NR_LOOXN560_CHARGE_EN_N		99
+
+
+#define GPIO_NR_LOOXN560_KP_MKIN0		100
+#define GPIO_NR_LOOXN560_KP_MKIN1		101
+#define GPIO_NR_LOOXN560_KP_MKIN2		102
+#define GPIO_NR_LOOXN560_KP_MKOUT0		103
+#define GPIO_NR_LOOXN560_KP_MKOUT1		104
+
+#define GPIO_NR_LOOXN560_USB_CHARGE_RATE_N	107
+#define GPIO_NR_LOOXN560_SD_POWER		108
+
+#define GPIO_NR_LOOXN560_KP_MKIN0_MD		(GPIO_NR_LOOXN560_KP_MKIN0 | GPIO_ALT_FN_1_IN)
+#define GPIO_NR_LOOXN560_KP_MKIN1_MD		(GPIO_NR_LOOXN560_KP_MKIN1 | GPIO_ALT_FN_1_IN)
+#define GPIO_NR_LOOXN560_KP_MKIN2_MD		(GPIO_NR_LOOXN560_KP_MKIN2 | GPIO_ALT_FN_1_IN)
+#define GPIO_NR_LOOXN560_KP_MKIN3_MD		(GPIO_NR_LOOXN560_KP_MKIN3 | GPIO_ALT_FN_3_IN)
+#define GPIO_NR_LOOXN560_KP_MKIN4_MD		(GPIO_NR_LOOXN560_KP_MKIN4 | GPIO_ALT_FN_3_IN)
+
+#define GPIO_NR_LOOXN560_KP_MKOUT0_MD		(GPIO_NR_LOOXN560_KP_MKOUT0 | GPIO_ALT_FN_2_OUT)
+#define GPIO_NR_LOOXN560_KP_MKOUT1_MD		(GPIO_NR_LOOXN560_KP_MKOUT1 | GPIO_ALT_FN_2_OUT)

