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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? sscape.c

?? linux 內核源代碼
?? C
?? 第 1 頁 / 共 3 頁
字號:
	set_host_mode_unsafe(s->io_base);	/*	 * Boot the board ... (I think)	 */	sscape_write_unsafe(s->io_base, GA_HMCTL_REG, sscape_read_unsafe(s->io_base, GA_HMCTL_REG) | 0x40);	spin_unlock_irqrestore(&s->lock, flags);	/*	 * If all has gone well, then the board should acknowledge	 * the new upload and tell us that it has rebooted OK. We	 * give it 5 seconds (max) ...	 */	ret = 0;	if (!obp_startup_ack(s, 5)) {		snd_printk(KERN_ERR "sscape: No response from on-board processor after upload\n");		ret = -EAGAIN;	} else if (!host_startup_ack(s, 5)) {		snd_printk(KERN_ERR "sscape: SoundScape failed to initialise\n");		ret = -EAGAIN;	}_release_dma:	/*	 * NOTE!!! We are NOT holding any spinlocks at this point !!!	 */	sscape_write(s, GA_DMAA_REG, (s->ic_type == IC_ODIE ? 0x70 : 0x40));	free_dmabuf(&dma);	return ret;}/* * Upload the bootblock(?) into the SoundScape. The only * purpose of this block of code seems to be to tell * us which version of the microcode we should be using. * * NOTE: The boot-block data resides in USER-SPACE!!! *       However, we have already verified its memory *       addresses by the time we get here. */static int sscape_upload_bootblock(struct soundscape *sscape, struct sscape_bootblock __user *bb){	unsigned long flags;	int data = 0;	int ret;	ret = upload_dma_data(sscape, bb->code, sizeof(bb->code));	spin_lock_irqsave(&sscape->lock, flags);	if (ret == 0) {		data = host_read_ctrl_unsafe(sscape->io_base, 100);	}	set_midi_mode_unsafe(sscape->io_base);	spin_unlock_irqrestore(&sscape->lock, flags);	if (ret == 0) {		if (data < 0) {			snd_printk(KERN_ERR "sscape: timeout reading firmware version\n");			ret = -EAGAIN;		}		else if (__copy_to_user(&bb->version, &data, sizeof(bb->version))) {			ret = -EFAULT;		}	}	return ret;}/* * Upload the microcode into the SoundScape. The * microcode is 64K of data, and if we try to copy * it into a local variable then we will SMASH THE * KERNEL'S STACK! We therefore leave it in USER * SPACE, and save ourselves from copying it at all. */static int sscape_upload_microcode(struct soundscape *sscape,                                   const struct sscape_microcode __user *mc){	unsigned long flags;	char __user *code;	int err;	/*	 * We are going to have to copy this data into a special	 * DMA-able buffer before we can upload it. We shall therefore	 * just check that the data pointer is valid for now.	 *	 * NOTE: This buffer is 64K long! That's WAY too big to	 *       copy into a stack-temporary anyway.	 */	if ( get_user(code, &mc->code) ||	     !access_ok(VERIFY_READ, code, SSCAPE_MICROCODE_SIZE) )		return -EFAULT;	if ((err = upload_dma_data(sscape, code, SSCAPE_MICROCODE_SIZE)) == 0) {		snd_printk(KERN_INFO "sscape: MIDI firmware loaded\n");	}	spin_lock_irqsave(&sscape->lock, flags);	set_midi_mode_unsafe(sscape->io_base);	spin_unlock_irqrestore(&sscape->lock, flags);	initialise_mpu401(sscape->mpu);	return err;}/* * Hardware-specific device functions, to implement special * IOCTLs for the SoundScape card. This is how we upload * the microcode into the card, for example, and so we * must ensure that no two processes can open this device * simultaneously, and that we can't open it at all if * someone is using the MIDI device. */static int sscape_hw_open(struct snd_hwdep * hw, struct file *file){	register struct soundscape *sscape = get_hwdep_soundscape(hw);	unsigned long flags;	int err;	spin_lock_irqsave(&sscape->fwlock, flags);	if ((sscape->midi_usage != 0) || sscape->hw_in_use) {		err = -EBUSY;	} else {		sscape->hw_in_use = 1;		err = 0;	}	spin_unlock_irqrestore(&sscape->fwlock, flags);	return err;}static int sscape_hw_release(struct snd_hwdep * hw, struct file *file){	register struct soundscape *sscape = get_hwdep_soundscape(hw);	unsigned long flags;	spin_lock_irqsave(&sscape->fwlock, flags);	sscape->hw_in_use = 0;	spin_unlock_irqrestore(&sscape->fwlock, flags);	return 0;}static int sscape_hw_ioctl(struct snd_hwdep * hw, struct file *file,                           unsigned int cmd, unsigned long arg){	struct soundscape *sscape = get_hwdep_soundscape(hw);	int err = -EBUSY;	switch (cmd) {	case SND_SSCAPE_LOAD_BOOTB:		{			register struct sscape_bootblock __user *bb = (struct sscape_bootblock __user *) arg;			/*			 * We are going to have to copy this data into a special			 * DMA-able buffer before we can upload it. We shall therefore			 * just check that the data pointer is valid for now ...			 */			if ( !access_ok(VERIFY_READ, bb->code, sizeof(bb->code)) )				return -EFAULT;			/*			 * Now check that we can write the firmware version number too...			 */			if ( !access_ok(VERIFY_WRITE, &bb->version, sizeof(bb->version)) )				return -EFAULT;			err = sscape_upload_bootblock(sscape, bb);		}		break;	case SND_SSCAPE_LOAD_MCODE:		{			register const struct sscape_microcode __user *mc = (const struct sscape_microcode __user *) arg;			err = sscape_upload_microcode(sscape, mc);		}		break;	default:		err = -EINVAL;		break;	} /* switch */	return err;}/* * Mixer control for the SoundScape's MIDI device. */static int sscape_midi_info(struct snd_kcontrol *ctl,                            struct snd_ctl_elem_info *uinfo){	uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;	uinfo->count = 1;	uinfo->value.integer.min = 0;	uinfo->value.integer.max = 127;	return 0;}static int sscape_midi_get(struct snd_kcontrol *kctl,                           struct snd_ctl_elem_value *uctl){	struct snd_cs4231 *chip = snd_kcontrol_chip(kctl);	struct snd_card *card = chip->card;	register struct soundscape *s = get_card_soundscape(card);	unsigned long flags;	spin_lock_irqsave(&s->lock, flags);	set_host_mode_unsafe(s->io_base);	if (host_write_ctrl_unsafe(s->io_base, CMD_GET_MIDI_VOL, 100)) {		uctl->value.integer.value[0] = host_read_ctrl_unsafe(s->io_base, 100);	}	set_midi_mode_unsafe(s->io_base);	spin_unlock_irqrestore(&s->lock, flags);	return 0;}static int sscape_midi_put(struct snd_kcontrol *kctl,                           struct snd_ctl_elem_value *uctl){	struct snd_cs4231 *chip = snd_kcontrol_chip(kctl);	struct snd_card *card = chip->card;	register struct soundscape *s = get_card_soundscape(card);	unsigned long flags;	int change;	spin_lock_irqsave(&s->lock, flags);	/*	 * We need to put the board into HOST mode before we	 * can send any volume-changing HOST commands ...	 */	set_host_mode_unsafe(s->io_base);	/*	 * To successfully change the MIDI volume setting, you seem to	 * have to write a volume command, write the new volume value,	 * and then perform another volume-related command. Perhaps the	 * first command is an "open" and the second command is a "close"?	 */	if (s->midi_vol == ((unsigned char) uctl->value.integer. value[0] & 127)) {		change = 0;		goto __skip_change;	}	change = (host_write_ctrl_unsafe(s->io_base, CMD_SET_MIDI_VOL, 100)	          && host_write_ctrl_unsafe(s->io_base, ((unsigned char) uctl->value.integer. value[0]) & 127, 100)	          && host_write_ctrl_unsafe(s->io_base, CMD_XXX_MIDI_VOL, 100));      __skip_change:	/*	 * Take the board out of HOST mode and back into MIDI mode ...	 */	set_midi_mode_unsafe(s->io_base);	spin_unlock_irqrestore(&s->lock, flags);	return change;}static struct snd_kcontrol_new midi_mixer_ctl = {	.iface = SNDRV_CTL_ELEM_IFACE_MIXER,	.name = "MIDI",	.info = sscape_midi_info,	.get = sscape_midi_get,	.put = sscape_midi_put};/* * The SoundScape can use two IRQs from a possible set of four. * These IRQs are encoded as bit patterns so that they can be * written to the control registers. */static unsigned __devinit get_irq_config(int irq){	static const int valid_irq[] = { 9, 5, 7, 10 };	unsigned cfg;	for (cfg = 0; cfg < ARRAY_SIZE(valid_irq); ++cfg) {		if (irq == valid_irq[cfg])			return cfg;	} /* for */	return INVALID_IRQ;}/* * Perform certain arcane port-checks to see whether there * is a SoundScape board lurking behind the given ports. */static int __devinit detect_sscape(struct soundscape *s){	unsigned long flags;	unsigned d;	int retval = 0;	int codec = s->wss_base;	spin_lock_irqsave(&s->lock, flags);	/*	 * The following code is lifted from the original OSS driver,	 * and as I don't have a datasheet I cannot really comment	 * on what it is doing...	 */	if ((inb(HOST_CTRL_IO(s->io_base)) & 0x78) != 0)		goto _done;	d = inb(ODIE_ADDR_IO(s->io_base)) & 0xf0;	if ((d & 0x80) != 0)		goto _done;	if (d == 0) {		s->codec_type = 1;		s->ic_type = IC_ODIE;	} else if ((d & 0x60) != 0) {		s->codec_type = 2;		s->ic_type = IC_OPUS;	} else		goto _done;	outb(0xfa, ODIE_ADDR_IO(s->io_base));	if ((inb(ODIE_ADDR_IO(s->io_base)) & 0x9f) != 0x0a)		goto _done;	outb(0xfe, ODIE_ADDR_IO(s->io_base));	if ((inb(ODIE_ADDR_IO(s->io_base)) & 0x9f) != 0x0e)		goto _done;	outb(0xfe, ODIE_ADDR_IO(s->io_base));	d = inb(ODIE_DATA_IO(s->io_base));	if (s->type != SSCAPE_VIVO && (d & 0x9f) != 0x0e)		goto _done;	d  = sscape_read_unsafe(s->io_base, GA_HMCTL_REG) & 0x3f;	sscape_write_unsafe(s->io_base, GA_HMCTL_REG, d | 0xc0);	if (s->type == SSCAPE_VIVO)		codec += 4;	/* wait for WSS codec */	for (d = 0; d < 500; d++) {		if ((inb(codec) & 0x80) == 0)			break;		spin_unlock_irqrestore(&s->lock, flags);		msleep(1);		spin_lock_irqsave(&s->lock, flags);	}	snd_printd(KERN_INFO "init delay = %d ms\n", d);	/*	 * SoundScape successfully detected!	 */	retval = 1;	_done:	spin_unlock_irqrestore(&s->lock, flags);	return retval;}/* * ALSA callback function, called when attempting to open the MIDI device. * Check that the MIDI firmware has been loaded, because we don't want * to crash the machine. Also check that someone isn't using the hardware * IOCTL device. */static int mpu401_open(struct snd_mpu401 * mpu){	int err;	if (!verify_mpu401(mpu)) {		snd_printk(KERN_ERR "sscape: MIDI disabled, please load firmware\n");		err = -ENODEV;	} else {		register struct soundscape *sscape = get_mpu401_soundscape(mpu);		unsigned long flags;		spin_lock_irqsave(&sscape->fwlock, flags);		if (sscape->hw_in_use || (sscape->midi_usage == ULONG_MAX)) {			err = -EBUSY;		} else {			++(sscape->midi_usage);			err = 0;		}		spin_unlock_irqrestore(&sscape->fwlock, flags);	}	return err;}static void mpu401_close(struct snd_mpu401 * mpu){	register struct soundscape *sscape = get_mpu401_soundscape(mpu);	unsigned long flags;	spin_lock_irqsave(&sscape->fwlock, flags);	--(sscape->midi_usage);	spin_unlock_irqrestore(&sscape->fwlock, flags);}/* * Initialse an MPU-401 subdevice for MIDI support on the SoundScape. */static int __devinit create_mpu401(struct snd_card *card, int devnum, unsigned long port, int irq){	struct soundscape *sscape = get_card_soundscape(card);	struct snd_rawmidi *rawmidi;	int err;	if ((err = snd_mpu401_uart_new(card, devnum,	                               MPU401_HW_MPU401,	                               port, MPU401_INFO_INTEGRATED,	                               irq, IRQF_DISABLED,	                               &rawmidi)) == 0) {		struct snd_mpu401 *mpu = (struct snd_mpu401 *) rawmidi->private_data;		mpu->open_input = mpu401_open;		mpu->open_output = mpu401_open;		mpu->close_input = mpu401_close;		mpu->close_output = mpu401_close;		mpu->private_data = sscape;		sscape->mpu = mpu;		initialise_mpu401(mpu);	}	return err;}/* * Override for the CS4231 playback format function. * The AD1845 has much simpler format and rate selection. */static void ad1845_playback_format(struct snd_cs4231 * chip, struct snd_pcm_hw_params *params, unsigned char format){	unsigned long flags;	unsigned rate = params_rate(params);	/*	 * The AD1845 can't handle sample frequencies	 * outside of 4 kHZ to 50 kHZ	 */	if (rate > 50000)		rate = 50000;	else if (rate < 4000)		rate = 4000;	spin_lock_irqsave(&chip->reg_lock, flags);	/*	 * Program the AD1845 correctly for the playback stream.	 * Note that we do NOT need to toggle the MCE bit because	 * the PLAYBACK_ENABLE bit of the Interface Configuration	 * register is set.	 * 	 * NOTE: We seem to need to write to the MSB before the LSB	 *       to get the correct sample frequency.	 */	snd_cs4231_out(chip, CS4231_PLAYBK_FORMAT, (format & 0xf0));	snd_cs4231_out(chip, AD1845_FREQ_SEL_MSB, (unsigned char) (rate >> 8));	snd_cs4231_out(chip, AD1845_FREQ_SEL_LSB, (unsigned char) rate);	spin_unlock_irqrestore(&chip->reg_lock, flags);}/* * Override for the CS4231 capture format function.  * The AD1845 has much simpler format and rate selection. */static void ad1845_capture_format(struct snd_cs4231 * chip, struct snd_pcm_hw_params *params, unsigned char format){	unsigned long flags;	unsigned rate = params_rate(params);	/*	 * The AD1845 can't handle sample frequencies 	 * outside of 4 kHZ to 50 kHZ	 */	if (rate > 50000)		rate = 50000;	else if (rate < 4000)		rate = 4000;	spin_lock_irqsave(&chip->reg_lock, flags);	/*	 * Program the AD1845 correctly for the playback stream.	 * Note that we do NOT need to toggle the MCE bit because	 * the CAPTURE_ENABLE bit of the Interface Configuration	 * register is set.	 *	 * NOTE: We seem to need to write to the MSB before the LSB	 *       to get the correct sample frequency.	 */	snd_cs4231_out(chip, CS4231_REC_FORMAT, (format & 0xf0));	snd_cs4231_out(chip, AD1845_FREQ_SEL_MSB, (unsigned char) (rate >> 8));	snd_cs4231_out(chip, AD1845_FREQ_SEL_LSB, (unsigned char) rate);	spin_unlock_irqrestore(&chip->reg_lock, flags);}/* * Create an AD1845 PCM subdevice on the SoundScape. The AD1845 * is very much like a CS4231, with a few extra bits. We will * try to support at least some of the extra bits by overriding * some of the CS4231 callback. */static int __devinit create_ad1845(struct snd_card *card, unsigned port,				   int irq, int dma1, int dma2){	register struct soundscape *sscape = get_card_soundscape(card);	struct snd_cs4231 *chip;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
懂色av一区二区三区免费观看| 欧美日本一区二区三区四区| 久久狠狠亚洲综合| 亚洲丰满少妇videoshd| 日韩毛片高清在线播放| 国产精品麻豆欧美日韩ww| 久久久久久久综合| 欧美mv日韩mv国产网站| 欧美一级淫片007| 日韩一区二区三| 久久亚洲综合色| 久久久久国产精品麻豆| 国产日韩欧美不卡在线| 国产日韩欧美精品电影三级在线 | 亚洲三级电影网站| 亚洲人成网站在线| 亚洲另类中文字| 婷婷国产在线综合| 美日韩一区二区三区| 激情综合色丁香一区二区| 国产一区二区精品在线观看| 国产不卡视频在线播放| 99热精品国产| 欧美亚洲日本国产| 欧美第一区第二区| 国产日韩av一区二区| 亚洲欧美中日韩| 一级特黄大欧美久久久| 欧美aa在线视频| 成人国产精品视频| 欧洲精品一区二区三区在线观看| 欧美精品久久一区| 久久只精品国产| 亚洲女性喷水在线观看一区| 偷拍亚洲欧洲综合| 国产自产视频一区二区三区| 色婷婷久久久亚洲一区二区三区 | 国产欧美视频一区二区三区| 国产精品萝li| 日韩精品亚洲一区二区三区免费| 精品一区二区免费看| av电影天堂一区二区在线观看| 欧美无砖专区一中文字| 精品久久久久久最新网址| 国产精品成人免费在线| 亚洲mv在线观看| 国产精品系列在线观看| 91电影在线观看| 日韩精品一区二区三区三区免费| 一区在线观看免费| 日本强好片久久久久久aaa| 成人av免费观看| 91精品国产乱| 亚洲三级小视频| 国内一区二区视频| 日本韩国欧美一区| 国产日韩欧美不卡| 日韩精品电影在线| 91免费看视频| 精品国产a毛片| 亚洲综合在线电影| 国产69精品久久久久777| 51午夜精品国产| 亚洲男人的天堂一区二区| 狂野欧美性猛交blacked| 在线视频你懂得一区二区三区| 欧美不卡123| 亚洲中国最大av网站| 懂色av一区二区夜夜嗨| 日韩一区国产二区欧美三区| 一个色综合网站| 成人一区二区三区视频| 91精品欧美一区二区三区综合在 | 顶级嫩模精品视频在线看| 欧美日韩精品一区视频| 国产视频一区二区在线观看| 青青青爽久久午夜综合久久午夜| aaa亚洲精品一二三区| 久久综合九色综合97_久久久| 三级在线观看一区二区| 91一区二区在线观看| 国产精品欧美久久久久无广告| 蜜桃免费网站一区二区三区| 欧美午夜片在线看| 亚洲欧美综合另类在线卡通| 国产精品1区2区| 欧美精品一区二区三区四区 | 99久久免费国产| 久久久久国产精品麻豆ai换脸| 久久成人综合网| 91精品欧美久久久久久动漫 | 色婷婷综合激情| 亚洲丝袜美腿综合| 国产v日产∨综合v精品视频| 日韩免费观看2025年上映的电影 | 欧美精品自拍偷拍| 亚洲香肠在线观看| 91福利在线观看| 一区二区三区四区中文字幕| 成人美女视频在线观看| 国产视频一区二区在线| 国产福利一区二区三区视频| 欧美videos中文字幕| 国产在线不卡视频| 欧美精品一区二区三区高清aⅴ | 日本亚洲电影天堂| 欧美色偷偷大香| 午夜视频在线观看一区二区三区 | 亚洲女子a中天字幕| 色哟哟一区二区三区| 有码一区二区三区| 在线观看日韩毛片| 天堂一区二区在线| 91精品国产综合久久蜜臀| 日产精品久久久久久久性色 | 日本成人在线不卡视频| 91精品国产高清一区二区三区| 午夜精品在线看| 91精品国产黑色紧身裤美女| 精品亚洲成a人在线观看| 欧美成人一级视频| 国产成人精品综合在线观看 | 成人免费不卡视频| 综合色天天鬼久久鬼色| 日本韩国欧美在线| 免费欧美日韩国产三级电影| 精品欧美乱码久久久久久 | 精品久久久久香蕉网| 国产成人午夜精品影院观看视频 | 91成人在线免费观看| 天堂蜜桃91精品| 2023国产精华国产精品| 成人精品在线视频观看| 一区二区三区免费看视频| 欧美精品亚洲一区二区在线播放| 麻豆高清免费国产一区| 国产精品你懂的在线欣赏| 91福利社在线观看| 久久国产剧场电影| 亚洲欧美日韩国产综合| 欧美老人xxxx18| 国产激情精品久久久第一区二区| 亚洲欧美激情插 | 日韩一区中文字幕| 欧美酷刑日本凌虐凌虐| 国产精品影视在线观看| 一区二区三区在线免费观看| 日韩欧美亚洲国产另类| caoporen国产精品视频| 日产国产欧美视频一区精品| 一区二区中文视频| 51精品视频一区二区三区| 成人午夜视频在线观看| 午夜av电影一区| 国产精品久久久一区麻豆最新章节| 欧美日韩国产a| 高清国产一区二区| 亚洲高清在线精品| 国产欧美日本一区视频| 欧美日韩视频在线一区二区| 国产一区二区三区在线看麻豆| 亚洲精品国产a| 久久理论电影网| 欧美日韩在线电影| 不卡视频一二三四| 老司机午夜精品| 亚洲国产视频a| 国产精品久久久久影院| 精品少妇一区二区三区在线视频| 91久久国产综合久久| 国产一区二区成人久久免费影院| 国产精品福利一区二区三区| 欧美三级在线看| 8v天堂国产在线一区二区| 在线播放/欧美激情| 91理论电影在线观看| 国产麻豆精品95视频| 五月天视频一区| 久久综合网色—综合色88| 欧美日本一区二区三区| 91成人免费在线视频| 午夜成人免费视频| 亚洲激情图片qvod| 亚洲品质自拍视频网站| 色综合久久综合| 成人h版在线观看| 国产一二三精品| 美女在线视频一区| 中文字幕一区二区三区精华液| 久久婷婷久久一区二区三区| 欧美成人三级在线| 成av人片一区二区| 高清av一区二区| 从欧美一区二区三区| 中文字幕永久在线不卡| 国产精品欧美久久久久一区二区| 欧美国产一区在线| 久久久久久久免费视频了| 色综合久久九月婷婷色综合| av电影在线观看完整版一区二区|