/* -*- linux-c -*- *
 *
 * ALSA driver for the digigram lx6464es interface
 *
 * Copyright (c) 2009 Tim Blechmann <tim@klingt.org>
 *
 *
 * 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; see the file COPYING.  If not, write to
 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 *
 */

#ifndef LX6464ES_H
#define LX6464ES_H

#include <linux/spinlock.h>
#include <linux/atomic.h>

#include <sound/core.h>
#include <sound/pcm.h>

#include "lx_core.h"

#define LXP "LX6464ES: "

enum {
    ES_cmd_free         = 0,    /* no command executing */
    ES_cmd_processing   = 1,	/* execution of a read/write command */
    ES_read_pending     = 2,    /* a asynchron read command is pending */
    ES_read_finishing   = 3,    /* a read command has finished waiting (set by
				 * Interrupt or CancelIrp) */
};

enum lx_stream_status {
	LX_STREAM_STATUS_FREE,
/* 	LX_STREAM_STATUS_OPEN, */
	LX_STREAM_STATUS_SCHEDULE_RUN,
/* 	LX_STREAM_STATUS_STARTED, */
	LX_STREAM_STATUS_RUNNING,
	LX_STREAM_STATUS_SCHEDULE_STOP,
/* 	LX_STREAM_STATUS_STOPPED, */
/* 	LX_STREAM_STATUS_PAUSED */
};


struct lx_stream {
	struct snd_pcm_substream  *stream;
	snd_pcm_uframes_t          frame_pos;
	enum lx_stream_status      status; /* free, open, running, draining
					    * pause */
	unsigned int               is_capture:1;
};


struct lx6464es {
	struct snd_card        *card;
	struct pci_dev         *pci;
	int			irq;

	u8			mac_address[6];

	struct mutex		lock;        /* interrupt lock */
	struct mutex            setup_mutex; /* mutex used in hw_params, open
					      * and close */

	/* ports */
	unsigned long		port_plx;	   /* io port (size=256) */
	void __iomem           *port_plx_remapped; /* remapped plx port */
	void __iomem           *port_dsp_bar;      /* memory port (32-bit,
						    * non-prefetchable,
						    * size=8K) */

	/* messaging */
	struct mutex		msg_lock;          /* message lock */
	struct lx_rmh           rmh;
	u32			irqsrc;

	/* configuration */
	uint			freq_ratio : 2;
	uint                    playback_mute : 1;
	uint                    hardware_running[2];
	u32                     board_sample_rate; /* sample rate read from
						    * board */
	u16                     pcm_granularity;   /* board blocksize */

	/* dma */
	struct snd_dma_buffer   capture_dma_buf;
	struct snd_dma_buffer   playback_dma_buf;

	/* pcm */
	struct snd_pcm         *pcm;

	/* streams */
	struct lx_stream        capture_stream;
	struct lx_stream        playback_stream;
};


