Beispiel #1
0
static void
snd_bebob_update(struct fw_unit *unit)
{
	struct snd_bebob *bebob = dev_get_drvdata(&unit->device);

	/* this is for firmware bootloader */
	if (bebob == NULL)
		goto end;

	fcp_bus_reset(bebob->unit);

	/* bus reset for isochronous transmit stream */
	if (cmp_connection_update(&bebob->in_conn) < 0) {
		amdtp_stream_pcm_abort(&bebob->tx_stream);
		mutex_lock(&bebob->mutex);
		snd_bebob_stream_stop(bebob, &bebob->tx_stream);
		mutex_unlock(&bebob->mutex);
	}
	amdtp_stream_update(&bebob->tx_stream);

	/* bus reset for isochronous receive stream */
	if (cmp_connection_update(&bebob->out_conn) < 0) {
		amdtp_stream_pcm_abort(&bebob->rx_stream);
		mutex_lock(&bebob->mutex);
		snd_bebob_stream_stop(bebob, &bebob->rx_stream);
		mutex_unlock(&bebob->mutex);
	}
	amdtp_stream_update(&bebob->rx_stream);

end:
	return;
}
Beispiel #2
0
/*
 * This driver doesn't update streams in bus reset handler.
 *
 * DM1000/ DM1100/DM1500 chipsets with BeBoB firmware transfer packets with
 * discontinued counter at bus reset. This discontinuity is immediately
 * detected in packet streaming layer, then it sets XRUN to PCM substream.
 *
 * ALSA PCM applications can know the XRUN by getting -EPIPE from PCM operation.
 * Then, they can recover the PCM substream by executing ioctl(2) with
 * SNDRV_PCM_IOCTL_PREPARE. 'struct snd_pcm_ops.prepare' is called and drivers
 * restart packet streaming.
 *
 * The above processing may be executed before this bus-reset handler is
 * executed. When this handler updates streams with current isochronous
 * channels, the streams already have the current ones.
 */
static void
bebob_update(struct fw_unit *unit)
{
	struct snd_bebob *bebob = dev_get_drvdata(&unit->device);

	if (bebob == NULL)
		return;

	/* Postpone a workqueue for deferred registration. */
	if (!bebob->registered)
		snd_fw_schedule_registration(unit, &bebob->dwork);
	else
		fcp_bus_reset(bebob->unit);
}
Beispiel #3
0
static void oxfw_bus_reset(struct fw_unit *unit)
{
	struct snd_oxfw *oxfw = dev_get_drvdata(&unit->device);

	fcp_bus_reset(oxfw->unit);

	mutex_lock(&oxfw->mutex);

	snd_oxfw_stream_update_simplex(oxfw, &oxfw->rx_stream);
	if (oxfw->has_output)
		snd_oxfw_stream_update_simplex(oxfw, &oxfw->tx_stream);

	mutex_unlock(&oxfw->mutex);
}
Beispiel #4
0
/*
 * This driver doesn't update streams in bus reset handler.
 *
 * DM1000/ DM1100/DM1500 chipsets with BeBoB firmware transfer packets with
 * discontinued counter at bus reset. This discontinuity is immediately
 * detected in packet streaming layer, then it sets XRUN to PCM substream.
 *
 * ALSA PCM applications can know the XRUN by getting -EPIPE from PCM operation.
 * Then, they can recover the PCM substream by executing ioctl(2) with
 * SNDRV_PCM_IOCTL_PREPARE. 'struct snd_pcm_ops.prepare' is called and drivers
 * restart packet streaming.
 *
 * The above processing may be executed before this bus-reset handler is
 * executed. When this handler updates streams with current isochronous
 * channels, the streams already have the current ones.
 */
static void
bebob_update(struct fw_unit *unit)
{
	struct snd_bebob *bebob = dev_get_drvdata(&unit->device);

	if (bebob == NULL)
		return;

	fcp_bus_reset(bebob->unit);

	if (bebob->deferred_registration) {
		if (snd_card_register(bebob->card) < 0) {
			snd_bebob_stream_destroy_duplex(bebob);
			snd_card_free(bebob->card);
		}
		bebob->deferred_registration = false;
	}
}
Beispiel #5
0
static void oxfw_bus_reset(struct fw_unit *unit)
{
	struct snd_oxfw *oxfw = dev_get_drvdata(&unit->device);

	if (!oxfw->registered)
		snd_fw_schedule_registration(unit, &oxfw->dwork);

	fcp_bus_reset(oxfw->unit);

	if (oxfw->registered) {
		mutex_lock(&oxfw->mutex);

		snd_oxfw_stream_update_simplex(oxfw, &oxfw->rx_stream);
		if (oxfw->has_output)
			snd_oxfw_stream_update_simplex(oxfw, &oxfw->tx_stream);

		mutex_unlock(&oxfw->mutex);

		if (oxfw->entry->vendor_id == OUI_STANTON)
			snd_oxfw_scs1x_update(oxfw);
	}
}