/* -*- linux-c -*- *1*2* ALSA driver for the digigram lx6464es interface3*4* Copyright (c) 2009 Tim Blechmann <[email protected]>5*6*7* This program is free software; you can redistribute it and/or modify8* it under the terms of the GNU General Public License as published by9* the Free Software Foundation; either version 2 of the License, or10* (at your option) any later version.11*12* This program is distributed in the hope that it will be useful,13* but WITHOUT ANY WARRANTY; without even the implied warranty of14* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the15* GNU General Public License for more details.16*17* You should have received a copy of the GNU General Public License18* along with this program; see the file COPYING. If not, write to19* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,20* Boston, MA 02111-1307, USA.21*22*/2324#ifndef LX6464ES_H25#define LX6464ES_H2627#include <linux/spinlock.h>28#include <asm/atomic.h>2930#include <sound/core.h>31#include <sound/pcm.h>3233#include "lx_core.h"3435#define LXP "LX6464ES: "3637enum {38ES_cmd_free = 0, /* no command executing */39ES_cmd_processing = 1, /* execution of a read/write command */40ES_read_pending = 2, /* a asynchron read command is pending */41ES_read_finishing = 3, /* a read command has finished waiting (set by42* Interrupt or CancelIrp) */43};4445enum lx_stream_status {46LX_STREAM_STATUS_FREE,47/* LX_STREAM_STATUS_OPEN, */48LX_STREAM_STATUS_SCHEDULE_RUN,49/* LX_STREAM_STATUS_STARTED, */50LX_STREAM_STATUS_RUNNING,51LX_STREAM_STATUS_SCHEDULE_STOP,52/* LX_STREAM_STATUS_STOPPED, */53/* LX_STREAM_STATUS_PAUSED */54};555657struct lx_stream {58struct snd_pcm_substream *stream;59snd_pcm_uframes_t frame_pos;60enum lx_stream_status status; /* free, open, running, draining61* pause */62unsigned int is_capture:1;63};646566struct lx6464es {67struct snd_card *card;68struct pci_dev *pci;69int irq;7071spinlock_t lock; /* interrupt spinlock */72struct mutex setup_mutex; /* mutex used in hw_params, open73* and close */7475struct tasklet_struct trigger_tasklet; /* trigger tasklet */76struct tasklet_struct tasklet_capture;77struct tasklet_struct tasklet_playback;7879/* ports */80unsigned long port_plx; /* io port (size=256) */81void __iomem *port_plx_remapped; /* remapped plx port */82void __iomem *port_dsp_bar; /* memory port (32-bit,83* non-prefetchable,84* size=8K) */8586/* messaging */87spinlock_t msg_lock; /* message spinlock */88struct lx_rmh rmh;8990/* configuration */91uint freq_ratio : 2;92uint playback_mute : 1;93uint hardware_running[2];94u32 board_sample_rate; /* sample rate read from95* board */96u16 pcm_granularity; /* board blocksize */9798/* dma */99struct snd_dma_buffer capture_dma_buf;100struct snd_dma_buffer playback_dma_buf;101102/* pcm */103struct snd_pcm *pcm;104105/* streams */106struct lx_stream capture_stream;107struct lx_stream playback_stream;108};109110111#endif /* LX6464ES_H */112113114