亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? assabet-uda1341.c

?? linux和2410結(jié)合開發(fā) 用他可以生成2410所需的zImage文件
?? C
字號:
/* * Glue audio driver for the SA1110 Assabet board & Philips UDA1341 codec. * * Copyright (c) 2000 Nicolas Pitre <nico@cam.org> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License. * * This is the machine specific part of the Assabet/UDA1341 support. * This driver makes use of the UDA1341 and the sa1100-audio modules. * * History: * * 2000-05-21	Nicolas Pitre	Initial release. * * 2001-06-03	Nicolas Pitre	Made this file a separate module, based on * 				the former sa1100-uda1341.c driver. * * 2001-07-17	Nicolas Pitre	Supports 44100Hz and 22050Hz samplerate now. * * 2001-08-03	Russell King	Fix left/right channel swap. *				Attempt to reduce power consumption when idle. * * 2001-09-23	Russell King	Remove old L3 bus driver. * * Please note that fiddling too much with MDREFR results in oopses, so we don't * touch MDREFR unnecessarily, which means we don't touch it on close. */#include <linux/module.h>#include <linux/init.h>#include <linux/types.h>#include <linux/fs.h>#include <linux/delay.h>#include <linux/pm.h>#include <linux/errno.h>#include <linux/sound.h>#include <linux/soundcard.h>#include <linux/cpufreq.h>#include <linux/l3/l3.h>#include <linux/l3/uda1341.h>#include <asm/semaphore.h>#include <asm/uaccess.h>#include <asm/hardware.h>#include <asm/dma.h>#include <asm/arch/assabet.h>#include "sa1100-audio.h"/* * Define this to fix the power drain on early Assabets */#define FIX_POWER_DRAIN/* * Debugging? */#undef DEBUG#ifdef DEBUG#define DPRINTK( x... )  printk( ##x )#else#define DPRINTK( x... )#endif#define AUDIO_RATE_DEFAULT	44100/* * Mixer (UDA1341) interface */static struct l3_client uda1341;static intmixer_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg){	/*	 * We only accept mixer (type 'M') ioctls.	 */	if (_IOC_TYPE(cmd) != 'M')		return -EINVAL;	return l3_command(&uda1341, cmd, (void *)arg);}static struct file_operations assabet_mixer_fops = {	ioctl:		mixer_ioctl,	owner:		THIS_MODULE};/* * Audio interface */static long audio_samplerate = AUDIO_RATE_DEFAULT;/* * FIXME: what about SFRM going high when SSP is disabled? */static void assabet_set_samplerate(long val){	struct uda1341_cfg cfg;	u_int clk_ref, clk_div;	/* We don't want to mess with clocks when frames are in flight */	Ser4SSCR0 &= ~SSCR0_SSE;	/* wait for any frame to complete */	udelay(125);	/*	 * Our clock source is derived from the CPLD on which we don't have	 * much control unfortunately.  This was intended for a fixed 48000 Hz	 * samplerate assuming a core clock of 221.2 MHz.  The CPLD appears	 * to divide the memory clock so there is a ratio of 4608 between	 * the core clock and the resulting samplerate (obtained by	 * measurements, the CPLD equations should confirm that).	 *	 * Still we can play with the SA1110's clock divisor for the SSP port	 * to get half the samplerate as well.	 *	 * Apparently the clock sent to the SA1110 for the SSP port is further	 * more divided from the clock sent to the UDA1341 (some people tried	 * to be too clever in their design, or simply failed to read the	 * SA1110 manual).  If it was the same clock we would have been able	 * to support a third samplerate with the UDA1341's 384FS mode.	 *	 * At least it would have been a minimum acceptable solution to be	 * able to set the CPLD divisor by software.  The iPAQ design is	 * certainly a better example to follow for a new design.	 */	clk_ref = cpufreq_get(0) * 1000 / 4608;	if (val > clk_ref*4/7) {		audio_samplerate = clk_ref;		cfg.fs = 256;		clk_div = SSCR0_SerClkDiv(2);	} else {		audio_samplerate = clk_ref/2;		cfg.fs = 512;		clk_div = SSCR0_SerClkDiv(4);	}	cfg.format = FMT_LSB16;	l3_command(&uda1341, L3_UDA1341_CONFIGURE, &cfg);	Ser4SSCR0 = (Ser4SSCR0 & ~0xff00) + clk_div + SSCR0_SSE;}/* * Initialise the Assabet audio driver. * * Note that we have to be careful with the order that we do things here; * there is a D-type flip flop which is clocked from the SFRM line which * indicates whether the same is for the left or right channel to the * UDA1341. * * When you disable the SSP (by clearing SSCR0_SSE) it appears that the * SFRM signal can float high.  When you re-enable the SSP, you clock the * flip flop once, and end up swapping the left and right channels. * * The ASSABET_BCR_CODEC_RST line will force this flip flop into a known * state, but this line resets other devices as well! * * In addition to the above, it appears that powering down the UDA1341 on * early Assabets leaves the UDA_WS actively driving a logic '1' into the * chip, wasting power!  (you can tell this by D11 being half-on).  We * attempt to correct this by kicking the flip flop on init/open/close. * We should probably do this on PM resume as well. * * (Note the ordering of ASSABET_BCR_AUDIO_ON, SFRM and ASSABET_BCR_CODEC_RST * is important). */static void assabet_audio_init(void *dummy){	unsigned long flags;	unsigned int mdrefr;	local_irq_save(flags);	/*	 * Enable the power for the UDA1341 before driving any signals.	 * We leave the audio amp (LM4880) disabled for now.	 */	ASSABET_BCR_set(ASSABET_BCR_AUDIO_ON);#ifdef FIX_POWER_DRAIN	GPSR = GPIO_SSP_SFRM;	GPCR = GPIO_SSP_SFRM;#endif	ASSABET_BCR_set(ASSABET_BCR_CODEC_RST);	ASSABET_BCR_clear(ASSABET_BCR_STEREO_LB);	/*	 * Setup the SSP uart.	 */	PPAR |= PPAR_SPR;	Ser4SSCR0 = SSCR0_DataSize(16) + SSCR0_TI + SSCR0_SerClkDiv(2);	Ser4SSCR1 = SSCR1_SClkIactL + SSCR1_SClk1P + SSCR1_ExtClk;	GAFR |= GPIO_SSP_TXD | GPIO_SSP_RXD | GPIO_SSP_SCLK | GPIO_SSP_CLK;	GPDR |= GPIO_SSP_TXD | GPIO_SSP_SCLK | GPIO_SSP_SFRM;	GPDR &= ~(GPIO_SSP_RXD | GPIO_SSP_CLK);	Ser4SSCR0 |= SSCR0_SSE;	/*	 * Only give SFRM to the SSP after it has been enabled.	 */	GAFR |= GPIO_SSP_SFRM;	/*	 * The assabet board uses the SDRAM clock as the source clock for	 * audio. This is supplied to the SA11x0 from the CPLD on pin 19.	 * At 206MHz we need to run the audio clock (SDRAM bank 2)	 * at half speed. This clock will scale with core frequency so	 * the audio sample rate will also scale. The CPLD on Assabet	 * will need to be programmed to match the core frequency.	 */	mdrefr = MDREFR;	if ((mdrefr & (MDREFR_K2DB2 | MDREFR_K2RUN | MDREFR_EAPD |		       MDREFR_KAPD)) != (MDREFR_K2DB2 | MDREFR_K2RUN)) {		mdrefr |= MDREFR_K2DB2 | MDREFR_K2RUN;		mdrefr &= ~(MDREFR_EAPD | MDREFR_KAPD);		MDREFR = mdrefr;		(void) MDREFR;	}	local_irq_restore(flags);	/* Wait for the UDA1341 to wake up */	mdelay(1);	l3_open(&uda1341);	assabet_set_samplerate(audio_samplerate);	/* Enable the audio power */	ASSABET_BCR_clear(ASSABET_BCR_QMUTE | ASSABET_BCR_SPK_OFF);}/* * Shutdown the Assabet audio driver. * * We have to be careful about the SFRM line here for the same reasons * described in the initialisation comments above.  This basically means * that we must hand the SSP pins back to the GPIO module before disabling * the SSP. * * In addition, to reduce power drain, we toggle the SFRM line once so * that the UDA_WS line is at logic 0. * * We can't clear ASSABET_BCR_CODEC_RST without knowing if the UCB1300 or * ADV7171 driver is still active.  If it is, then we still need to play * games, so we might as well leave ASSABET_BCR_CODEC_RST set. */static void assabet_audio_shutdown(void *dummy){	ASSABET_BCR_set(ASSABET_BCR_STEREO_LB | ASSABET_BCR_QMUTE |			ASSABET_BCR_SPK_OFF);	l3_close(&uda1341);	GAFR &= ~(GPIO_SSP_TXD | GPIO_SSP_RXD | GPIO_SSP_SCLK | GPIO_SSP_SFRM);	Ser4SSCR0 = 0;#ifdef FIX_POWER_DRAIN	GPSR = GPIO_SSP_SFRM;	GPCR = GPIO_SSP_SFRM;#endif	/* disable the audio power */	ASSABET_BCR_clear(ASSABET_BCR_AUDIO_ON);}static int assabet_audio_ioctl( struct inode *inode, struct file *file,				uint cmd, ulong arg){	long val;	int ret = 0;	/*	 * These are platform dependent ioctls which are not handled by the	 * generic sa1100-audio module.	 */	switch (cmd) {	case SNDCTL_DSP_STEREO:		ret = get_user(val, (int *) arg);		if (ret)			return ret;		/* the UDA1341 is stereo only */		ret = (val == 0) ? -EINVAL : 1;		return put_user(ret, (int *) arg);	case SNDCTL_DSP_CHANNELS:	case SOUND_PCM_READ_CHANNELS:		/* the UDA1341 is stereo only */		return put_user(2, (long *) arg);	case SNDCTL_DSP_SPEED:		ret = get_user(val, (long *) arg);		if (ret) break;		assabet_set_samplerate(val);		/* fall through */	case SOUND_PCM_READ_RATE:		return put_user(audio_samplerate, (long *) arg);	case SNDCTL_DSP_SETFMT:	case SNDCTL_DSP_GETFMTS:		/* we can do signed 16-bit only */		return put_user(AFMT_S16_LE, (long *) arg);	default:		/* Maybe this is meant for the mixer (As per OSS Docs) */		return mixer_ioctl(inode, file, cmd, arg);	}	return ret;}static audio_stream_t output_stream, input_stream;static audio_state_t audio_state = {	output_stream:	&output_stream,	output_dma:	DMA_Ser4SSPWr,	output_id:	"Assabet UDA1341 out",	input_stream:	&input_stream,	input_dma:	DMA_Ser4SSPRd,	input_id:	"Assabet UDA1341 in",	need_tx_for_rx:	1,	hw_init:	assabet_audio_init,	hw_shutdown:	assabet_audio_shutdown,	client_ioctl:	assabet_audio_ioctl,	sem:		__MUTEX_INITIALIZER(audio_state.sem),};static int assabet_audio_open(struct inode *inode, struct file *file){	return sa1100_audio_attach(inode, file, &audio_state);}/* * Missing fields of this structure will be patched with the call * to sa1100_audio_attach(). */static struct file_operations assabet_audio_fops = {	open:		assabet_audio_open,	owner:		THIS_MODULE};static int audio_dev_id, mixer_dev_id;static int __init assabet_uda1341_init(void){	int ret;	if (!machine_is_assabet())		return -ENODEV;	ret = l3_attach_client(&uda1341, "l3-bit-sa1100-gpio", "uda1341");	if (ret)		goto out;	/* register devices */	audio_dev_id = register_sound_dsp(&assabet_audio_fops, -1);	mixer_dev_id = register_sound_mixer(&assabet_mixer_fops, -1);#ifdef FIX_POWER_DRAIN	{		unsigned long flags;		local_irq_save(flags);		ASSABET_BCR_set(ASSABET_BCR_CODEC_RST);		GPSR = GPIO_SSP_SFRM;		GPDR |= GPIO_SSP_SFRM;		GPCR = GPIO_SSP_SFRM;		local_irq_restore(flags);	}#endif	printk(KERN_INFO "Sound: Assabet UDA1341: dsp id %d mixer id %d\n",		audio_dev_id, mixer_dev_id);	return 0;release_l3:	l3_detach_client(&uda1341);out:	return ret;}static void __exit assabet_uda1341_exit(void){	unregister_sound_dsp(audio_dev_id);	unregister_sound_mixer(mixer_dev_id);	l3_detach_client(&uda1341);}module_init(assabet_uda1341_init);module_exit(assabet_uda1341_exit);MODULE_AUTHOR("Nicolas Pitre");MODULE_DESCRIPTION("Glue audio driver for the SA1110 Assabet board & Philips UDA1341 codec.");EXPORT_NO_SYMBOLS;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
av在线播放成人| 欧美一区2区视频在线观看| 欧美在线视频全部完| 日韩精品一区二| 亚洲精品一二三区| 国产精品一区免费视频| 欧美高清dvd| 亚洲女性喷水在线观看一区| 国产在线精品一区二区不卡了 | 精品国产麻豆免费人成网站| 亚洲男帅同性gay1069| 国产乱码精品1区2区3区| 在线一区二区视频| 国产精品美女久久久久aⅴ国产馆| 日本欧美大码aⅴ在线播放| 欧美吞精做爰啪啪高潮| 中文字幕在线一区| 成人永久看片免费视频天堂| 日韩一区二区电影| 青青草97国产精品免费观看无弹窗版| 91麻豆成人久久精品二区三区| 国产日产亚洲精品系列| 国模少妇一区二区三区| 日韩欧美国产午夜精品| 日本不卡在线视频| 欧美电影在哪看比较好| 亚洲福利一区二区三区| 欧洲一区二区三区在线| 亚洲精品欧美专区| 91国模大尺度私拍在线视频| 国产精品美女久久久久高潮| 成人高清视频免费观看| 亚洲欧美综合色| bt欧美亚洲午夜电影天堂| 国产精品三级久久久久三级| 国产99久久久精品| 1区2区3区欧美| 91视频观看视频| 一区二区三区日韩欧美| 91福利资源站| 亚洲第一二三四区| 日韩欧美一级在线播放| 精品一区二区免费在线观看| 久久久久久久久99精品| 成人精品gif动图一区| 国产精品天干天干在观线| 成人教育av在线| 亚洲精品国久久99热| 在线观看91视频| 免费成人在线视频观看| 久久先锋影音av鲁色资源网| 成人在线综合网站| 亚洲视频1区2区| 欧美人伦禁忌dvd放荡欲情| 青青草国产精品亚洲专区无| 久久综合久久鬼色| av日韩在线网站| 三级在线观看一区二区| 久久亚洲一区二区三区明星换脸| 丰满岳乱妇一区二区三区| 亚洲男女一区二区三区| 69堂国产成人免费视频| 久久99精品久久久久久国产越南 | 久久这里都是精品| 99精品国产99久久久久久白柏 | 国产精品九色蝌蚪自拍| 欧美久久高跟鞋激| 国产成人在线影院| 亚洲一线二线三线视频| 精品国产免费人成电影在线观看四季| 99国产精品久久久久久久久久久| 亚洲成人tv网| 久久女同性恋中文字幕| 99vv1com这只有精品| 捆绑紧缚一区二区三区视频| 色8久久精品久久久久久蜜| 五月综合激情网| 国产精品污污网站在线观看| 欧美日韩一区不卡| 成人美女视频在线观看| 日韩电影在线观看电影| 国产精品久久久99| 欧美r级电影在线观看| 91视频在线观看| 精品一区二区久久久| 一个色妞综合视频在线观看| 久久久久国色av免费看影院| 欧美精品色综合| 91视频一区二区| 国产成人免费在线观看| 青青草97国产精品免费观看无弹窗版| 国产精品不卡在线观看| 久久久精品黄色| 欧美成人欧美edvon| 欧美日韩午夜在线| 日本精品视频一区二区| 成人av在线资源| 国产精品一区二区三区四区 | 一级女性全黄久久生活片免费| 56国语精品自产拍在线观看| 97精品电影院| 99国产精品久久久久久久久久 | 久久99热这里只有精品| 亚洲资源在线观看| 亚洲美女精品一区| 国产精品第五页| 国产精品理伦片| 国产精品欧美极品| 国产欧美日韩另类视频免费观看| 在线不卡中文字幕| 精品视频一区二区三区免费| 在线精品视频小说1| 色综合欧美在线| 91在线播放网址| 色婷婷综合中文久久一本| av电影一区二区| 91麻豆精品在线观看| 99久久99久久免费精品蜜臀| proumb性欧美在线观看| 北条麻妃国产九九精品视频| 成人18精品视频| 色综合亚洲欧洲| 成人免费视频国产在线观看| 成人蜜臀av电影| 99久久99久久精品免费看蜜桃| av电影在线观看一区| 91视频免费播放| 欧美日韩亚洲另类| 日韩欧美国产一二三区| 国产亚洲精品免费| 中文字幕一区二区三区在线不卡| 国产精品久久久久国产精品日日| 国产精品国产三级国产aⅴ中文| 亚洲欧美色图小说| 亚洲成人免费视| 久久国产精品免费| 粉嫩绯色av一区二区在线观看| 成人av片在线观看| 91视频免费看| 欧美一区二区三区在线电影| 欧美精品一区视频| 国产精品国产精品国产专区不片| 一区二区三区91| 久久69国产一区二区蜜臀| 高清国产一区二区三区| 91官网在线观看| 精品三级在线看| 成人欧美一区二区三区在线播放| 亚洲午夜私人影院| 国产一区三区三区| 在线一区二区三区四区| 日韩精品一区二区三区视频播放| 国产精品少妇自拍| 日韩精品乱码免费| 99久久精品99国产精品| 欧美一级黄色录像| 亚洲欧美一区二区不卡| 久久成人18免费观看| 91麻豆swag| 2欧美一区二区三区在线观看视频| 亚洲色图在线播放| 黄色精品一二区| 欧美日韩中文一区| 亚洲国产精品成人综合| 免费在线视频一区| 91国产丝袜在线播放| 久久精品男人天堂av| 亚洲电影第三页| 91小视频免费看| 久久久久久黄色| 美女脱光内衣内裤视频久久网站| 色婷婷综合久色| 国产区在线观看成人精品| 青青草97国产精品免费观看 | 亚洲成人三级小说| 99久久精品国产导航| 日韩精品一区在线| 亚洲第一精品在线| 91丨九色丨尤物| 国产欧美日韩三级| 精久久久久久久久久久| 欧美日韩精品专区| 亚洲免费高清视频在线| 久久久青草青青国产亚洲免观| 国产成人精品免费在线| 亚洲精品国产第一综合99久久 | 欧美三级午夜理伦三级中视频| 欧美日韩一区不卡| 综合亚洲深深色噜噜狠狠网站| 久久精品国产免费| 在线播放中文一区| 亚洲小少妇裸体bbw| 色婷婷精品大视频在线蜜桃视频| 欧美激情一区二区三区全黄 | 欧美一区二区三区在线观看视频 | www.在线成人| 日本一区二区动态图| 国产精品2024| 中文文精品字幕一区二区| 国产精品一二三区在线|