Commit a9c3c7e0 authored by Takashi Iwai's avatar Takashi Iwai

Merge branch 'topic/pcxhr-update' into to-push

parents cc491085 ade9b2fb
snd-pcxhr-objs := pcxhr.o pcxhr_hwdep.o pcxhr_mixer.o pcxhr_core.o snd-pcxhr-objs := pcxhr.o pcxhr_hwdep.o pcxhr_mixer.o pcxhr_core.o pcxhr_mix22.o
obj-$(CONFIG_SND_PCXHR) += snd-pcxhr.o obj-$(CONFIG_SND_PCXHR) += snd-pcxhr.o
This diff is collapsed.
...@@ -27,15 +27,18 @@ ...@@ -27,15 +27,18 @@
#include <linux/mutex.h> #include <linux/mutex.h>
#include <sound/pcm.h> #include <sound/pcm.h>
#define PCXHR_DRIVER_VERSION 0x000804 /* 0.8.4 */ #define PCXHR_DRIVER_VERSION 0x000905 /* 0.9.5 */
#define PCXHR_DRIVER_VERSION_STRING "0.8.4" /* 0.8.4 */ #define PCXHR_DRIVER_VERSION_STRING "0.9.5" /* 0.9.5 */
#define PCXHR_MAX_CARDS 6 #define PCXHR_MAX_CARDS 6
#define PCXHR_PLAYBACK_STREAMS 4 #define PCXHR_PLAYBACK_STREAMS 4
#define PCXHR_GRANULARITY 96 /* transfer granularity (should be min 96 and multiple of 48) */ #define PCXHR_GRANULARITY 96 /* min 96 and multiple of 48 */
#define PCXHR_GRANULARITY_MIN 96 /* transfer granularity of pipes and the dsp time (MBOX4) */ /* transfer granularity of pipes and the dsp time (MBOX4) */
#define PCXHR_GRANULARITY_MIN 96
/* TODO : granularity could be 64 or 128 */
#define PCXHR_GRANULARITY_HR22 192 /* granularity for stereo cards */
struct snd_pcxhr; struct snd_pcxhr;
struct pcxhr_mgr; struct pcxhr_mgr;
...@@ -51,6 +54,11 @@ enum pcxhr_clock_type { ...@@ -51,6 +54,11 @@ enum pcxhr_clock_type {
PCXHR_CLOCK_TYPE_AES_2, PCXHR_CLOCK_TYPE_AES_2,
PCXHR_CLOCK_TYPE_AES_3, PCXHR_CLOCK_TYPE_AES_3,
PCXHR_CLOCK_TYPE_AES_4, PCXHR_CLOCK_TYPE_AES_4,
PCXHR_CLOCK_TYPE_MAX = PCXHR_CLOCK_TYPE_AES_4,
HR22_CLOCK_TYPE_INTERNAL = PCXHR_CLOCK_TYPE_INTERNAL,
HR22_CLOCK_TYPE_AES_SYNC,
HR22_CLOCK_TYPE_AES_1,
HR22_CLOCK_TYPE_MAX = HR22_CLOCK_TYPE_AES_1,
}; };
struct pcxhr_mgr { struct pcxhr_mgr {
...@@ -61,6 +69,8 @@ struct pcxhr_mgr { ...@@ -61,6 +69,8 @@ struct pcxhr_mgr {
int irq; int irq;
int granularity;
/* card access with 1 mem bar and 2 io bar's */ /* card access with 1 mem bar and 2 io bar's */
unsigned long port[3]; unsigned long port[3];
...@@ -83,11 +93,16 @@ struct pcxhr_mgr { ...@@ -83,11 +93,16 @@ struct pcxhr_mgr {
/* hardware interface */ /* hardware interface */
unsigned int dsp_loaded; /* bit flags of loaded dsp indices */ unsigned int dsp_loaded; /* bit flags of loaded dsp indices */
unsigned int dsp_version; /* read from embedded once firmware is loaded */ unsigned int dsp_version; /* read from embedded once firmware is loaded */
int board_has_analog; /* if 0 the board is digital only */ int playback_chips;
int mono_capture; /* if 1 the board does mono capture */ int capture_chips;
int playback_chips; /* 4 or 6 */ int fw_file_set;
int capture_chips; /* 4 or 1 */ int firmware_num;
int firmware_num; /* 41 or 42 */ int is_hr_stereo:1;
int board_has_aes1:1; /* if 1 board has AES1 plug and SRC */
int board_has_analog:1; /* if 0 the board is digital only */
int board_has_mic:1; /* if 1 the board has microphone input */
int board_aes_in_192k:1;/* if 1 the aes input plugs do support 192kHz */
int mono_capture:1; /* if 1 the board does mono capture */
struct snd_dma_buffer hostport; struct snd_dma_buffer hostport;
...@@ -106,6 +121,9 @@ struct pcxhr_mgr { ...@@ -106,6 +121,9 @@ struct pcxhr_mgr {
int async_err_stream_xrun; int async_err_stream_xrun;
int async_err_pipe_xrun; int async_err_pipe_xrun;
int async_err_other_last; int async_err_other_last;
unsigned char xlx_cfg; /* copy of PCXHR_XLX_CFG register */
unsigned char xlx_selmic; /* copy of PCXHR_XLX_SELMIC register */
}; };
...@@ -156,22 +174,28 @@ struct snd_pcxhr { ...@@ -156,22 +174,28 @@ struct snd_pcxhr {
struct snd_pcm *pcm; /* PCM */ struct snd_pcm *pcm; /* PCM */
struct pcxhr_pipe playback_pipe; /* 1 stereo pipe only */ struct pcxhr_pipe playback_pipe; /* 1 stereo pipe only */
struct pcxhr_pipe capture_pipe[2]; /* 1 stereo pipe or 2 mono pipes */ struct pcxhr_pipe capture_pipe[2]; /* 1 stereo or 2 mono pipes */
struct pcxhr_stream playback_stream[PCXHR_PLAYBACK_STREAMS]; struct pcxhr_stream playback_stream[PCXHR_PLAYBACK_STREAMS];
struct pcxhr_stream capture_stream[2]; /* 1 stereo stream or 2 mono streams */ struct pcxhr_stream capture_stream[2]; /* 1 stereo or 2 mono streams */
int nb_streams_play; int nb_streams_play;
int nb_streams_capt; int nb_streams_capt;
int analog_playback_active[2]; /* Mixer : Master Playback active (!mute) */ int analog_playback_active[2]; /* Mixer : Master Playback !mute */
int analog_playback_volume[2]; /* Mixer : Master Playback Volume */ int analog_playback_volume[2]; /* Mixer : Master Playback Volume */
int analog_capture_volume[2]; /* Mixer : Master Capture Volume */ int analog_capture_volume[2]; /* Mixer : Master Capture Volume */
int digital_playback_active[PCXHR_PLAYBACK_STREAMS][2]; /* Mixer : Digital Playback Active [streams][stereo]*/ int digital_playback_active[PCXHR_PLAYBACK_STREAMS][2];
int digital_playback_volume[PCXHR_PLAYBACK_STREAMS][2]; /* Mixer : Digital Playback Volume [streams][stereo]*/ int digital_playback_volume[PCXHR_PLAYBACK_STREAMS][2];
int digital_capture_volume[2]; /* Mixer : Digital Capture Volume [stereo] */ int digital_capture_volume[2]; /* Mixer : Digital Capture Volume */
int monitoring_active[2]; /* Mixer : Monitoring Active */ int monitoring_active[2]; /* Mixer : Monitoring Active */
int monitoring_volume[2]; /* Mixer : Monitoring Volume */ int monitoring_volume[2]; /* Mixer : Monitoring Volume */
int audio_capture_source; /* Mixer : Audio Capture Source */ int audio_capture_source; /* Mixer : Audio Capture Source */
int mic_volume; /* used by cards with MIC only */
int mic_boost; /* used by cards with MIC only */
int mic_active; /* used by cards with MIC only */
int analog_capture_active; /* used by cards with MIC only */
int phantom_power; /* used by cards with MIC only */
unsigned char aes_bits[5]; /* Mixer : IEC958_AES bits */ unsigned char aes_bits[5]; /* Mixer : IEC958_AES bits */
}; };
...@@ -184,6 +208,8 @@ struct pcxhr_hostport ...@@ -184,6 +208,8 @@ struct pcxhr_hostport
/* exported */ /* exported */
int pcxhr_create_pcm(struct snd_pcxhr *chip); int pcxhr_create_pcm(struct snd_pcxhr *chip);
int pcxhr_set_clock(struct pcxhr_mgr *mgr, unsigned int rate); int pcxhr_set_clock(struct pcxhr_mgr *mgr, unsigned int rate);
int pcxhr_get_external_clock(struct pcxhr_mgr *mgr, enum pcxhr_clock_type clock_type, int *sample_rate); int pcxhr_get_external_clock(struct pcxhr_mgr *mgr,
enum pcxhr_clock_type clock_type,
int *sample_rate);
#endif /* __SOUND_PCXHR_H */ #endif /* __SOUND_PCXHR_H */
This diff is collapsed.
...@@ -65,7 +65,7 @@ enum { ...@@ -65,7 +65,7 @@ enum {
CMD_RESYNC_AUDIO_INPUTS, /* cmd_len = 1 stat_len = 0 */ CMD_RESYNC_AUDIO_INPUTS, /* cmd_len = 1 stat_len = 0 */
CMD_GET_DSP_RESOURCES, /* cmd_len = 1 stat_len = 4 */ CMD_GET_DSP_RESOURCES, /* cmd_len = 1 stat_len = 4 */
CMD_SET_TIMER_INTERRUPT, /* cmd_len = 1 stat_len = 0 */ CMD_SET_TIMER_INTERRUPT, /* cmd_len = 1 stat_len = 0 */
CMD_RES_PIPE, /* cmd_len = 2 stat_len = 0 */ CMD_RES_PIPE, /* cmd_len >=2 stat_len = 0 */
CMD_FREE_PIPE, /* cmd_len = 1 stat_len = 0 */ CMD_FREE_PIPE, /* cmd_len = 1 stat_len = 0 */
CMD_CONF_PIPE, /* cmd_len = 2 stat_len = 0 */ CMD_CONF_PIPE, /* cmd_len = 2 stat_len = 0 */
CMD_STOP_PIPE, /* cmd_len = 1 stat_len = 0 */ CMD_STOP_PIPE, /* cmd_len = 1 stat_len = 0 */
...@@ -96,6 +96,8 @@ void pcxhr_init_rmh(struct pcxhr_rmh *rmh, int cmd); ...@@ -96,6 +96,8 @@ void pcxhr_init_rmh(struct pcxhr_rmh *rmh, int cmd);
void pcxhr_set_pipe_cmd_params(struct pcxhr_rmh* rmh, int capture, unsigned int param1, void pcxhr_set_pipe_cmd_params(struct pcxhr_rmh* rmh, int capture, unsigned int param1,
unsigned int param2, unsigned int param3); unsigned int param2, unsigned int param3);
#define DSP_EXT_CMD_SET(x) (x->dsp_version > 0x012800)
/* /*
send the rmh send the rmh
*/ */
...@@ -110,6 +112,7 @@ int pcxhr_send_msg(struct pcxhr_mgr *mgr, struct pcxhr_rmh *rmh); ...@@ -110,6 +112,7 @@ int pcxhr_send_msg(struct pcxhr_mgr *mgr, struct pcxhr_rmh *rmh);
#define IO_NUM_REG_STATUS 5 #define IO_NUM_REG_STATUS 5
#define IO_NUM_REG_CUER 10 #define IO_NUM_REG_CUER 10
#define IO_NUM_UER_CHIP_REG 11 #define IO_NUM_UER_CHIP_REG 11
#define IO_NUM_REG_CONFIG_SRC 12
#define IO_NUM_REG_OUT_ANA_LEVEL 20 #define IO_NUM_REG_OUT_ANA_LEVEL 20
#define IO_NUM_REG_IN_ANA_LEVEL 21 #define IO_NUM_REG_IN_ANA_LEVEL 21
......
This diff is collapsed.
This diff is collapsed.
/*
* Driver for Digigram pcxhr compatible soundcards
*
* low level interface with interrupt ans message handling
*
* Copyright (c) 2004 by Digigram <alsa@digigram.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __SOUND_PCXHR_MIX22_H
#define __SOUND_PCXHR_MIX22_H
struct pcxhr_mgr;
int hr222_sub_init(struct pcxhr_mgr *mgr);
int hr222_sub_set_clock(struct pcxhr_mgr *mgr, unsigned int rate,
int *changed);
int hr222_get_external_clock(struct pcxhr_mgr *mgr,
enum pcxhr_clock_type clock_type,
int *sample_rate);
#define HR222_LINE_PLAYBACK_LEVEL_MIN 0 /* -25.5 dB */
#define HR222_LINE_PLAYBACK_ZERO_LEVEL 51 /* 0.0 dB */
#define HR222_LINE_PLAYBACK_LEVEL_MAX 99 /* +24.0 dB */
#define HR222_LINE_CAPTURE_LEVEL_MIN 0 /* -111.5 dB */
#define HR222_LINE_CAPTURE_ZERO_LEVEL 223 /* 0.0 dB */
#define HR222_LINE_CAPTURE_LEVEL_MAX 255 /* +16 dB */
#define HR222_MICRO_CAPTURE_LEVEL_MIN 0 /* -98.5 dB */
#define HR222_MICRO_CAPTURE_LEVEL_MAX 210 /* +6.5 dB */
int hr222_update_analog_audio_level(struct snd_pcxhr *chip,
int is_capture,
int channel);
int hr222_set_audio_source(struct snd_pcxhr *chip);
int hr222_iec958_capture_byte(struct snd_pcxhr *chip, int aes_idx,
unsigned char *aes_bits);
int hr222_iec958_update_byte(struct snd_pcxhr *chip, int aes_idx,
unsigned char aes_bits);
int hr222_add_mic_controls(struct snd_pcxhr *chip);
#endif /* __SOUND_PCXHR_MIX22_H */
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment