diff -uNr -x Entries.Log -x Repository -x Tag -x Root -x Entries -x '*.mod' -x '*orig*' -x '*.c~' -x '*.h~' cleancvs/kernel26/arch/arm/configs/htcblueangel_defconfig garage/kernel26/arch/arm/configs/htcblueangel_defconfig --- cleancvs/kernel26/arch/arm/configs/htcblueangel_defconfig 2006-06-16 00:50:37.000000000 +0200 +++ garage/kernel26/arch/arm/configs/htcblueangel_defconfig 2006-08-05 19:55:07.000000000 +0200 @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.16-hh2 -# Fri Jun 16 00:37:30 2006 +# Linux kernel version: 2.6.16-hh4 +# Sun Jul 23 19:31:55 2006 # CONFIG_ARM=y CONFIG_MMU=y @@ -30,9 +30,7 @@ CONFIG_IKCONFIG=y # CONFIG_MINIMAL_OOPS is not set CONFIG_IKCONFIG_PROC=y -CONFIG_INITRAMFS_SOURCE="../initramfs/filelist" -CONFIG_INITRAMFS_ROOT_UID=0 -CONFIG_INITRAMFS_ROOT_GID=0 +CONFIG_INITRAMFS_SOURCE="" CONFIG_UID16=y CONFIG_CC_OPTIMIZE_FOR_SIZE=y CONFIG_EMBEDDED=y @@ -120,6 +118,7 @@ # CONFIG_ARCH_LUBBOCK is not set # CONFIG_MACH_MAINSTONE is not set # CONFIG_ARCH_PXA_IDP is not set +CONFIG_PXA_SSP=m # CONFIG_ARCH_ESERIES is not set # CONFIG_MACH_A620 is not set # CONFIG_MACH_A716 is not set @@ -137,14 +136,17 @@ # CONFIG_MACH_HTCAPACHE is not set CONFIG_MACH_BLUEANGEL=y CONFIG_MACH_BLUEANGEL_LCD=y +CONFIG_MACH_BLUEANGEL_TOUCH=m # CONFIG_MACH_BLUEANGEL_PCMCIA is not set +CONFIG_MACH_BLUEANGEL_ACX100=m CONFIG_MACH_BLUEANGEL_SUSPEND=m -# CONFIG_MACH_BLUEANGEL_LEDS is not set +CONFIG_MACH_BLUEANGEL_LEDS=m CONFIG_MACH_BLUEANGEL_KEYPAD=m # CONFIG_MACH_BLUEANGEL_AUDIO is not set CONFIG_MACH_BLUEANGEL_BATTERY=m CONFIG_MACH_BLUEANGEL_ROM=m CONFIG_MACH_BLUEANGEL_DPRAM=m +# CONFIG_MACH_HTCBEETLES is not set # CONFIG_ARCH_AXIMX5 is not set # CONFIG_ARCH_AXIMX3 is not set # CONFIG_MACH_X30 is not set @@ -200,7 +202,16 @@ # # PCCARD (PCMCIA/CardBus) support # -# CONFIG_PCCARD is not set +CONFIG_PCCARD=m +# CONFIG_PCMCIA_DEBUG is not set +CONFIG_PCMCIA=m +CONFIG_PCMCIA_LOAD_CIS=y +CONFIG_PCMCIA_IOCTL=y + +# +# PC-card bridges +# +CONFIG_PCMCIA_PXA2XX=m # # Kernel Features @@ -230,7 +241,20 @@ # # CPU Frequency scaling # -# CONFIG_CPU_FREQ is not set +CONFIG_CPU_FREQ=y +CONFIG_CPU_FREQ_TABLE=y +# CONFIG_CPU_FREQ_DEBUG is not set +CONFIG_CPU_FREQ_STAT=y +CONFIG_CPU_FREQ_STAT_DETAILS=y +CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y +# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set +CONFIG_CPU_FREQ_GOV_PERFORMANCE=y +CONFIG_CPU_FREQ_GOV_POWERSAVE=m +CONFIG_CPU_FREQ_GOV_USERSPACE=m +CONFIG_CPU_FREQ_GOV_ONDEMAND=m +CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m +CONFIG_CPU_FREQ_PXA=y +CONFIG_PXA25x_ALTERNATE_FREQS=y # # Floating point emulation @@ -257,7 +281,7 @@ CONFIG_PM=y CONFIG_PM_LEGACY=y # CONFIG_PM_DEBUG is not set -# CONFIG_APM is not set +CONFIG_APM=y # # Networking @@ -441,10 +465,14 @@ # CONFIG_BT_HCIUSB is not set CONFIG_BT_HCIUART=m # CONFIG_BT_HCIUART_H4 is not set -# CONFIG_BT_HCIUART_BCSP is not set +CONFIG_BT_HCIUART_BCSP=y # CONFIG_BT_HCIBCM203X is not set # CONFIG_BT_HCIBPA10X is not set # CONFIG_BT_HCIBFUSB is not set +# CONFIG_BT_HCIDTL1 is not set +# CONFIG_BT_HCIBT3C is not set +# CONFIG_BT_HCIBLUECARD is not set +# CONFIG_BT_HCIBTUART is not set # CONFIG_BT_HCIVHCI is not set # CONFIG_IEEE80211 is not set @@ -455,7 +483,7 @@ # # Generic Driver Options # -CONFIG_STANDALONE=y +# CONFIG_STANDALONE is not set CONFIG_PREVENT_FIRMWARE_BUILD=y CONFIG_FW_LOADER=y # CONFIG_DEBUG_DRIVER is not set @@ -656,11 +684,35 @@ # Obsolete Wireless cards support (pre-802.11) # # CONFIG_STRIP is not set +# CONFIG_PCMCIA_WAVELAN is not set +# CONFIG_PCMCIA_NETWAVE is not set + +# +# Wireless 802.11 Frequency Hopping cards support +# +# CONFIG_PCMCIA_RAYCS is not set + +# +# Wireless 802.11b ISA/PCI cards support +# +# CONFIG_HERMES is not set # CONFIG_ATMEL is not set + +# +# Wireless 802.11b Pcmcia/Cardbus cards support +# +# CONFIG_AIRO_CS is not set +# CONFIG_PCMCIA_WL3501 is not set # CONFIG_HOSTAP is not set CONFIG_ACX=m # CONFIG_ACX_USB is not set -# CONFIG_ACX_MEM is not set +CONFIG_ACX_MEM=y +CONFIG_NET_WIRELESS=y + +# +# PCMCIA network device support +# +# CONFIG_NET_PCMCIA is not set # # Wan interfaces @@ -830,6 +882,13 @@ # # Ftape, the floppy tape device driver # + +# +# PCMCIA character devices +# +# CONFIG_SYNCLINK_CS is not set +# CONFIG_CARDMAN_4000 is not set +# CONFIG_CARDMAN_4040 is not set # CONFIG_RAW_DRIVER is not set # @@ -875,11 +934,12 @@ # CONFIG_HTC_ASIC2 is not set CONFIG_HTC_ASIC3=y # CONFIG_SOC_TSC2101 is not set +CONFIG_SOC_TSC2200=m # # Misc devices # -# CONFIG_BATTERY_MONITOR is not set +CONFIG_BATTERY_MONITOR=y # # Multimedia Capabilities Port drivers @@ -912,8 +972,8 @@ # CONFIG_FB_TILEBLITTING is not set # CONFIG_FB_IMAGEON is not set # CONFIG_FB_S1D13XXX is not set -CONFIG_FB_PXA=y -CONFIG_FB_PXA_PARAMETERS=y +# CONFIG_FB_PXA is not set +CONFIG_FB_W100=y # CONFIG_FB_VIRTUAL is not set # @@ -922,15 +982,15 @@ # CONFIG_VGA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y CONFIG_FRAMEBUFFER_CONSOLE=y -CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y +# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set CONFIG_FONTS=y # CONFIG_FONT_8x8 is not set -CONFIG_FONT_8x16=y +# CONFIG_FONT_8x16 is not set # CONFIG_FONT_6x11 is not set # CONFIG_FONT_7x14 is not set # CONFIG_FONT_PEARL_8x8 is not set # CONFIG_FONT_ACORN_8x8 is not set -# CONFIG_FONT_MINI_4x6 is not set +CONFIG_FONT_MINI_4x6=y # CONFIG_FONT_SUN8x16 is not set # CONFIG_FONT_SUN12x22 is not set # CONFIG_FONT_10x18 is not set @@ -938,10 +998,7 @@ # # Logo configuration # -CONFIG_LOGO=y -# CONFIG_LOGO_LINUX_MONO is not set -# CONFIG_LOGO_LINUX_VGA16 is not set -CONFIG_LOGO_LINUX_CLUT224=y +# CONFIG_LOGO is not set CONFIG_BACKLIGHT_LCD_SUPPORT=y CONFIG_BACKLIGHT_CLASS_DEVICE=y CONFIG_BACKLIGHT_DEVICE=y @@ -957,9 +1014,14 @@ # Advanced Linux Sound Architecture # CONFIG_SND=m -# CONFIG_SND_SEQUENCER is not set -# CONFIG_SND_MIXER_OSS is not set -# CONFIG_SND_PCM_OSS is not set +CONFIG_SND_TIMER=m +CONFIG_SND_PCM=m +CONFIG_SND_SEQUENCER=m +# CONFIG_SND_SEQ_DUMMY is not set +CONFIG_SND_OSSEMUL=y +CONFIG_SND_MIXER_OSS=m +CONFIG_SND_PCM_OSS=m +# CONFIG_SND_SEQUENCER_OSS is not set # CONFIG_SND_DYNAMIC_MINORS is not set CONFIG_SND_SUPPORT_OLD_API=y # CONFIG_SND_VERBOSE_PRINTK is not set @@ -968,7 +1030,10 @@ # # Generic devices # +CONFIG_SND_AC97_CODEC=m +CONFIG_SND_AC97_BUS=m # CONFIG_SND_DUMMY is not set +# CONFIG_SND_VIRMIDI is not set # CONFIG_SND_MTPAV is not set # CONFIG_SND_SERIAL_U16550 is not set # CONFIG_SND_MPU401 is not set @@ -979,10 +1044,12 @@ # CONFIG_SND_A716 is not set # CONFIG_SND_H1910 is not set # CONFIG_SND_H2200 is not set -# CONFIG_SND_HTCMAGICIAN is not set +CONFIG_SND_HTCMAGICIAN=m # CONFIG_SND_HX4700 is not set # CONFIG_SND_H5XXX_AK4535 is not set -# CONFIG_SND_PXA2XX_AC97 is not set +CONFIG_SND_PXA2xx_I2SOUND=m +CONFIG_SND_PXA2XX_PCM=m +CONFIG_SND_PXA2XX_AC97=m # # USB devices @@ -990,9 +1057,19 @@ # CONFIG_SND_USB_AUDIO is not set # +# PCMCIA devices +# +CONFIG_SND_UDA1380=m + +# # Open Sound System # -# CONFIG_SOUND_PRIME is not set +CONFIG_SOUND_PRIME=m +# CONFIG_OBSOLETE_OSS_DRIVER is not set +# CONFIG_SOUND_MSNDCLAS is not set +# CONFIG_SOUND_MSNDPIN is not set +# CONFIG_SOUND_WM97XX is not set +# CONFIG_SOUND_TVMIXER is not set # # USB support @@ -1021,7 +1098,7 @@ # USB Device Class drivers # # CONFIG_OBSOLETE_OSS_USB_DRIVER is not set -CONFIG_USB_ACM=m +# CONFIG_USB_ACM is not set # CONFIG_USB_PRINTER is not set # @@ -1080,7 +1157,19 @@ # CONFIG_USB_KAWETH is not set # CONFIG_USB_PEGASUS is not set # CONFIG_USB_RTL8150 is not set -# CONFIG_USB_USBNET is not set +CONFIG_USB_USBNET=y +CONFIG_USB_NET_CDCETHER=y +# CONFIG_USB_NET_GL620A is not set +# CONFIG_USB_NET_NET1080 is not set +# CONFIG_USB_NET_PLUSB is not set +# CONFIG_USB_NET_RNDIS_HOST is not set +CONFIG_USB_NET_CDC_SUBSET=y +# CONFIG_USB_ALI_M5632 is not set +# CONFIG_USB_AN2720 is not set +# CONFIG_USB_BELKIN is not set +CONFIG_USB_ARMLINUX=y +# CONFIG_USB_EPSON2888 is not set +# CONFIG_USB_NET_ZAURUS is not set # CONFIG_USB_ZD1201 is not set # CONFIG_USB_MON is not set @@ -1091,7 +1180,37 @@ # # USB Serial Converter support # -# CONFIG_USB_SERIAL is not set +CONFIG_USB_SERIAL=y +# CONFIG_USB_SERIAL_CONSOLE is not set +CONFIG_USB_SERIAL_GENERIC=y +# CONFIG_USB_SERIAL_AIRPRIME is not set +# CONFIG_USB_SERIAL_ANYDATA is not set +# CONFIG_USB_SERIAL_BELKIN is not set +# CONFIG_USB_SERIAL_WHITEHEAT is not set +# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set +# CONFIG_USB_SERIAL_CP2101 is not set +# CONFIG_USB_SERIAL_CYPRESS_M8 is not set +# CONFIG_USB_SERIAL_EMPEG is not set +# CONFIG_USB_SERIAL_FTDI_SIO is not set +# CONFIG_USB_SERIAL_VISOR is not set +# CONFIG_USB_SERIAL_IPAQ is not set +# CONFIG_USB_SERIAL_IR is not set +# CONFIG_USB_SERIAL_EDGEPORT is not set +# CONFIG_USB_SERIAL_EDGEPORT_TI is not set +# CONFIG_USB_SERIAL_GARMIN is not set +# CONFIG_USB_SERIAL_IPW is not set +# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set +# CONFIG_USB_SERIAL_KEYSPAN is not set +# CONFIG_USB_SERIAL_KLSI is not set +# CONFIG_USB_SERIAL_KOBIL_SCT is not set +# CONFIG_USB_SERIAL_MCT_U232 is not set +# CONFIG_USB_SERIAL_PL2303 is not set +# CONFIG_USB_SERIAL_HP4X is not set +# CONFIG_USB_SERIAL_SAFE is not set +# CONFIG_USB_SERIAL_TI is not set +# CONFIG_USB_SERIAL_CYBERJACK is not set +# CONFIG_USB_SERIAL_XIRCOM is not set +# CONFIG_USB_SERIAL_OMNINET is not set # # USB Miscellaneous drivers @@ -1117,21 +1236,22 @@ # # USB Gadget Support # -CONFIG_USB_GADGET=m +CONFIG_USB_GADGET=y CONFIG_USB_GADGET_DEBUG_FILES=y CONFIG_USB_GADGET_SELECTED=y # CONFIG_USB_GADGET_NET2280 is not set -# CONFIG_USB_GADGET_PXA2XX is not set +CONFIG_USB_GADGET_PXA2XX=y +CONFIG_USB_PXA2XX=y +CONFIG_USB_PXA2XX_SMALL=y # CONFIG_USB_GADGET_PXA27X is not set # CONFIG_USB_GADGET_GOKU is not set # CONFIG_USB_GADGET_MQ11XX is not set # CONFIG_USB_GADGET_LH7A40X is not set # CONFIG_USB_GADGET_OMAP is not set -CONFIG_USB_GADGET_DUMMY_HCD=y -CONFIG_USB_DUMMY_HCD=m -CONFIG_USB_GADGET_DUALSPEED=y -CONFIG_USB_ZERO=m -CONFIG_USB_ETH=m +# CONFIG_USB_GADGET_DUMMY_HCD is not set +# CONFIG_USB_GADGET_DUALSPEED is not set +# CONFIG_USB_ZERO is not set +CONFIG_USB_ETH=y # CONFIG_USB_ETH_RNDIS is not set # CONFIG_USB_GADGETFS is not set # CONFIG_USB_FILE_STORAGE is not set @@ -1147,12 +1267,12 @@ CONFIG_MMC_PXA=y # CONFIG_MMC_TMIO is not set # CONFIG_MMC_SAMCOP is not set -# CONFIG_MMC_ASIC3 is not set +CONFIG_MMC_ASIC3=y # # LED devices # -# CONFIG_CLASS_LEDS is not set +CONFIG_CLASS_LEDS=y # # File systems @@ -1160,11 +1280,11 @@ CONFIG_EXT2_FS=y # CONFIG_EXT2_FS_XATTR is not set # CONFIG_EXT2_FS_XIP is not set -CONFIG_EXT3_FS=m +CONFIG_EXT3_FS=y CONFIG_EXT3_FS_XATTR=y # CONFIG_EXT3_FS_POSIX_ACL is not set # CONFIG_EXT3_FS_SECURITY is not set -CONFIG_JBD=m +CONFIG_JBD=y # CONFIG_JBD_DEBUG is not set CONFIG_FS_MBCACHE=y CONFIG_REISERFS_FS=m @@ -1195,9 +1315,9 @@ # # DOS/FAT/NT Filesystems # -CONFIG_FAT_FS=y -CONFIG_MSDOS_FS=y -CONFIG_VFAT_FS=y +CONFIG_FAT_FS=m +CONFIG_MSDOS_FS=m +CONFIG_VFAT_FS=m CONFIG_FAT_DEFAULT_CODEPAGE=437 CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" # CONFIG_NTFS_FS is not set diff -uNr -x Entries.Log -x Repository -x Tag -x Root -x Entries -x '*.mod' -x '*orig*' -x '*.c~' -x '*.h~' cleancvs/kernel26/arch/arm/mach-pxa/himalaya/Kconfig garage/kernel26/arch/arm/mach-pxa/himalaya/Kconfig --- cleancvs/kernel26/arch/arm/mach-pxa/himalaya/Kconfig 2005-06-28 21:54:06.000000000 +0200 +++ garage/kernel26/arch/arm/mach-pxa/himalaya/Kconfig 2006-07-19 19:12:09.000000000 +0200 @@ -16,25 +16,19 @@ config HIMALAYA_TS tristate "HTC Himalaya TouchScreen (TI TSC2200)" - depends on MACH_HIMALAYA && TSC2200 && INPUT && INPUT_TOUCHSCREEN && HIMALAYA_INPUT + depends on MACH_HIMALAYA && SOC_TSC2200 && INPUT && INPUT_TOUCHSCREEN && HIMALAYA_INPUT help Module to handle HTC Himalaya touch screen. "MACH_HIMALAYA", "TSC2200" and "INPUT_TOUCHSCREEN" need to be enabled. config HIMALAYA_KP tristate "HTC Himalaya Keypad (TI TSC2200, ASIC3)" - depends on HTC_ASIC3 && MACH_HIMALAYA && TSC2200 && INPUT && HIMALAYA_INPUT + depends on HTC_ASIC3 && MACH_HIMALAYA && SOC_TSC2200 && INPUT && HIMALAYA_INPUT help Module to handle HTC Himalaya buttons. "MACH_HIMALAYA", "TSC2200" and "HTC_ASIC3" to be enabled. -config TSC2200 - tristate "Texas Instruments TSC2200" - depends on MACH_HIMALAYA && PXA_SSP - help - Texas Instruments TSC2200 driver. - config HIMALAYA_LEDS tristate "HTC Himalaya LEDs" depends on HTC_ASIC3 && MACH_HIMALAYA diff -uNr -x Entries.Log -x Repository -x Tag -x Root -x Entries -x '*.mod' -x '*orig*' -x '*.c~' -x '*.h~' cleancvs/kernel26/arch/arm/mach-pxa/htcblueangel/acx_hw.h garage/kernel26/arch/arm/mach-pxa/htcblueangel/acx_hw.h --- cleancvs/kernel26/arch/arm/mach-pxa/htcblueangel/acx_hw.h 1970-01-01 01:00:00.000000000 +0100 +++ garage/kernel26/arch/arm/mach-pxa/htcblueangel/acx_hw.h 2006-07-23 19:36:07.000000000 +0200 @@ -0,0 +1,18 @@ +/* + * Interface for ACX slave memory driver + * + * Copyright (c) 2006 SDG Systems, LLC + * + * GPL + * + */ + +#ifndef _ACX_HW_H +#define _ACX_HW_H + +struct acx_hardware_data { + int (*start_hw)( void ); + int (*stop_hw)( void ); +}; + +#endif /* _ACX_HW_H */ diff -uNr -x Entries.Log -x Repository -x Tag -x Root -x Entries -x '*.mod' -x '*orig*' -x '*.c~' -x '*.h~' cleancvs/kernel26/arch/arm/mach-pxa/htcblueangel/blueangel_audio.c garage/kernel26/arch/arm/mach-pxa/htcblueangel/blueangel_audio.c --- cleancvs/kernel26/arch/arm/mach-pxa/htcblueangel/blueangel_audio.c 2006-06-16 00:57:45.000000000 +0200 +++ garage/kernel26/arch/arm/mach-pxa/htcblueangel/blueangel_audio.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,870 +0,0 @@ -/* - * LED interface for Himalaya, the HTC PocketPC. - * - * License: GPL - * - * Author: Luke Kenneth Casson Leighton, Copyright(C) 2004 - * - * Copyright(C) 2004, Luke Kenneth Casson Leighton. - * - * History: - * - * 2004-02-19 Luke Kenneth Casson Leighton created. - * - */ - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -static char *id="blueangel_audio"; -static snd_card_t *card; -struct ssp_dev audio_ssp_dev; - -struct i2c_client *uda1380; - -extern struct platform_device blueangel_asic3; - -#define MAX_BUFFER_SIZE 65536 -#define MAX_DMA_SIZE 4096 - -#define chip_t blueangel_audio_t - -#ifdef DEBUG -#define dprintk(x...) printk(x) -#else -#define dprintk(x...) -#endif - - - -typedef enum stream_id_t{ - PLAYBACK=0, - CAPTURE, - MAX_STREAMS, -}stream_id_t; - -typedef struct blueangel_audio_stream { - char *id; /* identification string */ - int stream_id; /* numeric identification */ - - int dma_ch; /* DMA channel used */ - volatile u32 *drcmr; /* reference the DMA DRCMRC register - for i2s tx or rx */ - - dma_addr_t buffer; /* buffer (physical address) */ - unsigned int buffer_size; /* buffer size */ - - pxa_dma_desc *dma_dring; /* DMA descriptors ring */ - char *dma_dring_store; /* storage space for DMA descriptors - ring (alignment issue) */ - dma_addr_t dma_dring_p; /* (physical address) */ - dma_addr_t dma_dring_store_p; - - unsigned int periods; /* periods */ - unsigned int dma_descriptors; /* DMA descriptors in ring */ - unsigned int dma_size; /* DMA transfer size */ - unsigned int dma_dpp; /* DMA descriptors per period */ - - volatile int dma_running; /* DMA running? */ - - snd_pcm_substream_t *stream; -}blueangel_audio_stream_t; - -typedef struct snd_card_blueangel_audio { - snd_card_t *card; - snd_pcm_t *pcm; - struct i2c_client *uda1380; - long samplerate; - blueangel_audio_stream_t *s[MAX_STREAMS]; - snd_info_entry_t *proc_entry; - int power_on[4]; - int playback_active; - int record_active; - int mic_power; - int spk_power; - struct pm_dev *pm_dev; -} blueangel_audio_t; - -static struct snd_card_blueangel_audio *blueangel_audio = NULL; - -static void blueangel_audio_set_power(blueangel_audio_t *card) -{ - int mic_power; - int spk_power; - mic_power=(card->power_on[2] && card->record_active) || card->power_on[3]; - spk_power=(card->power_on[0] && card->playback_active) || card->power_on[1]; - dprintk("blueangel_audio_set_power %d %d\n", mic_power, spk_power); - if (mic_power != card->mic_power) - ipaq_asic3_set_gpio_out_a(&blueangel_asic3.dev, GPIOA_MIC_PWR_ON, mic_power ? GPIOA_MIC_PWR_ON : 0); - if (spk_power != card->spk_power) - ipaq_asic3_set_gpio_out_b(&blueangel_asic3.dev, GPIOB_SPK_PWR_ON, spk_power ? GPIOB_SPK_PWR_ON : 0); - card->mic_power=mic_power; - card->spk_power=spk_power; -} - -#define AUDIO_RATE_DEFAULT 44100 - -static void blueangel_audio_set_samplerate(blueangel_audio_t *blueangel_audio, long val, int force) -{ - struct i2c_client *uda1380 = blueangel_audio->uda1380; - struct uda1380_cfg cfg; - int mute,div; - - if (val == blueangel_audio->samplerate && !force) - return; - - mute = snd_uda1380_mute(uda1380, 1); - - pxa_i2s_set_samplerate(val); - div=705600/val; - div-=1; - dprintk("val=%ld div=%d\n", val, div); - ssp_config(&audio_ssp_dev, - SSCR0_TI | SSCR0_ECS | SSCR0_DataSize(0x10), - SSCR1_TxTresh(8) | SSCR1_RxTresh(8), - 0, - div << 8 - ); - ssp_enable(&audio_ssp_dev); - if (val >= 48000) - cfg.pll = REG0_PLL_25TO50; - else if (val >= 44100) - cfg.pll = REG0_PLL_25TO50; - else if (val >= 22050) - cfg.pll = REG0_PLL_12TO25; - else if (val >= 16000) - cfg.pll = REG0_PLL_12TO25; - else - cfg.pll = REG0_PLL_6TO12; - - cfg.format = FMT_MSB; - cfg.fs=256; - cfg.use_pll=1; - - i2c_clients_command(uda1380->adapter, I2C_UDA1380_CONFIGURE, &cfg); - blueangel_audio->samplerate = val; - - snd_uda1380_mute(uda1380, mute); -} - -static void blueangel_audio_audio_init(blueangel_audio_t *blueangel_audio) -{ - unsigned long flags; - - /* Setup the uarts */ - pxa_i2s_init(); - - /* Blip the UDA1380 reset line */ - local_irq_save(flags); - /* uda1380_device_controls.set_codec_reset(1); */ - local_irq_restore(flags); - - /* Enable the audio power */ - /* uda1380_device_controls.set_codec_power(1); */ - - mdelay(1); - - local_irq_save(flags); - /* uda1380_device_controls.set_codec_reset(0); */ - local_irq_restore(flags); - - /* Wait for the UDA1380 to wake up */ - mdelay(1); - - dprintk("blueangel_audio_audio_init: uda1380=%p\n", blueangel_audio->uda1380); - if (blueangel_audio->uda1380) - dprintk("blueangel_audio_audio_init: uda1380->adapter=%p\n", blueangel_audio->uda1380->adapter); - if (blueangel_audio->uda1380 && blueangel_audio->uda1380->adapter) { - /* Initialize the UDA1380 internal state */ - i2c_clients_command(blueangel_audio->uda1380->adapter, - I2C_UDA1380_OPEN, 0); - - blueangel_audio_set_samplerate(blueangel_audio, blueangel_audio->samplerate, 1); - - snd_uda1380_mute(blueangel_audio->uda1380, 0); - } else { - dprintk("*** UDA1380 ERROR***\n"); - } -} - - - -static void audio_dma_setup_descriptors_ring(blueangel_audio_stream_t *s) -{ - int i, j; - unsigned int p_size, d_size, di; - dma_addr_t p, d_buf; - d_size = sizeof(pxa_dma_desc); - - /* how many dma descriptors? */ - s->dma_size = MAX_DMA_SIZE; - p_size = s->buffer_size / s->periods; /* period size */ - s->dma_dpp = (p_size - 1) / s->dma_size + 1; /* dma descriptors - per period */ - - /* allocate storage space for descriptors ring, - included 15 bytes extra for the alignment issue */ - s->dma_dring_store = dma_alloc_coherent(NULL, d_size * s->periods * s->dma_dpp + 15, - &s->dma_dring_store_p, GFP_KERNEL); - - /* setup the descriptors ring pointer, aligned on a 16 bytes boundary */ - s->dma_dring = ((dma_addr_t) s->dma_dring_store & 0xf) ? - (pxa_dma_desc *) (((dma_addr_t) s->dma_dring_store & ~0xf) + 16) : - (pxa_dma_desc *) s->dma_dring_store; - s->dma_dring_p = s->dma_dring_store_p + - (dma_addr_t) s->dma_dring - (dma_addr_t) s->dma_dring_store; - - /* fill the descriptors ring */ - di = 0; /* current descriptor index */ - p = s->buffer; /* p: current period (address in buffer) */ - d_buf = s->buffer; /* d_buf: address in buffer - for current dma descriptor */ - /* iterate over periods */ - for (i = 0; i < s->periods; i++, p += p_size) { - /* iterate over dma descriptors in a period */ - for (j = 0; j < s->dma_dpp; j++, di++, d_buf += s->dma_size) { - /* link to next descriptor */ - s->dma_dring[di].ddadr = s->dma_dring_p + (di + 1) * d_size; - if (s->stream_id == PLAYBACK) { - s->dma_dring[di].dsadr = d_buf; - s->dma_dring[di].dtadr = __PREG(SSDR_P1); - s->dma_dring[di].dcmd = DCMD_TXPCDR; - } - else { - s->dma_dring[di].dsadr = __PREG(SADR); - s->dma_dring[di].dtadr = d_buf; - s->dma_dring[di].dcmd = DCMD_RXPCDR; - } - s->dma_dring[di].dcmd |= - ((p + p_size - d_buf) >= s->dma_size) ? - s->dma_size : p + p_size - d_buf; /* transfer length */ - } - s->dma_dring[di - 1].dcmd |= DCMD_ENDIRQEN; /* period irq */ - } - s->dma_dring[di - 1].ddadr = s->dma_dring_p; /* close the ring */ -} - -static void audio_dma_free_descriptors_ring(blueangel_audio_stream_t *s) -{ - unsigned int d_size = sizeof(pxa_dma_desc); - if (s->dma_dring_store) { - dma_free_coherent(NULL, d_size * s->periods * s->dma_dpp + 15, - s->dma_dring_store, s->dma_dring_store_p); - s->dma_dring_store = NULL; - s->dma_dring = NULL; - s->dma_dring_store_p = 0; - s->dma_dring_p = 0; - } -} - -static void audio_dma_request(blueangel_audio_stream_t *s, - void (*audio_dma_irq)(int , void *, struct pt_regs *)) -{ - int err; - dprintk("audio_dma_request\n"); - err = pxa_request_dma(s->id, DMA_PRIO_LOW, audio_dma_irq, s); - if (err < 0) { - dprintk("panic: cannot allocate DMA for %s\n", s->id); - /* CHRI-TODO: handle this error condition gracefully */ - } - s->dma_ch = err; - - if (s->stream_id == CAPTURE) { - s->drcmr = &DRCMRRXSADR; - *(s->drcmr) = s->dma_ch | DRCMR_MAPVLD; - } - else { - s->drcmr = &DRCMRTXSSDR; - *(s->drcmr) = s->dma_ch | DRCMR_MAPVLD; - } -} - -static void audio_dma_free(blueangel_audio_stream_t *s) -{ - pxa_free_dma(s->dma_ch); -} - - -static u_int audio_get_dma_pos(blueangel_audio_stream_t *s) -{ - snd_pcm_substream_t * substream = s->stream; - snd_pcm_runtime_t *runtime = substream->runtime; - unsigned int offset_bytes; - unsigned int offset; - int ch = s->dma_ch; - u32 pos; - - if (s->stream_id == CAPTURE) - pos = DTADR(ch); - else - pos = DSADR(ch); - offset_bytes = pos - s->buffer; - offset = bytes_to_frames(runtime,offset_bytes); - - return offset; -} - -static void audio_stop_dma(blueangel_audio_stream_t *s) -{ - DCSR(s->dma_ch) = DCSR_STOPIRQEN; - - while (! (DCSR(s->dma_ch) & DCSR_STOPSTATE)) { - if (!in_interrupt()) - schedule(); - } - - s->dma_running = 0; -} - -static void audio_start_dma(blueangel_audio_stream_t *s, int restart) -{ - dprintk("audio_start_dma\n"); - /* kick the DMA */ - DDADR(s->dma_ch) = s->dma_dring_p; - DCSR(s->dma_ch) = DCSR_RUN; - s->dma_running = 1; -} - -static void audio_dma_irq(int chan, void *dev_id, struct pt_regs *regs) -{ - blueangel_audio_stream_t *s = (blueangel_audio_stream_t *) dev_id; - int ch = s->dma_ch; - u32 dcsr; - dprintk("audio_dma_irq\n"); - - dcsr = DCSR(ch); - DCSR(ch) = dcsr & ~DCSR_STOPIRQEN; - - if (dcsr & DCSR_BUSERR) { - dprintk("bus error\n"); - return ; - } - - if (dcsr & DCSR_ENDINTR) { - snd_pcm_period_elapsed(s->stream); - return; - } -} - -static int snd_card_blueangel_audio_pcm_trigger(stream_id_t stream_id, - snd_pcm_substream_t * substream, int cmd) -{ - blueangel_audio_t *chip = snd_pcm_substream_chip(substream); - dprintk("snd_card_blueangel_audio_pcm_trigger\n"); - - switch (cmd) { - case SNDRV_PCM_TRIGGER_START: - if (chip->s[PLAYBACK]->dma_running) { - audio_stop_dma(chip->s[PLAYBACK]); - } - if (chip->s[CAPTURE]->dma_running) { - audio_stop_dma(chip->s[CAPTURE]); - } - audio_start_dma(chip->s[stream_id],0); - break; - case SNDRV_PCM_TRIGGER_STOP: - audio_stop_dma(chip->s[stream_id]); - break; - default: - return -EINVAL; - break; - } - return 0; - -} - -static snd_pcm_hardware_t snd_blueangel_audio_capture = -{ - .info = (SNDRV_PCM_INFO_INTERLEAVED | - SNDRV_PCM_INFO_BLOCK_TRANSFER | - SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID), - .formats = SNDRV_PCM_FMTBIT_S16_LE, - .rates = (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 |\ - SNDRV_PCM_RATE_22050 | \ - SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 |\ - SNDRV_PCM_RATE_KNOT), - .rate_min = 8000, - .rate_max = 48000, - .channels_min = 2, - .channels_max = 2, - .buffer_bytes_max = MAX_BUFFER_SIZE, - .period_bytes_min = 4096, - .period_bytes_max = MAX_BUFFER_SIZE/2, - .periods_min = 2, - .periods_max = MAX_BUFFER_SIZE/4096, - .fifo_size = 16, -}; - -static snd_pcm_hardware_t snd_blueangel_audio_playback = -{ - .info = (SNDRV_PCM_INFO_INTERLEAVED | - SNDRV_PCM_INFO_BLOCK_TRANSFER | - SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID), - .formats = SNDRV_PCM_FMTBIT_S16_LE, - .rates = (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 |\ - SNDRV_PCM_RATE_22050 | \ - SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 |\ - SNDRV_PCM_RATE_KNOT), - .rate_min = 8000, - .rate_max = 48000, - .channels_min = 2, - .channels_max = 2, - .buffer_bytes_max = MAX_BUFFER_SIZE, - .period_bytes_min = 4096, - .period_bytes_max = MAX_BUFFER_SIZE/2, - .periods_min = 2, - .periods_max = MAX_BUFFER_SIZE/4096, - .fifo_size = 16, -}; - - -static unsigned int rates[] = { 8000, 16000, 22050, 44100, 48000 }; - -#define RATES sizeof(rates) / sizeof(rates[0]) - -static snd_pcm_hw_constraint_list_t hw_constraints_rates = { - .count = RATES, - .list = rates, - .mask = 0, -}; - -/* Constraint: buffer_size = period_size * periods - A better way to assure it specifying directly? */ -static unsigned int period_sizes[] = { 1024, 2048, 4096, 8192, 16384, 32768 }; -static unsigned int buffer_sizes[] = { 2048, 4096, 8192, 16384, 32768, 65536 }; -#define PERIOD_SIZES sizeof(period_sizes) / sizeof(period_sizes[0]) -#define BUFFER_SIZES sizeof(period_sizes) / sizeof(period_sizes[0]) - -static snd_pcm_hw_constraint_list_t hw_constraints_period_sizes = { - .count = PERIOD_SIZES, - .list = period_sizes, - .mask = 0 -}; - -static snd_pcm_hw_constraint_list_t hw_constraints_buffer_sizes = { - .count = BUFFER_SIZES, - .list = buffer_sizes, - .mask = 0 -}; - -static int snd_card_blueangel_audio_playback_open(snd_pcm_substream_t * substream) -{ - blueangel_audio_t *chip = snd_pcm_substream_chip(substream); - snd_pcm_runtime_t *runtime = substream->runtime; - int err; - - dprintk("snd_card_blueangel_audio_playback_open\n"); - - chip->s[PLAYBACK]->stream = substream; - - runtime->hw = snd_blueangel_audio_playback; - - snd_pcm_hw_constraint_list(runtime, 0, - SNDRV_PCM_HW_PARAM_PERIOD_BYTES, - &hw_constraints_period_sizes); - snd_pcm_hw_constraint_list(runtime, 0, - SNDRV_PCM_HW_PARAM_BUFFER_BYTES, - &hw_constraints_buffer_sizes); - - if ((err = snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, - &hw_constraints_rates)) < 0) - return err; - - chip->playback_active=1; - blueangel_audio_set_power(chip); - - return 0; -} - - -static int snd_card_blueangel_audio_playback_close(snd_pcm_substream_t * substream) -{ - blueangel_audio_t *chip = snd_pcm_substream_chip(substream); - - dprintk("snd_card_blueangel_audio_playback_close\n"); - - chip->s[PLAYBACK]->dma_running = 0; - chip->s[PLAYBACK]->stream = NULL; - - chip->playback_active=0; - blueangel_audio_set_power(chip); - - return 0; -} - -static int snd_card_blueangel_audio_playback_ioctl(snd_pcm_substream_t * substream, - unsigned int cmd, void *arg) -{ - dprintk("snd_card_blueangel_audio_playback_ioctl\n"); - - return snd_pcm_lib_ioctl(substream, cmd, arg); -} - -static int snd_card_blueangel_audio_playback_prepare(snd_pcm_substream_t * substream) -{ - blueangel_audio_t *chip = snd_pcm_substream_chip(substream); - snd_pcm_runtime_t *runtime = substream->runtime; - - dprintk("snd_card_blueangel_audio_playback_prepare\n"); - /* set requested samplerate */ - blueangel_audio_set_samplerate(chip, runtime->rate, 0); - chip->samplerate = runtime->rate; - - return 0; -} - -static int snd_card_blueangel_audio_playback_trigger(snd_pcm_substream_t * substream, int cmd) -{ - dprintk("snd_card_blueangel_audio_playback_trigger\n"); - return snd_card_blueangel_audio_pcm_trigger(PLAYBACK, substream, cmd); -} - -static snd_pcm_uframes_t snd_card_blueangel_audio_playback_pointer(snd_pcm_substream_t * substream) -{ - blueangel_audio_t *chip = snd_pcm_substream_chip(substream); - snd_pcm_uframes_t pos; - - dprintk("snd_card_blueangel_audio_playback_pointer\n"); - pos = audio_get_dma_pos(chip->s[PLAYBACK]); - return pos; -} - -static int snd_card_blueangel_audio_capture_open(snd_pcm_substream_t * substream) -{ - blueangel_audio_t *chip = snd_pcm_substream_chip(substream); - snd_pcm_runtime_t *runtime = substream->runtime; - int err; - - chip->s[CAPTURE]->stream = substream; - - runtime->hw = snd_blueangel_audio_capture; - - snd_pcm_hw_constraint_list(runtime, 0, - SNDRV_PCM_HW_PARAM_PERIOD_BYTES, - &hw_constraints_period_sizes); - snd_pcm_hw_constraint_list(runtime, 0, - SNDRV_PCM_HW_PARAM_BUFFER_BYTES, - &hw_constraints_buffer_sizes); - - if ((err = snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, - &hw_constraints_rates)) < 0) - return err; - - /* uda1380_device_controls.set_mic_power(1); */ - return 0; -} - - -static int snd_card_blueangel_audio_capture_close(snd_pcm_substream_t * substream) -{ - blueangel_audio_t *chip = snd_pcm_substream_chip(substream); - - chip->s[CAPTURE]->dma_running = 0; - chip->s[CAPTURE]->stream = NULL; - - /* uda1380_device_controls.set_mic_power(0); */ - - dprintk("%s: capture closed\n", __FUNCTION__); - - return 0; -} - -static int snd_card_blueangel_audio_capture_ioctl(snd_pcm_substream_t * substream, - unsigned int cmd, void *arg) -{ - return snd_pcm_lib_ioctl(substream, cmd, arg); -} - -static int snd_card_blueangel_audio_capture_prepare(snd_pcm_substream_t * substream) -{ - blueangel_audio_t *chip = snd_pcm_substream_chip(substream); - snd_pcm_runtime_t *runtime = substream->runtime; - - /* set requested samplerate */ - blueangel_audio_set_samplerate(chip, runtime->rate, 0); - chip->samplerate = runtime->rate; - - return 0; -} - -static int snd_card_blueangel_audio_capture_trigger(snd_pcm_substream_t * substream, int cmd) -{ - return snd_card_blueangel_audio_pcm_trigger(CAPTURE, substream, cmd); -} - -static snd_pcm_uframes_t snd_card_blueangel_audio_capture_pointer(snd_pcm_substream_t * substream) -{ - blueangel_audio_t *chip = snd_pcm_substream_chip(substream); - snd_pcm_uframes_t pos; - - pos = audio_get_dma_pos(chip->s[CAPTURE]); - return pos; -} - -static int snd_blueangel_audio_hw_params(snd_pcm_substream_t * substream, - snd_pcm_hw_params_t * hw_params) -{ - blueangel_audio_t *chip = snd_pcm_substream_chip(substream); - - int err; - - dprintk("snd_blueangel_audio_hw_params\n"); - /* allocate the buffer */ - err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); - if (err<0) - dprintk("snd_pcm_lib_malloc_pages failed!\n"); - - /* setup the dma descriptors ring, that refers the buffer; - release the old one before in case, since hw_params - may be called more than one time*/ - if (chip->s[PLAYBACK]->stream == substream) { - if (chip->s[PLAYBACK]->dma_dring) - audio_dma_free_descriptors_ring(chip->s[PLAYBACK]); - chip->s[PLAYBACK]->buffer = substream->runtime->dma_addr; - chip->s[PLAYBACK]->buffer_size = params_buffer_bytes(hw_params); - chip->s[PLAYBACK]->periods = params_periods(hw_params); - audio_dma_setup_descriptors_ring(chip->s[PLAYBACK]); - } - else { - if (chip->s[CAPTURE]->dma_dring) - audio_dma_free_descriptors_ring(chip->s[CAPTURE]); - chip->s[CAPTURE]->buffer = substream->runtime->dma_addr; - chip->s[CAPTURE]->buffer_size = params_buffer_bytes(hw_params); - chip->s[CAPTURE]->periods = params_periods(hw_params); - audio_dma_setup_descriptors_ring(chip->s[CAPTURE]); - } - - return err; -} - -static int snd_blueangel_audio_hw_free(snd_pcm_substream_t * substream) -{ - blueangel_audio_t *chip = snd_pcm_substream_chip(substream); - dprintk("snd_blueangel_audio_hw_free\n"); - - /* free the dma descriptors ring */ - if (chip->s[PLAYBACK]->stream == substream) { - audio_dma_free_descriptors_ring(chip->s[PLAYBACK]); - } - else { - audio_dma_free_descriptors_ring(chip->s[CAPTURE]); - } - - return snd_pcm_lib_free_pages(substream); -} - -static snd_pcm_ops_t snd_card_blueangel_audio_playback_ops = { - .open = snd_card_blueangel_audio_playback_open, - .close = snd_card_blueangel_audio_playback_close, - .ioctl = snd_card_blueangel_audio_playback_ioctl, - .hw_params = snd_blueangel_audio_hw_params, - .hw_free = snd_blueangel_audio_hw_free, - .prepare = snd_card_blueangel_audio_playback_prepare, - .trigger = snd_card_blueangel_audio_playback_trigger, - .pointer = snd_card_blueangel_audio_playback_pointer, -}; - -static snd_pcm_ops_t snd_card_blueangel_audio_capture_ops = { - .open = snd_card_blueangel_audio_capture_open, - .close = snd_card_blueangel_audio_capture_close, - .ioctl = snd_card_blueangel_audio_capture_ioctl, - .hw_params = snd_blueangel_audio_hw_params, - .hw_free = snd_blueangel_audio_hw_free, - .prepare = snd_card_blueangel_audio_capture_prepare, - .trigger = snd_card_blueangel_audio_capture_trigger, - .pointer = snd_card_blueangel_audio_capture_pointer, -}; - - -static int __init snd_card_blueangel_audio_pcm(blueangel_audio_t *blueangel_audio, int device, int substreams) -{ - - int err; - - blueangel_audio->samplerate = AUDIO_RATE_DEFAULT; - - if ((err = snd_pcm_new(blueangel_audio->card, "UDA1380 PCM", device, - substreams, substreams, &(blueangel_audio->pcm))) < 0) - return err; - - err = snd_pcm_lib_preallocate_pages_for_all(blueangel_audio->pcm ,SNDRV_DMA_TYPE_DEV , NULL, MAX_BUFFER_SIZE, MAX_BUFFER_SIZE); - if (err < 0) - dprintk("buffer preallocation failed with code %d\n", err); - - snd_pcm_set_ops(blueangel_audio->pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_card_blueangel_audio_playback_ops); - snd_pcm_set_ops(blueangel_audio->pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_card_blueangel_audio_capture_ops); - blueangel_audio->pcm->private_data = blueangel_audio; - blueangel_audio->pcm->info_flags = 0; - strcpy(blueangel_audio->pcm->name, "UDA1380 PCM"); - - blueangel_audio->s[PLAYBACK] = kcalloc(1,sizeof(blueangel_audio_stream_t), GFP_KERNEL); - blueangel_audio->s[CAPTURE] = kcalloc(1,sizeof(blueangel_audio_stream_t), GFP_KERNEL); - - blueangel_audio_audio_init(blueangel_audio); - - /* setup nameing */ - blueangel_audio->s[PLAYBACK]->id = "UDA1380 PLAYBACK"; - blueangel_audio->s[CAPTURE]->id = "UDA1380 CAPTURE"; - - blueangel_audio->s[PLAYBACK]->stream_id = PLAYBACK; - blueangel_audio->s[CAPTURE]->stream_id = CAPTURE; - - /* setup DMA controller */ - audio_dma_request(blueangel_audio->s[PLAYBACK], audio_dma_irq); - audio_dma_request(blueangel_audio->s[CAPTURE], audio_dma_irq); - - blueangel_audio->s[PLAYBACK]->dma_running = 0; - blueangel_audio->s[CAPTURE]->dma_running = 0; - - /* descriptors ring */ - blueangel_audio->s[PLAYBACK]->dma_dring = NULL; - blueangel_audio->s[PLAYBACK]->dma_dring_p = 0; - blueangel_audio->s[PLAYBACK]->dma_dring_store = NULL; - blueangel_audio->s[CAPTURE]->dma_dring = NULL; - blueangel_audio->s[CAPTURE]->dma_dring_p = 0; - blueangel_audio->s[CAPTURE]->dma_dring_store = NULL; - - return 0; -} - -void snd_blueangel_audio_free(snd_card_t *card) -{ - blueangel_audio_t *chip = card->private_data; - - if (! chip) - return; - - if (chip->s[PLAYBACK] && chip->s[CAPTURE]) { - chip->s[PLAYBACK]->drcmr = 0; - chip->s[CAPTURE]->drcmr = 0; - - audio_dma_free(chip->s[PLAYBACK]); - audio_dma_free(chip->s[CAPTURE]); - - kfree(chip->s[PLAYBACK]); - kfree(chip->s[CAPTURE]); - - chip->s[PLAYBACK] = NULL; - chip->s[CAPTURE] = NULL; - } - - kfree(chip); - card->private_data = NULL; -} - -static void -blueangel_audio_power_callback(int item, int on, void *data) -{ - blueangel_audio_t *chip = data; - - chip->power_on[item]=on; - blueangel_audio_set_power(chip); -} - -int -blueangel_audio_pm(struct pm_dev *dev, pm_request_t rqst, void *data) -{ - printk("blueangel_audio_pm\n"); - return 0; -} - -static int blueangel_audio_init (void) -{ - int err; - - card = snd_card_new(-1, id, THIS_MODULE, 0); - if (card == NULL) - return -ENOMEM; - - blueangel_audio = kcalloc(1,sizeof(*blueangel_audio), GFP_KERNEL); - if (blueangel_audio == NULL) { - err = -ENOMEM; - goto nodev; - } - - card->private_data = (void *)blueangel_audio; - card->private_free = snd_blueangel_audio_free; - - blueangel_audio->card = card; - - request_module("i2c-pxa"); - request_module("snd-uda1380"); - - asic3_set_clock_cdex (&blueangel_asic3.dev, CLOCK_CDEX_CONTROL_CX, CLOCK_CDEX_CONTROL_CX); - GPDR(GPIO23_SCLK) |= GPIO_bit(GPIO23_SCLK); - GPDR(GPIO24_SFRM) |= GPIO_bit(GPIO24_SFRM); - GPDR(GPIO25_STXD) |= GPIO_bit(GPIO25_STXD); - pxa_gpio_mode(GPIO23_SCLK_MD); - pxa_gpio_mode(GPIO24_SFRM_MD); - pxa_gpio_mode(GPIO25_STXD_MD); - ssp_init(&audio_ssp_dev, 1, NULL ); - - - - snd_uda1380_register_power_callback(blueangel_audio_power_callback, blueangel_audio); - dprintk("snd_uda1380_activate\n"); - snd_uda1380_activate(); - uda1380=uda1380_get_i2c_client(); - dprintk("uda1380=%p\n", uda1380); - - snd_uda1380_mute(uda1380, 0); - asic3_set_clock_cdex (&blueangel_asic3.dev, CLOCK_CDEX_CONTROL_CX, CLOCK_CDEX_CONTROL_CX); - blueangel_audio->uda1380 = uda1380_get_i2c_client(); - dprintk("snd_uda1380_mixer_create\n"); - snd_uda1380_mixer_create(card); - if (! blueangel_audio->uda1380 || ! blueangel_audio->uda1380->adapter) { - dprintk("uda1380_get_i2c_client failed %p\n", blueangel_audio->uda1380); - if (blueangel_audio->uda1380) - dprintk("adapter=%p\n", blueangel_audio->uda1380->adapter); - } else { - if ((err = snd_card_blueangel_audio_pcm(blueangel_audio, 0, 2)) < 0) { - dprintk("snd_chip_uda1380_pcm failed\n"); - goto nodev; - } - } - blueangel_audio->pm_dev=pm_register(PM_SYS_DEV, PM_SYS_UNKNOWN, blueangel_audio_pm); - - dprintk("client=%p\n",uda1380_get_i2c_client()); - strcpy(card->driver, "UDA1380"); - strcpy(card->shortname, "UDA1380"); - sprintf(card->longname, "PXA + Philips UDA1380 driver"); - if ((err = snd_card_register(card)) == 0) { - dprintk("Audio support initialized\n"); - dprintk("client2=%p\n",uda1380_get_i2c_client()); - return 0; - } -nodev: - snd_card_free(card); - return err; -} - -static void blueangel_audio_exit (void) -{ - pm_unregister(blueangel_audio->pm_dev); - ssp_disable(&audio_ssp_dev); - ssp_exit(&audio_ssp_dev); - - snd_uda1380_mixer_free(); - snd_uda1380_deactivate(); - snd_card_free(card); -} - -module_init (blueangel_audio_init); -module_exit (blueangel_audio_exit); - diff -uNr -x Entries.Log -x Repository -x Tag -x Root -x Entries -x '*.mod' -x '*orig*' -x '*.c~' -x '*.h~' cleancvs/kernel26/arch/arm/mach-pxa/htcblueangel/blueangel_battery.c garage/kernel26/arch/arm/mach-pxa/htcblueangel/blueangel_battery.c --- cleancvs/kernel26/arch/arm/mach-pxa/htcblueangel/blueangel_battery.c 2006-06-16 00:57:45.000000000 +0200 +++ garage/kernel26/arch/arm/mach-pxa/htcblueangel/blueangel_battery.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,218 +0,0 @@ -/* -* Driver interface to the battery on the HTC Himalaya -* -* Use consistent with the GNU GPL is permitted, -* provided that this copyright notice is -* preserved in its entirety in all copies and derived works. -* -*/ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include "../himalaya/tsc2200.h" -//#include "../himalaya/pxa_nssp.h" - -#ifdef DEBUG -#define dprintk(x...) printk(x) -#else -#define dprintk(x...) -#endif - -extern struct platform_device blueangel_asic3; - -static void bat_tsc2200_start_conv_scan(void) -{ - tsc2200_write(TSC2200_CTRLREG_REF, 31); - tsc2200_write(TSC2200_CTRLREG_ADC, - TSC2200_CTRLREG_ADC_AD3 | - TSC2200_CTRLREG_ADC_AD1 | - TSC2200_CTRLREG_ADC_AD0 | - TSC2200_CTRLREG_ADC_RES (TSC2200_CTRLREG_ADC_RES_12BITP) | - TSC2200_CTRLREG_ADC_AVG (TSC2200_CTRLREG_ADC_8AVG) | - TSC2200_CTRLREG_ADC_CL (TSC2200_CTRLREG_ADC_CL_2MHZ_12BIT) | - TSC2200_CTRLREG_ADC_PV (TSC2200_CTRLREG_ADC_PV_500uS) ); -} - -static void bat_tsc2200_start_conv_temp(void) -{ - tsc2200_write(TSC2200_CTRLREG_REF, 31); - tsc2200_write(TSC2200_CTRLREG_ADC, - TSC2200_CTRLREG_ADC_AD3 | - TSC2200_CTRLREG_ADC_AD1 | - TSC2200_CTRLREG_ADC_RES (TSC2200_CTRLREG_ADC_RES_12BITP) | - TSC2200_CTRLREG_ADC_AVG (TSC2200_CTRLREG_ADC_8AVG) | - TSC2200_CTRLREG_ADC_CL (TSC2200_CTRLREG_ADC_CL_2MHZ_12BIT) | - TSC2200_CTRLREG_ADC_PV (TSC2200_CTRLREG_ADC_PV_500uS) ); -} - -static void bat_tsc2200_stop_conv(void) -{ - tsc2200_write(TSC2200_CTRLREG_ADC, - TSC2200_CTRLREG_ADC_STS | - TSC2200_CTRLREG_ADC_AD0 | - TSC2200_CTRLREG_ADC_RES (TSC2200_CTRLREG_ADC_RES_12BITP) | - TSC2200_CTRLREG_ADC_AVG (TSC2200_CTRLREG_ADC_8AVG) | - TSC2200_CTRLREG_ADC_CL (TSC2200_CTRLREG_ADC_CL_2MHZ_12BIT) | - TSC2200_CTRLREG_ADC_PV (TSC2200_CTRLREG_ADC_PV_500uS) ); -} - -static int himalaya_battery_get_status(struct battery *bat) -{ - dprintk("%s: in.\n", __FUNCTION__); - - if ( GPLR(63) & GPIO_bit(63) ) { - return BATTERY_STATUS_CHARGING; - } else { - return BATTERY_STATUS_NOT_CHARGING; - } -} - -static int himalaya_battery_get_voltage(struct battery *bat) -{ - int retval; - - dprintk("%s: in.\n", __FUNCTION__); - - down_interruptible(&tsc2200_sem); - bat_tsc2200_start_conv_scan(); - - while ( !(tsc2200_read(TSC2200_CTRLREG_ADC) & 0x4000) && - !tsc2200_dav()) { - dprintk("B2: %X\n", tsc2200_read(TSC2200_CTRLREG_ADC)); - mdelay(1); - } - - retval = tsc2200_read(TSC2200_DATAREG_AUX2); - dprintk("%s: BAT1: %X\nBAT2: %x\nAUX1: %x\nAUX2: %x\nTEMP1: %x\nTEMP2: %x\n", __FUNCTION__, tsc2200_read(TSC2200_DATAREG_BAT1), tsc2200_read(TSC2200_DATAREG_BAT2), tsc2200_read(TSC2200_DATAREG_AUX1), tsc2200_read(TSC2200_DATAREG_AUX2), tsc2200_read(TSC2200_DATAREG_TEMP1), tsc2200_read(TSC2200_DATAREG_TEMP2)); - - bat_tsc2200_stop_conv(); - up(&tsc2200_sem); - return retval; -} - -static int himalaya_battery_get_temp(struct battery *bat) -{ - int retval; - - dprintk("%s: in.\n", __FUNCTION__); - - down_interruptible(&tsc2200_sem); - bat_tsc2200_start_conv_temp(); - - while ( !(tsc2200_read(TSC2200_CTRLREG_ADC) & 0x4000) && - !tsc2200_dav()) { - dprintk("1: %X\n", tsc2200_read(TSC2200_CTRLREG_ADC)); - mdelay(1); - } - - retval = tsc2200_read(TSC2200_DATAREG_TEMP1); - dprintk("retval=0x%x\n", retval); - - dprintk("%s: BAT1: %03X\nBAT2: %03x\nAUX1: %03x\nAUX2: %03x\nTEMP1: %03x\nTEMP2: %03x\n", __FUNCTION__, tsc2200_read(TSC2200_DATAREG_BAT1), tsc2200_read(TSC2200_DATAREG_BAT2), tsc2200_read(TSC2200_DATAREG_AUX1), tsc2200_read(TSC2200_DATAREG_AUX2), tsc2200_read(TSC2200_DATAREG_TEMP1), tsc2200_read(TSC2200_DATAREG_TEMP2)); - bat_tsc2200_stop_conv(); - up(&tsc2200_sem); - dprintk("%s: out\n", __FUNCTION__); - return retval; -} - -struct battery battery_dev = { - .name = "main battery", - .id = "battery0", - .get_voltage = himalaya_battery_get_voltage, - .get_status = himalaya_battery_get_status, - .get_temp = himalaya_battery_get_temp, -}; - -#if 0 -static struct device bat_tsc2200_dev = { - .parent = &nssp_bus, - .bus = &nssp_bus_type, - .bus_id = "bat_tsc2200", -}; -#endif - -static void -blueangel_battery_get_power_status (struct apm_power_info *info) -{ - int val; - int full=0x8a3; - int empty=0x8c3; - - val=himalaya_battery_get_voltage(NULL); - - info->battery_life = (val-empty)*100/(full-empty); - if (info->battery_life < 0 || info->battery_life > 100) - printk("battery voltage (0x%x) not within [0x%x,0x%x]. Please report.\n", val, full, empty); - if (info->battery_life < 0) - info->battery_life = 0; - if (info->battery_life > 100) - info->battery_life = 100; - info->ac_line_status = APM_AC_OFFLINE; - if (!(ipaq_asic3_read_gpio_status_d(&blueangel_asic3.dev) & GPIOD_AC_CHARGER_N)) { - info->ac_line_status = APM_AC_ONLINE; - } - if (!(GPLR(GPIO_NR_BLUEANGEL_USB_DETECT_N) & GPIO_bit(GPIO_NR_BLUEANGEL_USB_DETECT_N))) { - info->ac_line_status = APM_AC_ONLINE; - } - info->units=APM_UNITS_MINS; - info->time = 360 * info->battery_life/100; /* time remaining */ - info->battery_flag = 0; - if (info->ac_line_status == APM_AC_OFFLINE) { - info->battery_status = APM_BATTERY_STATUS_CRITICAL; - if(info->battery_life > 5) { - info->battery_status = APM_BATTERY_STATUS_LOW; - } - if(info->battery_life > 20) { - info->battery_status = APM_BATTERY_STATUS_HIGH; - } - } else { - info->battery_status = APM_BATTERY_STATUS_CHARGING; - } -} - -static int bat_setup(void) -{ -#if 0 - device_register(&bat_tsc2200_dev); -#endif - battery_class_register(&battery_dev); - - return 0; -} - -static int __init bat_init(void) -{ - bat_setup(); - himalaya_battery_get_voltage(NULL); - himalaya_battery_get_temp(NULL); - apm_get_power_status = blueangel_battery_get_power_status; - - return 0; -} - -static void __exit bat_exit(void) -{ - apm_get_power_status = NULL; - battery_class_unregister(&battery_dev); -#if 0 - device_unregister(&bat_tsc2200_dev); -#endif -} - -module_init(bat_init) -module_exit(bat_exit) - -MODULE_AUTHOR("Matthias Burghardt"); -MODULE_DESCRIPTION("Battery (TI TSC2200) support for the HTC Himalaya"); -MODULE_LICENSE("GPL"); diff -uNr -x Entries.Log -x Repository -x Tag -x Root -x Entries -x '*.mod' -x '*orig*' -x '*.c~' -x '*.h~' cleancvs/kernel26/arch/arm/mach-pxa/htcblueangel/blueangel.c garage/kernel26/arch/arm/mach-pxa/htcblueangel/blueangel.c --- cleancvs/kernel26/arch/arm/mach-pxa/htcblueangel/blueangel.c 2006-06-29 21:40:28.000000000 +0200 +++ garage/kernel26/arch/arm/mach-pxa/htcblueangel/blueangel.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,407 +0,0 @@ -/* - * Hardware definitions for HTC Blueangel - * - * Copyright 2004 Xanadux.org - * - * Use consistent with the GNU GPL is permitted, - * provided that this copyright notice is - * preserved in its entirety in all copies and derived works. - * - * Authors: w4xy@xanadux.org - * - * History: - * - * 2004-02-07 W4XY Initial port heavily based on h1900.c - * - */ -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include - -#include "../generic.h" - -#include -#include -#include -#include -#include "../drivers/serial/pxa-serial.h" - - -struct ipaq_model_ops ipaq_model_ops; -EXPORT_SYMBOL(ipaq_model_ops); - -extern struct platform_device blueangel_asic3; -struct platform_pxa_serial_funcs pxa_serial_funcs [] = { - {}, /* No special FFUART options */ - {}, /* No special BTUART options */ - {}, /* No special STUART options */ - {}, /* No special HWUART options */ -}; - -static struct ipaq_model_ops blueangel_model_ops __initdata = { - .generic_name = "blueangel", -}; - -static void __init blueangel_init_irq( void ) -{ - /* Initialize standard IRQs */ - pxa_init_irq(); -} - -static void ser_stuart_gpio_config(struct uart_pxa_port *up, int enable) -{ - printk("ser_stuart_gpio_config %d\n", enable); - STISR=0; -} - -static void ser_hwuart_gpio_config(struct uart_pxa_port *up, int enable) -{ - printk("ser_hwuart_gpio_config %d\n", enable); - if (enable) { - GPDR(GPIO42_HWRXD) &= ~(GPIO_bit(GPIO42_HWRXD)); - GPDR(GPIO43_HWTXD) |= GPIO_bit(GPIO43_HWTXD); - GPDR(GPIO44_HWCTS) &= ~(GPIO_bit(GPIO44_HWCTS)); - GPDR(GPIO45_HWRTS) |= GPIO_bit(GPIO45_HWRTS); - pxa_gpio_mode(GPIO42_HWRXD_MD); - pxa_gpio_mode(GPIO43_HWTXD_MD); - pxa_gpio_mode(GPIO44_HWCTS_MD); - pxa_gpio_mode(GPIO45_HWRTS_MD); - ipaq_asic3_set_gpio_dir_a(&blueangel_asic3.dev, GPIOA_BT_PWR1_ON, GPIOA_BT_PWR1_ON); - ipaq_asic3_set_gpio_out_a(&blueangel_asic3.dev, GPIOA_BT_PWR1_ON, GPIOA_BT_PWR1_ON); - ipaq_asic3_set_gpio_dir_b(&blueangel_asic3.dev, GPIOB_BT_PWR2_ON, GPIOB_BT_PWR2_ON); - ipaq_asic3_set_gpio_out_b(&blueangel_asic3.dev, GPIOB_BT_PWR2_ON, GPIOB_BT_PWR2_ON); - } else { - ipaq_asic3_set_gpio_out_a(&blueangel_asic3.dev, GPIOA_BT_PWR1_ON, 0); - ipaq_asic3_set_gpio_out_b(&blueangel_asic3.dev, GPIOB_BT_PWR2_ON, 0); - } -} - -int blueangel_boardid; -EXPORT_SYMBOL(blueangel_boardid); - -static void -blueangel_get_boardid(void) -{ - int i; - - int save_gpdr=GPDR(GPIO_NR_BLUEANGEL_BOARDID3); - GPDR(GPIO_NR_BLUEANGEL_BOARDID3) &= ~(GPIO_bit(GPIO_NR_BLUEANGEL_BOARDID3)); - for (i = 0 ; i < 1000; i++); - blueangel_boardid=0; - if (GPLR(GPIO_NR_BLUEANGEL_BOARDID0) & GPIO_bit(GPIO_NR_BLUEANGEL_BOARDID0)) - blueangel_boardid |= 1; - if (GPLR(GPIO_NR_BLUEANGEL_BOARDID1) & GPIO_bit(GPIO_NR_BLUEANGEL_BOARDID1)) - blueangel_boardid |= 2; - if (GPLR(GPIO_NR_BLUEANGEL_BOARDID2) & GPIO_bit(GPIO_NR_BLUEANGEL_BOARDID2)) - blueangel_boardid |= 4; - if (GPLR(GPIO_NR_BLUEANGEL_BOARDID3) & GPIO_bit(GPIO_NR_BLUEANGEL_BOARDID3)) - blueangel_boardid |= 8; - GPDR(GPIO_NR_BLUEANGEL_BOARDID3)=save_gpdr; - printk("Blue Angel Board ID 0x%x\n", blueangel_boardid); - system_rev=blueangel_boardid; -} - -/* - * Common map_io initialization - */ -static void __init blueangel_map_io(void) -{ - int i; - - pxa_map_io(); - blueangel_get_boardid(); - -#if 0 - PGSR0 = GPSRx_SleepValue; - PGSR1 = GPSRy_SleepValue; - PGSR2 = GPSRz_SleepValue; -#endif - - STISR=0; /* Disable UART mode of STUART */ - printk("CKEN=0x%x CKEN11_USB=0x%x\n", CKEN, CKEN11_USB); - pxa_set_cken(CKEN11_USB, 1); - printk("CKEN=0x%x\n", CKEN); -#if 0 - - GAFR0_L = 0x98000000; - GAFR0_U = 0x494A8110; - GAFR1_L = 0x699A8159; - GAFR1_U = 0x0005AAAA; - GAFR2_L = 0xA0000000; - GAFR2_U = 0x00000002; - - /* don't do these for now because one of them turns the screen to mush */ - /* reason: the ATI chip gets reset / LCD gets disconnected: - * a fade-to-white means that the ati 3200 registers are set incorrectly */ - GPCR0 = 0xFF00FFFF; - GPCR1 = 0xFFFFFFFF; - GPCR2 = 0xFFFFFFFF; - - GPSR0 = 0x444F88EF; - GPSR1 = 0x57BF7306; - GPSR2 = 0x03FFE008; - PGSR0 = 0x40DF88EF; - PGSR1 = 0x53BF7206; - PGSR2 = 0x03FFE000; - GPDR0 = 0xD7E9A042; - GPDR1 = 0xFCFFABA3; - GPDR2 = 0x000FEFFE; - GPSR0 = 0x444F88EF; - GPSR1 = 0xD7BF7306; - GPSR2 = 0x03FFE008; - GRER0 = 0x00000000; - GRER1 = 0x00000000; - GRER2 = 0x00000000; - GFER0 = 0x00000000; - GFER1 = 0x00000000; - GFER2 = 0x00000000; -#endif - - - pxa_serial_funcs[2].configure = ser_stuart_gpio_config; - pxa_serial_funcs[3].configure = ser_hwuart_gpio_config; - stuart_device.dev.platform_data = &pxa_serial_funcs[2]; - hwuart_device.dev.platform_data = &pxa_serial_funcs[3]; - - /* disable all ongoing DMA */ - for(i = 0; i < 16; i++) DCSR(i) = 7; - -#if 0 - /* Add wakeup on AC plug/unplug (and resume button) */ - PWER = PWER_RTC | PWER_GPIO4 | PWER_GPIO0; - PFER = PWER_RTC | PWER_GPIO4 | PWER_GPIO0; - PRER = PWER_GPIO4 | PWER_GPIO0; - PCFR = PCFR_OPDE; -#endif - - ipaq_model_ops = blueangel_model_ops; -} - -/* - * the ASIC3 should really only be referenced via the asic3_base - * module. it contains functions something like asic3_gpio_b_out() - * which should really be used rather than macros. - */ - -static struct asic3_platform_data asic3_platform_data_6 = { - .gpio_a = { - .dir = 0xbffd, - .init = 0x0110, - .sleep_out = 0x0010, - .batt_fault_out = 0x0010, - .sleep_mask = 0xffff, - .sleep_conf = 0x0008, - .alt_function = 0x9800, /* Caution: need to be set to a correct value */ - }, - .gpio_b = { - .dir = 0xfffc, - .init = 0x48f8, - .sleep_out = 0x0000, - .batt_fault_out = 0x0000, - .sleep_mask = 0xffff, - .sleep_conf = 0x000c, - .alt_function = 0x0000, /* Caution: need to be set to a correct value */ - }, - .gpio_c = { - .dir = 0xfff7, - .init = 0xc344, - .sleep_out = 0x04c4, - .batt_fault_out = 0x0484, - .sleep_mask = 0xffff, - .sleep_conf = 0x000c, - .alt_function = 0x003b, /* Caution: need to be set to a correct value */ - }, - .gpio_d = { - .dir = 0x0040, - .init = 0x3e1b, - .sleep_out = 0x3e1b, - .batt_fault_out = 0x3e1b, - .sleep_mask = 0x0000, - .sleep_conf = 0x000c, - .alt_function = 0x0000, /* Caution: need to be set to a correct value */ - }, - .bus_shift=1, -}; - -static struct asic3_platform_data asic3_platform_data_o = { - .gpio_a = { - .dir = 0xbffd, - .init = 0x0110, - .sleep_out = 0x0010, - .batt_fault_out = 0x0010, - .sleep_mask = 0xffff, - .sleep_conf = 0x0008, - .alt_function = 0x9800, /* Caution: need to be set to a correct value */ - }, - .gpio_b = { - .dir = 0xfffc, - .init = 0x40fc, - .sleep_out = 0x0000, - .batt_fault_out = 0x0000, - .sleep_mask = 0xffff, - .sleep_conf = 0x000c, - .alt_function = 0x0000, /* Caution: need to be set to a correct value */ - }, - .gpio_c = { - .dir = 0xfff7, - .init = 0xc344, - .sleep_out = 0x04c4, - .batt_fault_out = 0x0484, - .sleep_mask = 0xffff, - .sleep_conf = 0x000c, - .alt_function = 0x003b, /* Caution: need to be set to a correct value */ - }, - .gpio_d = { - .dir = 0x0040, - .init = 0x3e1b, - .sleep_out = 0x3e1b, - .batt_fault_out = 0x3e1b, - .sleep_mask = 0x0000, - .sleep_conf = 0x000c, - .alt_function = 0x0000, /* Caution: need to be set to a correct value */ - }, - .bus_shift=1, -}; - -static struct resource asic3_resources[] = { - [0] = { - .start = BLUEANGEL_ASIC3_GPIO_PHYS, - .end = BLUEANGEL_ASIC3_GPIO_PHYS + 0xfffff, - .flags = IORESOURCE_MEM, - }, - [1] = { - .start = IRQ_NR_BLUEANGEL_ASIC3, - .end = IRQ_NR_BLUEANGEL_ASIC3, - .flags = IORESOURCE_IRQ, - }, - [2] = { - .start = BLUEANGEL_ASIC3_MMC_PHYS, - .end = BLUEANGEL_ASIC3_MMC_PHYS + IPAQ_ASIC3_MAP_SIZE, - .flags = IORESOURCE_MEM, - }, - [3] = { - .start = IRQ_GPIO(GPIO_NR_BLUEANGEL_SD_IRQ_N), - .flags = IORESOURCE_IRQ, - }, -}; - -struct platform_device blueangel_asic3 = { - .name = "asic3", - .id = 0, - .num_resources = ARRAY_SIZE(asic3_resources), - .resource = asic3_resources, -}; -EXPORT_SYMBOL(blueangel_asic3); - -/* LCD */ - -static struct platform_device blueangel_lcd = { - .name = "blueangel-lcd", - .id = -1, - .dev = { - .platform_data = NULL, - }, -}; - -static struct platform_device *devices[] __initdata = { - &blueangel_asic3, - &blueangel_lcd, -}; - -void blueangel_hereiam(void) { -// ipaq_asic3_set_gpio_out_b(&blueangel_asic3.dev, 0x8, 0xfb0); -} - -static int blueangel_udc_is_connected(void) { - int ret; - - ret=!(GPLR(GPIO_NR_BLUEANGEL_USB_DETECT_N) & GPIO_bit(GPIO_NR_BLUEANGEL_USB_DETECT_N)); - printk("udc_is_connected returns %d\n",ret); - - return ret; -} - -static void blueangel_udc_command(int cmd) { - switch(cmd){ - case PXA2XX_UDC_CMD_DISCONNECT: - printk("_udc_control: disconnect\n"); - ipaq_asic3_set_gpio_dir_c(&blueangel_asic3.dev, GPIOC_USB_PULLUP_N, GPIOC_USB_PULLUP_N); - ipaq_asic3_set_gpio_out_c(&blueangel_asic3.dev, GPIOC_USB_PULLUP_N, GPIOC_USB_PULLUP_N); - break; - case PXA2XX_UDC_CMD_CONNECT: - printk("_udc_control: connect\n"); - ipaq_asic3_set_gpio_dir_c(&blueangel_asic3.dev, GPIOC_USB_PULLUP_N, GPIOC_USB_PULLUP_N); - ipaq_asic3_set_gpio_out_c(&blueangel_asic3.dev, GPIOC_USB_PULLUP_N, 0); - break; - default: - printk("_udc_control: unknown command!\n"); - break; - } -} - -static struct pxa2xx_udc_mach_info blueangel_udc_mach_info = { - .udc_is_connected = blueangel_udc_is_connected, - .udc_command = blueangel_udc_command, -}; - - -static void __init blueangel_init(void) -{ - switch (blueangel_boardid) - { - case 6: - blueangel_asic3.dev.platform_data=&asic3_platform_data_6; - break; - case 4: - case 5: - blueangel_asic3.dev.platform_data=&asic3_platform_data_o; - break; - default: - blueangel_asic3.dev.platform_data=&asic3_platform_data_o; - } - - platform_add_devices (devices, ARRAY_SIZE (devices)); - - pxa_set_udc_info(&blueangel_udc_mach_info); - -} - -MACHINE_START(BLUEANGEL, "HTC Blueangel") - /* Maintainer xanadux.org */ - .phys_ram = 0xa0000000, - .phys_io = 0x40000000, - .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, - .boot_params = 0xa0000100, - .map_io = blueangel_map_io, - .init_irq = blueangel_init_irq, - .timer = &pxa_timer, - .init_machine = blueangel_init, -MACHINE_END - diff -uNr -x Entries.Log -x Repository -x Tag -x Root -x Entries -x '*.mod' -x '*orig*' -x '*.c~' -x '*.h~' cleancvs/kernel26/arch/arm/mach-pxa/htcblueangel/blueangel_dpram.c garage/kernel26/arch/arm/mach-pxa/htcblueangel/blueangel_dpram.c --- cleancvs/kernel26/arch/arm/mach-pxa/htcblueangel/blueangel_dpram.c 2006-06-16 00:57:48.000000000 +0200 +++ garage/kernel26/arch/arm/mach-pxa/htcblueangel/blueangel_dpram.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,457 +0,0 @@ -/* - * - * Based on drivers/serial/8250.c by Russell King. - * - * 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. - */ - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -/* HTC DPRAM */ -#define PORT_DPRAM 69 - -struct dpram_data { - unsigned long data_phys; - void *data_virt; - unsigned long ctrl_phys; - void *ctrl_virt; -} dpram_data; - -#define REG0 (*((volatile unsigned short *)(dpram_data.ctrl_virt+0))) -#define REG2 (*((volatile unsigned short *)(dpram_data.ctrl_virt+2))) -#define REG4 (*((volatile unsigned short *)(dpram_data.ctrl_virt+4))) -#define REG6 (*((volatile unsigned short *)(dpram_data.ctrl_virt+6))) -#define REG8 (*((volatile unsigned short *)(dpram_data.ctrl_virt+8))) -#define REG100 (*((volatile unsigned short *)(dpram_data.ctrl_virt+100))) -#define REG214 (*((volatile unsigned short *)(dpram_data.ctrl_virt+214))) - -#ifdef DEBUG -#define dprintk(x...) printk(x) -#else -#define dprintk(x...) -#endif - -static void -dpram_ack1(void) -{ - REG100 &= 0xfbff; - REG0 |= 0x200; - REG0 &= 0xfe00; -} - -static void -dpram_ack2(void) -{ - REG100 &= 0xf7ff; - REG0 |= 0x200; - REG0 &= 0xfe00; -} - -static void -dpram_ack3(void) -{ - REG100 &= 0xefff; - REG0 |= 0x200; - REG0 &= 0xfe00; -} - -static void -dpram_req1(void) -{ - REG100|=0x400; - REG0|=0x800; -} - -static void -dpram_req2(void) -{ - REG100|=0x800; - REG0|=0x800; -} - -static void -dpram_req3(void) -{ - REG100|=0x1000; - REG0|=0x800; -} - -static void dpram_enable_ms(struct uart_port *port) -{ - dprintk("dpram_enable_ms\n"); -} - -static void dpram_stop_tx(struct uart_port *port, unsigned int tty_stop) -{ - dprintk("dpram_stop_tx\n"); -} - -static void dpram_stop_rx(struct uart_port *port) -{ - dprintk("dpram_stop_rx\n"); -} - -static void -receive_chars(struct uart_port *up) -{ - struct tty_struct *tty = up->info->tty; - unsigned int ch, flag; - int i,count; - unsigned short s; - unsigned char *rxptr; - - - rxptr=dpram_data.data_virt+0x200; - s=REG6; - dprintk("REG6=0x%x\n", s); - count=s & 0x3ff; - if ((s & 0x1000) && count) { - dprintk("%d bytes data available\n", count); - for (i = 0 ; i < count ; i++) { -#if 0 /* TODO !!! */ - if (unlikely(tty->flip.count >= TTY_FLIPBUF_SIZE)) { - if (tty->low_latency) - tty_flip_buffer_push(tty); - } -#endif - ch=*rxptr++; - flag = TTY_NORMAL; - up->icount.rx++; - uart_insert_char(up, 0, 0, ch, flag); - } - tty_flip_buffer_push(tty); - } - REG4|=0x800; - return; - -#if 0 - - do { - if (unlikely(tty->flip.count >= TTY_FLIPBUF_SIZE)) { - if (tty->low_latency) - tty_flip_buffer_push(tty); - /* - * If this failed then we will throw away the - * bytes but must do so to clear interrupts - */ - } - ch = 0; /* serial_in(up, UART_RX); */ - flag = TTY_NORMAL; - up->icount.rx++; - - uart_insert_char(up, *status, UART_LSR_OE, ch, flag); - - } while ((*status & UART_LSR_DR) && (max_count-- > 0)); - tty_flip_buffer_push(tty); -#endif -} - -static unsigned char -transmit_char(struct uart_port *up, struct circ_buf *xmit) -{ - unsigned char ret; - - ret=xmit->buf[xmit->tail]; - xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); - up->icount.tx++; - - return ret; -} -static void transmit_chars(struct uart_port *up) -{ - struct circ_buf *xmit = &up->info->xmit; - int count,written; - unsigned short *txptr; - unsigned short s; - - txptr=dpram_data.data_virt; - - if (up->x_char) { - dprintk("x_char\n"); - *txptr=up->x_char; - REG0=(REG0&0xfe00)|1; - dpram_req1(); - up->icount.tx++; - up->x_char = 0; - return; - } - if (uart_circ_empty(xmit) || uart_tx_stopped(up)) { - dpram_stop_tx(up, 0); - return; - } - - dprintk("REG0=0x%x\n", REG0); - count = 255; - written=0; - do { - s=transmit_char(up, xmit); - written++; - if (! uart_circ_empty(xmit)) { - s |= (transmit_char(up, xmit) << 8); - written++; - } - dprintk("transmitting 0x%x\n", s); - *txptr++=s; - if (uart_circ_empty(xmit)) - break; - } while (--count > 0); - dprintk("written %d\n", written); - REG0=(REG0&0xfe00)|(written & 0x1ff); - dpram_req1(); - - if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) - uart_write_wakeup(up); - - if (uart_circ_empty(xmit)) - dpram_stop_tx(up, 0); -} - -static void dpram_start_tx(struct uart_port *port, unsigned int tty_start) -{ - dprintk("dpram_start_tx\n"); - transmit_chars(port); -} - -static void check_modem_status(struct uart_port *up) -{ - dprintk("check_modem_status\n"); -} - -/* - * This handles the interrupt from one port. - */ -static irqreturn_t -dpram_irq_rx(int irq, void *dev_id, struct pt_regs *regs) -{ - dprintk("dpram_irq_rx\n"); - receive_chars(dev_id); - return IRQ_HANDLED; -} - -static irqreturn_t -dpram_irq_tx(int irq, void *dev_id, struct pt_regs *regs) -{ - - dprintk("dpram_irq_tx\n"); - dpram_ack1(); - transmit_chars(dev_id); - return IRQ_HANDLED; -} - -static unsigned int dpram_tx_empty(struct uart_port *port) -{ - dprintk("dpram_tx_empty\n"); - return TIOCSER_TEMT; -} - -static unsigned int dpram_get_mctrl(struct uart_port *port) -{ - dprintk("dpram_get_mctrl\n"); - return TIOCM_CTS | TIOCM_DSR | TIOCM_CAR; -} - -static void dpram_set_mctrl(struct uart_port *port, unsigned int mctrl) -{ - dprintk("dpram_set_mctrl\n"); -} - -static void dpram_break_ctl(struct uart_port *port, int break_state) -{ - dprintk("dpram_break_ctl\n"); -} - -static int dpram_startup(struct uart_port *port) -{ - int retval; - dprintk("dpram_startup\n"); - - /* - * Allocate the IRQ - */ - retval = request_irq(IRQ_NR_BLUEANGEL_RX_FULL, dpram_irq_rx, 0, "DPRAM_RX", port); - set_irq_type(IRQ_NR_BLUEANGEL_RX_FULL, IRQT_FALLING); - if (! retval) { - retval = request_irq(IRQ_NR_BLUEANGEL_TX_EMPTY, dpram_irq_tx, 0, "DPRAM_TX", port); - set_irq_type(IRQ_NR_BLUEANGEL_TX_EMPTY, IRQT_FALLING); - } - - REG8=0x1; - REG214=0x1; - REG100=0x1; - REG0=0x0; - - receive_chars(port); - return retval; -} - -static void dpram_shutdown(struct uart_port *port) -{ - dprintk("dpram_shutdown\n"); - free_irq(IRQ_NR_BLUEANGEL_RX_FULL, port); - free_irq(IRQ_NR_BLUEANGEL_TX_EMPTY, port); -} - -static void -dpram_set_termios(struct uart_port *port, struct termios *termios, - struct termios *old) -{ - dprintk("dpram_set_termios\n"); -} - -static void -dpram_pm(struct uart_port *port, unsigned int state, - unsigned int oldstate) -{ - dprintk("dpram_pm %d %d\n", state, oldstate); -} - -static void dpram_release_port(struct uart_port *port) -{ - dprintk("dpram_release_port\n"); -} - -static int dpram_request_port(struct uart_port *port) -{ - dprintk("dpram_request_port\n"); - return 0; -} - -static void dpram_config_port(struct uart_port *port, int flags) -{ - dprintk("dpram_config_port\n"); - port->type = PORT_DPRAM; -} - -static int -dpram_verify_port(struct uart_port *port, struct serial_struct *ser) -{ - /* we don't want the core code to modify any port params */ - return -EINVAL; -} - -static const char * -dpram_type(struct uart_port *port) -{ - return "DPRAM"; -} - -struct uart_ops dpram_pops = { - .tx_empty = dpram_tx_empty, - .set_mctrl = dpram_set_mctrl, - .get_mctrl = dpram_get_mctrl, - .stop_tx = dpram_stop_tx, - .start_tx = dpram_start_tx, - .stop_rx = dpram_stop_rx, - .enable_ms = dpram_enable_ms, - .break_ctl = dpram_break_ctl, - .startup = dpram_startup, - .shutdown = dpram_shutdown, - .set_termios = dpram_set_termios, - .pm = dpram_pm, - .type = dpram_type, - .release_port = dpram_release_port, - .request_port = dpram_request_port, - .config_port = dpram_config_port, - .verify_port = dpram_verify_port, -}; - -static struct uart_port dpram_port = { - .type = PORT_DPRAM, - .iotype = UPIO_MEM, - .irq = IRQ_NR_BLUEANGEL_RX_FULL, - .uartclk = 921600 * 16, - .fifosize = 64, - .ops = &dpram_pops, - .line = 0, -}; - -static struct uart_driver dpram_reg = { - .owner = THIS_MODULE, - .driver_name = "DPRAM serial", - .devfs_name = "tts/", - .dev_name = "ttyS", - .major = TTY_MAJOR, - .minor = 72, - .nr = 1, - .name_base = 8, -}; - -int __init dpram_init(void) -{ - int ret,i; - unsigned short *hwidentp,s; - char hwident[64]; - - dpram_data.data_phys=0x10000000; - dpram_data.ctrl_phys=0x10800000; - dpram_data.data_virt=ioremap(dpram_data.data_phys, 4096); - if (! dpram_data.data_virt) { - ret=-ENOMEM; - goto err1; - } - dpram_data.ctrl_virt=ioremap(dpram_data.ctrl_phys, 4096); - if (! dpram_data.ctrl_virt) { - ret=-ENOMEM; - goto err2; - } - dpram_port.membase=dpram_data.ctrl_virt; - dpram_port.mapbase=dpram_data.ctrl_phys; - ret = uart_register_driver(&dpram_reg); - if (ret != 0) - goto err3; - ret = uart_add_one_port(&dpram_reg, &dpram_port); - if (ret != 0) - goto err4; - hwidentp=dpram_data.ctrl_virt+0x300; - for (i=0;i<16;i++) { - s=*hwidentp++; - hwident[i*2+1]=s & 0xff; - hwident[i*2]=s >> 8; - } - hwident[i*2]='\0'; - printk("dpram hwident: '%s'\n",hwident); - return 0; - -err4: - uart_unregister_driver(&dpram_reg); -err3: - iounmap(dpram_data.ctrl_virt); -err2: - iounmap(dpram_data.data_virt); -err1: - return ret; -} - -void __exit dpram_exit(void) -{ - uart_remove_one_port(&dpram_reg, &dpram_port); - uart_unregister_driver(&dpram_reg); - iounmap(dpram_data.ctrl_virt); - iounmap(dpram_data.data_virt); -} - -module_init(dpram_init); -module_exit(dpram_exit); - -MODULE_LICENSE("GPL"); diff -uNr -x Entries.Log -x Repository -x Tag -x Root -x Entries -x '*.mod' -x '*orig*' -x '*.c~' -x '*.h~' cleancvs/kernel26/arch/arm/mach-pxa/htcblueangel/blueangel_kp.c garage/kernel26/arch/arm/mach-pxa/htcblueangel/blueangel_kp.c --- cleancvs/kernel26/arch/arm/mach-pxa/htcblueangel/blueangel_kp.c 2006-06-16 00:57:55.000000000 +0200 +++ garage/kernel26/arch/arm/mach-pxa/htcblueangel/blueangel_kp.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,413 +0,0 @@ -/* - * LED interface for Himalaya, the HTC PocketPC. - * - * License: GPL - * - * Author: Luke Kenneth Casson Leighton, Copyright(C) 2004 - * - * Copyright(C) 2004, Luke Kenneth Casson Leighton. - * - * History: - * - * 2004-02-19 Luke Kenneth Casson Leighton created. - * - */ - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "../himalaya/tsc2200.h" - -#ifdef DEBUG -#define dprintk(x...) printk(x) -#else -#define dprintk(x...) -#endif - -extern struct platform_device blueangel_asic3; - -enum button_irq_type { - gpio, asic3d, tsc2200 -}; - -#define FN_BIT 0x80 -#define SHIFT_BIT 0x80 - -static struct qkey { - unsigned char code; - unsigned char key; - -} qkeys[] = { - {0x01, KEY_ESC}, /* operator button */ - {0x05, KEY_L}, - {0x06, KEY_O}, - {0x07, KEY_P}, - {0x08, KEY_ENTER}, - {0x12, KEY_LEFTSHIFT}, - {0x14, KEY_RESERVED}, /* FN */ - {0x17, KEY_MINUS}, /* ? */ - {0x23, KEY_TAB}, - {0x26, KEY_DOT}, /* . */ - {0x27, KEY_SLASH}, /* _ */ - {0x28, KEY_LEFTCTRL}, /* Menu */ - {0x34, KEY_BACKSPACE}, - {0x35, KEY_T}, - {0x36, KEY_Y}, - {0x37, KEY_U}, - {0x38, KEY_I}, - {0x41, KEY_Q}, - {0x42, KEY_W}, - {0x43, KEY_E}, - {0x44, KEY_R}, - {0x45, KEY_G}, - {0x46, KEY_H}, - {0x47, KEY_J}, - {0x48, KEY_K}, - {0x51, KEY_A}, - {0x52, KEY_S}, - {0x53, KEY_D}, - {0x54, KEY_F}, - {0x55, KEY_V}, - {0x56, KEY_B}, - {0x57, KEY_N}, - {0x58, KEY_M}, - {0x61, KEY_Z}, - {0x62, KEY_X}, - {0x63, KEY_C}, - {0x64, KEY_LEFTALT}, - {0x65, KEY_SPACE}, - {0x67, KEY_COMMA}, /* , */ - /* With FN pressed */ - {0x01|FN_BIT, KEY_ESC}, /* vodafone button */ - {0x05|FN_BIT, KEY_6}, - {0x06|FN_BIT, KEY_3}, - {0x07|FN_BIT, KEY_MINUS|SHIFT_BIT}, /* sharp s */ - {0x08|FN_BIT, KEY_ENTER}, - {0x12|FN_BIT, KEY_CAPSLOCK}, - {0x14|FN_BIT, KEY_RESERVED}, /* FN */ - {0x17|FN_BIT, KEY_9}, /* ? */ - {0x23|FN_BIT, KEY_TAB}, - {0x26|FN_BIT, KEY_0}, - {0x27|FN_BIT, KEY_BACKSLASH}, /* _ */ - {0x28|FN_BIT, KEY_LEFTCTRL}, /* Menu */ - {0x34|FN_BIT, KEY_BACKSPACE}, - {0x35|FN_BIT, KEY_5|SHIFT_BIT}, - {0x36|FN_BIT, KEY_6|SHIFT_BIT}, - {0x37|FN_BIT, KEY_1}, - {0x38|FN_BIT, KEY_2}, - {0x41|FN_BIT, KEY_1|SHIFT_BIT}, - {0x42|FN_BIT, KEY_2|SHIFT_BIT}, - {0x43|FN_BIT, KEY_3|SHIFT_BIT}, - {0x44|FN_BIT, KEY_4|SHIFT_BIT}, - {0x45|FN_BIT, KEY_UP}, - {0x46|FN_BIT, KEY_RIGHTBRACE}, /* + */ - {0x47|FN_BIT, KEY_4}, - {0x48|FN_BIT, KEY_5}, - {0x51|FN_BIT, KEY_8|SHIFT_BIT}, - {0x52|FN_BIT, KEY_9|SHIFT_BIT}, - {0x53|FN_BIT, KEY_7|SHIFT_BIT}, - {0x54|FN_BIT, KEY_0|SHIFT_BIT}, - {0x55|FN_BIT, KEY_DOWN}, - {0x56|FN_BIT, KEY_RIGHT}, - {0x57|FN_BIT, KEY_7}, - {0x58|FN_BIT, KEY_8}, - {0x61|FN_BIT, KEY_RESERVED}, /* @ */ - {0x62|FN_BIT, KEY_RESERVED}, /* Euro Sign */ - {0x63|FN_BIT, KEY_LEFT}, - {0x64|FN_BIT, KEY_LEFTALT}, - {0x65|FN_BIT, KEY_SPACE}, - {0x67|FN_BIT, KEY_RIGHTBRACE|SHIFT_BIT}, /* * */ -}; - -static int num_qkeys=sizeof(qkeys)/sizeof(struct qkey); - -static struct key { - char *name; - enum button_irq_type irq_type; - int irq; - int irq_level; - int key; -} keys[] = { - {"power_button", gpio, IRQ_NR_BLUEANGEL_POWER_BUTTON, IRQT_FALLING, KEY_POWER}, - {"menu_button", asic3d, 5, IRQT_FALLING, KEY_F3 /* KEY_MENU */}, - {"ok_button", asic3d, 7, IRQT_FALLING, KEY_F4 /* KEY_OK */}, - {"windows_button", asic3d, 8, IRQT_FALLING, KEY_F1}, - {"record_button", asic3d, 9, IRQT_FALLING, KEY_F9 /* KEY_RECORD */}, - {"camera_button", asic3d, 10, IRQT_FALLING, KEY_F10 /* KEY_CAMERA */}, - {"volume_slider_up", asic3d, 11, IRQT_FALLING, KEY_VOLUMEUP}, - {"volume_slider_down", asic3d, 12, IRQT_FALLING, KEY_VOLUMEDOWN}, - {"mail_button", asic3d, 15, IRQT_FALLING, KEY_F2 /* KEY_EMAIL */}, - {"contacts", tsc2200, 0, IRQT_RISING, KEY_F5 /* KEY_CONTACTS */}, - {"calendar", tsc2200, 1, IRQT_RISING, KEY_F6 /* KEY_CALENDAR */}, - {"up", tsc2200, 3, IRQT_RISING, KEY_UP}, - {"select", tsc2200, 6, IRQT_RISING, KEY_KPENTER /* KEY_SELECT */}, - {"left", tsc2200, 7, IRQT_RISING, KEY_LEFT}, - {"phone_lift", tsc2200, 9, IRQT_RISING, KEY_F7 /* KEY_PHONE */}, - {"down", tsc2200, 11, IRQT_RISING, KEY_DOWN }, - {"phone_hangup", tsc2200, 12, IRQT_RISING, KEY_F8 /* CANCEL */}, - {"right", tsc2200, 15, IRQT_RISING, KEY_RIGHT}, -}; - -static int num_keys=sizeof(keys)/sizeof(struct key); - -static struct timer_list timer; - -#define KP_POLL_TIME 20 /* milliseconds */ - -extern struct platform_device blueangel_asic3; - -static struct input_dev blueangel_kp_input_dev; - -static void -blueangel_kp_report_key(struct key *k, int pressed) -{ - input_report_key(&blueangel_kp_input_dev, k->key, pressed); - input_sync(&blueangel_kp_input_dev); - - if (pressed) - dprintk("%s pressed\n", k->name); - else - dprintk("%s released\n", k->name); -} - -static int asic3d_old; -static int tsc2200_old; -static int fn_bit; - -static void -blueangel_kp_check_keys(int irq_type, int *old, int new) -{ - int i; - int xor; - struct key *k; - - xor=new ^ *old; - for (i = 0 ; i < num_keys ; i++) { - k=&keys[i]; - if (k->irq_type == irq_type && (xor & (1 << k->irq))) - blueangel_kp_report_key(k, new & (1 << k->irq)); - } - *old=new; -} - -static irqreturn_t blueangel_qkbd_irq(int irq, void *data, struct pt_regs *regs) -{ - int timeout=0,key,dummy,pressed,i,keysym,shift; - dprintk("%s: got interrupt for %d...\n", __FUNCTION__, irq); - input_regs(&blueangel_kp_input_dev, regs); - - dummy=asic3_read_register(&blueangel_asic3.dev, _IPAQ_ASIC3_SPI_Base+_IPAQ_ASIC3_SPI_TxData); - asic3_write_register(&blueangel_asic3.dev, _IPAQ_ASIC3_SPI_Base+_IPAQ_ASIC3_SPI_TxData, 0); - asic3_write_register(&blueangel_asic3.dev, _IPAQ_ASIC3_SPI_Base+_IPAQ_ASIC3_SPI_Control, - asic3_read_register(&blueangel_asic3.dev, _IPAQ_ASIC3_SPI_Base+_IPAQ_ASIC3_SPI_Control) | 0x8000); - asic3_write_register(&blueangel_asic3.dev, _IPAQ_ASIC3_SPI_Base+_IPAQ_ASIC3_SPI_Control, - asic3_read_register(&blueangel_asic3.dev, _IPAQ_ASIC3_SPI_Base+_IPAQ_ASIC3_SPI_Control) | 0x10); - for (;;) { - if (!(asic3_read_register(&blueangel_asic3.dev, _IPAQ_ASIC3_SPI_Base+_IPAQ_ASIC3_SPI_Status) & 0x10)) - break; - udelay(10); - if (timeout++ > 10) { - printk("Timeout reading key\n"); - break; - } - } - key=asic3_read_register(&blueangel_asic3.dev, _IPAQ_ASIC3_SPI_Base+_IPAQ_ASIC3_SPI_RxData); - - pressed=(key & 0x80) == 0; - key&=0x7f; - key|=fn_bit; - dprintk("received key=0x%x\n", key); - for (i = 0 ; i < num_qkeys ; i++) { - if (qkeys[i].code == key) { - dprintk("reporting keysym %d pressed=%d\n", qkeys[i].key, pressed); - if ((key & ~FN_BIT) == 0x14) { - fn_bit=pressed ? FN_BIT : 0; - } else { - keysym=qkeys[i].key; - shift=keysym & SHIFT_BIT; - keysym &= ~SHIFT_BIT; - if (shift && pressed) { - input_report_key(&blueangel_kp_input_dev, KEY_RIGHTSHIFT, 1); - input_sync(&blueangel_kp_input_dev); - } - input_report_key(&blueangel_kp_input_dev, keysym, pressed); - input_sync(&blueangel_kp_input_dev); - if (shift && !pressed) { - input_report_key(&blueangel_kp_input_dev, KEY_RIGHTSHIFT, 0); - input_sync(&blueangel_kp_input_dev); - } - } - return IRQ_HANDLED; - } - } - printk("key unhandled\n"); - return IRQ_HANDLED; -} - -static irqreturn_t blueangel_kp_irq(int irq, void *data, struct pt_regs *regs) -{ - struct key *k=data; - dprintk("%s: got interrupt for %d...\n", __FUNCTION__, irq); - input_regs(&blueangel_kp_input_dev, regs); - if (k->irq_level == IRQT_FALLING) - k->irq_level=IRQT_RISING; - else - k->irq_level=IRQT_FALLING; - set_irq_type(irq, k->irq_level); - if (k->irq_type == asic3d) - blueangel_kp_check_keys(asic3d, &asic3d_old, ~(ipaq_asic3_read_gpio_status_d(&blueangel_asic3.dev))); - else - blueangel_kp_report_key(k, !(GPLR(GPIO_NR_BLUEANGEL_POWER_BUTTON_N) & GPIO_bit(GPIO_NR_BLUEANGEL_POWER_BUTTON_N))); - return IRQ_HANDLED; -} - -static void -blueangel_kp_timer(unsigned long dummy) -{ - int status, keys; - - status=tsc2200_read(TSC2200_CTRLREG_KEY); - if (status & 0x8000) - keys=tsc2200_read(TSC2200_DATAREG_KPDATA); - else - keys=0; - blueangel_kp_check_keys(tsc2200,&tsc2200_old, keys); - if (keys) - mod_timer (&timer, jiffies + (KP_POLL_TIME * HZ) / 1000); - else - enable_irq(IRQ_NR_BLUEANGEL_TSC2200_KB); -} - -static irqreturn_t blueangel_kp_tsc2200_irq(int irq, void *data, struct pt_regs *regs) -{ - int status, keys; - input_regs(&blueangel_kp_input_dev, regs); - status=tsc2200_read(TSC2200_CTRLREG_KEY); - if (status & 0x8000) - keys=tsc2200_read(TSC2200_DATAREG_KPDATA); - else - keys=0; - blueangel_kp_check_keys(tsc2200,&tsc2200_old, keys); - if (keys) { - dprintk("keys=0x%x\n", keys); - disable_irq(IRQ_NR_BLUEANGEL_TSC2200_KB); - mod_timer (&timer, jiffies + (KP_POLL_TIME * HZ) / 1000); - } - return IRQ_HANDLED; -} - -static int blueangel_kp_init (void) -{ - int i,irq,key; - struct key *k; - - dprintk("%s\n", __FUNCTION__); - disable_irq(ASIC3_SPI_IRQ); - asic3_write_register(&blueangel_asic3.dev, _IPAQ_ASIC3_SPI_Base+_IPAQ_ASIC3_SPI_Int, 0); - - blueangel_kp_input_dev.evbit[0] = BIT(EV_KEY) | BIT(EV_REP); - init_input_dev(&blueangel_kp_input_dev); - for (i = 0 ; i < num_keys ; i++) { - k=&keys[i]; - irq=-1; - set_bit(k->key, blueangel_kp_input_dev.keybit); - switch (k->irq_type) { - case gpio: - irq=k->irq; - break; - case asic3d: - irq=asic3_irq_base(&blueangel_asic3.dev) + ASIC3_GPIOD_IRQ_BASE + k->irq; - break; - case tsc2200: - break; - } - if (irq != -1) { - dprintk("requesting irq %d\n", irq); - request_irq(irq, blueangel_kp_irq, SA_SAMPLE_RANDOM, k->name, k); - set_irq_type(irq, k->irq_level); - } -#if 0 - blueangel_kp_input_dev.keybit[k->key] |= BIT(k->key); -#endif - } - for (i = 0 ; i < num_qkeys ; i++) { - key=qkeys[i].key; - - if (key) { - dprintk("enabling key %d\n", qkeys[i].key); - set_bit(key, blueangel_kp_input_dev.keybit); - } - } - - request_irq(IRQ_NR_BLUEANGEL_TSC2200_KB, blueangel_kp_tsc2200_irq, SA_SAMPLE_RANDOM, "blueangel_tsc2200_kb", NULL); - set_irq_type(IRQ_NR_BLUEANGEL_TSC2200_KB, IRQT_FALLING); - irq=asic3_irq_base(&blueangel_asic3.dev) + ASIC3_GPIOD_IRQ_BASE + GPIOD_QKBD_IRQ; - request_irq(irq, blueangel_qkbd_irq, SA_SAMPLE_RANDOM, "blueangel_qkbd", NULL); - set_irq_type(irq, IRQT_FALLING); - - - init_timer(&timer); - timer.function = blueangel_kp_timer; - timer.data = 0; - - - blueangel_kp_input_dev.name = "blueangelkb"; - blueangel_kp_input_dev.phys = "keyboard/blueangelkb"; - -// blueangel_kp_input_dev.id.bustype = BUS_PXA_NSSP; - blueangel_kp_input_dev.id.vendor = 0x0001; - blueangel_kp_input_dev.id.product = 0x0001; - blueangel_kp_input_dev.id.version = 0x0100; - - input_register_device(&blueangel_kp_input_dev); - - - return 0; -} - -static void blueangel_kp_exit (void) -{ - int i,irq; - struct key *k; - - dprintk("%s\n", __FUNCTION__); - input_unregister_device(&blueangel_kp_input_dev); - for (i = 0 ; i < num_keys ; i++) { - k=&keys[i]; - irq=-1; - switch (k->irq_type) { - case gpio: - irq=k->irq; - break; - case asic3d: - irq=asic3_irq_base(&blueangel_asic3.dev) + ASIC3_GPIOD_IRQ_BASE + k->irq; - break; - case tsc2200: - break; - } - if (irq != -1) { - dprintk("releasing irq %d\n", irq); - free_irq(irq, k); - } - } - free_irq(IRQ_NR_BLUEANGEL_TSC2200_KB, NULL); - irq=asic3_irq_base(&blueangel_asic3.dev) + ASIC3_GPIOD_IRQ_BASE + GPIOD_QKBD_IRQ; - free_irq(irq, NULL); - del_timer_sync (&timer); -} - -module_init (blueangel_kp_init); -module_exit (blueangel_kp_exit); - diff -uNr -x Entries.Log -x Repository -x Tag -x Root -x Entries -x '*.mod' -x '*orig*' -x '*.c~' -x '*.h~' cleancvs/kernel26/arch/arm/mach-pxa/htcblueangel/blueangel_lcd.c garage/kernel26/arch/arm/mach-pxa/htcblueangel/blueangel_lcd.c --- cleancvs/kernel26/arch/arm/mach-pxa/htcblueangel/blueangel_lcd.c 2006-06-29 21:40:28.000000000 +0200 +++ garage/kernel26/arch/arm/mach-pxa/htcblueangel/blueangel_lcd.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,492 +0,0 @@ -/* - * Hardware definitions for HP iPAQ Handheld Computers - * - * Copyright 2000-2003 Hewlett-Packard Company. - * - * Use consistent with the GNU GPL is permitted, - * provided that this copyright notice is - * preserved in its entirety in all copies and derived works. - * - * COMPAQ COMPUTER CORPORATION MAKES NO WARRANTIES, EXPRESSED OR IMPLIED, - * AS TO THE USEFULNESS OR CORRECTNESS OF THIS CODE OR ITS - * FITNESS FOR ANY PARTICULAR PURPOSE. - * - * Author: Jamey Hicks. - * - * History: - * - * 2003-05-14 Joshua Wise Adapted for the HP iPAQ H1900 - * 2002-08-23 Jamey Hicks Adapted for use with PXA250-based iPAQs - * 2001-10-?? Andrew Christian Added support for iPAQ H3800 - * and abstracted EGPIO interface. - * - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include