#endif /* LX6464ES_H */
/commit/drivers/usb/chipidea?id=252bf9f4c43fd58f96587a97866cb7cc980e7544'>chipidea</a>/<a href='/cgit.cgi/linux/net-next.git/commit/drivers/usb/chipidea/Kconfig?id=252bf9f4c43fd58f96587a97866cb7cc980e7544'>Kconfig</a></div><div class='content'><div class='cgit-panel'><b>diff options</b><form method='get'><input type='hidden' name='id' value='252bf9f4c43fd58f96587a97866cb7cc980e7544'/><table><tr><td colspan='2'/></tr><tr><td class='label'>context:</td><td class='ctrl'><select name='context' onchange='this.form.submit();'><option value='1'>1</option><option value='2'>2</option><option value='3' selected='selected'>3</option><option value='4'>4</option><option value='5'>5</option><option value='6'>6</option><option value='7'>7</option><option value='8'>8</option><option value='9'>9</option><option value='10'>10</option><option value='15'>15</option><option value='20'>20</option><option value='25'>25</option><option value='30'>30</option><option value='35'>35</option><option value='40'>40</option></select></td></tr><tr><td class='label'>space:</td><td class='ctrl'><select name='ignorews' onchange='this.form.submit();'><option value='0' selected='selected'>include</option><option value='1'>ignore</option></select></td></tr><tr><td class='label'>mode:</td><td class='ctrl'><select name='dt' onchange='this.form.submit();'><option value='0' selected='selected'>unified</option><option value='1'>ssdiff</option><option value='2'>stat only</option></select></td></tr><tr><td/><td class='ctrl'><noscript><input type='submit' value='reload'/></noscript></td></tr></table></form></div><table summary='commit info' class='commit-info'>
<tr><th>author</th><td>Linus Torvalds &lt;torvalds@linux-foundation.org&gt;</td><td class='right'>2017-02-04 10:38:09 -0800</td></tr>
<tr><th>committer</th><td>Linus Torvalds &lt;torvalds@linux-foundation.org&gt;</td><td class='right'>2017-02-04 10:38:09 -0800</td></tr>
<tr><th>commit</th><td colspan='2' class='oid'><a href='/cgit.cgi/linux/net-next.git/commit/drivers/usb/chipidea/Kconfig?id=252bf9f4c43fd58f96587a97866cb7cc980e7544'>252bf9f4c43fd58f96587a97866cb7cc980e7544</a> (<a href='/cgit.cgi/linux/net-next.git/patch/drivers/usb/chipidea/Kconfig?id=252bf9f4c43fd58f96587a97866cb7cc980e7544'>patch</a>)</td></tr>
<tr><th>tree</th><td colspan='2' class='oid'><a href='/cgit.cgi/linux/net-next.git/tree/?id=252bf9f4c43fd58f96587a97866cb7cc980e7544'>aeff11933ae538381392f91ec10da99e49c61c91</a> /<a href='/cgit.cgi/linux/net-next.git/tree/drivers/usb/chipidea/Kconfig?id=252bf9f4c43fd58f96587a97866cb7cc980e7544'>drivers/usb/chipidea/Kconfig</a></td></tr>
<tr><th>parent</th><td colspan='2' class='oid'><a href='/cgit.cgi/linux/net-next.git/commit/drivers/usb/chipidea/Kconfig?id=8fcdcc42a5268f298ac91962a5e816294435006f'>8fcdcc42a5268f298ac91962a5e816294435006f</a> (<a href='/cgit.cgi/linux/net-next.git/diff/drivers/usb/chipidea/Kconfig?id=252bf9f4c43fd58f96587a97866cb7cc980e7544&amp;id2=8fcdcc42a5268f298ac91962a5e816294435006f'>diff</a>)</td></tr><tr><th>parent</th><td colspan='2' class='oid'><a href='/cgit.cgi/linux/net-next.git/commit/drivers/usb/chipidea/Kconfig?id=b17c1bba9cec1727451b906d9a0c209774624873'>b17c1bba9cec1727451b906d9a0c209774624873</a> (<a href='/cgit.cgi/linux/net-next.git/diff/drivers/usb/chipidea/Kconfig?id=252bf9f4c43fd58f96587a97866cb7cc980e7544&amp;id2=b17c1bba9cec1727451b906d9a0c209774624873'>diff</a>)</td></tr></table>
<div class='commit-subject'>Merge tag 'staging-4.10-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging</div><div class='commit-msg'>Pull staging/IIO fixes from Greg KH:
 "Here are a few small IIO and one staging driver fix for 4.10-rc7. They
  fix some reported issues with the drivers.

  All of them have been in linux-next for a week or so with no reported
  issues"

* tag 'staging-4.10-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
  staging: greybus: timesync: validate platform state callback
  iio: dht11: Use usleep_range instead of msleep for start signal
  iio: adc: palmas_gpadc: retrieve a valid iio_dev in suspend/resume
  iio: health: max30100: fixed parenthesis around FIFO count check
  iio: health: afe4404: retrieve a valid iio_dev in suspend/resume
  iio: health: afe4403: retrieve a valid iio_dev in suspend/resume
</div><div class='diffstat-header'><a href='/cgit.cgi/linux/net-next.git/diff/?id=252bf9f4c43fd58f96587a97866cb7cc980e7544'>Diffstat</a> (limited to 'drivers/usb/chipidea/Kconfig')</div><table summary='diffstat' class='diffstat'>