Lines Matching defs:galaxy
372 static int galaxy_init(struct snd_galaxy *galaxy, u8 *type)
378 err = dsp_reset(galaxy->port);
382 err = dsp_get_version(galaxy->port, &major, &minor);
389 err = dsp_command(galaxy->port, DSP_COMMAND_GALAXY_8);
393 err = dsp_command(galaxy->port, GALAXY_COMMAND_GET_TYPE);
397 err = dsp_get_byte(galaxy->port, type);
404 static int galaxy_set_mode(struct snd_galaxy *galaxy, u8 mode)
408 err = dsp_command(galaxy->port, DSP_COMMAND_GALAXY_9);
412 err = dsp_command(galaxy->port, mode);
420 err = dsp_reset(galaxy->port);
428 static void galaxy_set_config(struct snd_galaxy *galaxy, u32 config)
430 u8 tmp = ioread8(galaxy->config_port + CONFIG_PORT_SET);
433 iowrite8(tmp | 0x80, galaxy->config_port + CONFIG_PORT_SET);
435 iowrite8(config, galaxy->config_port + i);
438 iowrite8(tmp & 0x7f, galaxy->config_port + CONFIG_PORT_SET);
442 static void galaxy_config(struct snd_galaxy *galaxy, u32 config)
447 u8 tmp = ioread8(galaxy->config_port + i - 1);
448 galaxy->config = (galaxy->config << 8) | tmp;
450 config |= galaxy->config & GALAXY_CONFIG_MASK;
451 galaxy_set_config(galaxy, config);
454 static int galaxy_wss_config(struct snd_galaxy *galaxy, u8 wss_config)
458 err = wss_detect(galaxy->wss_port);
462 wss_set_config(galaxy->wss_port, wss_config);
464 err = galaxy_set_mode(galaxy, GALAXY_MODE_WSS);
473 struct snd_galaxy *galaxy = card->private_data;
475 if (galaxy->wss_port) {
476 wss_set_config(galaxy->wss_port, 0);
477 ioport_unmap(galaxy->wss_port);
478 release_and_free_resource(galaxy->res_wss_port);
480 if (galaxy->config_port) {
481 galaxy_set_config(galaxy, galaxy->config);
482 ioport_unmap(galaxy->config_port);
483 release_and_free_resource(galaxy->res_config_port);
485 if (galaxy->port) {
486 ioport_unmap(galaxy->port);
487 release_and_free_resource(galaxy->res_port);
493 struct snd_galaxy *galaxy;
500 sizeof(*galaxy), &card);
505 galaxy = card->private_data;
507 galaxy->res_port = request_region(port[n], 16, DRV_NAME);
508 if (!galaxy->res_port) {
514 galaxy->port = ioport_map(port[n], 16);
516 err = galaxy_init(galaxy, &type);
523 galaxy->res_config_port = request_region(port[n] + GALAXY_PORT_CONFIG,
525 if (!galaxy->res_config_port) {
532 galaxy->config_port = ioport_map(port[n] + GALAXY_PORT_CONFIG, 16);
534 galaxy_config(galaxy, config[n]);
536 galaxy->res_wss_port = request_region(wss_port[n], 4, DRV_NAME);
537 if (!galaxy->res_wss_port) {
543 galaxy->wss_port = ioport_map(wss_port[n], 4);
545 err = galaxy_wss_config(galaxy, wss_config[n]);