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: <bob...@us...> - 2007-06-24 09:41:01
|
Revision: 1064 http://svn.sourceforge.net/hackndev/?rev=1064&view=rev Author: bobofdoom Date: 2007-06-24 02:40:43 -0700 (Sun, 24 Jun 2007) Log Message: ----------- qemu: Created Changelog for Hack&Dev patches. Added Paths: ----------- qemu/trunk/Changelog.hackndev Added: qemu/trunk/Changelog.hackndev =================================================================== --- qemu/trunk/Changelog.hackndev (rev 0) +++ qemu/trunk/Changelog.hackndev 2007-06-24 09:40:43 UTC (rev 1064) @@ -0,0 +1,2 @@ +version hnd0: + - Initial release. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bob...@us...> - 2007-06-24 09:23:36
|
Revision: 1063 http://svn.sourceforge.net/hackndev/?rev=1063&view=rev Author: bobofdoom Date: 2007-06-24 02:23:31 -0700 (Sun, 24 Jun 2007) Log Message: ----------- qemu: Tagged hnd0 release. Added Paths: ----------- qemu/tags/qemu-0.9.0-mokosvn-hnd0/ Copied: qemu/tags/qemu-0.9.0-mokosvn-hnd0 (from rev 1062, qemu/trunk) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bob...@us...> - 2007-06-24 09:22:09
|
Revision: 1062 http://svn.sourceforge.net/hackndev/?rev=1062&view=rev Author: bobofdoom Date: 2007-06-24 02:22:07 -0700 (Sun, 24 Jun 2007) Log Message: ----------- qemu: Created tags directory. Added Paths: ----------- qemu/tags/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bob...@us...> - 2007-06-24 05:00:48
|
Revision: 1061 http://svn.sourceforge.net/hackndev/?rev=1061&view=rev Author: bobofdoom Date: 2007-06-23 22:00:46 -0700 (Sat, 23 Jun 2007) Log Message: ----------- qemu: Boot from kernel image by default. Modified Paths: -------------- qemu/trunk/Makefile.target qemu/trunk/hw/palm.c Modified: qemu/trunk/Makefile.target =================================================================== --- qemu/trunk/Makefile.target 2007-06-24 04:43:53 UTC (rev 1060) +++ qemu/trunk/Makefile.target 2007-06-24 05:00:46 UTC (rev 1061) @@ -469,9 +469,10 @@ VL_OBJS+= arm-semi.o VL_OBJS+= pxa2xx.o pxa2xx_pic.o pxa2xx_gpio.o pxa2xx_timer.o pxa2xx_dma.o VL_OBJS+= pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o max111x.o max7310.o +VL_OBJS+= palm.o mdoc.o VL_OBJS+= spitz.o ads7846.o ide.o serial.o nand.o $(AUDIODRV) wm8750.o wm8753.o VL_OBJS+= s3c2410.o s3c24xx_gpio.o s3c24xx_lcd.o s3c24xx_mmci.o s3c24xx_rtc.o -VL_OBJS+= s3c24xx_udc.o neo1973.o pcf5060x.o jbt6k74.o palm.o +VL_OBJS+= s3c24xx_udc.o neo1973.o pcf5060x.o jbt6k74.o VL_OBJS+= $(GSM_OBJS) modem.o CPPFLAGS+= -DHAS_AUDIO $(GSM_CPPFLAGS) endif Modified: qemu/trunk/hw/palm.c =================================================================== --- qemu/trunk/hw/palm.c 2007-06-24 04:43:53 UTC (rev 1060) +++ qemu/trunk/hw/palm.c 2007-06-24 05:00:46 UTC (rev 1061) @@ -1003,16 +1003,16 @@ ld_gpio_setup(cpu); // FIXME: write t650 gpio func /* Setup initial (reset) machine state */ - cpu->env->regs[15] = 0; - //cpu->env->regs[15] = PXA2XX_SDRAM_BASE; + //cpu->env->regs[15] = 0; + cpu->env->regs[15] = PXA2XX_SDRAM_BASE; //mdoc_init(); //memset(phys_ram_base + t650_ram, 0, t650_rom); //load_image("palmt650.rom", phys_ram_base + t650_ram); - //arm_load_kernel(cpu->env, t650_ram, kernel_filename, kernel_cmdline, - // initrd_filename, 909, PXA2XX_SDRAM_BASE); + arm_load_kernel(cpu->env, t650_ram, kernel_filename, kernel_cmdline, + initrd_filename, 909, PXA2XX_SDRAM_BASE); } @@ -1053,16 +1053,16 @@ t680_gpio_setup(cpu); /* Setup initial (reset) machine state */ - cpu->env->regs[15] = 0; - //cpu->env->regs[15] = PXA2XX_SDRAM_BASE; + //cpu->env->regs[15] = 0; + cpu->env->regs[15] = PXA2XX_SDRAM_BASE; //mdoc_init(); memset(phys_ram_base + t680_ram, 0, t680_rom); - load_image("../../BOOTROM/palmt680.rom", phys_ram_base + t680_ram); + //load_image("../../BOOTROM/palmt680.rom", phys_ram_base + t680_ram); - //arm_load_kernel(cpu->env, t680_ram, kernel_filename, kernel_cmdline, - // initrd_filename, 909, PXA2XX_SDRAM_BASE); + arm_load_kernel(cpu->env, t680_ram, kernel_filename, kernel_cmdline, + initrd_filename, 909, PXA2XX_SDRAM_BASE); } @@ -1102,14 +1102,14 @@ /* Setup initial (reset) machine state */ cpu->env->regs[15] = 0; -// cpu->env->regs[15] = PXA2XX_SDRAM_BASE; + cpu->env->regs[15] = PXA2XX_SDRAM_BASE; memset(phys_ram_base, 0, tc_ram); memset(phys_ram_base + tc_ram, 0, tc_rom); - load_image("../../BOOTROM/palmtc.rom", phys_ram_base + tc_ram); + //load_image("../../BOOTROM/palmtc.rom", phys_ram_base + tc_ram); -// arm_load_kernel(cpu->env, tc_ram, kernel_filename, kernel_cmdline, -// initrd_filename, 918 /* THIS IS ARM_ID!! */ //, PXA2XX_SDRAM_BASE); + arm_load_kernel(cpu->env, tc_ram, kernel_filename, kernel_cmdline, + initrd_filename, 918 /* THIS IS ARM_ID!! */ , PXA2XX_SDRAM_BASE); } @@ -1152,12 +1152,12 @@ z72_gpio_setup(cpu); /* Setup initial (reset) machine state */ - cpu->env->regs[15] = 0; -// cpu->env->regs[15] = PXA2XX_SDRAM_BASE; +// cpu->env->regs[15] = 0; + cpu->env->regs[15] = PXA2XX_SDRAM_BASE; memset(phys_ram_base, 0, z72_ram); memset(phys_ram_base + z72_ram, 0, z72_rom); - load_image("../../BOOTROM/palmz72.rom", phys_ram_base + z72_ram); +// load_image("../../BOOTROM/palmz72.rom", phys_ram_base + z72_ram); arm_load_kernel(cpu->env, z72_ram, kernel_filename, kernel_cmdline, initrd_filename, 904, PXA2XX_SDRAM_BASE); @@ -1203,13 +1203,13 @@ tx_gpio_setup(cpu); /* Setup initial (reset) machine state */ - cpu->env->regs[15] = 0; -// cpu->env->regs[15] = PXA2XX_SDRAM_BASE; +// cpu->env->regs[15] = 0; + cpu->env->regs[15] = PXA2XX_SDRAM_BASE; memset(phys_ram_base, 0, tx_ram); memset(phys_ram_base + tx_ram, 0, tx_rom); - load_image("../../BOOTROM/palmtx.rom", phys_ram_base + tx_ram); - +// load_image("../../BOOTROM/palmtx.rom", phys_ram_base + tx_ram); +// arm_load_kernel(cpu->env, tx_ram, kernel_filename, kernel_cmdline, initrd_filename, 885, PXA2XX_SDRAM_BASE); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bob...@us...> - 2007-06-24 03:56:00
|
Revision: 1058 http://svn.sourceforge.net/hackndev/?rev=1058&view=rev Author: bobofdoom Date: 2007-06-23 20:55:52 -0700 (Sat, 23 Jun 2007) Log Message: ----------- Created qemu directory. Added Paths: ----------- qemu/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2007-06-24 00:56:48
|
Revision: 1057 http://svn.sourceforge.net/hackndev/?rev=1057&view=rev Author: marex_z71 Date: 2007-06-23 17:56:47 -0700 (Sat, 23 Jun 2007) Log Message: ----------- PalmTC: USB gadget support, still a bit flaky though Modified Paths: -------------- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/palmtc.c Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/palmtc.c =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/palmtc.c 2007-06-24 00:48:26 UTC (rev 1056) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/palmtc.c 2007-06-24 00:56:47 UTC (rev 1057) @@ -19,12 +19,15 @@ #include <linux/platform_device.h> #include <linux/fb.h> #include <linux/irq.h> +#include <linux/delay.h> +#include <asm/arch/pxa2xx_udc_gpio.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 <asm/arch/udc.h> #include "../generic.h" @@ -105,6 +108,40 @@ }; +/* USB gadget */ +static int palmtc_udc_is_connected(void) +{ + int ret = GET_PALMTC_GPIO(USB_DETECT); + if (ret) + printk (KERN_INFO "palmtc_udc: device detected [USB_DETECT: %d]\n",ret); + else + printk (KERN_INFO "palmtc_udc: no device detected [USB_DETECT: %d]\n",ret); + + return ret; + +} + +static void palmtc_udc_command (int cmd) +{ + switch (cmd) { + case PXA2XX_UDC_CMD_DISCONNECT: + SET_PALMTC_GPIO(USB_POWER, 0); + printk(KERN_INFO "palmtc_udc: got command PXA2XX_UDC_CMD_DISCONNECT\n"); + break; + case PXA2XX_UDC_CMD_CONNECT: + SET_PALMTC_GPIO(USB_POWER, 1); + printk(KERN_INFO "palmtc_udc: got command PXA2XX_UDC_CMD_CONNECT\n"); + break; + default: + printk("palmtc_udc: unknown command '%d'\n", cmd); + } +} + +static struct pxa2xx_udc_mach_info palmtc_udc_mach_info __initdata = { + .udc_is_connected = palmtc_udc_is_connected, + .udc_command = palmtc_udc_command, +}; + /* Backlight ***/ static struct pxapwmbl_platform_data palmtc_backlight_data = { .pwm = 1, @@ -159,6 +196,7 @@ GCR &= ~GCR_PRIRDY_IEN; pxa_set_mci_info( &palmtc_mci_platform_data ); + pxa_set_udc_info( &palmtc_udc_mach_info ); platform_add_devices (devices, ARRAY_SIZE (devices)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2007-06-24 00:48:28
|
Revision: 1056 http://svn.sourceforge.net/hackndev/?rev=1056&view=rev Author: marex_z71 Date: 2007-06-23 17:48:26 -0700 (Sat, 23 Jun 2007) Log Message: ----------- PalmTC: driver for built-in flash, may be dangerous Modified Paths: -------------- linux4palm/linux/trunk/drivers/mtd/maps/Kconfig linux4palm/linux/trunk/drivers/mtd/maps/Makefile Added Paths: ----------- linux4palm/linux/trunk/drivers/mtd/maps/palmtc-flash.c Modified: linux4palm/linux/trunk/drivers/mtd/maps/Kconfig =================================================================== --- linux4palm/linux/trunk/drivers/mtd/maps/Kconfig 2007-06-24 00:46:55 UTC (rev 1055) +++ linux4palm/linux/trunk/drivers/mtd/maps/Kconfig 2007-06-24 00:48:26 UTC (rev 1056) @@ -504,6 +504,15 @@ help Very dangerous stuff ;) +config MTD_PALMTC + tristate "Palm Tungsten|C flash (DANGEROUS)" + depends on MTD_CFI && MACH_OMAP_PALMTC + help + This MTD map describes how flash memory on Palm Tungsten|C + is organized. With this driver you can read and probably also + write into device's FlashROM memory (DANGEROUS, use with + caution!). + config MTD_MPC1211 tristate "CFI Flash device mapped on Interface MPC-1211" depends on SH_MPC1211 && MTD_CFI Modified: linux4palm/linux/trunk/drivers/mtd/maps/Makefile =================================================================== --- linux4palm/linux/trunk/drivers/mtd/maps/Makefile 2007-06-24 00:46:55 UTC (rev 1055) +++ linux4palm/linux/trunk/drivers/mtd/maps/Makefile 2007-06-24 00:48:26 UTC (rev 1056) @@ -61,6 +61,7 @@ obj-$(CONFIG_MTD_WALNUT) += walnut.o obj-$(CONFIG_MTD_H720X) += h720x-flash.o obj-$(CONFIG_MTD_PALMT3) += palmt3-flash.o +obj-$(CONFIG_MTD_PALMTC) += palmtc-flash.o obj-$(CONFIG_MTD_SBC8240) += sbc8240.o obj-$(CONFIG_MTD_NOR_TOTO) += omap-toto-flash.o obj-$(CONFIG_MTD_MPC1211) += mpc1211.o Added: linux4palm/linux/trunk/drivers/mtd/maps/palmtc-flash.c =================================================================== --- linux4palm/linux/trunk/drivers/mtd/maps/palmtc-flash.c (rev 0) +++ linux4palm/linux/trunk/drivers/mtd/maps/palmtc-flash.c 2007-06-24 00:48:26 UTC (rev 1056) @@ -0,0 +1,148 @@ +/* + * Palm Tungsten|C MTD map + * + * Author: Marek Vasut <mar...@gm...> + * + * Based on Palm T|T3 flash support by + * Vladimir "Farcaller" Pouzanov <far...@gm...> + * Original code and (C) by + * Jungjun Kim <jun...@hy...> + * Thomas Gleixner <tg...@li...> + * + * + * 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 SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * 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., + * 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + +#include <linux/module.h> +#include <linux/types.h> +#include <linux/kernel.h> +#include <linux/init.h> +#include <linux/errno.h> +#include <linux/slab.h> + +#include <linux/mtd/mtd.h> +#include <linux/mtd/map.h> +#include <linux/mtd/partitions.h> +#include <asm/hardware.h> +#include <asm/io.h> + +static struct mtd_info *mymtd; + +static struct map_info palmtc_map = { + .name = "palmtc-flash", + .bankwidth = 2, + .size = 0x800000, /* 8MB */ + .phys = 0x0, /* starting at CS0 */ +}; + +static struct mtd_partition palmtc_partitions[] = { + { + .name = "SmallROM", + .size = 0x40000, /* 256kB */ + .offset = 0, + .mask_flags = MTD_WRITEABLE + },{ + .name = "BigROM", + .size = 0x7c0000, /* 8MB - 256kB (smallrom) */ + .offset = 0x40000, + .mask_flags = MTD_WRITEABLE, + } +}; + +#define NUM_PARTITIONS (sizeof(palmtc_partitions)/sizeof(palmtc_partitions[0])) + +static int nr_mtd_parts; +static struct mtd_partition *mtd_parts; +static const char *probes[] = { "cmdlinepart", NULL }; + +/* + * Initialize FLASH support + */ +int __init palmtc_mtd_init(void) +{ + + char *part_type = NULL; + + palmtc_map.virt = ioremap(0x0, 0x1000000); + + if (!palmtc_map.virt) { + printk(KERN_ERR "palmtc-flash: ioremap failed\n"); + return -EIO; + } + + simple_map_init(&palmtc_map); + + /* Probe for flash bankwidth 2 */ + printk(KERN_INFO "palmtc-flash: probing 16bit FLASH\n"); + mymtd = do_map_probe("cfi_probe", &palmtc_map); + + if (mymtd) { + mymtd->owner = THIS_MODULE; + +#ifdef CONFIG_MTD_PARTITIONS + nr_mtd_parts = parse_mtd_partitions(mymtd, probes, &mtd_parts, 0); + if (nr_mtd_parts > 0) + part_type = "command line"; +#endif + if (nr_mtd_parts <= 0) { + mtd_parts = palmtc_partitions; + nr_mtd_parts = NUM_PARTITIONS; + part_type = "builtin"; + } + + printk(KERN_INFO "Using %s partition table\n", part_type); + add_mtd_partitions(mymtd, mtd_parts, nr_mtd_parts); + return 0; + } + + iounmap((void *)palmtc_map.virt); + return -ENXIO; +} + +/* + * Cleanup + */ +static void __exit palmtc_mtd_cleanup(void) +{ + + if (mymtd) { + del_mtd_partitions(mymtd); + map_destroy(mymtd); + } + + /* Free partition info, if commandline partition was used */ + if (mtd_parts && (mtd_parts != palmtc_partitions)) + kfree (mtd_parts); + + if (palmtc_map.virt) { + iounmap((void *)palmtc_map.virt); + palmtc_map.virt = 0; + } +} + + +module_init(palmtc_mtd_init); +module_exit(palmtc_mtd_cleanup); + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Marek Vasut <mar...@gm...>"); +MODULE_DESCRIPTION("MTD map for Palm Tungsten|C"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2007-06-24 00:46:58
|
Revision: 1055 http://svn.sourceforge.net/hackndev/?rev=1055&view=rev Author: marex_z71 Date: 2007-06-23 17:46:55 -0700 (Sat, 23 Jun 2007) Log Message: ----------- HacknDev: fix g_zero header location Modified Paths: -------------- linux4palm/linux/trunk/drivers/usb/gadget/zero.c Modified: linux4palm/linux/trunk/drivers/usb/gadget/zero.c =================================================================== --- linux4palm/linux/trunk/drivers/usb/gadget/zero.c 2007-06-24 00:32:02 UTC (rev 1054) +++ linux4palm/linux/trunk/drivers/usb/gadget/zero.c 2007-06-24 00:46:55 UTC (rev 1055) @@ -84,7 +84,7 @@ #include <asm/system.h> #include <asm/unaligned.h> -#include <linux/usb_ch9.h> +#include <linux/usb/ch9.h> #include <linux/usb_gadget.h> #include "gadget_chips.h" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2007-06-24 00:32:07
|
Revision: 1054 http://svn.sourceforge.net/hackndev/?rev=1054&view=rev Author: marex_z71 Date: 2007-06-23 17:32:02 -0700 (Sat, 23 Jun 2007) Log Message: ----------- PalmTX: remove my non-working driver which got accidentally to previous commit Removed Paths: ------------- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmtx_pcmcia.c Deleted: linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmtx_pcmcia.c =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmtx_pcmcia.c 2007-06-24 00:30:26 UTC (rev 1053) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmtx_pcmcia.c 2007-06-24 00:32:02 UTC (rev 1054) @@ -1,130 +0,0 @@ -#include <linux/module.h> -#include <linux/kernel.h> -#include <linux/errno.h> -#include <linux/interrupt.h> -#include <linux/init.h> -#include <linux/device.h> -#include <linux/platform_device.h> -#include <linux/delay.h> -#include <linux/irq.h> - -#include <asm/mach-types.h> -#include <asm/hardware.h> -#include <../drivers/pcmcia/soc_common.h> -#include <asm/arch/pxa-regs.h> -#include <asm/arch/palmtx-gpio.h> -#include <asm/irq.h> - -/* This is ugly, move it to palmtx-gpio.h after debuging is done */ -#define PALMTX_PCMCIA_READY 116 -#define PALMTX_PCMCIA_POWER 94 -#define PALMTX_PCMCIA_RESET 108 - -static int palmtx_pcmcia_hw_init (struct soc_pcmcia_socket *skt) -{ - set_irq_type(PALMTX_PCMCIA_READY, IRQT_FALLING); - skt->irq = IRQ_GPIO(PALMTX_PCMCIA_READY); - - printk("pcmcia_hw_init %d\n", skt->nr); - return 0; -} - -static void palmtx_pcmcia_hw_shutdown (struct soc_pcmcia_socket *skt) -{ - -} - - -static void -palmtx_pcmcia_socket_state (struct soc_pcmcia_socket *skt, struct pcmcia_state *state) -{ - state->detect = 1; /* always inserted */ - state->ready = GET_GPIO(PALMTX_PCMCIA_READY) ? 1 : 0; - state->bvd1 = 1; - state->bvd2 = 1; - state->wrprot = 1; - state->vs_3v = 1; - state->vs_Xv = 0; -} - - - -static int -palmtx_pcmcia_configure_socket (struct soc_pcmcia_socket *skt, const socket_state_t *state) -{ - printk ("palmtx_pcmcia_config_skt: Reset:%d Vcc:%d\n", (state->flags & SS_RESET) ? 1 : 0, - state->Vcc); - - /* GPIO 94 is power according to GPIO map */ - SET_GPIO(PALMTX_PCMCIA_POWER, 1); - - /* GPIO 108 is reset according to GPIO map */ - SET_GPIO(PALMTX_PCMCIA_RESET, (state->flags & SS_RESET) ? 1 : 0); - - return 0; -} - -static void palmtx_pcmcia_socket_init(struct soc_pcmcia_socket *skt) -{ - printk("palmtx_pcmcia_socket_init\n"); - -} - - - -static void palmtx_pcmcia_socket_suspend (struct soc_pcmcia_socket *skt) -{ - printk("palmtx_pcmcia_socket_suspend\n"); -} - -static struct pcmcia_low_level palmtx_pcmcia_ops = { - .owner = THIS_MODULE, - - .first = 0, - .nr = 1, - - .hw_init = palmtx_pcmcia_hw_init, - .hw_shutdown = palmtx_pcmcia_hw_shutdown, - - .socket_state = palmtx_pcmcia_socket_state, - .configure_socket = palmtx_pcmcia_configure_socket, - - .socket_init = palmtx_pcmcia_socket_init, - .socket_suspend = palmtx_pcmcia_socket_suspend, -}; - - -static void palmtx_pcmcia_release (struct device * dev) -{ -} - - -static struct platform_device palmtx_pcmcia_device = { - .name = "pxa2xx-pcmcia", - .id = 0, - .dev = { - .platform_data = &palmtx_pcmcia_ops, - .release = palmtx_pcmcia_release - } -}; - -static int __init palmtx_pcmcia_init(void) -{ - printk ("pcmcia_init\n"); - - if(!machine_is_xscale_palmtx()) return -ENODEV; - - return platform_device_register (&palmtx_pcmcia_device); -} - -static void __exit palmtx_pcmcia_exit(void) -{ - platform_device_unregister (&palmtx_pcmcia_device); -} - -module_init(palmtx_pcmcia_init); -module_exit(palmtx_pcmcia_exit); - -MODULE_AUTHOR ("Marek Vasut <mar...@gm...>"); -MODULE_DESCRIPTION ("PCMCIA support 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: <bob...@us...> - 2007-06-23 14:24:39
|
Revision: 1052 http://svn.sourceforge.net/hackndev/?rev=1052&view=rev Author: bobofdoom Date: 2007-06-23 07:24:12 -0700 (Sat, 23 Jun 2007) Log Message: ----------- Reverted F8/F13 swap patch as it was refuted by Marex and s2b could not provide solid evidence for it being useful. 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-06-23 06:16:53 UTC (rev 1051) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld.c 2007-06-23 14:24:12 UTC (rev 1052) @@ -282,7 +282,7 @@ }, { /* row 3 */ - KEY_F8, /* Rotate display */ + KEY_F13, /* Rotate display */ KEY_ENTER, /* Nav centre */ KEY_LEFT, /* Nav left */ }, @@ -312,7 +312,7 @@ ********************************/ #ifdef CONFIG_KEYBOARD_GPIO static struct gpio_keys_button palmld_pxa_buttons[] = { - {KEY_F13, GPIO_NR_PALMLD_POWER_SWITCH, 0, "Power switch" }, + {KEY_F8, GPIO_NR_PALMLD_POWER_SWITCH, 0, "Power switch" }, }; static struct gpio_keys_platform_data palmld_pxa_keys_data = { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bob...@us...> - 2007-06-23 06:16:56
|
Revision: 1051 http://svn.sourceforge.net/hackndev/?rev=1051&view=rev Author: bobofdoom Date: 2007-06-22 23:16:53 -0700 (Fri, 22 Jun 2007) Log Message: ----------- l4p: Removed time hacks. Use RTC SA1100 time hacks instead. Patch thanks to step2back. Modified Paths: -------------- linux4palm/linux/trunk/arch/arm/mach-pxa/time.c Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/time.c =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/time.c 2007-06-23 06:13:38 UTC (rev 1050) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/time.c 2007-06-23 06:16:53 UTC (rev 1051) @@ -29,30 +29,15 @@ #include <asm/mach/time.h> #include <asm/arch/pxa-regs.h> -#ifdef CONFIG_RTC_EPOCH -#define PL_ODDS (1970-CONFIG_RTC_EPOCH) -#else -#define PL_ODDS 0 -#endif - -#define SECS_PER_DAY 24*60*60 -#define SECS_PER_LEAP (SECS_PER_DAY*366) -#define SECS_PER_OTHER (SECS_PER_DAY*365) -#define SECS_LY (((PL_ODDS-(PL_ODDS % 4))/4)*SECS_PER_LEAP) -#define SECS_OY ((PL_ODDS-((PL_ODDS-(PL_ODDS % 4))/4))*SECS_PER_OTHER) -#define SECS_ODDS_SUM (SECS_LY+SECS_OY) - static inline unsigned long pxa_get_rtc_time(void) { - return RCNR - SECS_ODDS_SUM; + return RCNR; } static int pxa_set_rtc(void) { unsigned long current_time = xtime.tv_sec; - current_time += SECS_ODDS_SUM; - if (RTSR & RTSR_ALE) { /* make sure not to forward the clock over an alarm */ unsigned long alarm = RTAR; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bob...@us...> - 2007-06-23 06:13:40
|
Revision: 1050 http://svn.sourceforge.net/hackndev/?rev=1050&view=rev Author: bobofdoom Date: 2007-06-22 23:13:38 -0700 (Fri, 22 Jun 2007) Log Message: ----------- palmld: Use F8 for rotate. Patch thanks to step2back. 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-06-23 06:07:45 UTC (rev 1049) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld.c 2007-06-23 06:13:38 UTC (rev 1050) @@ -282,7 +282,7 @@ }, { /* row 3 */ - KEY_F13, /* Rotate display */ + KEY_F8, /* Rotate display */ KEY_ENTER, /* Nav centre */ KEY_LEFT, /* Nav left */ }, @@ -312,7 +312,7 @@ ********************************/ #ifdef CONFIG_KEYBOARD_GPIO static struct gpio_keys_button palmld_pxa_buttons[] = { - {KEY_F8, GPIO_NR_PALMLD_POWER_SWITCH, 0, "Power switch" }, + {KEY_F13, GPIO_NR_PALMLD_POWER_SWITCH, 0, "Power switch" }, }; static struct gpio_keys_platform_data palmld_pxa_keys_data = { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bob...@us...> - 2007-06-23 06:07:46
|
Revision: 1049 http://svn.sourceforge.net/hackndev/?rev=1049&view=rev Author: bobofdoom Date: 2007-06-22 23:07:45 -0700 (Fri, 22 Jun 2007) Log Message: ----------- l4p: Removed references to disabled CONFIG_SA1100_RTC in defconfigs. Modified Paths: -------------- linux4palm/linux/trunk/arch/arm/configs/palmld_defconfig linux4palm/linux/trunk/arch/arm/configs/palmt3_defconfig linux4palm/linux/trunk/arch/arm/configs/palmt5_defconfig linux4palm/linux/trunk/arch/arm/configs/palmt650_defconfig linux4palm/linux/trunk/arch/arm/configs/palmtc_defconfig linux4palm/linux/trunk/arch/arm/configs/palmtx_defconfig linux4palm/linux/trunk/arch/arm/configs/palmz72_defconfig Modified: linux4palm/linux/trunk/arch/arm/configs/palmld_defconfig =================================================================== --- linux4palm/linux/trunk/arch/arm/configs/palmld_defconfig 2007-06-23 06:02:34 UTC (rev 1048) +++ linux4palm/linux/trunk/arch/arm/configs/palmld_defconfig 2007-06-23 06:07:45 UTC (rev 1049) @@ -837,7 +837,7 @@ # CONFIG_WATCHDOG is not set CONFIG_HW_RANDOM=m # CONFIG_NVRAM is not set -CONFIG_SA1100_RTC=y +# CONFIG_SA1100_RTC is not set # CONFIG_DTLK is not set # CONFIG_R3964 is not set # CONFIG_TIHTC is not set Modified: linux4palm/linux/trunk/arch/arm/configs/palmt3_defconfig =================================================================== --- linux4palm/linux/trunk/arch/arm/configs/palmt3_defconfig 2007-06-23 06:02:34 UTC (rev 1048) +++ linux4palm/linux/trunk/arch/arm/configs/palmt3_defconfig 2007-06-23 06:07:45 UTC (rev 1049) @@ -767,7 +767,7 @@ CONFIG_SA1100_WATCHDOG=m CONFIG_HW_RANDOM=m # CONFIG_NVRAM is not set -CONFIG_SA1100_RTC=y + # CONFIG_DTLK is not set # CONFIG_R3964 is not set # CONFIG_TIHTC is not set Modified: linux4palm/linux/trunk/arch/arm/configs/palmt5_defconfig =================================================================== --- linux4palm/linux/trunk/arch/arm/configs/palmt5_defconfig 2007-06-23 06:02:34 UTC (rev 1048) +++ linux4palm/linux/trunk/arch/arm/configs/palmt5_defconfig 2007-06-23 06:07:45 UTC (rev 1049) @@ -760,7 +760,7 @@ # CONFIG_WATCHDOG is not set CONFIG_HW_RANDOM=m # CONFIG_NVRAM is not set -CONFIG_SA1100_RTC=y + # CONFIG_DTLK is not set # CONFIG_R3964 is not set # CONFIG_TIHTC is not set Modified: linux4palm/linux/trunk/arch/arm/configs/palmt650_defconfig =================================================================== --- linux4palm/linux/trunk/arch/arm/configs/palmt650_defconfig 2007-06-23 06:02:34 UTC (rev 1048) +++ linux4palm/linux/trunk/arch/arm/configs/palmt650_defconfig 2007-06-23 06:07:45 UTC (rev 1049) @@ -671,7 +671,7 @@ # CONFIG_WATCHDOG is not set CONFIG_HW_RANDOM=m # CONFIG_NVRAM is not set -CONFIG_SA1100_RTC=m + # CONFIG_DTLK is not set # CONFIG_R3964 is not set # CONFIG_RAW_DRIVER is not set Modified: linux4palm/linux/trunk/arch/arm/configs/palmtc_defconfig =================================================================== --- linux4palm/linux/trunk/arch/arm/configs/palmtc_defconfig 2007-06-23 06:02:34 UTC (rev 1048) +++ linux4palm/linux/trunk/arch/arm/configs/palmtc_defconfig 2007-06-23 06:07:45 UTC (rev 1049) @@ -693,7 +693,7 @@ # CONFIG_WATCHDOG is not set CONFIG_HW_RANDOM=m # CONFIG_NVRAM is not set -CONFIG_SA1100_RTC=y + # CONFIG_DTLK is not set # CONFIG_R3964 is not set Modified: linux4palm/linux/trunk/arch/arm/configs/palmtx_defconfig =================================================================== --- linux4palm/linux/trunk/arch/arm/configs/palmtx_defconfig 2007-06-23 06:02:34 UTC (rev 1048) +++ linux4palm/linux/trunk/arch/arm/configs/palmtx_defconfig 2007-06-23 06:07:45 UTC (rev 1049) @@ -689,7 +689,7 @@ # CONFIG_WATCHDOG is not set CONFIG_HW_RANDOM=m # CONFIG_NVRAM is not set -CONFIG_SA1100_RTC=m + # CONFIG_DTLK is not set # CONFIG_R3964 is not set # CONFIG_TIHTC is not set Modified: linux4palm/linux/trunk/arch/arm/configs/palmz72_defconfig =================================================================== --- linux4palm/linux/trunk/arch/arm/configs/palmz72_defconfig 2007-06-23 06:02:34 UTC (rev 1048) +++ linux4palm/linux/trunk/arch/arm/configs/palmz72_defconfig 2007-06-23 06:07:45 UTC (rev 1049) @@ -688,7 +688,7 @@ # CONFIG_WATCHDOG is not set CONFIG_HW_RANDOM=m # CONFIG_NVRAM is not set -CONFIG_SA1100_RTC=m + # CONFIG_DTLK is not set # CONFIG_R3964 is not set # CONFIG_TIHTC is not set This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bob...@us...> - 2007-06-23 06:02:41
|
Revision: 1048 http://svn.sourceforge.net/hackndev/?rev=1048&view=rev Author: bobofdoom Date: 2007-06-22 23:02:34 -0700 (Fri, 22 Jun 2007) Log Message: ----------- l4p: Disabled duplicate SA1100 RTC driver, use the one in drivers/rtc instead please. Modified Paths: -------------- linux4palm/linux/trunk/drivers/char/Kconfig linux4palm/linux/trunk/drivers/char/sa1100-rtc.c Modified: linux4palm/linux/trunk/drivers/char/Kconfig =================================================================== --- linux4palm/linux/trunk/drivers/char/Kconfig 2007-06-23 02:10:11 UTC (rev 1047) +++ linux4palm/linux/trunk/drivers/char/Kconfig 2007-06-23 06:02:34 UTC (rev 1048) @@ -810,19 +810,23 @@ via the file /proc/rtc and its behaviour is set by various ioctls on /dev/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. +# +# 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. - 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/trunk/drivers/char/sa1100-rtc.c =================================================================== --- linux4palm/linux/trunk/drivers/char/sa1100-rtc.c 2007-06-23 02:10:11 UTC (rev 1047) +++ linux4palm/linux/trunk/drivers/char/sa1100-rtc.c 2007-06-23 06:02:34 UTC (rev 1048) @@ -1,4 +1,16 @@ /* + * + * 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 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2007-06-23 02:10:13
|
Revision: 1047 http://svn.sourceforge.net/hackndev/?rev=1047&view=rev Author: marex_z71 Date: 2007-06-22 19:10:11 -0700 (Fri, 22 Jun 2007) Log Message: ----------- PalmTC: Divide pixclock divider by two, no more horrible whining Modified Paths: -------------- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/palmtc.c Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/palmtc.c =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/palmtc.c 2007-06-22 21:00:23 UTC (rev 1046) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/palmtc.c 2007-06-23 02:10:11 UTC (rev 1047) @@ -65,7 +65,7 @@ .modes = palmtc_lcd_modes, .num_modes = ARRAY_SIZE(palmtc_lcd_modes), .lccr0 = 0x07B008F9, - .lccr3 = 0x04700004, + .lccr3 = 0x04700002, .pxafb_backlight_power = palmtc_backlight_power, }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hap...@us...> - 2007-06-22 21:00:28
|
Revision: 1046 http://svn.sourceforge.net/hackndev/?rev=1046&view=rev Author: happy-slapin Date: 2007-06-22 14:00:23 -0700 (Fri, 22 Jun 2007) Log Message: ----------- OV9640: Fixed i2c driver Modified Paths: -------------- linux4palm/linux/trunk/drivers/i2c/chips/Kconfig linux4palm/linux/trunk/drivers/i2c/chips/Makefile linux4palm/linux/trunk/drivers/i2c/chips/i2c-ov9640.c linux4palm/linux/trunk/drivers/i2c/chips/i2c-ov9640.h Modified: linux4palm/linux/trunk/drivers/i2c/chips/Kconfig =================================================================== --- linux4palm/linux/trunk/drivers/i2c/chips/Kconfig 2007-06-22 20:03:14 UTC (rev 1045) +++ linux4palm/linux/trunk/drivers/i2c/chips/Kconfig 2007-06-22 21:00:23 UTC (rev 1046) @@ -150,4 +150,10 @@ This driver can also be built as a module. If so, the module will be called max6875. +config I2C_OV9640 + tristate "Support for OmniVision 9640 camera sensor" + depends on I2C + help + Say yes here to enable OV9640 sensor which is found in some + handhelds and phones endmenu Modified: linux4palm/linux/trunk/drivers/i2c/chips/Makefile =================================================================== --- linux4palm/linux/trunk/drivers/i2c/chips/Makefile 2007-06-22 20:03:14 UTC (rev 1045) +++ linux4palm/linux/trunk/drivers/i2c/chips/Makefile 2007-06-22 21:00:23 UTC (rev 1046) @@ -15,8 +15,10 @@ obj-$(CONFIG_ISP1301_OMAP) += isp1301_omap.o obj-$(CONFIG_TPS65010) += tps65010.o -obj-$(CONFIG_I2C_ADCM2650) +=adcm2650-i2c.o +obj-$(CONFIG_I2C_ADCM2650) += adcm2650-i2c.o +obj-$(CONFIG_I2C_OV9640) += i2c-ov9640.o + ifeq ($(CONFIG_I2C_DEBUG_CHIP),y) EXTRA_CFLAGS += -DDEBUG endif Modified: linux4palm/linux/trunk/drivers/i2c/chips/i2c-ov9640.c =================================================================== --- linux4palm/linux/trunk/drivers/i2c/chips/i2c-ov9640.c 2007-06-22 20:03:14 UTC (rev 1045) +++ linux4palm/linux/trunk/drivers/i2c/chips/i2c-ov9640.c 2007-06-22 21:00:23 UTC (rev 1046) @@ -13,63 +13,48 @@ #define DPRINTK(fmt,args...) do { if (DEBUG) printk("in function %s "fmt,__FUNCTION__,##args);} while(0) extern int i2c_adapter_id(struct i2c_adapter *adap); -int i2c_ov9640_cleanup(void); -void i2c_ov9640_inc_use (struct i2c_client *client); -void i2c_ov9640_dec_use (struct i2c_client *client); -int i2c_ov9640_attach_adapter(struct i2c_adapter *adapter); -int i2c_ov9640_detect_client(struct i2c_adapter *, int, unsigned short, int); -int i2c_ov9640_detach_client(struct i2c_client *client); +void i2c_ov9640_cleanup(void); +static int i2c_ov9640_attach_adapter(struct i2c_adapter *adapter); +static int i2c_ov9640_detect_client(struct i2c_adapter *, int, int); +static int i2c_ov9640_detach_client(struct i2c_client *client); struct i2c_driver ov9640_driver = { - name: "ov9640 driver", /* name */ - id: I2C_DRIVERID_OV9640, /* id */ - flags: I2C_DF_NOTIFY, /* flags */ - attach_adapter: &i2c_ov9640_attach_adapter, /* attach_adapter */ - detach_client: &i2c_ov9640_detach_client, /* detach_client */ - command: NULL, - inc_use: &i2c_ov9640_inc_use, - dec_use: &i2c_ov9640_dec_use + .driver = { + .name = "i2c-ov9640", /* name */ + }, + .attach_adapter = &i2c_ov9640_attach_adapter, /* attach_adapter */ + .detach_client = &i2c_ov9640_detach_client, /* detach_client */ }; extern struct i2c_adapter *i2cdev_adaps[]; -/* Unique ID allocation */ -static int ov9640_id = 0; struct i2c_client *g_client = NULL; static unsigned short normal_i2c[] = {OV9640_SLAVE_ADDR ,I2C_CLIENT_END }; -static unsigned short normal_i2c_range[] = { I2C_CLIENT_END }; +/* static unsigned short normal_i2c_range[] = { I2C_CLIENT_END }; */ I2C_CLIENT_INSMOD; -/* - * This call returns a unique low identifier for each registered adapter, - * or -1 if the adapter was not registered. - */ -void i2c_ov9640_inc_use (struct i2c_client *client) -{ - MOD_INC_USE_COUNT; -#ifdef MODULE -#endif -} - -void i2c_ov9640_dec_use (struct i2c_client *client) -{ - MOD_DEC_USE_COUNT; -#ifdef MODULE -#endif -} - char ov9640_read(u8 addr, u8 *pvalue) { - int res=0; - char buf=0; - struct i2c_msg msgs[2] = { - { 0, I2C_M_WR, 1, &addr }, - { 0, I2C_M_RD, 1, &buf }}; + int res = 0; + char buf = 0; + struct i2c_msg msgs[2]; + struct ov9640_data * p; if( g_client == NULL ) return -1; - i2c_ov9640_inc_use(g_client); - msgs[0].addr=msgs[1].addr=g_client->addr; + p = i2c_get_clientdata(g_client); + + msgs[0].addr = g_client->addr; + msgs[0].flags = 0; + msgs[0].len = 1; + msgs[0].buf = &addr; + + msgs[1].addr = g_client->addr; + msgs[1].flags = I2C_M_RD; + msgs[1].len = 1; + msgs[1].buf = &buf; + + down(&p->update_lock); res=i2c_transfer(g_client->adapter,&msgs[0],1); if (res<=0) goto out; @@ -77,7 +62,7 @@ if (res<=0) goto out; *pvalue = buf; - i2c_ov9640_dec_use(g_client); + up(&p->update_lock); out: DPRINTK(KERN_INFO "In funtion %s addr:%x,value=%x\n", __FUNCTION__, addr,*pvalue); if (res<=0) DPRINTK("res = %d \n",res); @@ -86,27 +71,16 @@ int ov9640_write(u8 addr, u8 value) { - int res=0; + int res = 0; + char buf[2] = {addr, value}; + + struct ov9640_data * p; if( g_client == NULL ) return -1; - /* - char buf=0; - struct i2c_msg msgs[2] = { - { 0, I2C_M_WR, 1, &addr }, - { 0, I2C_M_WR, 1, &value }}; - msgs[0].addr=msgs[1].addr=g_client->addr; - res=i2c_transfer(g_client->adapter,&msgs[0],1); - if (res<=0) return res; - res=i2c_transfer(g_client->adapter,&msgs[1],1); - if (res<=0) return res; - - - res=i2c_smbus_write_byte_data(g_client, addr, value ); - */ - char buf[2]={addr,value}; - i2c_ov9640_inc_use(g_client); + p = i2c_get_clientdata(g_client); + down(&p->update_lock); res = i2c_master_send(g_client, buf, 2); - i2c_ov9640_dec_use(g_client); + up(&p->update_lock); if (res >0) res =0; else res =-1; DPRINTK(KERN_INFO "In funtion %s addr:%x value:%xreturn %d \n", __FUNCTION__, addr,value,res); @@ -120,10 +94,6 @@ DPRINTK("in function %s\n",__FUNCTION__); i2c_master_recv(client,&msgbuf,1); return msgbuf; - /* - */ -// return i2c_smbus_read_word_data(client,reg); -// return i2c_smbus_read_byte_data(client,reg); } int i2c_ov9640_write(struct i2c_client *client, u8 reg, u16 value) @@ -139,7 +109,7 @@ } -int i2c_ov9640_detect_client(struct i2c_adapter *adapter, int address, unsigned short flags, int kind) +static int i2c_ov9640_detect_client(struct i2c_adapter *adapter, int address, int kind) { struct i2c_client *new_client; int err = 0; @@ -168,7 +138,7 @@ need it, remove it. We do it here to help to lessen memory fragmentation. */ - new_client=kmalloc(sizeof(struct i2c_client)+sizeof(struct ov9640_data), + new_client=kzalloc(sizeof(struct i2c_client)+sizeof(struct ov9640_data), GFP_KERNEL ); if ( !new_client ) { @@ -177,9 +147,8 @@ } data = (struct ov9640_data *) (new_client + 1); - new_client->addr = address; - new_client->data = data; + i2c_set_clientdata(new_client, data); new_client->adapter = adapter; new_client->driver = &ov9640_driver; new_client->flags = 0; @@ -210,8 +179,6 @@ } strcpy(new_client->name, "ov9640"); - /* Automatically unique */ - new_client->id = ov9640_id++; /* Only if you use this field */ data->valid = 0; @@ -232,7 +199,6 @@ very code-efficient in this case. */ ERROR3: -ERROR1: kfree(new_client); g_client = NULL; ERROR0: @@ -279,25 +245,22 @@ return 0; } -int i2c_ov9640_cleanup(void) +void i2c_ov9640_cleanup(void) { - int res; - if (ov9640_initialized == 1) { - if ((res = i2c_del_driver(&ov9640_driver))) { + if (i2c_del_driver(&ov9640_driver)) { DPRINTK("ov9640: Driver registration failed, module not removed.\n"); - return res; + return; } ov9640_initialized --; } - return 0; } -EXPORT_SYMBOL(i2c_ov9640_init); +//EXPORT_SYMBOL(i2c_ov9640_init); EXPORT_SYMBOL(ov9640_write); EXPORT_SYMBOL(ov9640_read); -EXPORT_SYMBOL(i2c_ov9640_cleanup); -//module_init(i2c_ov9640_init); -//module_exit(i2c_ov9640_cleanup); +//EXPORT_SYMBOL(i2c_ov9640_cleanup); +module_init(i2c_ov9640_init); +module_exit(i2c_ov9640_cleanup); MODULE_LICENSE("GPL"); Modified: linux4palm/linux/trunk/drivers/i2c/chips/i2c-ov9640.h =================================================================== --- linux4palm/linux/trunk/drivers/i2c/chips/i2c-ov9640.h 2007-06-22 20:03:14 UTC (rev 1045) +++ linux4palm/linux/trunk/drivers/i2c/chips/i2c-ov9640.h 2007-06-22 21:00:23 UTC (rev 1046) @@ -1,7 +1,9 @@ #ifndef __I2C_OV9640_H__ #define __I2C_OV9640_H__ +#ifndef DEBUG #define DEBUG +#endif /* Calculating the Module Block Number */ #define BLOCK(a) (u8)((a) >> 7) /* register's module block address. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sle...@us...> - 2007-06-22 20:03:26
|
Revision: 1045 http://svn.sourceforge.net/hackndev/?rev=1045&view=rev Author: sleep_walker Date: 2007-06-22 13:03:14 -0700 (Fri, 22 Jun 2007) Log Message: ----------- l4p: 'platform_device'ed tsc2101, SUSPEND/RESUME works on T|T3! Modified Paths: -------------- linux4palm/linux/trunk/drivers/input/touchscreen/tsc2101_ts.c linux4palm/linux/trunk/drivers/mfd/tsc2101.c Modified: linux4palm/linux/trunk/drivers/input/touchscreen/tsc2101_ts.c =================================================================== --- linux4palm/linux/trunk/drivers/input/touchscreen/tsc2101_ts.c 2007-06-22 19:19:08 UTC (rev 1044) +++ linux4palm/linux/trunk/drivers/input/touchscreen/tsc2101_ts.c 2007-06-22 20:03:14 UTC (rev 1045) @@ -17,6 +17,7 @@ #include <linux/input.h> #include <linux/module.h> #include <linux/soc/tsc2101.h> +#include <linux/platform_device.h> #ifdef CONFIG_TOUCHSCREEN_TSC2101 #define X_AXIS_MAX 3800 @@ -45,9 +46,9 @@ return; } -void tsc2101_ts_setup(struct device *dev) +void tsc2101_ts_setup(struct platform_device *dev) { - struct tsc2101_data *tsc2101_ts = dev_get_drvdata(dev); + struct tsc2101_data *tsc2101_ts = platform_get_drvdata(dev); struct input_dev *input_dev; //init_input_dev(&(tsc2101_ts->inputdevice)); Modified: linux4palm/linux/trunk/drivers/mfd/tsc2101.c =================================================================== --- linux4palm/linux/trunk/drivers/mfd/tsc2101.c 2007-06-22 19:19:08 UTC (rev 1044) +++ linux4palm/linux/trunk/drivers/mfd/tsc2101.c 2007-06-22 20:03:14 UTC (rev 1045) @@ -23,7 +23,7 @@ #include <linux/platform_device.h> #include "tsc2101.h" -extern void tsc2101_ts_setup(struct device *dev); +extern void tsc2101_ts_setup(struct platform_device *dev); extern void tsc2101_ts_report(struct tsc2101_data *devdata, int x, int y, int p, int pendown); static int tsc2101_regread(struct tsc2101_data *devdata, int regnum) @@ -227,9 +227,9 @@ mod_timer(&(devdata->misc_timer), jiffies + HZ); } -void tsc2101_print_miscdata(struct device *dev) +void tsc2101_print_miscdata(struct platform_device *dev) { - struct tsc2101_data *devdata = dev_get_drvdata(dev); + struct tsc2101_data *devdata = platform_get_drvdata(dev); printk(KERN_ERR "TSC2101 Bat: %04x\n",devdata->miscdata.bat); printk(KERN_ERR "TSC2101 Aux1: %04x\n",devdata->miscdata.aux1); @@ -238,9 +238,9 @@ printk(KERN_ERR "TSC2101 Temp2: %04x\n",devdata->miscdata.temp2); } -static int tsc2101_suspend(struct device *dev, pm_message_t state) +static int tsc2101_suspend(struct platform_device *dev, pm_message_t state) { - struct tsc2101_data *devdata = dev_get_drvdata(dev); + struct tsc2101_data *devdata = platform_get_drvdata(dev); /* comment this out like in old driver, it's sick though */ /* if (level == SUSPEND_POWER_DOWN) { */ @@ -251,9 +251,9 @@ return 0; } -static int tsc2101_resume(struct device *dev) +static int tsc2101_resume(struct platform_device *dev) { - struct tsc2101_data *devdata = dev_get_drvdata(dev); + struct tsc2101_data *devdata = platform_get_drvdata(dev); /* comment this out like in old driver, it's sick though */ /* if (level == RESUME_POWER_ON) { */ @@ -265,7 +265,7 @@ } -static int __init tsc2101_probe(struct device *dev) +static int tsc2101_probe(struct platform_device *dev) { struct tsc2101_data *devdata; struct tsc2101_ts_event ts_data; @@ -273,9 +273,9 @@ if (!(devdata = kcalloc(1, sizeof(struct tsc2101_data), GFP_KERNEL))) return -ENOMEM; - dev_set_drvdata(dev,devdata); + platform_set_drvdata(dev,devdata); spin_lock_init(&devdata->lock); - devdata->platform = dev->platform_data; + devdata->platform = dev->dev.platform_data; init_timer(&devdata->ts_timer); devdata->ts_timer.data = (unsigned long) devdata; @@ -305,9 +305,9 @@ } -static int __exit tsc2101_remove(struct device *dev) +static int tsc2101_remove(struct platform_device *dev) { - struct tsc2101_data *devdata = dev_get_drvdata(dev); + struct tsc2101_data *devdata = platform_get_drvdata(dev); free_irq(devdata->platform->irq, devdata); del_timer_sync(&devdata->ts_timer); @@ -318,23 +318,26 @@ return 0; } -static struct device_driver tsc2101_driver = { +static struct platform_driver tsc2101_driver = { + .driver = { .name = "tsc2101", - .bus = &platform_bus_type, + .owner = THIS_MODULE, + }, +/* .bus = &platform_bus_type, */ .probe = tsc2101_probe, - .remove = __exit_p(tsc2101_remove), + .remove = tsc2101_remove, .suspend = tsc2101_suspend, .resume = tsc2101_resume, }; static int __init tsc2101_init(void) { - return driver_register(&tsc2101_driver); + return platform_driver_register(&tsc2101_driver); } static void __exit tsc2101_exit(void) { - driver_unregister(&tsc2101_driver); + platform_driver_unregister(&tsc2101_driver); } module_init(tsc2101_init); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hap...@us...> - 2007-06-22 19:19:11
|
Revision: 1044 http://svn.sourceforge.net/hackndev/?rev=1044&view=rev Author: happy-slapin Date: 2007-06-22 12:19:08 -0700 (Fri, 22 Jun 2007) Log Message: ----------- OV9640: Added i2c module code Added Paths: ----------- linux4palm/linux/trunk/drivers/i2c/chips/i2c-ov9640.c linux4palm/linux/trunk/drivers/i2c/chips/i2c-ov9640.h Added: linux4palm/linux/trunk/drivers/i2c/chips/i2c-ov9640.c =================================================================== --- linux4palm/linux/trunk/drivers/i2c/chips/i2c-ov9640.c (rev 0) +++ linux4palm/linux/trunk/drivers/i2c/chips/i2c-ov9640.c 2007-06-22 19:19:08 UTC (rev 1044) @@ -0,0 +1,303 @@ +#include <linux/kernel.h> +#include <linux/module.h> +#include <linux/slab.h> +#include <linux/init.h> +#include <linux/i2c.h> +#include <asm/hardware.h> +#include <asm/types.h> +#include <linux/delay.h> + +#include "i2c-ov9640.h" + +#define DEBUG 1 +#define DPRINTK(fmt,args...) do { if (DEBUG) printk("in function %s "fmt,__FUNCTION__,##args);} while(0) +extern int i2c_adapter_id(struct i2c_adapter *adap); + +int i2c_ov9640_cleanup(void); +void i2c_ov9640_inc_use (struct i2c_client *client); +void i2c_ov9640_dec_use (struct i2c_client *client); +int i2c_ov9640_attach_adapter(struct i2c_adapter *adapter); +int i2c_ov9640_detect_client(struct i2c_adapter *, int, unsigned short, int); +int i2c_ov9640_detach_client(struct i2c_client *client); + +struct i2c_driver ov9640_driver = +{ + name: "ov9640 driver", /* name */ + id: I2C_DRIVERID_OV9640, /* id */ + flags: I2C_DF_NOTIFY, /* flags */ + attach_adapter: &i2c_ov9640_attach_adapter, /* attach_adapter */ + detach_client: &i2c_ov9640_detach_client, /* detach_client */ + command: NULL, + inc_use: &i2c_ov9640_inc_use, + dec_use: &i2c_ov9640_dec_use +}; + +extern struct i2c_adapter *i2cdev_adaps[]; +/* Unique ID allocation */ +static int ov9640_id = 0; +struct i2c_client *g_client = NULL; +static unsigned short normal_i2c[] = {OV9640_SLAVE_ADDR ,I2C_CLIENT_END }; +static unsigned short normal_i2c_range[] = { I2C_CLIENT_END }; +I2C_CLIENT_INSMOD; + +/* + * This call returns a unique low identifier for each registered adapter, + * or -1 if the adapter was not registered. + */ +void i2c_ov9640_inc_use (struct i2c_client *client) +{ + MOD_INC_USE_COUNT; +#ifdef MODULE +#endif +} + +void i2c_ov9640_dec_use (struct i2c_client *client) +{ + MOD_DEC_USE_COUNT; +#ifdef MODULE +#endif +} + +char ov9640_read(u8 addr, u8 *pvalue) +{ + int res=0; + char buf=0; + struct i2c_msg msgs[2] = { + { 0, I2C_M_WR, 1, &addr }, + { 0, I2C_M_RD, 1, &buf }}; + + if( g_client == NULL ) + return -1; + i2c_ov9640_inc_use(g_client); + msgs[0].addr=msgs[1].addr=g_client->addr; + res=i2c_transfer(g_client->adapter,&msgs[0],1); + if (res<=0) + goto out; + res=i2c_transfer(g_client->adapter,&msgs[1],1); + if (res<=0) + goto out; + *pvalue = buf; + i2c_ov9640_dec_use(g_client); +out: + DPRINTK(KERN_INFO "In funtion %s addr:%x,value=%x\n", __FUNCTION__, addr,*pvalue); + if (res<=0) DPRINTK("res = %d \n",res); + return res; +} + +int ov9640_write(u8 addr, u8 value) +{ + int res=0; + if( g_client == NULL ) + return -1; + /* + char buf=0; + struct i2c_msg msgs[2] = { + { 0, I2C_M_WR, 1, &addr }, + { 0, I2C_M_WR, 1, &value }}; + msgs[0].addr=msgs[1].addr=g_client->addr; + res=i2c_transfer(g_client->adapter,&msgs[0],1); + if (res<=0) return res; + res=i2c_transfer(g_client->adapter,&msgs[1],1); + if (res<=0) return res; + + + res=i2c_smbus_write_byte_data(g_client, addr, value ); + */ + char buf[2]={addr,value}; + i2c_ov9640_inc_use(g_client); + res = i2c_master_send(g_client, buf, 2); + i2c_ov9640_dec_use(g_client); + if (res >0) res =0; + else res =-1; + DPRINTK(KERN_INFO "In funtion %s addr:%x value:%xreturn %d \n", __FUNCTION__, addr,value,res); + return res; +} + + +int i2c_ov9640_read(struct i2c_client *client, u8 reg) +{ + unsigned char msgbuf=0; + DPRINTK("in function %s\n",__FUNCTION__); + i2c_master_recv(client,&msgbuf,1); + return msgbuf; + /* + */ +// return i2c_smbus_read_word_data(client,reg); +// return i2c_smbus_read_byte_data(client,reg); +} + +int i2c_ov9640_write(struct i2c_client *client, u8 reg, u16 value) +{ + return i2c_smbus_write_word_data(client,reg,value); +} + + +int i2c_ov9640_attach_adapter(struct i2c_adapter *adap) +{ + DPRINTK("In function %s.\n", __FUNCTION__); + return i2c_probe(adap,&addr_data,i2c_ov9640_detect_client); +} + + +int i2c_ov9640_detect_client(struct i2c_adapter *adapter, int address, unsigned short flags, int kind) +{ + struct i2c_client *new_client; + int err = 0; + struct ov9640_data *data; + + /*check if */ + if(g_client != NULL) { + err = -ENXIO; + goto ERROR0; + } + + + DPRINTK(KERN_INFO "In funtion %s. address=0X%X\n", __FUNCTION__, address); + /* Let's see whether this adapter can support what we need. + Please substitute the things you need here! */ + if ( !i2c_check_functionality(adapter,I2C_FUNC_SMBUS_WORD_DATA) ) { + DPRINTK(KERN_INFO "Word op is not permited.\n"); + goto ERROR0; + } + + /* OK. For now, we presume we have a valid client. We now create the + client structure, even though we cannot fill it completely yet. + But it allows us to access several i2c functions safely */ + + /* Note that we reserve some space for ov9640_data too. If you don't + need it, remove it. We do it here to help to lessen memory + fragmentation. */ + + new_client=kmalloc(sizeof(struct i2c_client)+sizeof(struct ov9640_data), + GFP_KERNEL ); + + if ( !new_client ) { + err = -ENOMEM; + goto ERROR0; + } + + data = (struct ov9640_data *) (new_client + 1); + + new_client->addr = address; + new_client->data = data; + new_client->adapter = adapter; + new_client->driver = &ov9640_driver; + new_client->flags = 0; + + g_client = new_client; + + /* Now, we do the remaining detection. If no `force' parameter is used. */ + + /* First, the generic detection (if any), that is skipped if any force + parameter was used. */ + + if (kind <= 0) { + char res = -1; + mdelay(2000); + ov9640_read(REV,&res); + /* The below is of course bogus */ + DPRINTK("I2C: Probe ov9640 chip..addr=0x%x, REV=%d, res=0x%x\n", address, REV, res); + /*ov9640 chip id is 0x9648 + if(res != OV9640_CHIP_ID) { + DPRINTK(KERN_WARNING "Failed.product id =%d \n",res); + goto ERROR1; + } + else { + DPRINTK("OV9640 chip id is 0X%04X\n", OV9640_CHIP_ID); + if ( ov9640_id == 0 ) + DPRINTK(" detected.\n"); + }*/ + } + + strcpy(new_client->name, "ov9640"); + /* Automatically unique */ + new_client->id = ov9640_id++; + + /* Only if you use this field */ + data->valid = 0; + + /* Only if you use this field */ + init_MUTEX(&data->update_lock); + + /* Tell the i2c layer a new client has arrived */ + if ((err = i2c_attach_client(new_client))) + goto ERROR3; + + /* This function can write default values to the client registers, if + needed. */ + /* ov9640_init_client(new_client); */ + return 0; + + /* OK, this is not exactly good programming practice, usually. But it is + very code-efficient in this case. */ + +ERROR3: +ERROR1: + kfree(new_client); + g_client = NULL; +ERROR0: + return err; +} + +int i2c_ov9640_detach_client(struct i2c_client *client) +{ + int err; + + /* Try to detach the client from i2c space */ + if ((err = i2c_detach_client(client))) { + DPRINTK("ov9640.o: Client deregistration failed, client not detached.\n"); + return err; + } + + kfree(client); /* Frees client data too, if allocated at the same time */ + g_client = NULL; + return 0; +} + +/* Keep track of how far we got in the initialization process. If several + things have to initialized, and we fail halfway, only those things + have to be cleaned up! */ +static int ov9640_initialized = 0; + +int i2c_ov9640_init(void) +{ + int res; + + if (ov9640_initialized) + return 0; + DPRINTK("I2C: driver for device ov9640.\n"); + if ( (res = i2c_add_driver(&ov9640_driver)) ) { + DPRINTK("ov9640: Driver registration failed, module not inserted.\n"); + i2c_ov9640_cleanup(); + return res; + } + ov9640_initialized ++; + if(g_client != NULL) + DPRINTK("I2C: driver for device %s registed!.\n", g_client->name); + else + DPRINTK("I2C: driver for device unregisted!.\n"); + return 0; +} + +int i2c_ov9640_cleanup(void) +{ + int res; + + if (ov9640_initialized == 1) { + if ((res = i2c_del_driver(&ov9640_driver))) { + DPRINTK("ov9640: Driver registration failed, module not removed.\n"); + return res; + } + ov9640_initialized --; + } + return 0; +} + +EXPORT_SYMBOL(i2c_ov9640_init); +EXPORT_SYMBOL(ov9640_write); +EXPORT_SYMBOL(ov9640_read); +EXPORT_SYMBOL(i2c_ov9640_cleanup); +//module_init(i2c_ov9640_init); +//module_exit(i2c_ov9640_cleanup); +MODULE_LICENSE("GPL"); + Added: linux4palm/linux/trunk/drivers/i2c/chips/i2c-ov9640.h =================================================================== --- linux4palm/linux/trunk/drivers/i2c/chips/i2c-ov9640.h (rev 0) +++ linux4palm/linux/trunk/drivers/i2c/chips/i2c-ov9640.h 2007-06-22 19:19:08 UTC (rev 1044) @@ -0,0 +1,42 @@ +#ifndef __I2C_OV9640_H__ +#define __I2C_OV9640_H__ + +#define DEBUG + +/* Calculating the Module Block Number */ +#define BLOCK(a) (u8)((a) >> 7) /* register's module block address. */ +#define OFFSET(a) (u8)((a) & 0x7F ) /* register's offset to this block. */ + +/* Update the block address.*/ +#define BLOCK_SWITCH_CMD 0xFE + +#define OV9640_SLAVE_ADDR (0x60>>1) /* 60 for write , 61 for read */ +// #define SENSOR_SLAVE_ADDR 0x0055 /* tbd: */ + + +#define I2C_DRIVERID_OV9640 I2C_DRIVERID_EXP2 + +/*ov9640 chip id*/ +#define OV9640_CHIP_ID 0x9648 + +/* Register definitions in OV9640's chip. */ +#define PID 0xA +#define REV 0xA + +struct ov9640_data { + /* + * Because the i2c bus is slow, it is often useful to cache the read + * information of a chip for some time (for example, 1 or 2 seconds). + * It depends of course on the device whether this is really worthwhile + * or even sensible. + */ + struct semaphore update_lock; /* When we are reading lots of information, + another process should not update the + below information */ + + char valid; /* != 0 if the following fields are valid. */ + int blockaddr; /* current using block address. */ + unsigned long last_updated; /* In jiffies */ +}; +#endif + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sle...@us...> - 2007-06-22 01:43:24
|
Revision: 1043 http://svn.sourceforge.net/hackndev/?rev=1043&view=rev Author: sleep_walker Date: 2007-06-21 18:43:20 -0700 (Thu, 21 Jun 2007) Log Message: ----------- l4p: tsc2101 cleaning Modified Paths: -------------- linux4palm/linux/trunk/drivers/mfd/tsc2101.c Modified: linux4palm/linux/trunk/drivers/mfd/tsc2101.c =================================================================== --- linux4palm/linux/trunk/drivers/mfd/tsc2101.c 2007-06-22 01:34:51 UTC (rev 1042) +++ linux4palm/linux/trunk/drivers/mfd/tsc2101.c 2007-06-22 01:43:20 UTC (rev 1043) @@ -142,7 +142,7 @@ tsc2101_regwrite(devdata, TSC2101_REG_ADC, 0x4000); } -static void ts_interrupt_main(struct tsc2101_data *devdata, int isTimer, struct pt_regs *regs) +static void ts_interrupt_main(struct tsc2101_data *devdata, int isTimer) { unsigned long flags; struct tsc2101_ts_event ts_data; @@ -181,15 +181,15 @@ { struct tsc2101_data *devdata = (struct tsc2101_data *) data; - ts_interrupt_main(devdata, 1, NULL); + ts_interrupt_main(devdata, 1); } -static irqreturn_t tsc2101_handler(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t tsc2101_handler(int irq, void *dev_id) { struct tsc2101_data *devdata = dev_id; set_irq_type(devdata->platform->irq,IRQT_NOEDGE); - ts_interrupt_main(devdata, 0, regs); + ts_interrupt_main(devdata, 0); return IRQ_HANDLED; } @@ -238,9 +238,10 @@ printk(KERN_ERR "TSC2101 Temp2: %04x\n",devdata->miscdata.temp2); } -static int tsc2101_suspend(struct device *dev, u32 state, u32 level) +static int tsc2101_suspend(struct device *dev, pm_message_t state) { struct tsc2101_data *devdata = dev_get_drvdata(dev); + /* comment this out like in old driver, it's sick though */ /* if (level == SUSPEND_POWER_DOWN) { */ tsc2101_ts_disable(devdata); @@ -250,7 +251,7 @@ return 0; } -static int tsc2101_resume(struct device *dev, u32 level) +static int tsc2101_resume(struct device *dev) { struct tsc2101_data *devdata = dev_get_drvdata(dev); @@ -311,7 +312,7 @@ free_irq(devdata->platform->irq, devdata); del_timer_sync(&devdata->ts_timer); del_timer_sync(&devdata->misc_timer); - input_unregister_device(&devdata->inputdevice); + input_unregister_device(devdata->inputdevice); tsc2101_ts_disable(devdata); kfree(devdata); return 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2007-06-22 01:35:01
|
Revision: 1042 http://svn.sourceforge.net/hackndev/?rev=1042&view=rev Author: marex_z71 Date: 2007-06-21 18:34:51 -0700 (Thu, 21 Jun 2007) Log Message: ----------- PalmT3: remove deprecated palmt3_ts driver Modified Paths: -------------- linux4palm/linux/trunk/drivers/input/touchscreen/Makefile Removed Paths: ------------- linux4palm/linux/trunk/drivers/input/touchscreen/palmt3_ts.c Modified: linux4palm/linux/trunk/drivers/input/touchscreen/Makefile =================================================================== --- linux4palm/linux/trunk/drivers/input/touchscreen/Makefile 2007-06-21 23:57:54 UTC (rev 1041) +++ linux4palm/linux/trunk/drivers/input/touchscreen/Makefile 2007-06-22 01:34:51 UTC (rev 1042) @@ -17,7 +17,6 @@ obj-$(CONFIG_TOUCHSCREEN_MTOUCH) += mtouch.o obj-$(CONFIG_TOUCHSCREEN_MK712) += mk712.o obj-$(CONFIG_TOUCHSCREEN_HP600) += hp680_ts_input.o -obj-$(CONFIG_PALM_T3_TSC2101) += palmt3_ts.o obj-$(CONFIG_TOUCHSCREEN_WM97XX) += wm97xx-ts.o wm97xx-ts-objs := wm97xx-core.o Deleted: linux4palm/linux/trunk/drivers/input/touchscreen/palmt3_ts.c =================================================================== --- linux4palm/linux/trunk/drivers/input/touchscreen/palmt3_ts.c 2007-06-21 23:57:54 UTC (rev 1041) +++ linux4palm/linux/trunk/drivers/input/touchscreen/palmt3_ts.c 2007-06-22 01:34:51 UTC (rev 1042) @@ -1,122 +0,0 @@ -/* - * Palm T|T3 touchscreen support - * - * Author: - * Vladimir "Farcaller" Pouzanov <far...@gm...> - * - * Based on tsc2101_ts.c by Richard Purdie - */ - -/* FIXME do I really need all those headers? */ -#include <linux/init.h> -#include <linux/kernel.h> -#include <asm/mach-types.h> -#include <asm/mach/arch.h> -#include <linux/interrupt.h> -#include <asm/arch/pxa-regs.h> -#include <asm/arch/pxa_keys.h> -#include <asm/arch/ssp.h> -#include <asm/arch/irqs.h> -#include <linux/sched.h> -#include <linux/workqueue.h> -#include <asm/hardware.h> -//#include "palmt3_ts.h" - -#define PALMT3_GPIO_TSC2101_SS 24 -#define PALMT3_GPIO_TOUCHSCREEN 37 - -/* FIXME Find more correct values? */ -#define X_AXIS_MAX 3800 -#define X_AXIS_MIN 300 -#define Y_AXIS_MAX 3900 -#define Y_AXIS_MIN 140 -#define PRESSURE_MIN 0 -#define PRESSURE_MAX 20000 - -void palmt3_tsc2101_readdata(void *ts_data); -struct tsc2101_ts_data { - int x,y,p; -}; -extern struct tsc2101_ts_data palmt3_ts_data; - -static struct input_dev inputdevice; - -/* static struct workqueue_struct *palmt3_ts_wq; */ -static struct timer_list palmt3_ts_timer; - -/*** IRQ handlers ***/ -static void palmt3_ts_handle(void* unused) -{ - palmt3_tsc2101_readdata(0); - - input_report_abs(&inputdevice, ABS_X, palmt3_ts_data.x); - input_report_abs(&inputdevice, ABS_Y, palmt3_ts_data.y); - input_report_abs(&inputdevice, ABS_PRESSURE, palmt3_ts_data.p); - input_report_key(&inputdevice, BTN_TOUCH, 1); - input_sync(&inputdevice); -} - -irqreturn_t palmt3_ts_irq(int irq, void *dev_id, struct pt_regs *regs) -{ - /* FIXME The first method seems to generate too much points - * But the second one is too slow... maybe try something other - * then HZ/4? - */ - - /* - static int initialised = 0; - static struct work_struct task; - - if (initialised == 0) { - INIT_WORK(&task, palmt3_ts_handle, NULL); - initialised = 1; - } else { - PREPARE_WORK(&task, palmt3_ts_handle, NULL); - } - - queue_work(palmt3_ts_wq, &task); - */ - mod_timer(&palmt3_ts_timer, jiffies + HZ/16); - return IRQ_HANDLED; -} - -static int __init palmt3_ts_init(void) -{ - init_input_dev(&inputdevice); - inputdevice.name = "tsc2101_ts"; - inputdevice.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); - inputdevice.keybit[LONG(BTN_TOUCH)] |= BIT(BTN_TOUCH); - input_set_abs_params(&inputdevice, ABS_X, X_AXIS_MIN, X_AXIS_MAX, 0, 0); - input_set_abs_params(&inputdevice, ABS_Y, Y_AXIS_MIN, Y_AXIS_MAX, 0, 0); - input_set_abs_params(&inputdevice, ABS_PRESSURE, PRESSURE_MIN, PRESSURE_MAX, 0, 0); - input_register_device(&inputdevice); - - printk("tsc2101 touchscreen driver registered\n"); - - /* palmt3_ts_wq = create_workqueue("T3 Touchscreen"); */ - init_timer(&palmt3_ts_timer); - palmt3_ts_timer.function = palmt3_ts_handle; - palmt3_ts_timer.data = 0; - - if(request_irq(IRQ_GPIO(PALMT3_GPIO_TOUCHSCREEN), palmt3_ts_irq, - SA_SAMPLE_RANDOM, "T3 Touchscreen GPIO", NULL)) { - printk(KERN_ERR "palmt3_ts: Unable to register GPIO handler for %d\n", PALMT3_GPIO_TSC2101_SS); - } else { - set_irq_type (IRQ_GPIO(PALMT3_GPIO_TOUCHSCREEN), IRQT_BOTHEDGE); - printk(KERN_INFO "palmt3_ts: Touchscreen GPIO registered\n"); - } - - printk("tsc2101 touchscreen driver initialized\n"); - return 0; -} - -static void __exit palmt3_ts_cleanup(void) -{ - /* FIXME Unreg stuff */ - printk(KERN_INFO "palmt3_ts: cleanup\n"); -} - -module_init(palmt3_ts_init); -module_exit(palmt3_ts_cleanup); - -MODULE_LICENCE("GPL"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sle...@us...> - 2007-06-20 13:40:28
|
Revision: 1040 http://svn.sourceforge.net/hackndev/?rev=1040&view=rev Author: sleep_walker Date: 2007-06-20 06:40:10 -0700 (Wed, 20 Jun 2007) Log Message: ----------- l4p: fixing palmt3_defconfig Modified Paths: -------------- linux4palm/linux/trunk/arch/arm/configs/palmt3_defconfig Modified: linux4palm/linux/trunk/arch/arm/configs/palmt3_defconfig =================================================================== --- linux4palm/linux/trunk/arch/arm/configs/palmt3_defconfig 2007-06-19 10:36:14 UTC (rev 1039) +++ linux4palm/linux/trunk/arch/arm/configs/palmt3_defconfig 2007-06-20 13:40:10 UTC (rev 1040) @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.21-hnd0-tt3 -# Mon May 28 22:46:09 2007 +# Linux kernel version: 2.6.21-hnd1 +# Wed Jun 20 14:45:06 2007 # CONFIG_ARM=y CONFIG_SYS_SUPPORTS_APM_EMULATION=y @@ -50,9 +50,7 @@ # CONFIG_SYSFS_DEPRECATED is not set # CONFIG_RELAY is not set CONFIG_BLK_DEV_INITRD=y -CONFIG_INITRAMFS_SOURCE="/home/farcaller/develop/linux4palm/initlive-ng/image" -CONFIG_INITRAMFS_ROOT_UID=0 -CONFIG_INITRAMFS_ROOT_GID=0 +CONFIG_INITRAMFS_SOURCE="" CONFIG_CC_OPTIMIZE_FOR_SIZE=y CONFIG_SYSCTL=y # CONFIG_EMBEDDED is not set @@ -1202,6 +1200,7 @@ # # CONFIG_ADFS_FS is not set # CONFIG_AFFS_FS is not set +# CONFIG_AUFS is not set # CONFIG_HFS_FS is not set # CONFIG_HFSPLUS_FS is not set # CONFIG_BEFS_FS is not set This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2007-06-19 10:36:16
|
Revision: 1039 http://svn.sourceforge.net/hackndev/?rev=1039&view=rev Author: marex_z71 Date: 2007-06-19 03:36:14 -0700 (Tue, 19 Jun 2007) Log Message: ----------- PalmLD: Rotate button F13 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-06-16 14:27:37 UTC (rev 1038) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld.c 2007-06-19 10:36:14 UTC (rev 1039) @@ -282,7 +282,7 @@ }, { /* row 3 */ - KEY_F8, /* Rotate display */ + KEY_F13, /* Rotate display */ KEY_ENTER, /* Nav centre */ KEY_LEFT, /* Nav left */ }, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <med...@us...> - 2007-06-16 14:27:48
|
Revision: 1038 http://svn.sourceforge.net/hackndev/?rev=1038&view=rev Author: medaglia Date: 2007-06-16 07:27:37 -0700 (Sat, 16 Jun 2007) Log Message: ----------- Palm TE2: Code clean-up; added buttons support using gpio-keys. Modified Paths: -------------- linux4palm/linux/trunk/arch/arm/mach-pxa/palmte2/Makefile linux4palm/linux/trunk/arch/arm/mach-pxa/palmte2/palmte2.c Removed Paths: ------------- linux4palm/linux/trunk/arch/arm/mach-pxa/palmte2/gpioed.c linux4palm/linux/trunk/arch/arm/mach-pxa/palmte2/palmte2_ac97.c linux4palm/linux/trunk/arch/arm/mach-pxa/palmte2/palmte2_buttons.c Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmte2/Makefile =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmte2/Makefile 2007-06-14 21:46:15 UTC (rev 1037) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmte2/Makefile 2007-06-16 14:27:37 UTC (rev 1038) @@ -3,6 +3,3 @@ # obj-$(CONFIG_MACH_TUNGE2) += palmte2.o -obj-$(CONFIG_PALMTE2_BUTTONS) += palmte2_buttons.o -obj-$(CONFIG_GPIOD) += gpioed.o -obj-$(CONFIG_PALMTE2_AC97) += palmte2_ac97.o Deleted: linux4palm/linux/trunk/arch/arm/mach-pxa/palmte2/gpioed.c =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmte2/gpioed.c 2007-06-14 21:46:15 UTC (rev 1037) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmte2/gpioed.c 2007-06-16 14:27:37 UTC (rev 1038) @@ -1,206 +0,0 @@ -/*** Basic includes ***/ -#include <linux/module.h> -#include <linux/kernel.h> -#include <linux/init.h> -#include <linux/proc_fs.h> - -#include <linux/interrupt.h> -#include <asm/irq.h> -#include <asm/mach/arch.h> -#include <asm/mach/map.h> -#include <asm/mach-types.h> -#include <asm/hardware.h> -#include <linux/sched.h> -#include <linux/workqueue.h> -#include <asm/arch/pxa-regs.h> -#include <asm/arch/irqs.h> -#include <asm/uaccess.h> - -/*** GPIO macros ***/ -#define GET_PALMT3_GPIO(gpio) \ - (GPLR(GPIO_NR_PALMT3_ ## gpio) & GPIO_bit(GPIO_NR_PALMT3_ ## gpio)) - -#define SET_PALMT3_GPIO(gpio, setp) \ - do { \ - if (setp) \ - GPSR(GPIO_NR_PALMT3_ ## gpio) = GPIO_bit(GPIO_NR_PALMT3_ ## gpio); \ - else \ - GPCR(GPIO_NR_PALMT3_ ## gpio) = GPIO_bit(GPIO_NR_PALMT3_ ## gpio); \ - } while (0) - -#define SET_PALMT3_GPIO_N(gpio, setp) \ - do { \ - if (setp) \ - GPCR(GPIO_NR_PALMT3_ ## gpio) = GPIO_bit(GPIO_NR_PALMT3_ ## gpio); \ - else \ - GPSR(GPIO_NR_PALMT3_ ## gpio) = GPIO_bit(GPIO_NR_PALMT3_ ## gpio); \ - } while (0) - -#define GET_GPIO(gpio) (GPLR(gpio) & GPIO_bit(gpio)) - -/*** /proc interface ***/ -static struct proc_dir_entry *proc_intf; -#define procfs_name "gpioed" -#define PROCFS_MAX_SIZE 20 - -static char procfs_buffer[PROCFS_MAX_SIZE]; -static unsigned long procfs_buffer_size = 0; - -int procfile_read(char *buffer, char **buffer_location, off_t offset, int buffer_length, int *eof, void *data) -{ - int ret; - long int i; - long int address = 0xff000000; - - if (offset > 0) { - ret = 0; - } else { - ret = sprintf(buffer, "%lx = %lx\n", address+i, *((unsigned long*)(address+i))); - } - return ret; -} - -void handle_request(void); - -int procfile_write(struct file *file, const char *buffer, unsigned long count, void *data) -{ - procfs_buffer_size = count; - if (procfs_buffer_size > PROCFS_MAX_SIZE ) { - procfs_buffer_size = PROCFS_MAX_SIZE; - } - - /* write data to the buffer */ - if ( copy_from_user(procfs_buffer, buffer, procfs_buffer_size) ) { - return -EFAULT; - } - - handle_request(); - - return procfs_buffer_size; -} - -/*** IRQ (GPIO) handling ***/ -static struct workqueue_struct *my_workqueue; -#define MY_WORK_QUEUE_NAME "GPIOed" - -static void handle_gpio(void* irq) -{ - int gpn = (int)irq; - printk(KERN_ERR "*** GPIO *** %d *** is *** %s ***\n", gpn, GET_GPIO(gpn) ? "high" : "low"); -} - -irqreturn_t gpio_irq(int irq, void *dev_id, struct pt_regs *regs) -{ - static int initialised = 0; - static struct work_struct task; - - if (initialised == 0) { - INIT_WORK(&task, handle_gpio, dev_id); - initialised = 1; - } else { - PREPARE_WORK(&task, handle_gpio, dev_id); - } - - queue_work(my_workqueue, &task); - - return IRQ_HANDLED; -} - -/*** GPIO R/W ***/ -static int gpio_get(int id) -{ - return GET_GPIO(id); -} - -static void gpio_set(int id, int on) -{ - do { - if (on) - GPSR(id) = GPIO_bit(id); - else - GPCR(id) = GPIO_bit(id); - } while (0); -} - -static int gpio_watch(int x) -{ - int ret; - ret = request_irq (IRQ_GPIO(x), gpio_irq, SA_SAMPLE_RANDOM, "test_handler", (void*)x); - set_irq_type (IRQ_GPIO(x), IRQT_BOTHEDGE); - if(ret!=0) { - printk(KERN_ERR "GPIOed: failed to register for GPIO %d\n", x); - return 1; - } else { - printk(KERN_ERR "GPIOed: Registered GPIO %d\n", x); - return 0; - } -} - -/*** Request handler ***/ -void handle_request() -{ - char *p = NULL; - unsigned long id = simple_strtoul(procfs_buffer+2, &p, 10); - switch(procfs_buffer[0]) { - case 'r': - printk(KERN_ERR "GPIOed: GPIO %lu is %s\n", id, gpio_get(id)?"high":"low"); - break; - case 's': - gpio_watch(id); - break; - case 'h': - gpio_set(id, 1); - printk(KERN_ERR "GPIOed: GPIO %lu set high\n", id); - break; - case 'l': - gpio_set(id, 0); - printk(KERN_ERR "GPIOed: GPIO %lu set low\n", id); - break; - default: - printk(KERN_ERR "GPIOed: Unknown request\n"); - break; - } -} - -/*** init&exit ***/ -static int __init gpioed_init(void) -{ - my_workqueue = create_workqueue(MY_WORK_QUEUE_NAME); - - proc_intf = create_proc_entry(procfs_name, 0644, NULL); - if (proc_intf == NULL) { - remove_proc_entry(procfs_name, &proc_root); - printk(KERN_ALERT "Error: Could not initialize /proc/%s\n", - procfs_name); - return -ENOMEM; - } - - proc_intf->read_proc = procfile_read; - proc_intf->write_proc = procfile_write; - proc_intf->owner = THIS_MODULE; - proc_intf->mode = S_IFREG | S_IRUGO; - proc_intf->uid = 0; - proc_intf->gid = 0; - proc_intf->size = 37; - - printk(KERN_INFO "/proc/%s created\n", procfs_name); - - return 0; -} - -static void __exit gpioed_exit(void) -{ - destroy_workqueue(my_workqueue); - remove_proc_entry(procfs_name, &proc_root); - printk(KERN_INFO "/proc/%s removed\n", procfs_name); -} - - -/*** Some more stuff ***/ -module_init(gpioed_init); -module_exit(gpioed_exit); - -MODULE_LICENSE("GPL"); -MODULE_AUTHOR("Vladimir \"Farcaller\" Pouzanov <far...@gm...>"); -MODULE_DESCRIPTION("GPIO editor for PXA26x"); - Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmte2/palmte2.c =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmte2/palmte2.c 2007-06-14 21:46:15 UTC (rev 1037) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmte2/palmte2.c 2007-06-16 14:27:37 UTC (rev 1038) @@ -1,5 +1,5 @@ /* - * Hardware definitions for Tungsten E2. + * Hardware definitions for Palm Tungsten E2. * * Based on: palmld.c from Alex Osborne. * @@ -9,12 +9,12 @@ #include <linux/kernel.h> #include <linux/init.h> +#include <linux/input.h> #include <asm/mach/arch.h> #include <asm/mach-types.h> #include <asm/arch/hardware.h> #include <asm/mach/map.h> #include <asm/domain.h> -#include <asm/page.h> #include <linux/device.h> #include <linux/platform_device.h> @@ -26,11 +26,11 @@ #include <asm/arch/pxafb.h> #include <asm/arch/pxa-regs.h> #include <asm/arch/udc.h> -#include <asm/arch/irda.h> #include <asm/arch/mmc.h> -#include <asm/arch/palmld-gpio.h> #include <asm/arch/pxapwm-bl.h> +#include <linux/gpio_keys.h> +#include <asm/arch/palmte2-gpio.h> #include <sound/driver.h> #include <sound/core.h> #include <sound/pcm.h> @@ -41,109 +41,31 @@ #define DEBUG -/** - * IRDA - */ -#if 0 -static void -palmte2_irda_configure (struct uart_pxa_port *up, int enable) -{ - /* printk("irda_configure, %d\n", enable); */ - /* Switch STUART RX/TX pins to SIR */ - - pxa_gpio_mode(GPIO_NR_PALMLD_STD_RXD_MD); - pxa_gpio_mode(GPIO_NR_PALMLD_STD_TXD_MD); - - /* make sure FIR ICP is off */ - ICCR0 = 0; - - /* XXX: It's a BIG hack, but it works for now. Must be fixed! */ - STISR = 0x17; - -#if 0 - if (enable) { - /* configure STUART to for SIR */ - STISR = STISR_RCVEIR | STISR_RXPL; - } else { - STISR = 0; - } -#endif -} - -static void -palmte2_irda_set_txrx (struct uart_pxa_port *up, int txrx) -{ - unsigned old_stisr = STISR; - unsigned new_stisr = old_stisr; - - /* XXX: Another big hack that works for now. */ - txrx = PXA_SERIAL_RX; - - if (txrx & PXA_SERIAL_TX) { - /* Ignore RX if TX is set */ - txrx &= PXA_SERIAL_TX; - new_stisr |= STISR_XMITIR; - } else - new_stisr &= ~STISR_XMITIR; - - if (txrx & PXA_SERIAL_RX) - new_stisr |= STISR_RCVEIR; - else - new_stisr &= ~STISR_RCVEIR; - - if (new_stisr != old_stisr) { - while (!(STLSR & LSR_TEMT)); - STISR = new_stisr; - } -} - -static int -palmte2_irda_get_txrx (struct uart_pxa_port *up) -{ - return (((STISR & STISR_XMITIR) ? PXA_SERIAL_TX : 0) | - ((STISR & STISR_RCVEIR) ? PXA_SERIAL_RX : 0)); - -} - -static struct platform_pxa_serial_funcs palmte2_pxa_irda_funcs = { - .configure = palmte2_irda_configure, - .set_txrx = palmte2_irda_set_txrx, - .get_txrx = palmte2_irda_get_txrx, -}; - -#endif - -struct platform_device palmte2_buttons = { - .name = "palmte2-buttons", - .id = -1, -}; - -/** +/* * AC97 audio controller */ -static pxa2xx_audio_ops_t palmld_audio_ops = { - /* - .startup = palmld_audio_startup, +static pxa2xx_audio_ops_t palmte2_audio_ops = { +/* + .startup = palmte2_audio_startup, .shutdown = mst_audio_shutdown, .suspend = mst_audio_suspend, .resume = mst_audio_resume, - */ +*/ }; -static struct platform_device palmld_ac97 = { +static struct platform_device palmte2_ac97 = { .name = "pxa2xx-ac97", .id = -1, .dev = { - .platform_data = &palmld_audio_ops + .platform_data = &palmte2_audio_ops }, }; -/** - * * * Backlight - * * - * */ +/* + * Backlight + */ static struct pxapwmbl_platform_data palmte2_backlight_data = { .pwm = 0, .max_intensity = 0x160, @@ -160,31 +82,42 @@ }, }; +/* + * Keypad - gpio_keys + */ -static struct platform_device *devices[] __initdata = { - &palmte2_buttons, - &palmld_ac97, - &palmte2_backlight, +#ifdef CONFIG_KEYBOARD_GPIO + +static struct gpio_keys_button palmte2_pxa_buttons[] = { + {KEY_F4, GPIO_NR_PALMTE2_KP_DKIN0, 1, "Notes"}, + {KEY_F3, GPIO_NR_PALMTE2_KP_DKIN1, 1, "Tasks"}, + {KEY_F1, GPIO_NR_PALMTE2_KP_DKIN2, 1, "Calendar"}, + {KEY_F2, GPIO_NR_PALMTE2_KP_DKIN3, 1, "Contacts"}, + {KEY_ENTER, GPIO_NR_PALMTE2_KP_DKIN4, 1, "Center"}, + {KEY_DOWN, GPIO_NR_PALMTE2_KP_DKIN5, 1, "Left"}, + {KEY_UP, GPIO_NR_PALMTE2_KP_DKIN6, 1, "Right"}, + {KEY_RIGHT, GPIO_NR_PALMTE2_KP_DKIN7, 1, "Down"}, + {KEY_LEFT, GPIO_NR_PALMTE2_KP_DKIN8, 1, "Up"}, }; -/* framebuffer */ +static struct gpio_keys_platform_data palmte2_pxa_keys_data = { + .buttons = palmte2_pxa_buttons, + .nbuttons = ARRAY_SIZE(palmte2_pxa_buttons), +}; -static void palm_backlight_power(int on) -{ - /* TODO */ - if(on) { - /* setup backlight PWM settings */ - PWM_CTRL0 = 0x7; - PWM_PWDUTY0 = 0x11a; - PWM_PERVAL0 = 0x16c; - /* turn on PWMs */ - CKEN |= CKEN0_PWM0 | CKEN1_PWM1; - } else { - /* turn off PWMs */ - CKEN &= ~(CKEN0_PWM0 | CKEN1_PWM1); - } -} +static struct platform_device palmte2_pxa_keys = { + .name = "gpio-keys", + .dev = { + .platform_data = &palmte2_pxa_keys_data, + }, +}; +#endif + +/* + * Framebuffer + */ + static struct pxafb_mode_info palmte2_lcd_modes[] = { { .pixclock = 0, @@ -193,7 +126,7 @@ .bpp = 16, .hsync_len = 4, .vsync_len = 1, - + .left_margin = 28, .right_margin = 7, .upper_margin = 7, @@ -205,30 +138,36 @@ static struct pxafb_mach_info palmte2_lcd_screen = { .modes = palmte2_lcd_modes, .num_modes = ARRAY_SIZE(palmte2_lcd_modes), - .lccr0 = 0x000000F9, .lccr3 = 0x04700006, - .pxafb_backlight_power = palm_backlight_power, + .pxafb_backlight_power = NULL, }; +/* + * Init Machine + */ + +static struct platform_device *devices[] __initdata = { + &palmte2_ac97, +#ifdef CONFIG_KEYBOARD_GPIO + &palmte2_pxa_keys, +#endif + &palmte2_backlight, +}; + static void __init palmte2_init(void) { GCR &= ~GCR_PRIRDY_IEN; - + set_pxa_fb_info(&palmte2_lcd_screen); - -/* stuart_device.dev.platform_data = &palmte2_pxa_irda_funcs; */ - platform_add_devices(devices, ARRAY_SIZE(devices)); - /* - palmte2_irda_configure (NULL, 1); - palmte2_irda_set_txrx (NULL, PXA_SERIAL_TX); - */ + platform_add_devices(devices, ARRAY_SIZE(devices)); } MACHINE_START(TUNGE2, "Palm Tungsten E2") -/* Maintainer: Carlos E. Medaglia Dyonisio <ca...@ne...> */ -/* .phys_ram = 0xa0000000, */ + + /* Maintainer: Carlos E. Medaglia Dyonisio <ca...@ne...> */ + .phys_io = 0x40000000, .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, .map_io = pxa_map_io, Deleted: linux4palm/linux/trunk/arch/arm/mach-pxa/palmte2/palmte2_ac97.c =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmte2/palmte2_ac97.c 2007-06-14 21:46:15 UTC (rev 1037) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmte2/palmte2_ac97.c 2007-06-16 14:27:37 UTC (rev 1038) @@ -1,597 +0,0 @@ -/* - * linux/arch/arm/mach-pxa/palmte2/palmte2-ts.c - * - * Touchscreen/battery driver for Palm LifeDrive's WM9712 AC97 codec. - * - * Author: Alex Osborne <bob...@gm...> - */ - -#include <linux/kernel.h> -#include <linux/module.h> -#include <linux/init.h> -#include <linux/interrupt.h> -#include <linux/input.h> -#include <linux/device.h> -#include <linux/workqueue.h> -#include <linux/battery.h> - -#include <asm/delay.h> -#include <asm/system.h> -#include <asm/arch/hardware.h> -#include <asm/arch/pxa-regs.h> -#include <asm/arch/irqs.h> -/* XXX: Should be changed! */ -//#include <asm/arch-pxa/palmld-ac97.h> -#include <linux/wm97xx.h> - -#include <asm/mach-types.h> -#include <asm/mach/arch.h> -#include <asm/mach/map.h> - -#include <sound/driver.h> -#include <sound/core.h> -#include <sound/pcm.h> -#include <sound/initval.h> -#include <sound/ac97_codec.h> - -#define TS_IRQ 50 - -#define palmte2_ac97_WORK_QUEUE_NAME "palmte2_ac97.c" -#define palmte2_headphones_ac97_WORK_QUEUE_NAME "palmte2_headphones_ac97.c" - -#define GET_GPIO(gpio) \ - (GPLR(gpio) & GPIO_bit(gpio)) - -#define X_AXIS_MAX 3800 -#define X_AXIS_MIN 200 -#define Y_AXIS_MAX 3910 -#define Y_AXIS_MIN 200 -#define PRESSURE_MIN 0 -#define PRESSURE_MAX 300 - -#define GPIO_DEBUG - -static spinlock_t palmte2_ac97_lock = SPIN_LOCK_UNLOCKED; - -static struct workqueue_struct *palmte2_ac97_workqueue; -static struct workqueue_struct *palmte2_headphones_ac97_workqueue; -static struct work_struct palmte2_ac97_irq_task; -static struct work_struct palmte2_headphones_ac97_irq_task; -struct input_dev *palmte2_ac97_input; -struct device *palmte2_ac97_dev; - -static u64 battery_update_jiffies_64 = 0; -static int battery_voltage; -static int penup = 1; -static int doing_work = 0; - -DECLARE_MUTEX(battery_update_mutex); - -/* - * ac97 codec - */ - -void wm97xx_gpio_func(ac97_t *ac97, int gpio, int func) -{ - int GEn; - GEn = ac97->bus->ops->read(ac97, 0x56); - if(func) - GEn |= gpio; - else - GEn &= ~gpio; - ac97->bus->ops->write(ac97, 0x56, GEn); -} - -void wm97xx_gpio_mode(ac97_t *ac97, int gpio, int config, int polarity, - int sticky, int wakeup) -{ - int GCn, GPn, GSn, GWn; - GCn = ac97->bus->ops->read(ac97, 0x4c); - GPn = ac97->bus->ops->read(ac97, 0x4e); - GSn = ac97->bus->ops->read(ac97, 0x50); - GWn = ac97->bus->ops->read(ac97, 0x52); - - if(config) - GCn |= gpio; - else - GCn &= ~gpio; - - if(polarity) - GPn |= gpio; - else - GPn &= ~gpio; - - if(sticky) - GSn |= gpio; - else - GSn &= ~gpio; - - if(wakeup) - GWn |= gpio; - else - GWn &= ~gpio; - - ac97->bus->ops->write(ac97, 0x4c, GCn); - ac97->bus->ops->write(ac97, 0x4e, GPn); - ac97->bus->ops->write(ac97, 0x50, GSn); - ac97->bus->ops->write(ac97, 0x52, GWn); -} - -void wm97xx_set_digitiser_power(struct device *dev, int value) -{ - ac97_t *ac97 = dev->platform_data; - u16 d2; - - d2 = ac97->bus->ops->read(ac97, AC97_WM97XX_DIGITISER2); - d2 |= value; - ac97->bus->ops->write(ac97, AC97_WM97XX_DIGITISER2, d2); -} - -/* - * This is a hack that waits until the ac97 bus is free. I was unable to find - * a more appropriate way of doing this, but it seems to work. If we don't use - * this, then the driver will eventually conflict with another driver's use - * of AC97 (probably audio) and will lockup. - */ -void wait_for_ac97(void) -{ - int timeout=1000; - - while (CAR & CAR_CAIP) { - set_current_state(TASK_INTERRUPTIBLE); - schedule_timeout(HZ/100); - set_current_state(TASK_RUNNING); - if(!timeout--) { - printk("palmte2_ac97_pendown: CAR_CAIP timeout\n"); - return; - } - } - CAR &= ~CAR_CAIP; - -} - -static int palmte2_ac97_take_reading(struct device *dev, int adcsel) -{ - ac97_t *ac97 = dev->platform_data; - int timeout=200; - u16 r76, r7a; - - r76 = ac97->bus->ops->read(ac97, 0x76); - r76 &= ~WM97XX_ADCSEL_MASK; /* clear ADCSEL */ - r76 |= adcsel; /* set ADCSEL */ - r76 &= ~(1<<11); /* COO = 0 (single measurement) */ - r76 &= ~(1<<10); /* CTC = 0 (polling mode) */ - r76 |= (1<<15); /* start reading */ - ac97->bus->ops->write(ac97, 0x76, r76); - - do { - if(!(timeout--)) { - printk("palmte2_ac97_pendown: timed out waiting for poll to complete.\n"); - return 0; - } - r76 = ac97->bus->ops->read(ac97, 0x76); - } while((r76 & (1<<15))); - - r7a = ac97->bus->ops->read(ac97, 0x7a); - - return r7a; -} - - - -/* - * battery - */ - -void update_data(int force) -{ - u16 reading; - ac97_t *ac97; - - if(!force && (battery_update_jiffies_64 + HZ > jiffies_64)) { - return; - } - - if(down_trylock(&battery_update_mutex)) { - return; - } - - - spin_lock(&palmte2_ac97_lock); - wait_for_ac97(); - - #ifdef GPIO_DEBUG - ac97 = palmte2_ac97_dev->platform_data; - - // invert and univert the gpio a few times while watching - // the PXA's gpios to see if we can spot a connection ;) - printk("%x %x %x %x\n", GPLR0, GPLR1, GPLR2, GPLR3); - - reading = ac97->bus->ops->read(ac97, 0x58); - ac97->bus->ops->write(ac97, 0x58, reading | 1); - udelay(10); - printk("%x %x %x %x\n", GPLR0, GPLR1, GPLR2, GPLR3); - - reading = ac97->bus->ops->read(ac97, 0x58); - ac97->bus->ops->write(ac97, 0x58, reading & (~1)); - udelay(10); - printk("%x %x %x %x\n", GPLR0, GPLR1, GPLR2, GPLR3); - - - #else - wm97xx_set_digitiser_power(palmte2_ac97_dev, WM97XX_PRP_DET_DIG); - reading = palmte2_ac97_take_reading(palmte2_ac97_dev, WM97XX_ADCSEL_BMON); - wm97xx_set_digitiser_power(palmte2_ac97_dev, WM97XX_PRP_DET); - - #endif - - spin_unlock(&palmte2_ac97_lock); - battery_voltage = reading & 0xfff; - printk("Battery: %d\n", battery_voltage); - - battery_update_jiffies_64 = jiffies_64; - up(&battery_update_mutex); -} - -int get_min_voltage(struct battery *b) -{ - return 0; -} -int get_min_charge(struct battery *b) -{ - return 0; -} -int get_max_voltage(struct battery *b) -{ - return 4750; /* mV */ -} -int get_max_charge(struct battery *b) -{ - return 1; -} -int get_voltage(struct battery *b) -{ - update_data(0); - return battery_voltage; -} -int get_charge(struct battery *b) -{ - return 0; -} -int get_status(struct battery *b) -{ - return 0; //power_status == POWER_NONE? 0: 1; -} - -static struct battery palmte2_battery = { - .name = "palmte2-ac97", - .id = "battery0", - .get_min_voltage = get_min_voltage, - .get_min_current = NULL, - .get_min_charge = get_min_charge, - .get_max_voltage = get_max_voltage, - .get_max_current = NULL, - .get_max_charge = get_max_charge, - .get_temp = NULL, - .get_voltage = get_voltage, - .get_current = NULL, - .get_charge = get_charge, - .get_status = get_status, -}; - -static void -battery_class_release(struct class_device *dev) -{ -} - -static void -battery_class_class_release(struct class *class) -{ -} - - -/* - * touchscreen - */ - -static void palmte2_ac97_pendown(struct device *dev) -{ - //ac97_t *ac97 = dev->platform_data; - int xread, yread, pressure; - int pendown=0, valid_coords=0; - - input_report_key(palmte2_ac97_input, BTN_TOUCH, !penup); - /* take readings until the pen goes up */ - do { - spin_lock(&palmte2_ac97_lock); - wait_for_ac97(); - - /* power up digitiser */ - wm97xx_set_digitiser_power(dev, WM97XX_PRP_DET_DIG); - - /* take readings */ - xread = palmte2_ac97_take_reading(dev, WM97XX_ADCSEL_X); - yread = palmte2_ac97_take_reading(dev, WM97XX_ADCSEL_Y); - pressure = palmte2_ac97_take_reading(dev, WM97XX_ADCSEL_PRES); - - /* power down digitiser to conserve power */ - wm97xx_set_digitiser_power(dev, WM97XX_PRP_DET); - - pendown = pressure & (1<<15); - valid_coords = (xread & 0xfff) && (yread & 0xfff) && (pressure & 0xfff); - - if (valid_coords) { - input_report_abs(palmte2_ac97_input, ABS_X, xread & 0xfff); - input_report_abs(palmte2_ac97_input, ABS_Y, yread & 0xfff); - input_report_abs(palmte2_ac97_input, ABS_PRESSURE, pressure & 0xfff); - } - - input_sync(palmte2_ac97_input); - - spin_unlock(&palmte2_ac97_lock); - - set_current_state(TASK_INTERRUPTIBLE); - schedule_timeout(HZ/100); - set_current_state(TASK_RUNNING); - } while(!penup); - - input_report_key(palmte2_ac97_input, BTN_TOUCH, !penup); - input_sync(palmte2_ac97_input); - - doing_work = 0; -} - -static void palmte2_ac97_irq_work(void *data) -{ - struct device *dev = data; - palmte2_ac97_pendown(dev); -} - -static void palmte2_headphones_ac97_irq_work(void *data) -{ - u16 reg; - ac97_t *ac97; - struct device *dev = data; - - ac97 = dev->platform_data; - - reg = ac97->bus->ops->read(ac97, 0x24); - - printk("reg: %x\n", reg); - if(GET_GPIO(12)) { - //reg = ((reg | 0x08) & (~0x30)); - reg = 0x1cef; - ac97->bus->ops->write(ac97, 0x24, reg); - printk("reg: %x\n", reg); - } else { - // reg = ((reg & ~0x08) | (0x30)); - reg = 0x1f77; - ac97->bus->ops->write(ac97, 0x24, reg); - printk("reg: %x\n", reg); - } - printk("AC97: 0x%x\n", ac97->bus->ops->read(ac97, 0x00)); - printk("AC97: 0x%x\n", ac97->bus->ops->read(ac97, 0x02)); - printk("AC97: 0x%x\n", ac97->bus->ops->read(ac97, 0x04)); - printk("AC97: 0x%x\n", ac97->bus->ops->read(ac97, 0x06)); - printk("AC97: 0x%x\n", ac97->bus->ops->read(ac97, 0x08)); - printk("AC97: 0x%x\n", ac97->bus->ops->read(ac97, 0x0a)); - printk("AC97: 0x%x\n", ac97->bus->ops->read(ac97, 0x0c)); - printk("AC97: 0x%x\n", ac97->bus->ops->read(ac97, 0x0e)); - printk("AC97: 0x%x\n", ac97->bus->ops->read(ac97, 0x10)); - printk("AC97: 0x%x\n", ac97->bus->ops->read(ac97, 0x12)); - printk("AC97: 0x%x\n", ac97->bus->ops->read(ac97, 0x14)); - printk("AC97: 0x%x\n", ac97->bus->ops->read(ac97, 0x16)); - printk("AC97: 0x%x\n", ac97->bus->ops->read(ac97, 0x18)); - printk("AC97: 0x%x\n", ac97->bus->ops->read(ac97, 0x1a)); - printk("AC97: 0x%x\n", ac97->bus->ops->read(ac97, 0x1c)); - printk("AC97: NULL\n"); - printk("AC97: 0x%x\n", ac97->bus->ops->read(ac97, 0x20)); - printk("AC97: 0x%x\n", ac97->bus->ops->read(ac97, 0x22)); - printk("AC97: 0x%x\n", ac97->bus->ops->read(ac97, 0x24)); - printk("AC97: 0x%x\n", ac97->bus->ops->read(ac97, 0x26)); - printk("AC97: 0x%x\n", ac97->bus->ops->read(ac97, 0x28)); - printk("AC97: 0x%x\n", ac97->bus->ops->read(ac97, 0x2a)); - printk("AC97: 0x%x\n", ac97->bus->ops->read(ac97, 0x2c)); - printk("AC97: 0x%x\n", ac97->bus->ops->read(ac97, 0x2e)); - printk("AC97: NULL\n"); - printk("AC97: 0x%x\n", ac97->bus->ops->read(ac97, 0x32)); - printk("AC97: 0x%x\n", ac97->bus->ops->read(ac97, 0x34)); - printk("AC97: 0x%x\n", ac97->bus->ops->read(ac97, 0x36)); - printk("AC97: 0x%x\n", ac97->bus->ops->read(ac97, 0x38)); - printk("AC97: 0x%x\n", ac97->bus->ops->read(ac97, 0x3a)); -} - -static irqreturn_t palmte2_ac97_irq_handler(int irq, void *dev_id, struct pt_regs *regs) -{ - /* - * we can't use ac97 from within the interrupt handler, so schedule a task - * to do the actual handling. - */ - /* XXX: 50? Should be a define */ - penup = !GET_GPIO(50); - rmb(); - - if (!penup && !doing_work) { - /* XXX: Should be changed to a spin_lock! (?) */ - doing_work = 1; - queue_work(palmte2_ac97_workqueue, &palmte2_ac97_irq_task); - } - - return IRQ_HANDLED; -} - -static irqreturn_t palmte2_headphones_irq_handler(int irq, void *dev_id, struct pt_regs *regs) -{ - //reg = ac97->bus->ops->read(ac97, 0x58); - queue_work(palmte2_headphones_ac97_workqueue, &palmte2_headphones_ac97_irq_task); - /* - if(GET_GPIO(12)) { - ac97->bus->ops->write(ac97, 0x24, ((reg | 0x08) & (~0x30))); - } else { - ac97->bus->ops->write(ac97, 0x24, ((reg & ~0x08) | (0x30))); - } -*/ - return IRQ_HANDLED; -} - -static int __init palmte2_ac97_probe(struct device *dev) -{ - int err; - ac97_t *ac97 = dev->platform_data; - u16 d2; - - if(!machine_is_tunge2()) - return -ENODEV; - - /* for use by bettery level monitor */ - palmte2_ac97_dev = dev; - - /* setup work queue */ - palmte2_ac97_workqueue = create_workqueue(palmte2_ac97_WORK_QUEUE_NAME); - INIT_WORK(&palmte2_ac97_irq_task, palmte2_ac97_irq_work, dev); - - palmte2_headphones_ac97_workqueue = create_workqueue(palmte2_headphones_ac97_WORK_QUEUE_NAME); - INIT_WORK(&palmte2_headphones_ac97_irq_task, palmte2_headphones_ac97_irq_work, dev); - - set_irq_type(IRQ_GPIO(TS_IRQ), IRQT_BOTHEDGE); - err = request_irq(IRQ_GPIO(50), palmte2_ac97_irq_handler, - SA_INTERRUPT, "Touchscreen", dev); - - set_irq_type(IRQ_GPIO(12), IRQT_BOTHEDGE); - err = request_irq(IRQ_GPIO(12), palmte2_headphones_irq_handler, - SA_INTERRUPT, "Headphones", dev); - - if(err) { - printk(KERN_ERR "palmte2_ac97_probe: cannot request touchscreen IRQ\n"); - return -1; - } - - spin_lock(&palmte2_ac97_lock); - - /* reset levels */ - ac97->bus->ops->write(ac97, 0x54, 0); - - /* disable digitiser to save power, enable pen-down detect */ -/* d2 = ac97->bus->ops->read(ac97, AC97_WM97XX_DIGITISER2); - d2 |= WM97XX_PRP_DET; - ac97->bus->ops->write(ac97, AC97_WM97XX_DIGITISER2, d2); -*/ - /* enable interrupts on codec's gpio 2 (connected to cpu gpio 27) */ - /* ????? */ - wm97xx_gpio_mode(ac97, WM97XX_GPIO_3, WM97XX_GPIO_IN, - WM97XX_GPIO_POL_HIGH, WM97XX_GPIO_NOTSTICKY, WM97XX_GPIO_NOWAKE); - wm97xx_gpio_func(ac97, WM97XX_GPIO_3, 0); - - wm97xx_gpio_mode(ac97, WM97XX_GPIO_13, WM97XX_GPIO_IN, - WM97XX_GPIO_POL_HIGH, WM97XX_GPIO_NOTSTICKY, WM97XX_GPIO_NOWAKE); - - /* disable ada detect interrupt */ - wm97xx_gpio_mode(ac97, WM97XX_GPIO_12, WM97XX_GPIO_IN, - WM97XX_GPIO_POL_HIGH, WM97XX_GPIO_NOTSTICKY, WM97XX_GPIO_NOWAKE); - - /* turn off irq gpio inverting */ - ac97->bus->ops->write(ac97, 0x58, ac97->bus->ops->read(ac97, 0x58)&~1); - - /* turn on the digitiser and DISABLE pen down detector */ - d2 = ac97->bus->ops->read(ac97, AC97_WM97XX_DIGITISER2); - d2 |= WM97XX_PRP_DETW; - ac97->bus->ops->write(ac97, AC97_WM97XX_DIGITISER2, d2); - - spin_unlock(&palmte2_ac97_lock); - - /* setup the input device */ - palmte2_ac97_input = input_allocate_device(); - palmte2_ac97_input->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); - palmte2_ac97_input->keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH); - input_set_abs_params(palmte2_ac97_input, ABS_X, X_AXIS_MIN, X_AXIS_MAX, 0, 0); - input_set_abs_params(palmte2_ac97_input, ABS_Y, Y_AXIS_MIN, Y_AXIS_MAX, 0, 0); - input_set_abs_params(palmte2_ac97_input, ABS_PRESSURE, PRESSURE_MIN, PRESSURE_MAX, 0, 0); - - palmte2_ac97_input->name = "Palm Tungsten E2 touchscreen"; - palmte2_ac97_input->dev = dev; - palmte2_ac97_input->id.bustype = BUS_HOST; - input_register_device(palmte2_ac97_input); - - /* register battery */ - if(battery_class_register(&palmte2_battery)) { - printk(KERN_ERR "palmte2_ac97_probe: Could not register battery " - "class\n"); - } else { - palmte2_battery.class_dev.class->release = battery_class_release; - palmte2_battery.class_dev.class->class_release = battery_class_class_release; - } - - ac97->bus->ops->write(ac97, 0x16, 0x8000); - - printk("AC97: 0x%x\n", ac97->bus->ops->read(ac97, 0x00)); - printk("AC97: 0x%x\n", ac97->bus->ops->read(ac97, 0x02)); - printk("AC97: 0x%x\n", ac97->bus->ops->read(ac97, 0x04)); - printk("AC97: 0x%x\n", ac97->bus->ops->read(ac97, 0x06)); - printk("AC97: 0x%x\n", ac97->bus->ops->read(ac97, 0x08)); - printk("AC97: 0x%x\n", ac97->bus->ops->read(ac97, 0x0a)); - printk("AC97: 0x%x\n", ac97->bus->ops->read(ac97, 0x0c)); - printk("AC97: 0x%x\n", ac97->bus->ops->read(ac97, 0x0e)); - printk("AC97: 0x%x\n", ac97->bus->ops->read(ac97, 0x10)); - printk("AC97: 0x%x\n", ac97->bus->ops->read(ac97, 0x12)); - printk("AC97: 0x%x\n", ac97->bus->ops->read(ac97, 0x14)); - printk("AC97: 0x%x\n", ac97->bus->ops->read(ac97, 0x16)); - printk("AC97: 0x%x\n", ac97->bus->ops->read(ac97, 0x18)); - printk("AC97: 0x%x\n", ac97->bus->ops->read(ac97, 0x1a)); - printk("AC97: 0x%x\n", ac97->bus->ops->read(ac97, 0x1c)); - printk("AC97: NULL\n"); - printk("AC97: 0x%x\n", ac97->bus->ops->read(ac97, 0x20)); - printk("AC97: 0x%x\n", ac97->bus->ops->read(ac97, 0x22)); - printk("AC97: 0x%x\n", ac97->bus->ops->read(ac97, 0x24)); - printk("AC97: 0x%x\n", ac97->bus->ops->read(ac97, 0x26)); - printk("AC97: 0x%x\n", ac97->bus->ops->read(ac97, 0x28)); - printk("AC97: 0x%x\n", ac97->bus->ops->read(ac97, 0x2a)); - printk("AC97: 0x%x\n", ac97->bus->ops->read(ac97, 0x2c)); - printk("AC97: 0x%x\n", ac97->bus->ops->read(ac97, 0x2e)); - printk("AC97: NULL\n"); - printk("AC97: 0x%x\n", ac97->bus->ops->read(ac97, 0x32)); - printk("AC97: 0x%x\n", ac97->bus->ops->read(ac97, 0x34)); - printk("AC97: 0x%x\n", ac97->bus->ops->read(ac97, 0x36)); - printk("AC97: 0x%x\n", ac97->bus->ops->read(ac97, 0x38)); - printk("AC97: 0x%x\n", ac97->bus->ops->read(ac97, 0x3a)); - return 0; -} - -static int palmte2_ac97_remove (struct device *dev) -{ - ac97_t *ac97 = dev->platform_data; - printk("x: %x\n", ac97->bus->ops->read(ac97, AC97_WM97XX_DIGITISER2)); - input_unregister_device(palmte2_ac97_input); - free_irq(IRQ_GPIO(TS_IRQ), dev); - return 0; -} - -static struct device_driver palmte2_ac97_driver = { - .name = "WM9711,WM9712", - .bus = &ac97_bus_type, - .probe = palmte2_ac97_probe, - .remove = palmte2_ac97_remove, -#ifdef CONFIG_PM - .suspend = NULL, - .resume = NULL, -#endif -}; - -static int __init palmte2_ac97_init(void) -{ - if(!machine_is_tunge2()) - return -ENODEV; - - return driver_register(&palmte2_ac97_driver); -} - -static void palmte2_ac97_exit(void) -{ - driver_unregister(&palmte2_ac97_driver); -} - -module_init(palmte2_ac97_init); -module_exit(palmte2_ac97_exit); - -MODULE_AUTHOR ("Carlos Eduardo Medaglia Dyonisio <ca...@ne...>"); -MODULE_DESCRIPTION ("WM9712L AC97 codec support for Palm Tungsten E2"); -MODULE_LICENSE ("GPL"); Deleted: linux4palm/linux/trunk/arch/arm/mach-pxa/palmte2/palmte2_buttons.c =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmte2/palmte2_buttons.c 2007-06-14 21:46:15 UTC (rev 1037) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmte2/palmte2_buttons.c 2007-06-16 14:27:37 UTC (rev 1038) @@ -1,148 +0,0 @@ -/* - * linux/arch/arm/mach-pxa/palmte2/palmte2-buttons.c - * - * Button driver for Palm Tungsten E2 - * - * Author: Carlos Eduardo Medaglia Dyonisio <ca...@ne...> - */ - -#include <linux/kernel.h> -#include <linux/module.h> -#include <linux/init.h> -#include <linux/interrupt.h> -#include <linux/input.h> -#include <linux/device.h> -#include <linux/platform_device.h> -#include <asm/irq.h> -#include <asm/mach/irq.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> - -#define GET_GPIO(gpio) (GPLR(gpio) & GPIO_bit(gpio)) - -#define MAX_BUTTONS 23 - -struct input_dev *button_dev; -static struct device_driver palmte2_buttons_driver; - -static struct { - int keycode; - char *desc; -} palmte2_buttons[MAX_BUTTONS] = { - { -1, NULL }, /* GPIO 0 */ - { -1, NULL }, - { -1, "Power" }, - { -1, NULL }, - { -1, NULL }, - { KEY_F4, "Notes" }, /* GPIO 5 */ - { -1, NULL }, - { KEY_F3, "Tasks" }, - { -1, NULL }, - { -1, NULL }, - { -1, NULL }, /* GPIO 10 */ - { KEY_LEFTSHIFT, "Calendar" }, - { -1, NULL }, - { KEY_PAGEUP, "Contacts" }, - { KEY_ENTER, "Center" }, - { -1, NULL }, /* GPIO 15 */ - { -1, NULL }, - { -1, NULL }, - { -1, NULL }, - { KEY_LEFT, "Left" }, - { KEY_RIGHT, "Right" }, /* GPIO 20 */ - { KEY_DOWN, "Down" }, - { KEY_UP, "Up" } -}; - -static irqreturn_t palmte2_keypad_irq_handler(int irq, void *dev_id, struct pt_regs *regs) -{ - input_report_key(button_dev, palmte2_buttons[IRQ_TO_GPIO(irq)].keycode, - GET_GPIO(IRQ_TO_GPIO(irq)) ? 0 : 1); - return IRQ_HANDLED; -} - -static int __init palmte2_buttons_probe(struct device *dev) -{ - int err = 0; - int i; - - if(!machine_is_tunge2()) - return -ENODEV; - - button_dev = input_allocate_device(); - button_dev->evbit[0] = BIT(EV_KEY); - for(i=0;i<MAX_BUTTONS;i++) { - if(palmte2_buttons[i].keycode >= 0) { - button_dev->keybit[LONG(palmte2_buttons[i].keycode)] |= - BIT(palmte2_buttons[i].keycode); - } - } - button_dev->name = "Palm Tungsten E2 buttons"; - button_dev->id.bustype = BUS_HOST; - input_register_device(button_dev); - - for(i=0;i<MAX_BUTTONS;i++) { - if(palmte2_buttons[i].keycode >= 0) { - err += request_irq(IRQ_GPIO(i), - palmte2_keypad_irq_handler, - SA_SAMPLE_RANDOM | SA_INTERRUPT, - "keypad", (void*)i); - set_irq_type(IRQ_GPIO(i), IRQT_BOTHEDGE); - } - } - - if(err) { - printk("err = %d\n", err); - } - - return 0; -} - -static int __exit palmte2_buttons_remove (struct device *dev) -{ - int i; - for(i=0;i<MAX_BUTTONS;i++) { - if(palmte2_buttons[i].keycode >= 0) { - free_irq(IRQ_GPIO(i), (void*)i); - } - } - return 0; -} - -static struct device_driver palmte2_buttons_driver = { - .name = "palmte2-buttons", - .bus = &platform_bus_type, - .probe = palmte2_buttons_probe, - .remove = palmte2_buttons_remove, -#ifdef CONFIG_PM - .suspend = NULL, - .resume = NULL, -#endif -}; - -static int __init palmte2_buttons_init(void) -{ - if(!machine_is_tunge2()) - return -ENODEV; - - return driver_register(&palmte2_buttons_driver); -} - -static void __exit palmte2_buttons_exit(void) -{ - input_unregister_device(button_dev); - driver_unregister(&palmte2_buttons_driver); -} - -module_init(palmte2_buttons_init); -module_exit(palmte2_buttons_exit); - -MODULE_AUTHOR ("Carlos Eduardo Medaglia Dyonisio <ca...@ne...>"); -MODULE_DESCRIPTION ("Button support for Palm Tungsten E2"); -MODULE_LICENSE ("GPL"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2007-06-14 21:46:17
|
Revision: 1037 http://svn.sourceforge.net/hackndev/?rev=1037&view=rev Author: marex_z71 Date: 2007-06-14 14:46:15 -0700 (Thu, 14 Jun 2007) Log Message: ----------- Cocoboot: Fix typo Modified Paths: -------------- cocoboot/trunk/m68k/mainform.c Modified: cocoboot/trunk/m68k/mainform.c =================================================================== --- cocoboot/trunk/m68k/mainform.c 2007-06-14 16:03:49 UTC (rev 1036) +++ cocoboot/trunk/m68k/mainform.c 2007-06-14 21:46:15 UTC (rev 1037) @@ -170,7 +170,7 @@ { char msg[255]; - sprintf(msg, " RAM base: 9x%lx\n" + sprintf(msg, " RAM base: 0x%lx\n" " Size: %ldmb (0x%lx)\n" " Phys TTB: 0x%lx\n" " Virt TTB: 0x%lx", This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2007-06-14 16:04:47
|
Revision: 1036 http://svn.sourceforge.net/hackndev/?rev=1036&view=rev Author: marex_z71 Date: 2007-06-14 09:03:49 -0700 (Thu, 14 Jun 2007) Log Message: ----------- PalmTC: corrected GPIO functions Modified Paths: -------------- linux4palm/linux/trunk/drivers/input/touchscreen/palmtc_ts.c linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmtc-gpio.h Modified: linux4palm/linux/trunk/drivers/input/touchscreen/palmtc_ts.c =================================================================== --- linux4palm/linux/trunk/drivers/input/touchscreen/palmtc_ts.c 2007-06-14 15:47:55 UTC (rev 1035) +++ linux4palm/linux/trunk/drivers/input/touchscreen/palmtc_ts.c 2007-06-14 16:03:49 UTC (rev 1036) @@ -459,8 +459,8 @@ int ucb1400_battery_get_status(struct battery *b) { - int ac_connected = gpio_get_value(GPIO_NR_PALMTC_POWER_DETECT); - int usb_connected = !gpio_get_value(GPIO_NR_PALMTC_USB_DETECT); + int ac_connected = !(gpio_get_value(GPIO_NR_PALMTC_CRADLE_DETECT_N)); + int usb_connected = gpio_get_value(GPIO_NR_PALMTC_USB_DETECT); ucb1400_adc_enable(bat.ucb); if (ucb1400_adc_read(bat.ucb, UCB_ADC_INP_AD0) <= 0) Modified: linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmtc-gpio.h =================================================================== --- linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmtc-gpio.h 2007-06-14 15:47:55 UTC (rev 1035) +++ linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmtc-gpio.h 2007-06-14 16:03:49 UTC (rev 1036) @@ -12,15 +12,55 @@ /* Palm Tungsten C GPIOs */ #define GPIO_NR_PALMTC_EARPHONE_DETECT 2 -#define GPIO_NR_PALMTC_USB_DETECT 4 -#define GPIO_NR_PALMTC_POWER_DETECT 5 +#define GPIO_NR_PALMTC_CRADLE_DETECT_N 4 +#define GPIO_NR_PALMTC_USB_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_PALMTC_BL_POWER 16 +#define GPIO_NR_PALMTC_USB_POWER 36 //#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) +/* Utility macros */ + +#define GET_PALMTC_GPIO(gpio) \ + (GPLR(GPIO_NR_PALMTC_ ## gpio) & GPIO_bit(GPIO_NR_PALMTC_ ## gpio)) + +#define SET_PALMTC_GPIO(gpio, setp) \ + do { \ + if (setp) \ + GPSR(GPIO_NR_PALMTC_ ## gpio) = GPIO_bit(GPIO_NR_PALMTC_ ## gpio); \ + else \ + GPCR(GPIO_NR_PALMTC_ ## gpio) = GPIO_bit(GPIO_NR_PALMTC_ ## gpio); \ + } while (0) + +#define SET_PALMTC_GPIO_N(gpio, setp) \ + do { \ + if (setp) \ + GPCR(GPIO_NR_PALMTC_ ## gpio) = GPIO_bit(GPIO_NR_PALMTC_ ## gpio); \ + else \ + GPSR(GPIO_NR_PALMTC_ ## gpio) = GPIO_bit(GPIO_NR_PALMTC_ ## gpio); \ + } while (0) + +#define GET_GPIO(gpio) (GPLR(gpio) & GPIO_bit(gpio)) + +#define SET_GPIO(gpio, setp) \ + do { \ + if (setp) \ + GPSR(gpio) = GPIO_bit(gpio); \ + else \ + GPCR(gpio) = GPIO_bit(gpio); \ + } while (0) + +#define SET_GPIO_N(gpio, setp) \ + do { \ + if (setp) \ + GPCR(gpio) = GPIO_bit(gpio); \ + else \ + GPSR(gpio) = GPIO_bit(gpio); \ + } while (0) + #endif /* _PALMTC_GPIO_H_ */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |