From: <mar...@us...> - 2007-04-19 18:09:09
|
Revision: 958 http://svn.sourceforge.net/hackndev/?rev=958&view=rev Author: marex_z71 Date: 2007-04-19 11:09:06 -0700 (Thu, 19 Apr 2007) Log Message: ----------- PalmTC: Update to 2.6.20 ... most of code updated, ptc_ucb1400 still broken Modified Paths: -------------- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/palmtc.c linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/palmtc_keyboard.c linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/ptc_ucb1400.c linux4palm/linux/trunk/drivers/usb/gadget/pxa2xx_udc.c Added Paths: ----------- linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmtc-gpio.h linux4palm/linux/trunk/include/asm-arm/arch-pxa/ptc_ucb1400.h Removed Paths: ------------- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/palmtc-gpio.h linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/ptc_ucb1400.h Deleted: linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/palmtc-gpio.h =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/palmtc-gpio.h 2007-04-18 10:12:50 UTC (rev 957) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/palmtc-gpio.h 2007-04-19 18:09:06 UTC (rev 958) @@ -1,26 +0,0 @@ -/* - * palmtc-gpio.h - * - * Authors: Holger Bocklet <bit...@gm...> - * - */ - -#ifndef _PALMTC_GPIO_H_ -#define _PALMTC_GPIO_H_ - -#include <asm/arch/pxa-regs.h> - -/* Palm Tungsten C GPIOs */ -#define GPIO_NR_PALMTC_EARPHONE_DETECT 2 -#define GPIO_NR_PALMLD_USB_DETECT 4 -#define GPIO_NR_PALMLD_POWER_DETECT 5 -#define GPIO_NR_PALMTC_HOTSYNC_BUTTON 7 -#define GPIO_NR_PALMTC_SD_DETECT 12 // low->high wenn out, high->low when inserted -#define GPIO_NR_PALMLD_BL_POWER 16 - -//#define GPIO_NR_PALMLD_STD_RXD 46 /* IRDA */ -//#define GPIO_NR_PALMLD_STD_TXD 47 - -#define IRQ_GPIO_PALMTC_SD_DETECT IRQ_GPIO(GPIO_NR_PALMTC_SD_DETECT) - -#endif /* _PALMTC_GPIO_H_ */ Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/palmtc.c =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/palmtc.c 2007-04-18 10:12:50 UTC (rev 957) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/palmtc.c 2007-04-19 18:09:06 UTC (rev 958) @@ -18,14 +18,15 @@ #include <linux/device.h> #include <linux/platform_device.h> #include <linux/fb.h> +#include <linux/irq.h> #include <asm/arch/pxa-dmabounce.h> #include <asm/arch/pxafb.h> #include <asm/arch/pxa-regs.h> #include <asm/arch/pxapwm-bl.h> +#include <asm/arch/palmtc-gpio.h> #include "../generic.h" -#include "palmtc-gpio.h" #define DEBUG @@ -40,28 +41,36 @@ CKEN &= ~CKEN1_PWM1; } -static struct pxafb_mach_info palmtclcd __initdata = { - .pixclock = 0, - .xres = 320, - .yres = 320, - .bpp = 16, - .hsync_len = 4, - .left_margin = 30, - .right_margin = 7, - .vsync_len = 4, - .upper_margin = 6, - .lower_margin = 7, - .sync = FB_SYNC_HOR_HIGH_ACT|FB_SYNC_VERT_HIGH_ACT, +static struct pxafb_mode_info palmtc_lcd_modes[] = { +{ + /* pixclock is set by lccr3 below */ + .pixclock = 0, + .xres = 320, + .yres = 320, + .bpp = 16, + .hsync_len = 4, + .vsync_len = 4, - .lccr0 = 0x07B008F9, - .lccr3 = 0x04700004, + /* fixme: these are the margins PalmOS has set, + * they seem to work but could be better. + */ + .left_margin = 30, + .right_margin = 7, + .upper_margin = 6, + .lower_margin = 7, +}, +}; +static struct pxafb_mach_info palmtc_lcd_screen = { + .modes = palmtc_lcd_modes, + .num_modes = ARRAY_SIZE(palmtc_lcd_modes), + .lccr0 = 0x07B008F9, + .lccr3 = 0x04700004, + .pxafb_backlight_power = palmtc_backlight_power, }; - - -static int palmtc_mci_init(struct device *dev, irqreturn_t (*palmtc_detect_int)(int, void *, struct pt_regs *), void *data) +static int palmtc_mci_init(struct device *dev, irqreturn_t (*palmtc_detect_int)(int, void *), void *data) { int err; @@ -144,7 +153,7 @@ static void __init palmtc_init(void) { - set_pxa_fb_info(&palmtclcd); + set_pxa_fb_info( &palmtc_lcd_screen ); GCR &= ~GCR_PRIRDY_IEN; pxa_set_mci_info( &palmtc_mci_platform_data ); Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/palmtc_keyboard.c =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/palmtc_keyboard.c 2007-04-18 10:12:50 UTC (rev 957) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/palmtc_keyboard.c 2007-04-19 18:09:06 UTC (rev 958) @@ -20,6 +20,7 @@ #include <linux/delay.h> #include <linux/reboot.h> #include <linux/sched.h> +#include <linux/irq.h> #include <asm/mach/arch.h> #include <asm/mach-types.h> @@ -153,13 +154,13 @@ static spinlock_t kbd_lock = SPIN_LOCK_UNLOCKED; -static irqreturn_t palmtc_kbd_irq_handler(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t palmtc_kbd_irq_handler(int irq, void *dev_id) { queue_work(palmtc_kbd_workqueue, &palmtc_kbd_task); return IRQ_HANDLED; } -static void palmtc_kbd_queuework(void *data) +static void palmtc_kbd_queuework(struct work_struct *data) { unsigned long tdiff_msec, flags; int gpio, row, col; @@ -344,7 +345,7 @@ input_register_device(keyboard_dev); palmtc_kbd_workqueue = create_workqueue("palmtckbdw"); - INIT_WORK(&palmtc_kbd_task, palmtc_kbd_queuework, NULL); + INIT_WORK(&palmtc_kbd_task, palmtc_kbd_queuework); #ifdef USE_RELEASE_TIMER init_timer (&key_release_timer); Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/ptc_ucb1400.c =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/ptc_ucb1400.c 2007-04-18 10:12:50 UTC (rev 957) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/ptc_ucb1400.c 2007-04-19 18:09:06 UTC (rev 958) @@ -23,7 +23,6 @@ #include <linux/jiffies.h> #include <linux/moduleparam.h> #include <linux/wait.h> -#include <linux/config.h> #include <linux/errno.h> #include <linux/kthread.h> #include <linux/workqueue.h> @@ -32,19 +31,19 @@ #include <linux/ctype.h> #include <linux/time.h> #include <linux/mutex.h> +#include <linux/freezer.h> #include <asm/delay.h> #include <asm/arch/hardware.h> #include <asm/arch/pxa-regs.h> #include <asm/arch/irqs.h> +#include <asm/arch/ptc_ucb1400.h> #include <asm/apm.h> #include <sound/driver.h> #include <sound/core.h> #include <sound/ac97_codec.h> -#include "ptc_ucb1400.h" - #define PALMTC_UCB_DEBUG #ifdef PALMTC_UCB_DEBUG @@ -59,8 +58,8 @@ struct ucb1400 { - struct device *dev; - ac97_t *ac97; + struct device *dev; + ac97_t *ac97; struct input_dev *idev; struct task_struct *thread; //wait_queue_head_t pen_irq_wait; @@ -531,7 +530,7 @@ } // ISR for ac97, shared with pxa2xx-ac97, and later with ucb1400-gpio and ucb1400-adc -static irqreturn_t ucb1400_irq(int irqnr, void *devid, struct pt_regs *regs) +static irqreturn_t ucb1400_irq(int irqnr, void *devid) { u32 status; struct ucb1400 *ucb = (struct ucb1400 *) devid; @@ -549,7 +548,7 @@ } -static void palmtc_ucb1400_irq_queuework(void *data) +static void palmtc_ucb1400_irq_queuework(struct work_struct *data) { struct ucb1400 *ucb = (struct ucb1400 *) data; u16 val,val1,val2; @@ -693,7 +692,7 @@ input_set_abs_params(ucb->idev, ABS_PRESSURE, UCB_TS_PRESSURE_MIN, UCB_TS_PRESSURE_MAX, 1, 1); ucb->idev->name = "Palm Tungsten C touchscreen (ucb1400)"; - ucb->idev->dev = dev; +/* ucb->idev->dev = dev; */ input_register_device(ucb->idev); // clear ucb1400-ints if there are @@ -726,7 +725,7 @@ } // init workqueue for irq-handling ucb->palmtc_ucb1400_workqueue = create_workqueue("kpalmtcucbw"); - INIT_WORK(&ucb->palmtc_ucb1400_work, palmtc_ucb1400_irq_queuework, ucb); + INIT_WORK(&ucb->palmtc_ucb1400_work, palmtc_ucb1400_irq_queuework); //adc val=ucb1400_reg_read(ucb, UCB_CSR2); Deleted: linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/ptc_ucb1400.h =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/ptc_ucb1400.h 2007-04-18 10:12:50 UTC (rev 957) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/ptc_ucb1400.h 2007-04-19 18:09:06 UTC (rev 958) @@ -1,122 +0,0 @@ -/* - * linux/drivers/mfd/ucb1400.h - * - * Copyright (C) 2001 Russell King, All Rights Reserved. - * - * 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. - */ - -/* ucb1400 aclink register mappings: */ - -#define UCB_IO_DATA 0x5a -#define UCB_IO_DIR 0x5c -#define UCB_IE_RIS 0x5e -#define UCB_IE_FAL 0x60 -#define UCB_IE_STATUS 0x62 -#define UCB_IE_CLEAR 0x62 -#define UCB_TS_CR 0x64 -#define UCB_ADC_CR 0x66 -#define UCB_ADC_DATA 0x68 -#define UCB_CSR1 0x6a -#define UCB_CSR2 0x6c -#define UCB_IE_EXTRA 0x70 - -#define UCB_CS_GPIO_AC97_INT (1 << 2) - -#define UCB_ADC_DAT(x) ((x) & 0x3ff) - -#define UCB_IO_0 (1 << 0) -#define UCB_IO_1 (1 << 1) -#define UCB_IO_2 (1 << 2) -#define UCB_IO_3 (1 << 3) -#define UCB_IO_4 (1 << 4) -#define UCB_IO_5 (1 << 5) -#define UCB_IO_6 (1 << 6) -#define UCB_IO_7 (1 << 7) -#define UCB_IO_8 (1 << 8) -#define UCB_IO_9 (1 << 9) - -#define UCB_IE_ADC (1 << 11) -#define UCB_IE_TSPX (1 << 12) -#define UCB_IE_TSMX (1 << 13) -#define UCB_IE_TCLIP (1 << 14) -#define UCB_IE_ACLIP (1 << 15) -#define UCB_IE_IO (0x3FF) - -#define UCB_TC_B_VOICE_ENA (1 << 3) -#define UCB_TC_B_CLIP (1 << 4) -#define UCB_TC_B_ATT (1 << 6) -#define UCB_TC_B_SIDE_ENA (1 << 11) -#define UCB_TC_B_MUTE (1 << 13) -#define UCB_TC_B_IN_ENA (1 << 14) -#define UCB_TC_B_OUT_ENA (1 << 15) - -#define UCB_AC_B_LOOP (1 << 8) -#define UCB_AC_B_MUTE (1 << 13) -#define UCB_AC_B_IN_ENA (1 << 14) -#define UCB_AC_B_OUT_ENA (1 << 15) - -#define UCB_TS_CR_TSMX_POW (1 << 0) -#define UCB_TS_CR_TSPX_POW (1 << 1) -#define UCB_TS_CR_TSMY_POW (1 << 2) -#define UCB_TS_CR_TSPY_POW (1 << 3) -#define UCB_TS_CR_TSMX_GND (1 << 4) -#define UCB_TS_CR_TSPX_GND (1 << 5) -#define UCB_TS_CR_TSMY_GND (1 << 6) -#define UCB_TS_CR_TSPY_GND (1 << 7) -#define UCB_TS_CR_MODE_INT (0 << 8) -#define UCB_TS_CR_MODE_PRES (1 << 8) -#define UCB_TS_CR_MODE_POS (2 << 8) -#define UCB_TS_CR_BIAS_ENA (1 << 11) -#define UCB_TS_CR_TSPX (1 << 12) -#define UCB_TS_CR_TSMX (1 << 13) - -#define UCB_ADC_SYNC_ENA (1 << 0) -#define UCB_ADC_VREFBYP_CON (1 << 1) -#define UCB_ADC_INP_TSPX (0 << 2) -#define UCB_ADC_INP_TSMX (1 << 2) -#define UCB_ADC_INP_TSPY (2 << 2) -#define UCB_ADC_INP_TSMY (3 << 2) -#define UCB_ADC_INP_AD0 (4 << 2) -#define UCB_ADC_INP_AD1 (5 << 2) -#define UCB_ADC_INP_AD2 (6 << 2) -#define UCB_ADC_INP_AD3 (7 << 2) -#define UCB_ADC_EXT_REF (1 << 5) -#define UCB_ADC_START (1 << 7) -#define UCB_ADC_ENA (1 << 15) - -#define UCB_ADC_FILTER_ENA (1 << 12) - -#define UCB_ADC_DATA_MASK 0x3ff -#define UCB_ADC_DATA_VALID (1 << 15) - -#define UCB_ID_1400 0x4304 - -#define UCB_MODE 0x0d -#define UCB_MODE_DYN_VFLAG_ENA (1 << 12) -#define UCB_MODE_AUD_OFF_CAN (1 << 13) - -#define UCB_NOSYNC 0 -#define UCB_SYNC 1 - -#define UCB_RISING (1 << 0) -#define UCB_FALLING (1 << 1) - - -// constants on palm tc -#define UCB_TS_X_MIN 100 -#define UCB_TS_X_MAX 870 -#define UCB_TS_Y_MIN 270 -#define UCB_TS_Y_MAX 970 -#define UCB_TS_PRESSURE_MIN 0 -#define UCB_TS_PRESSURE_MAX 740 -#define UCB_TS_FUZZ 15 - -#define UCB_BATT_HIGH 560 // adc "ticks" not mV ! -#define UCB_BATT_LOW 490 -#define UCB_BATT_CRITICAL 480 - -#define UCB_BATT_DURATION 600 // battery duration in minutes -#define UCB_ADC_TIMEOUT 50 Modified: linux4palm/linux/trunk/drivers/usb/gadget/pxa2xx_udc.c =================================================================== --- linux4palm/linux/trunk/drivers/usb/gadget/pxa2xx_udc.c 2007-04-18 10:12:50 UTC (rev 957) +++ linux4palm/linux/trunk/drivers/usb/gadget/pxa2xx_udc.c 2007-04-19 18:09:06 UTC (rev 958) @@ -2525,7 +2525,7 @@ /* * probe - binds to the platform device */ -static int __init pxa2xx_udc_probe(struct platform_device *pdev) +static int pxa2xx_udc_probe(struct platform_device *pdev) { struct pxa2xx_udc *dev = &memory; int retval, out_dma = 1, vbus_irq; @@ -2677,7 +2677,7 @@ pullup_off(); } -static int __exit pxa2xx_udc_remove(struct platform_device *pdev) +static int pxa2xx_udc_remove(struct platform_device *pdev) { struct pxa2xx_udc *dev = platform_get_drvdata(pdev); Added: linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmtc-gpio.h =================================================================== --- linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmtc-gpio.h (rev 0) +++ linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmtc-gpio.h 2007-04-19 18:09:06 UTC (rev 958) @@ -0,0 +1,26 @@ +/* + * palmtc-gpio.h + * + * Authors: Holger Bocklet <bit...@gm...> + * + */ + +#ifndef _PALMTC_GPIO_H_ +#define _PALMTC_GPIO_H_ + +#include <asm/arch/pxa-regs.h> + +/* Palm Tungsten C GPIOs */ +#define GPIO_NR_PALMTC_EARPHONE_DETECT 2 +#define GPIO_NR_PALMLD_USB_DETECT 4 +#define GPIO_NR_PALMLD_POWER_DETECT 5 +#define GPIO_NR_PALMTC_HOTSYNC_BUTTON 7 +#define GPIO_NR_PALMTC_SD_DETECT 12 // low->high when out, high->low when inserted +#define GPIO_NR_PALMLD_BL_POWER 16 + +//#define GPIO_NR_PALMLD_STD_RXD 46 /* IRDA */ +//#define GPIO_NR_PALMLD_STD_TXD 47 + +#define IRQ_GPIO_PALMTC_SD_DETECT IRQ_GPIO(GPIO_NR_PALMTC_SD_DETECT) + +#endif /* _PALMTC_GPIO_H_ */ Added: linux4palm/linux/trunk/include/asm-arm/arch-pxa/ptc_ucb1400.h =================================================================== --- linux4palm/linux/trunk/include/asm-arm/arch-pxa/ptc_ucb1400.h (rev 0) +++ linux4palm/linux/trunk/include/asm-arm/arch-pxa/ptc_ucb1400.h 2007-04-19 18:09:06 UTC (rev 958) @@ -0,0 +1,122 @@ +/* + * linux/drivers/mfd/ucb1400.h + * + * Copyright (C) 2001 Russell King, All Rights Reserved. + * + * 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. + */ + +/* ucb1400 aclink register mappings: */ + +#define UCB_IO_DATA 0x5a +#define UCB_IO_DIR 0x5c +#define UCB_IE_RIS 0x5e +#define UCB_IE_FAL 0x60 +#define UCB_IE_STATUS 0x62 +#define UCB_IE_CLEAR 0x62 +#define UCB_TS_CR 0x64 +#define UCB_ADC_CR 0x66 +#define UCB_ADC_DATA 0x68 +#define UCB_CSR1 0x6a +#define UCB_CSR2 0x6c +#define UCB_IE_EXTRA 0x70 + +#define UCB_CS_GPIO_AC97_INT (1 << 2) + +#define UCB_ADC_DAT(x) ((x) & 0x3ff) + +#define UCB_IO_0 (1 << 0) +#define UCB_IO_1 (1 << 1) +#define UCB_IO_2 (1 << 2) +#define UCB_IO_3 (1 << 3) +#define UCB_IO_4 (1 << 4) +#define UCB_IO_5 (1 << 5) +#define UCB_IO_6 (1 << 6) +#define UCB_IO_7 (1 << 7) +#define UCB_IO_8 (1 << 8) +#define UCB_IO_9 (1 << 9) + +#define UCB_IE_ADC (1 << 11) +#define UCB_IE_TSPX (1 << 12) +#define UCB_IE_TSMX (1 << 13) +#define UCB_IE_TCLIP (1 << 14) +#define UCB_IE_ACLIP (1 << 15) +#define UCB_IE_IO (0x3FF) + +#define UCB_TC_B_VOICE_ENA (1 << 3) +#define UCB_TC_B_CLIP (1 << 4) +#define UCB_TC_B_ATT (1 << 6) +#define UCB_TC_B_SIDE_ENA (1 << 11) +#define UCB_TC_B_MUTE (1 << 13) +#define UCB_TC_B_IN_ENA (1 << 14) +#define UCB_TC_B_OUT_ENA (1 << 15) + +#define UCB_AC_B_LOOP (1 << 8) +#define UCB_AC_B_MUTE (1 << 13) +#define UCB_AC_B_IN_ENA (1 << 14) +#define UCB_AC_B_OUT_ENA (1 << 15) + +#define UCB_TS_CR_TSMX_POW (1 << 0) +#define UCB_TS_CR_TSPX_POW (1 << 1) +#define UCB_TS_CR_TSMY_POW (1 << 2) +#define UCB_TS_CR_TSPY_POW (1 << 3) +#define UCB_TS_CR_TSMX_GND (1 << 4) +#define UCB_TS_CR_TSPX_GND (1 << 5) +#define UCB_TS_CR_TSMY_GND (1 << 6) +#define UCB_TS_CR_TSPY_GND (1 << 7) +#define UCB_TS_CR_MODE_INT (0 << 8) +#define UCB_TS_CR_MODE_PRES (1 << 8) +#define UCB_TS_CR_MODE_POS (2 << 8) +#define UCB_TS_CR_BIAS_ENA (1 << 11) +#define UCB_TS_CR_TSPX (1 << 12) +#define UCB_TS_CR_TSMX (1 << 13) + +#define UCB_ADC_SYNC_ENA (1 << 0) +#define UCB_ADC_VREFBYP_CON (1 << 1) +#define UCB_ADC_INP_TSPX (0 << 2) +#define UCB_ADC_INP_TSMX (1 << 2) +#define UCB_ADC_INP_TSPY (2 << 2) +#define UCB_ADC_INP_TSMY (3 << 2) +#define UCB_ADC_INP_AD0 (4 << 2) +#define UCB_ADC_INP_AD1 (5 << 2) +#define UCB_ADC_INP_AD2 (6 << 2) +#define UCB_ADC_INP_AD3 (7 << 2) +#define UCB_ADC_EXT_REF (1 << 5) +#define UCB_ADC_START (1 << 7) +#define UCB_ADC_ENA (1 << 15) + +#define UCB_ADC_FILTER_ENA (1 << 12) + +#define UCB_ADC_DATA_MASK 0x3ff +#define UCB_ADC_DATA_VALID (1 << 15) + +#define UCB_ID_1400 0x4304 + +#define UCB_MODE 0x0d +#define UCB_MODE_DYN_VFLAG_ENA (1 << 12) +#define UCB_MODE_AUD_OFF_CAN (1 << 13) + +#define UCB_NOSYNC 0 +#define UCB_SYNC 1 + +#define UCB_RISING (1 << 0) +#define UCB_FALLING (1 << 1) + + +// constants on palm tc +#define UCB_TS_X_MIN 100 +#define UCB_TS_X_MAX 870 +#define UCB_TS_Y_MIN 270 +#define UCB_TS_Y_MAX 970 +#define UCB_TS_PRESSURE_MIN 0 +#define UCB_TS_PRESSURE_MAX 740 +#define UCB_TS_FUZZ 15 + +#define UCB_BATT_HIGH 560 // adc "ticks" not mV ! +#define UCB_BATT_LOW 490 +#define UCB_BATT_CRITICAL 480 + +#define UCB_BATT_DURATION 600 // battery duration in minutes +#define UCB_ADC_TIMEOUT 50 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |