Merge branch 'main' of https://github.com/serifpersia/us144mkii
This commit is contained in:
commit
db5df99677
332
us144mkii.c
332
us144mkii.c
|
|
@ -26,22 +26,14 @@ MODULE_LICENSE("GPL");
|
||||||
*/
|
*/
|
||||||
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
|
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
|
||||||
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;
|
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;
|
||||||
<<<<<<< HEAD
|
|
||||||
static bool enable[SNDRV_CARDS] = {1, [1 ...(SNDRV_CARDS - 1)] = 0};
|
static bool enable[SNDRV_CARDS] = {1, [1 ...(SNDRV_CARDS - 1)] = 0};
|
||||||
=======
|
|
||||||
static bool enable[SNDRV_CARDS] = { 1, [1 ...(SNDRV_CARDS - 1)] = 0 };
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
static int dev_idx;
|
static int dev_idx;
|
||||||
|
|
||||||
static struct usb_driver tascam_alsa_driver;
|
static struct usb_driver tascam_alsa_driver;
|
||||||
|
|
||||||
/* --- Forward Declarations --- */
|
/* --- Forward Declarations --- */
|
||||||
static int tascam_probe(struct usb_interface *intf,
|
static int tascam_probe(struct usb_interface *intf,
|
||||||
<<<<<<< HEAD
|
|
||||||
const struct usb_device_id *usb_id);
|
const struct usb_device_id *usb_id);
|
||||||
=======
|
|
||||||
const struct usb_device_id *usb_id);
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
static void tascam_disconnect(struct usb_interface *intf);
|
static void tascam_disconnect(struct usb_interface *intf);
|
||||||
static int tascam_suspend(struct usb_interface *intf, pm_message_t message);
|
static int tascam_suspend(struct usb_interface *intf, pm_message_t message);
|
||||||
static int tascam_resume(struct usb_interface *intf);
|
static int tascam_resume(struct usb_interface *intf);
|
||||||
|
|
@ -74,7 +66,6 @@ static DEVICE_ATTR_RO(driver_version);
|
||||||
void tascam_free_urbs(struct tascam_card *tascam) {
|
void tascam_free_urbs(struct tascam_card *tascam) {
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
usb_kill_anchored_urbs(&tascam->playback_anchor);
|
usb_kill_anchored_urbs(&tascam->playback_anchor);
|
||||||
for (i = 0; i < NUM_PLAYBACK_URBS; i++) {
|
for (i = 0; i < NUM_PLAYBACK_URBS; i++) {
|
||||||
if (tascam->playback_urbs[i]) {
|
if (tascam->playback_urbs[i]) {
|
||||||
|
|
@ -129,67 +120,6 @@ void tascam_free_urbs(struct tascam_card *tascam) {
|
||||||
tascam->midi_out_urbs[i] = NULL;
|
tascam->midi_out_urbs[i] = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
=======
|
|
||||||
usb_kill_anchored_urbs(&tascam->playback_anchor);
|
|
||||||
for (i = 0; i < NUM_PLAYBACK_URBS; i++) {
|
|
||||||
if (tascam->playback_urbs[i]) {
|
|
||||||
usb_free_coherent(
|
|
||||||
tascam->dev, tascam->playback_urb_alloc_size,
|
|
||||||
tascam->playback_urbs[i]->transfer_buffer,
|
|
||||||
tascam->playback_urbs[i]->transfer_dma);
|
|
||||||
usb_free_urb(tascam->playback_urbs[i]);
|
|
||||||
tascam->playback_urbs[i] = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
usb_kill_anchored_urbs(&tascam->feedback_anchor);
|
|
||||||
for (i = 0; i < NUM_FEEDBACK_URBS; i++) {
|
|
||||||
if (tascam->feedback_urbs[i]) {
|
|
||||||
usb_free_coherent(
|
|
||||||
tascam->dev, tascam->feedback_urb_alloc_size,
|
|
||||||
tascam->feedback_urbs[i]->transfer_buffer,
|
|
||||||
tascam->feedback_urbs[i]->transfer_dma);
|
|
||||||
usb_free_urb(tascam->feedback_urbs[i]);
|
|
||||||
tascam->feedback_urbs[i] = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
usb_kill_anchored_urbs(&tascam->capture_anchor);
|
|
||||||
for (i = 0; i < NUM_CAPTURE_URBS; i++) {
|
|
||||||
if (tascam->capture_urbs[i]) {
|
|
||||||
usb_free_coherent(
|
|
||||||
tascam->dev, tascam->capture_urb_alloc_size,
|
|
||||||
tascam->capture_urbs[i]->transfer_buffer,
|
|
||||||
tascam->capture_urbs[i]->transfer_dma);
|
|
||||||
usb_free_urb(tascam->capture_urbs[i]);
|
|
||||||
tascam->capture_urbs[i] = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
usb_kill_anchored_urbs(&tascam->midi_in_anchor);
|
|
||||||
for (i = 0; i < NUM_MIDI_IN_URBS; i++) {
|
|
||||||
if (tascam->midi_in_urbs[i]) {
|
|
||||||
usb_free_coherent(
|
|
||||||
tascam->dev, MIDI_IN_BUF_SIZE,
|
|
||||||
tascam->midi_in_urbs[i]->transfer_buffer,
|
|
||||||
tascam->midi_in_urbs[i]->transfer_dma);
|
|
||||||
usb_free_urb(tascam->midi_in_urbs[i]);
|
|
||||||
tascam->midi_in_urbs[i] = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
usb_kill_anchored_urbs(&tascam->midi_out_anchor);
|
|
||||||
for (i = 0; i < NUM_MIDI_OUT_URBS; i++) {
|
|
||||||
if (tascam->midi_out_urbs[i]) {
|
|
||||||
usb_free_coherent(
|
|
||||||
tascam->dev, MIDI_OUT_BUF_SIZE,
|
|
||||||
tascam->midi_out_urbs[i]->transfer_buffer,
|
|
||||||
tascam->midi_out_urbs[i]->transfer_dma);
|
|
||||||
usb_free_urb(tascam->midi_out_urbs[i]);
|
|
||||||
tascam->midi_out_urbs[i] = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
kfree(tascam->playback_routing_buffer);
|
kfree(tascam->playback_routing_buffer);
|
||||||
tascam->playback_routing_buffer = NULL;
|
tascam->playback_routing_buffer = NULL;
|
||||||
|
|
@ -216,39 +146,21 @@ int tascam_alloc_urbs(struct tascam_card *tascam) {
|
||||||
int i;
|
int i;
|
||||||
size_t max_packet_size;
|
size_t max_packet_size;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
max_packet_size = ((96000 / 8000) + 2) * BYTES_PER_FRAME;
|
max_packet_size = ((96000 / 8000) + 2) * BYTES_PER_FRAME;
|
||||||
tascam->playback_urb_alloc_size = max_packet_size * PLAYBACK_URB_PACKETS;
|
tascam->playback_urb_alloc_size = max_packet_size * PLAYBACK_URB_PACKETS;
|
||||||
|
|
||||||
for (i = 0; i < NUM_PLAYBACK_URBS; i++) {
|
for (i = 0; i < NUM_PLAYBACK_URBS; i++) {
|
||||||
struct urb *urb = usb_alloc_urb(PLAYBACK_URB_PACKETS, GFP_KERNEL);
|
struct urb *urb = usb_alloc_urb(PLAYBACK_URB_PACKETS, GFP_KERNEL);
|
||||||
=======
|
|
||||||
max_packet_size = ((96000 / 8000) + 2) * BYTES_PER_FRAME;
|
|
||||||
tascam->playback_urb_alloc_size =
|
|
||||||
max_packet_size * PLAYBACK_URB_PACKETS;
|
|
||||||
|
|
||||||
for (i = 0; i < NUM_PLAYBACK_URBS; i++) {
|
|
||||||
struct urb *urb =
|
|
||||||
usb_alloc_urb(PLAYBACK_URB_PACKETS, GFP_KERNEL);
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
if (!urb)
|
if (!urb)
|
||||||
goto error;
|
goto error;
|
||||||
tascam->playback_urbs[i] = urb;
|
tascam->playback_urbs[i] = urb;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
urb->transfer_buffer =
|
urb->transfer_buffer =
|
||||||
usb_alloc_coherent(tascam->dev, tascam->playback_urb_alloc_size,
|
usb_alloc_coherent(tascam->dev, tascam->playback_urb_alloc_size,
|
||||||
GFP_KERNEL, &urb->transfer_dma);
|
GFP_KERNEL, &urb->transfer_dma);
|
||||||
if (!urb->transfer_buffer)
|
if (!urb->transfer_buffer)
|
||||||
goto error;
|
goto error;
|
||||||
=======
|
|
||||||
urb->transfer_buffer = usb_alloc_coherent(
|
|
||||||
tascam->dev, tascam->playback_urb_alloc_size,
|
|
||||||
GFP_KERNEL, &urb->transfer_dma);
|
|
||||||
if (!urb->transfer_buffer)
|
|
||||||
goto error;
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
urb->dev = tascam->dev;
|
urb->dev = tascam->dev;
|
||||||
urb->pipe = usb_sndisocpipe(tascam->dev, EP_AUDIO_OUT);
|
urb->pipe = usb_sndisocpipe(tascam->dev, EP_AUDIO_OUT);
|
||||||
|
|
@ -258,25 +170,15 @@ int tascam_alloc_urbs(struct tascam_card *tascam) {
|
||||||
urb->complete = playback_urb_complete;
|
urb->complete = playback_urb_complete;
|
||||||
}
|
}
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
tascam->feedback_urb_alloc_size = FEEDBACK_PACKET_SIZE * MAX_FEEDBACK_PACKETS;
|
tascam->feedback_urb_alloc_size = FEEDBACK_PACKET_SIZE * MAX_FEEDBACK_PACKETS;
|
||||||
|
|
||||||
for (i = 0; i < NUM_FEEDBACK_URBS; i++) {
|
for (i = 0; i < NUM_FEEDBACK_URBS; i++) {
|
||||||
struct urb *f_urb = usb_alloc_urb(MAX_FEEDBACK_PACKETS, GFP_KERNEL);
|
struct urb *f_urb = usb_alloc_urb(MAX_FEEDBACK_PACKETS, GFP_KERNEL);
|
||||||
=======
|
|
||||||
tascam->feedback_urb_alloc_size =
|
|
||||||
FEEDBACK_PACKET_SIZE * MAX_FEEDBACK_PACKETS;
|
|
||||||
|
|
||||||
for (i = 0; i < NUM_FEEDBACK_URBS; i++) {
|
|
||||||
struct urb *f_urb =
|
|
||||||
usb_alloc_urb(MAX_FEEDBACK_PACKETS, GFP_KERNEL);
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
if (!f_urb)
|
if (!f_urb)
|
||||||
goto error;
|
goto error;
|
||||||
tascam->feedback_urbs[i] = f_urb;
|
tascam->feedback_urbs[i] = f_urb;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
f_urb->transfer_buffer =
|
f_urb->transfer_buffer =
|
||||||
usb_alloc_coherent(tascam->dev, tascam->feedback_urb_alloc_size,
|
usb_alloc_coherent(tascam->dev, tascam->feedback_urb_alloc_size,
|
||||||
GFP_KERNEL, &f_urb->transfer_dma);
|
GFP_KERNEL, &f_urb->transfer_dma);
|
||||||
|
|
@ -290,22 +192,6 @@ int tascam_alloc_urbs(struct tascam_card *tascam) {
|
||||||
f_urb->context = tascam;
|
f_urb->context = tascam;
|
||||||
f_urb->complete = feedback_urb_complete;
|
f_urb->complete = feedback_urb_complete;
|
||||||
}
|
}
|
||||||
=======
|
|
||||||
f_urb->transfer_buffer = usb_alloc_coherent(
|
|
||||||
tascam->dev, tascam->feedback_urb_alloc_size,
|
|
||||||
GFP_KERNEL, &f_urb->transfer_dma);
|
|
||||||
if (!f_urb->transfer_buffer)
|
|
||||||
goto error;
|
|
||||||
|
|
||||||
f_urb->dev = tascam->dev;
|
|
||||||
f_urb->pipe =
|
|
||||||
usb_rcvisocpipe(tascam->dev, EP_PLAYBACK_FEEDBACK);
|
|
||||||
f_urb->transfer_flags = URB_ISO_ASAP | URB_NO_TRANSFER_DMA_MAP;
|
|
||||||
f_urb->interval = 4;
|
|
||||||
f_urb->context = tascam;
|
|
||||||
f_urb->complete = feedback_urb_complete;
|
|
||||||
}
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
tascam->capture_urb_alloc_size = CAPTURE_URB_SIZE;
|
tascam->capture_urb_alloc_size = CAPTURE_URB_SIZE;
|
||||||
for (i = 0; i < NUM_CAPTURE_URBS; i++) {
|
for (i = 0; i < NUM_CAPTURE_URBS; i++) {
|
||||||
|
|
@ -315,7 +201,6 @@ int tascam_alloc_urbs(struct tascam_card *tascam) {
|
||||||
goto error;
|
goto error;
|
||||||
tascam->capture_urbs[i] = c_urb;
|
tascam->capture_urbs[i] = c_urb;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
c_urb->transfer_buffer =
|
c_urb->transfer_buffer =
|
||||||
usb_alloc_coherent(tascam->dev, tascam->capture_urb_alloc_size,
|
usb_alloc_coherent(tascam->dev, tascam->capture_urb_alloc_size,
|
||||||
GFP_KERNEL, &c_urb->transfer_dma);
|
GFP_KERNEL, &c_urb->transfer_dma);
|
||||||
|
|
@ -328,27 +213,11 @@ int tascam_alloc_urbs(struct tascam_card *tascam) {
|
||||||
capture_urb_complete, tascam);
|
capture_urb_complete, tascam);
|
||||||
c_urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
|
c_urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
|
||||||
}
|
}
|
||||||
=======
|
|
||||||
c_urb->transfer_buffer = usb_alloc_coherent(
|
|
||||||
tascam->dev, tascam->capture_urb_alloc_size, GFP_KERNEL,
|
|
||||||
&c_urb->transfer_dma);
|
|
||||||
if (!c_urb->transfer_buffer)
|
|
||||||
goto error;
|
|
||||||
|
|
||||||
usb_fill_bulk_urb(c_urb, tascam->dev,
|
|
||||||
usb_rcvbulkpipe(tascam->dev, EP_AUDIO_IN),
|
|
||||||
c_urb->transfer_buffer,
|
|
||||||
tascam->capture_urb_alloc_size,
|
|
||||||
capture_urb_complete, tascam);
|
|
||||||
c_urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
|
|
||||||
}
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
/* MIDI URB and buffer allocation */
|
/* MIDI URB and buffer allocation */
|
||||||
for (i = 0; i < NUM_MIDI_IN_URBS; i++) {
|
for (i = 0; i < NUM_MIDI_IN_URBS; i++) {
|
||||||
struct urb *m_urb = usb_alloc_urb(0, GFP_KERNEL);
|
struct urb *m_urb = usb_alloc_urb(0, GFP_KERNEL);
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
if (!m_urb)
|
if (!m_urb)
|
||||||
goto error;
|
goto error;
|
||||||
tascam->midi_in_urbs[i] = m_urb;
|
tascam->midi_in_urbs[i] = m_urb;
|
||||||
|
|
@ -362,27 +231,10 @@ int tascam_alloc_urbs(struct tascam_card *tascam) {
|
||||||
tascam_midi_in_urb_complete, tascam);
|
tascam_midi_in_urb_complete, tascam);
|
||||||
m_urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
|
m_urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
|
||||||
}
|
}
|
||||||
=======
|
|
||||||
if (!m_urb)
|
|
||||||
goto error;
|
|
||||||
tascam->midi_in_urbs[i] = m_urb;
|
|
||||||
m_urb->transfer_buffer =
|
|
||||||
usb_alloc_coherent(tascam->dev, MIDI_IN_BUF_SIZE,
|
|
||||||
GFP_KERNEL, &m_urb->transfer_dma);
|
|
||||||
if (!m_urb->transfer_buffer)
|
|
||||||
goto error;
|
|
||||||
usb_fill_bulk_urb(m_urb, tascam->dev,
|
|
||||||
usb_rcvbulkpipe(tascam->dev, EP_MIDI_IN),
|
|
||||||
m_urb->transfer_buffer, MIDI_IN_BUF_SIZE,
|
|
||||||
tascam_midi_in_urb_complete, tascam);
|
|
||||||
m_urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
|
|
||||||
}
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
for (i = 0; i < NUM_MIDI_OUT_URBS; i++) {
|
for (i = 0; i < NUM_MIDI_OUT_URBS; i++) {
|
||||||
struct urb *m_urb = usb_alloc_urb(0, GFP_KERNEL);
|
struct urb *m_urb = usb_alloc_urb(0, GFP_KERNEL);
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
if (!m_urb)
|
if (!m_urb)
|
||||||
goto error;
|
goto error;
|
||||||
tascam->midi_out_urbs[i] = m_urb;
|
tascam->midi_out_urbs[i] = m_urb;
|
||||||
|
|
@ -424,52 +276,6 @@ int tascam_alloc_urbs(struct tascam_card *tascam) {
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (!tascam->capture_routing_buffer)
|
if (!tascam->capture_routing_buffer)
|
||||||
goto error;
|
goto error;
|
||||||
=======
|
|
||||||
if (!m_urb)
|
|
||||||
goto error;
|
|
||||||
tascam->midi_out_urbs[i] = m_urb;
|
|
||||||
m_urb->transfer_buffer =
|
|
||||||
usb_alloc_coherent(tascam->dev, MIDI_OUT_BUF_SIZE,
|
|
||||||
GFP_KERNEL, &m_urb->transfer_dma);
|
|
||||||
if (!m_urb->transfer_buffer)
|
|
||||||
goto error;
|
|
||||||
usb_fill_bulk_urb(m_urb, tascam->dev,
|
|
||||||
usb_sndbulkpipe(tascam->dev, EP_MIDI_OUT),
|
|
||||||
m_urb->transfer_buffer,
|
|
||||||
0, /* length set later */
|
|
||||||
tascam_midi_out_urb_complete, tascam);
|
|
||||||
m_urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
|
|
||||||
}
|
|
||||||
|
|
||||||
tascam->capture_ring_buffer =
|
|
||||||
kmalloc(CAPTURE_RING_BUFFER_SIZE, GFP_KERNEL);
|
|
||||||
if (!tascam->capture_ring_buffer)
|
|
||||||
goto error;
|
|
||||||
|
|
||||||
tascam->capture_decode_raw_block =
|
|
||||||
kmalloc(RAW_BYTES_PER_DECODE_BLOCK, GFP_KERNEL);
|
|
||||||
if (!tascam->capture_decode_raw_block)
|
|
||||||
goto error;
|
|
||||||
|
|
||||||
tascam->capture_decode_dst_block =
|
|
||||||
kmalloc(FRAMES_PER_DECODE_BLOCK * DECODED_CHANNELS_PER_FRAME *
|
|
||||||
DECODED_SAMPLE_SIZE,
|
|
||||||
GFP_KERNEL);
|
|
||||||
if (!tascam->capture_decode_dst_block)
|
|
||||||
goto error;
|
|
||||||
|
|
||||||
tascam->playback_routing_buffer =
|
|
||||||
kmalloc(tascam->playback_urb_alloc_size, GFP_KERNEL);
|
|
||||||
if (!tascam->playback_routing_buffer)
|
|
||||||
goto error;
|
|
||||||
|
|
||||||
tascam->capture_routing_buffer =
|
|
||||||
kmalloc(FRAMES_PER_DECODE_BLOCK * DECODED_CHANNELS_PER_FRAME *
|
|
||||||
DECODED_SAMPLE_SIZE,
|
|
||||||
GFP_KERNEL);
|
|
||||||
if (!tascam->capture_routing_buffer)
|
|
||||||
goto error;
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|
@ -479,16 +285,9 @@ error:
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
void tascam_stop_work_handler(struct work_struct *work) {
|
void tascam_stop_work_handler(struct work_struct *work) {
|
||||||
struct tascam_card *tascam =
|
struct tascam_card *tascam =
|
||||||
container_of(work, struct tascam_card, stop_work);
|
container_of(work, struct tascam_card, stop_work);
|
||||||
=======
|
|
||||||
void tascam_stop_work_handler(struct work_struct *work)
|
|
||||||
{
|
|
||||||
struct tascam_card *tascam =
|
|
||||||
container_of(work, struct tascam_card, stop_work);
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
usb_kill_anchored_urbs(&tascam->playback_anchor);
|
usb_kill_anchored_urbs(&tascam->playback_anchor);
|
||||||
usb_kill_anchored_urbs(&tascam->feedback_anchor);
|
usb_kill_anchored_urbs(&tascam->feedback_anchor);
|
||||||
|
|
@ -558,7 +357,6 @@ static int tascam_suspend(struct usb_interface *intf, pm_message_t message) {
|
||||||
usb_kill_anchored_urbs(&tascam->midi_in_anchor);
|
usb_kill_anchored_urbs(&tascam->midi_in_anchor);
|
||||||
usb_kill_anchored_urbs(&tascam->midi_out_anchor);
|
usb_kill_anchored_urbs(&tascam->midi_out_anchor);
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
/*
|
/*
|
||||||
* Send the vendor-specific "Deep Sleep" command. Failure to send this
|
* Send the vendor-specific "Deep Sleep" command. Failure to send this
|
||||||
* command before host-initiated suspend can leave the device in an
|
* command before host-initiated suspend can leave the device in an
|
||||||
|
|
@ -574,24 +372,6 @@ static int tascam_suspend(struct usb_interface *intf, pm_message_t message) {
|
||||||
1000); /* timeout */
|
1000); /* timeout */
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
dev_err(&intf->dev, "failed to send deep sleep command: %d\n", err);
|
dev_err(&intf->dev, "failed to send deep sleep command: %d\n", err);
|
||||||
=======
|
|
||||||
/*
|
|
||||||
* Send the vendor-specific "Deep Sleep" command. Failure to send this
|
|
||||||
* command before host-initiated suspend can leave the device in an
|
|
||||||
* unstable state, leading to system freezes on idle (autosuspend).
|
|
||||||
*/
|
|
||||||
err = usb_control_msg(tascam->dev, usb_sndctrlpipe(tascam->dev, 0),
|
|
||||||
0x00, /* bRequest */
|
|
||||||
0x40, /* bmRequestType: H2D, Vendor, Device */
|
|
||||||
0x0044, /* wValue */
|
|
||||||
0x0000, /* wIndex */
|
|
||||||
NULL, /* data */
|
|
||||||
0, /* size */
|
|
||||||
1000); /* timeout */
|
|
||||||
if (err < 0)
|
|
||||||
dev_err(&intf->dev, "failed to send deep sleep command: %d\n",
|
|
||||||
err);
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
@ -615,7 +395,6 @@ static int tascam_resume(struct usb_interface *intf) {
|
||||||
|
|
||||||
dev_info(&intf->dev, "resuming TASCAM US-144MKII\n");
|
dev_info(&intf->dev, "resuming TASCAM US-144MKII\n");
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
/*
|
/*
|
||||||
* The device requires a full re-initialization sequence upon resume.
|
* The device requires a full re-initialization sequence upon resume.
|
||||||
* First, re-establish the active USB interface settings.
|
* First, re-establish the active USB interface settings.
|
||||||
|
|
@ -636,31 +415,6 @@ static int tascam_resume(struct usb_interface *intf) {
|
||||||
/* Re-configure the sample rate if one was previously active */
|
/* Re-configure the sample rate if one was previously active */
|
||||||
if (tascam->current_rate > 0)
|
if (tascam->current_rate > 0)
|
||||||
us144mkii_configure_device_for_rate(tascam, tascam->current_rate);
|
us144mkii_configure_device_for_rate(tascam, tascam->current_rate);
|
||||||
=======
|
|
||||||
/*
|
|
||||||
* The device requires a full re-initialization sequence upon resume.
|
|
||||||
* First, re-establish the active USB interface settings.
|
|
||||||
*/
|
|
||||||
err = usb_set_interface(tascam->dev, 0, 1);
|
|
||||||
if (err < 0) {
|
|
||||||
dev_err(&intf->dev,
|
|
||||||
"resume: failed to set alt setting on intf 0: %d\n",
|
|
||||||
err);
|
|
||||||
return err;
|
|
||||||
}
|
|
||||||
err = usb_set_interface(tascam->dev, 1, 1);
|
|
||||||
if (err < 0) {
|
|
||||||
dev_err(&intf->dev,
|
|
||||||
"resume: failed to set alt setting on intf 1: %d\n",
|
|
||||||
err);
|
|
||||||
return err;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Re-configure the sample rate if one was previously active */
|
|
||||||
if (tascam->current_rate > 0)
|
|
||||||
us144mkii_configure_device_for_rate(tascam,
|
|
||||||
tascam->current_rate);
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
@ -681,7 +435,6 @@ static int tascam_resume(struct usb_interface *intf) {
|
||||||
* Return: 0 on success, or a negative error code on failure.
|
* Return: 0 on success, or a negative error code on failure.
|
||||||
*/
|
*/
|
||||||
static int tascam_probe(struct usb_interface *intf,
|
static int tascam_probe(struct usb_interface *intf,
|
||||||
<<<<<<< HEAD
|
|
||||||
const struct usb_device_id *usb_id) {
|
const struct usb_device_id *usb_id) {
|
||||||
struct usb_device *dev = interface_to_usbdev(intf);
|
struct usb_device *dev = interface_to_usbdev(intf);
|
||||||
struct snd_card *card;
|
struct snd_card *card;
|
||||||
|
|
@ -706,29 +459,6 @@ static int tascam_probe(struct usb_interface *intf,
|
||||||
dev_err(&dev->dev, "Too many TASCAM devices present");
|
dev_err(&dev->dev, "Too many TASCAM devices present");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
=======
|
|
||||||
const struct usb_device_id *usb_id)
|
|
||||||
{
|
|
||||||
struct usb_device *dev = interface_to_usbdev(intf);
|
|
||||||
struct snd_card *card;
|
|
||||||
struct tascam_card *tascam;
|
|
||||||
int err;
|
|
||||||
char *handshake_buf;
|
|
||||||
|
|
||||||
if (dev->speed != USB_SPEED_HIGH)
|
|
||||||
dev_info(
|
|
||||||
&dev->dev,
|
|
||||||
"Device is connected to a USB 1.1 port, this is not supported.\n");
|
|
||||||
|
|
||||||
if (intf->cur_altsetting->desc.bInterfaceNumber == 1) {
|
|
||||||
tascam = usb_get_intfdata(usb_ifnum_to_if(dev, 0));
|
|
||||||
if (tascam) {
|
|
||||||
usb_set_intfdata(intf, tascam);
|
|
||||||
tascam->iface1 = intf;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
if (!enable[dev_idx]) {
|
if (!enable[dev_idx]) {
|
||||||
dev_info(&dev->dev, "TASCAM US-144MKII device disabled");
|
dev_info(&dev->dev, "TASCAM US-144MKII device disabled");
|
||||||
|
|
@ -748,7 +478,6 @@ static int tascam_probe(struct usb_interface *intf,
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
if (handshake_buf[0] != 0x12 && handshake_buf[0] != 0x16 &&
|
if (handshake_buf[0] != 0x12 && handshake_buf[0] != 0x16 &&
|
||||||
handshake_buf[0] != 0x30) {
|
handshake_buf[0] != 0x30) {
|
||||||
dev_err(&dev->dev, "Unexpected handshake value: 0x%x\n", handshake_buf[0]);
|
dev_err(&dev->dev, "Unexpected handshake value: 0x%x\n", handshake_buf[0]);
|
||||||
|
|
@ -780,49 +509,6 @@ static int tascam_probe(struct usb_interface *intf,
|
||||||
tascam->dev = usb_get_dev(dev);
|
tascam->dev = usb_get_dev(dev);
|
||||||
tascam->card = card;
|
tascam->card = card;
|
||||||
tascam->iface0 = intf;
|
tascam->iface0 = intf;
|
||||||
=======
|
|
||||||
err = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0),
|
|
||||||
VENDOR_REQ_MODE_CONTROL, RT_D2H_VENDOR_DEV,
|
|
||||||
MODE_VAL_HANDSHAKE_READ, 0x0000, handshake_buf, 1,
|
|
||||||
USB_CTRL_TIMEOUT_MS);
|
|
||||||
if (err < 0) {
|
|
||||||
dev_err(&dev->dev, "Handshake read failed with %d\n", err);
|
|
||||||
kfree(handshake_buf);
|
|
||||||
return err;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (handshake_buf[0] != 0x12 && handshake_buf[0] != 0x16 &&
|
|
||||||
handshake_buf[0] != 0x30) {
|
|
||||||
dev_err(&dev->dev, "Unexpected handshake value: 0x%x\n",
|
|
||||||
handshake_buf[0]);
|
|
||||||
kfree(handshake_buf);
|
|
||||||
return -ENODEV;
|
|
||||||
}
|
|
||||||
kfree(handshake_buf);
|
|
||||||
|
|
||||||
err = usb_set_interface(dev, 0, 1);
|
|
||||||
if (err < 0) {
|
|
||||||
dev_err(&dev->dev,
|
|
||||||
"Failed to set alt setting 1 on interface 0: %d\n",
|
|
||||||
err);
|
|
||||||
return err;
|
|
||||||
}
|
|
||||||
|
|
||||||
err = usb_set_interface(dev, 1, 1);
|
|
||||||
if (err < 0) {
|
|
||||||
dev_err(&dev->dev,
|
|
||||||
"Failed to set alt setting 1 on interface 1: %d\n",
|
|
||||||
err);
|
|
||||||
return err;
|
|
||||||
}
|
|
||||||
|
|
||||||
err = snd_card_new(&dev->dev, index[dev_idx], id[dev_idx], THIS_MODULE,
|
|
||||||
sizeof(struct tascam_card), &card);
|
|
||||||
if (err < 0) {
|
|
||||||
dev_err(&dev->dev, "Failed to create sound card instance\n");
|
|
||||||
return err;
|
|
||||||
}
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
spin_lock_init(&tascam->lock);
|
spin_lock_init(&tascam->lock);
|
||||||
spin_lock_init(&tascam->midi_in_lock);
|
spin_lock_init(&tascam->midi_in_lock);
|
||||||
|
|
@ -842,9 +528,9 @@ static int tascam_probe(struct usb_interface *intf,
|
||||||
|
|
||||||
strscpy(card->driver, DRIVER_NAME, sizeof(card->driver));
|
strscpy(card->driver, DRIVER_NAME, sizeof(card->driver));
|
||||||
if (dev->descriptor.idProduct == USB_PID_TASCAM_US144) {
|
if (dev->descriptor.idProduct == USB_PID_TASCAM_US144) {
|
||||||
strscpy(card->shortname, "TASCAM US144", sizeof(card->shortname));
|
strscpy(card->shortname, "TASCAM US-144", sizeof(card->shortname));
|
||||||
} else if (dev->descriptor.idProduct == USB_PID_TASCAM_US144MKII) {
|
} else if (dev->descriptor.idProduct == USB_PID_TASCAM_US144MKII) {
|
||||||
strscpy(card->shortname, "TASCAM US144MKII", sizeof(card->shortname));
|
strscpy(card->shortname, "TASCAM US-144MKII", sizeof(card->shortname));
|
||||||
} else {
|
} else {
|
||||||
strscpy(card->shortname, "TASCAM Unknown", sizeof(card->shortname));
|
strscpy(card->shortname, "TASCAM Unknown", sizeof(card->shortname));
|
||||||
}
|
}
|
||||||
|
|
@ -852,7 +538,6 @@ static int tascam_probe(struct usb_interface *intf,
|
||||||
card->shortname, USB_VID_TASCAM, dev->descriptor.idProduct,
|
card->shortname, USB_VID_TASCAM, dev->descriptor.idProduct,
|
||||||
dev_name(&dev->dev));
|
dev_name(&dev->dev));
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
err = device_create_file(&dev->dev, &dev_attr_driver_version);
|
err = device_create_file(&dev->dev, &dev_attr_driver_version);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
dev_warn(&dev->dev, "could not create driver_version attribute, err: %d\n",
|
dev_warn(&dev->dev, "could not create driver_version attribute, err: %d\n",
|
||||||
|
|
@ -871,19 +556,6 @@ static int tascam_probe(struct usb_interface *intf,
|
||||||
err = tascam_create_midi(tascam);
|
err = tascam_create_midi(tascam);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
goto free_card;
|
goto free_card;
|
||||||
=======
|
|
||||||
strscpy(card->driver, DRIVER_NAME, sizeof(card->driver));
|
|
||||||
strscpy(card->shortname, "TASCAM US-144MKII", sizeof(card->shortname));
|
|
||||||
snprintf(card->longname, sizeof(card->longname), "%s (%04x:%04x) at %s",
|
|
||||||
card->shortname, USB_VID_TASCAM, USB_PID_TASCAM_US144MKII,
|
|
||||||
dev_name(&dev->dev));
|
|
||||||
|
|
||||||
err = device_create_file(&dev->dev, &dev_attr_driver_version);
|
|
||||||
if (err < 0)
|
|
||||||
dev_warn(&dev->dev,
|
|
||||||
"could not create driver_version attribute, err: %d\n",
|
|
||||||
err);
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
err = tascam_create_controls(tascam);
|
err = tascam_create_controls(tascam);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
|
|
|
||||||
47
us144mkii.h
47
us144mkii.h
|
|
@ -14,14 +14,11 @@
|
||||||
#include <sound/rawmidi.h>
|
#include <sound/rawmidi.h>
|
||||||
|
|
||||||
#define DRIVER_NAME "us144mkii"
|
#define DRIVER_NAME "us144mkii"
|
||||||
#define DRIVER_VERSION "1.7.4"
|
#define DRIVER_VERSION "1.7.5"
|
||||||
|
|
||||||
/* --- USB Device Identification --- */
|
/* --- USB Device Identification --- */
|
||||||
#define USB_VID_TASCAM 0x0644
|
#define USB_VID_TASCAM 0x0644
|
||||||
<<<<<<< HEAD
|
|
||||||
#define USB_PID_TASCAM_US144 0x800f
|
#define USB_PID_TASCAM_US144 0x800f
|
||||||
=======
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
#define USB_PID_TASCAM_US144MKII 0x8020
|
#define USB_PID_TASCAM_US144MKII 0x8020
|
||||||
|
|
||||||
/* --- USB Endpoints (Alternate Setting 1) --- */
|
/* --- USB Endpoints (Alternate Setting 1) --- */
|
||||||
|
|
@ -38,7 +35,6 @@
|
||||||
#define RT_D2H_VENDOR_DEV (USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE)
|
#define RT_D2H_VENDOR_DEV (USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE)
|
||||||
|
|
||||||
enum uac_request {
|
enum uac_request {
|
||||||
<<<<<<< HEAD
|
|
||||||
UAC_SET_CUR = 0x01,
|
UAC_SET_CUR = 0x01,
|
||||||
UAC_GET_CUR = 0x81,
|
UAC_GET_CUR = 0x81,
|
||||||
};
|
};
|
||||||
|
|
@ -56,31 +52,11 @@ enum tascam_mode_value {
|
||||||
MODE_VAL_HANDSHAKE_READ = 0x0000,
|
MODE_VAL_HANDSHAKE_READ = 0x0000,
|
||||||
MODE_VAL_CONFIG = 0x0010,
|
MODE_VAL_CONFIG = 0x0010,
|
||||||
MODE_VAL_STREAM_START = 0x0030,
|
MODE_VAL_STREAM_START = 0x0030,
|
||||||
=======
|
|
||||||
UAC_SET_CUR = 0x01,
|
|
||||||
UAC_GET_CUR = 0x81,
|
|
||||||
};
|
|
||||||
|
|
||||||
enum uac_control_selector {
|
|
||||||
UAC_SAMPLING_FREQ_CONTROL = 0x0100,
|
|
||||||
};
|
|
||||||
|
|
||||||
enum tascam_vendor_request {
|
|
||||||
VENDOR_REQ_REGISTER_WRITE = 0x41,
|
|
||||||
VENDOR_REQ_MODE_CONTROL = 0x49,
|
|
||||||
};
|
|
||||||
|
|
||||||
enum tascam_mode_value {
|
|
||||||
MODE_VAL_HANDSHAKE_READ = 0x0000,
|
|
||||||
MODE_VAL_CONFIG = 0x0010,
|
|
||||||
MODE_VAL_STREAM_START = 0x0030,
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#define HANDSHAKE_SUCCESS_VAL 0x12
|
#define HANDSHAKE_SUCCESS_VAL 0x12
|
||||||
|
|
||||||
enum tascam_register {
|
enum tascam_register {
|
||||||
<<<<<<< HEAD
|
|
||||||
REG_ADDR_UNKNOWN_0D = 0x0d04,
|
REG_ADDR_UNKNOWN_0D = 0x0d04,
|
||||||
REG_ADDR_UNKNOWN_0E = 0x0e00,
|
REG_ADDR_UNKNOWN_0E = 0x0e00,
|
||||||
REG_ADDR_UNKNOWN_0F = 0x0f00,
|
REG_ADDR_UNKNOWN_0F = 0x0f00,
|
||||||
|
|
@ -89,16 +65,6 @@ enum tascam_register {
|
||||||
REG_ADDR_RATE_88200 = 0x1008,
|
REG_ADDR_RATE_88200 = 0x1008,
|
||||||
REG_ADDR_RATE_96000 = 0x100a,
|
REG_ADDR_RATE_96000 = 0x100a,
|
||||||
REG_ADDR_UNKNOWN_11 = 0x110b,
|
REG_ADDR_UNKNOWN_11 = 0x110b,
|
||||||
=======
|
|
||||||
REG_ADDR_UNKNOWN_0D = 0x0d04,
|
|
||||||
REG_ADDR_UNKNOWN_0E = 0x0e00,
|
|
||||||
REG_ADDR_UNKNOWN_0F = 0x0f00,
|
|
||||||
REG_ADDR_RATE_44100 = 0x1000,
|
|
||||||
REG_ADDR_RATE_48000 = 0x1002,
|
|
||||||
REG_ADDR_RATE_88200 = 0x1008,
|
|
||||||
REG_ADDR_RATE_96000 = 0x100a,
|
|
||||||
REG_ADDR_UNKNOWN_11 = 0x110b,
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#define REG_VAL_ENABLE 0x0101
|
#define REG_VAL_ENABLE 0x0101
|
||||||
|
|
@ -264,7 +230,6 @@ struct tascam_card {
|
||||||
spinlock_t midi_out_lock;
|
spinlock_t midi_out_lock;
|
||||||
u8 midi_running_status;
|
u8 midi_running_status;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
/* Shared state & Routing Matrix */
|
/* Shared state & Routing Matrix */
|
||||||
spinlock_t lock;
|
spinlock_t lock;
|
||||||
atomic_t active_urbs;
|
atomic_t active_urbs;
|
||||||
|
|
@ -273,16 +238,6 @@ struct tascam_card {
|
||||||
unsigned int digital_out_source; /* 0: Playback 1-2, 1: Playback 3-4 */
|
unsigned int digital_out_source; /* 0: Playback 1-2, 1: Playback 3-4 */
|
||||||
unsigned int capture_12_source; /* 0: Analog In, 1: Digital In */
|
unsigned int capture_12_source; /* 0: Analog In, 1: Digital In */
|
||||||
unsigned int capture_34_source; /* 0: Analog In, 1: Digital In */
|
unsigned int capture_34_source; /* 0: Analog In, 1: Digital In */
|
||||||
=======
|
|
||||||
/* Shared state & Routing Matrix */
|
|
||||||
spinlock_t lock;
|
|
||||||
atomic_t active_urbs;
|
|
||||||
int current_rate;
|
|
||||||
unsigned int line_out_source; /* 0: Playback 1-2, 1: Playback 3-4 */
|
|
||||||
unsigned int digital_out_source; /* 0: Playback 1-2, 1: Playback 3-4 */
|
|
||||||
unsigned int capture_12_source; /* 0: Analog In, 1: Digital In */
|
|
||||||
unsigned int capture_34_source; /* 0: Analog In, 1: Digital In */
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
unsigned int feedback_accumulator_pattern[FEEDBACK_ACCUMULATOR_SIZE];
|
unsigned int feedback_accumulator_pattern[FEEDBACK_ACCUMULATOR_SIZE];
|
||||||
unsigned int feedback_pattern_out_idx;
|
unsigned int feedback_pattern_out_idx;
|
||||||
|
|
|
||||||
|
|
@ -69,20 +69,11 @@ static int tascam_capture_prepare(struct snd_pcm_substream *substream) {
|
||||||
* Return: The current capture pointer position in frames.
|
* Return: The current capture pointer position in frames.
|
||||||
*/
|
*/
|
||||||
static snd_pcm_uframes_t
|
static snd_pcm_uframes_t
|
||||||
<<<<<<< HEAD
|
|
||||||
tascam_capture_pointer(struct snd_pcm_substream *substream) {
|
tascam_capture_pointer(struct snd_pcm_substream *substream) {
|
||||||
struct tascam_card *tascam = snd_pcm_substream_chip(substream);
|
struct tascam_card *tascam = snd_pcm_substream_chip(substream);
|
||||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||||
u64 pos;
|
u64 pos;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
=======
|
|
||||||
tascam_capture_pointer(struct snd_pcm_substream *substream)
|
|
||||||
{
|
|
||||||
struct tascam_card *tascam = snd_pcm_substream_chip(substream);
|
|
||||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
|
||||||
u64 pos;
|
|
||||||
unsigned long flags;
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
if (!atomic_read(&tascam->capture_active))
|
if (!atomic_read(&tascam->capture_active))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -125,25 +116,15 @@ const struct snd_pcm_ops tascam_capture_ops = {
|
||||||
static void decode_tascam_capture_block(const u8 *src_block, s32 *dst_block) {
|
static void decode_tascam_capture_block(const u8 *src_block, s32 *dst_block) {
|
||||||
int frame, bit;
|
int frame, bit;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
memset(dst_block, 0,
|
memset(dst_block, 0,
|
||||||
FRAMES_PER_DECODE_BLOCK * DECODED_CHANNELS_PER_FRAME *
|
FRAMES_PER_DECODE_BLOCK * DECODED_CHANNELS_PER_FRAME *
|
||||||
DECODED_SAMPLE_SIZE);
|
DECODED_SAMPLE_SIZE);
|
||||||
=======
|
|
||||||
memset(dst_block, 0,
|
|
||||||
FRAMES_PER_DECODE_BLOCK * DECODED_CHANNELS_PER_FRAME *
|
|
||||||
DECODED_SAMPLE_SIZE);
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
for (frame = 0; frame < FRAMES_PER_DECODE_BLOCK; ++frame) {
|
for (frame = 0; frame < FRAMES_PER_DECODE_BLOCK; ++frame) {
|
||||||
const u8 *p_src_frame_base = src_block + frame * 64;
|
const u8 *p_src_frame_base = src_block + frame * 64;
|
||||||
s32 *p_dst_frame = dst_block + frame * 4;
|
s32 *p_dst_frame = dst_block + frame * 4;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
s32 ch[4] = {0};
|
s32 ch[4] = {0};
|
||||||
=======
|
|
||||||
s32 ch[4] = { 0 };
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
for (bit = 0; bit < 24; ++bit) {
|
for (bit = 0; bit < 24; ++bit) {
|
||||||
u8 byte1 = p_src_frame_base[bit];
|
u8 byte1 = p_src_frame_base[bit];
|
||||||
|
|
@ -176,7 +157,6 @@ static void decode_tascam_capture_block(const u8 *src_block, s32 *dst_block) {
|
||||||
* copies the final audio data into the ALSA capture ring buffer. This offloads
|
* copies the final audio data into the ALSA capture ring buffer. This offloads
|
||||||
* * the CPU-intensive decoding from the time-sensitive URB completion handlers.
|
* * the CPU-intensive decoding from the time-sensitive URB completion handlers.
|
||||||
*/
|
*/
|
||||||
<<<<<<< HEAD
|
|
||||||
void tascam_capture_work_handler(struct work_struct *work) {
|
void tascam_capture_work_handler(struct work_struct *work) {
|
||||||
struct tascam_card *tascam =
|
struct tascam_card *tascam =
|
||||||
container_of(work, struct tascam_card, capture_work);
|
container_of(work, struct tascam_card, capture_work);
|
||||||
|
|
@ -186,42 +166,21 @@ void tascam_capture_work_handler(struct work_struct *work) {
|
||||||
u8 *raw_block = tascam->capture_decode_raw_block;
|
u8 *raw_block = tascam->capture_decode_raw_block;
|
||||||
s32 *decoded_block = tascam->capture_decode_dst_block;
|
s32 *decoded_block = tascam->capture_decode_dst_block;
|
||||||
s32 *routed_block = tascam->capture_routing_buffer;
|
s32 *routed_block = tascam->capture_routing_buffer;
|
||||||
=======
|
|
||||||
void tascam_capture_work_handler(struct work_struct *work)
|
|
||||||
{
|
|
||||||
struct tascam_card *tascam =
|
|
||||||
container_of(work, struct tascam_card, capture_work);
|
|
||||||
struct snd_pcm_substream *substream = tascam->capture_substream;
|
|
||||||
struct snd_pcm_runtime *runtime;
|
|
||||||
unsigned long flags;
|
|
||||||
u8 *raw_block = tascam->capture_decode_raw_block;
|
|
||||||
s32 *decoded_block = tascam->capture_decode_dst_block;
|
|
||||||
s32 *routed_block = tascam->capture_routing_buffer;
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
if (!substream || !substream->runtime)
|
if (!substream || !substream->runtime)
|
||||||
return;
|
return;
|
||||||
runtime = substream->runtime;
|
runtime = substream->runtime;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
if (!raw_block || !decoded_block || !routed_block) {
|
if (!raw_block || !decoded_block || !routed_block) {
|
||||||
dev_err(tascam->card->dev,
|
dev_err(tascam->card->dev,
|
||||||
"Capture decode/routing buffers not allocated!\n");
|
"Capture decode/routing buffers not allocated!\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
=======
|
|
||||||
if (!raw_block || !decoded_block || !routed_block) {
|
|
||||||
dev_err(tascam->card->dev,
|
|
||||||
"Capture decode/routing buffers not allocated!\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
while (atomic_read(&tascam->capture_active)) {
|
while (atomic_read(&tascam->capture_active)) {
|
||||||
size_t write_ptr, read_ptr, available_data;
|
size_t write_ptr, read_ptr, available_data;
|
||||||
bool can_process;
|
bool can_process;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
spin_lock_irqsave(&tascam->lock, flags);
|
spin_lock_irqsave(&tascam->lock, flags);
|
||||||
write_ptr = tascam->capture_ring_buffer_write_ptr;
|
write_ptr = tascam->capture_ring_buffer_write_ptr;
|
||||||
read_ptr = tascam->capture_ring_buffer_read_ptr;
|
read_ptr = tascam->capture_ring_buffer_read_ptr;
|
||||||
|
|
@ -229,21 +188,10 @@ void tascam_capture_work_handler(struct work_struct *work)
|
||||||
? (write_ptr - read_ptr)
|
? (write_ptr - read_ptr)
|
||||||
: (CAPTURE_RING_BUFFER_SIZE - read_ptr + write_ptr);
|
: (CAPTURE_RING_BUFFER_SIZE - read_ptr + write_ptr);
|
||||||
can_process = (available_data >= RAW_BYTES_PER_DECODE_BLOCK);
|
can_process = (available_data >= RAW_BYTES_PER_DECODE_BLOCK);
|
||||||
=======
|
|
||||||
spin_lock_irqsave(&tascam->lock, flags);
|
|
||||||
write_ptr = tascam->capture_ring_buffer_write_ptr;
|
|
||||||
read_ptr = tascam->capture_ring_buffer_read_ptr;
|
|
||||||
available_data = (write_ptr >= read_ptr) ?
|
|
||||||
(write_ptr - read_ptr) :
|
|
||||||
(CAPTURE_RING_BUFFER_SIZE - read_ptr +
|
|
||||||
write_ptr);
|
|
||||||
can_process = (available_data >= RAW_BYTES_PER_DECODE_BLOCK);
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
if (can_process) {
|
if (can_process) {
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
for (i = 0; i < RAW_BYTES_PER_DECODE_BLOCK; i++)
|
for (i = 0; i < RAW_BYTES_PER_DECODE_BLOCK; i++)
|
||||||
raw_block[i] = tascam->capture_ring_buffer[(read_ptr + i) %
|
raw_block[i] = tascam->capture_ring_buffer[(read_ptr + i) %
|
||||||
CAPTURE_RING_BUFFER_SIZE];
|
CAPTURE_RING_BUFFER_SIZE];
|
||||||
|
|
@ -251,36 +199,17 @@ void tascam_capture_work_handler(struct work_struct *work)
|
||||||
(read_ptr + RAW_BYTES_PER_DECODE_BLOCK) % CAPTURE_RING_BUFFER_SIZE;
|
(read_ptr + RAW_BYTES_PER_DECODE_BLOCK) % CAPTURE_RING_BUFFER_SIZE;
|
||||||
}
|
}
|
||||||
spin_unlock_irqrestore(&tascam->lock, flags);
|
spin_unlock_irqrestore(&tascam->lock, flags);
|
||||||
=======
|
|
||||||
for (i = 0; i < RAW_BYTES_PER_DECODE_BLOCK; i++)
|
|
||||||
raw_block[i] =
|
|
||||||
tascam->capture_ring_buffer
|
|
||||||
[(read_ptr + i) %
|
|
||||||
CAPTURE_RING_BUFFER_SIZE];
|
|
||||||
tascam->capture_ring_buffer_read_ptr =
|
|
||||||
(read_ptr + RAW_BYTES_PER_DECODE_BLOCK) %
|
|
||||||
CAPTURE_RING_BUFFER_SIZE;
|
|
||||||
}
|
|
||||||
spin_unlock_irqrestore(&tascam->lock, flags);
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
if (!can_process)
|
if (!can_process)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
decode_tascam_capture_block(raw_block, decoded_block);
|
decode_tascam_capture_block(raw_block, decoded_block);
|
||||||
process_capture_routing_us144mkii(tascam, decoded_block, routed_block);
|
process_capture_routing_us144mkii(tascam, decoded_block, routed_block);
|
||||||
=======
|
|
||||||
decode_tascam_capture_block(raw_block, decoded_block);
|
|
||||||
process_capture_routing_us144mkii(tascam, decoded_block,
|
|
||||||
routed_block);
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
spin_lock_irqsave(&tascam->lock, flags);
|
spin_lock_irqsave(&tascam->lock, flags);
|
||||||
if (atomic_read(&tascam->capture_active)) {
|
if (atomic_read(&tascam->capture_active)) {
|
||||||
int f;
|
int f;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
for (f = 0; f < FRAMES_PER_DECODE_BLOCK; ++f) {
|
for (f = 0; f < FRAMES_PER_DECODE_BLOCK; ++f) {
|
||||||
u8 *dst_frame_start =
|
u8 *dst_frame_start =
|
||||||
runtime->dma_area +
|
runtime->dma_area +
|
||||||
|
|
@ -301,37 +230,6 @@ void tascam_capture_work_handler(struct work_struct *work)
|
||||||
}
|
}
|
||||||
spin_unlock_irqrestore(&tascam->lock, flags);
|
spin_unlock_irqrestore(&tascam->lock, flags);
|
||||||
}
|
}
|
||||||
=======
|
|
||||||
for (f = 0; f < FRAMES_PER_DECODE_BLOCK; ++f) {
|
|
||||||
u8 *dst_frame_start =
|
|
||||||
runtime->dma_area +
|
|
||||||
frames_to_bytes(
|
|
||||||
runtime,
|
|
||||||
tascam->driver_capture_pos);
|
|
||||||
s32 *routed_frame_start =
|
|
||||||
routed_block + (f * NUM_CHANNELS);
|
|
||||||
int c;
|
|
||||||
|
|
||||||
for (c = 0; c < NUM_CHANNELS; c++) {
|
|
||||||
u8 *dst_channel =
|
|
||||||
dst_frame_start +
|
|
||||||
(c * BYTES_PER_SAMPLE);
|
|
||||||
s32 *src_channel_s32 =
|
|
||||||
routed_frame_start + c;
|
|
||||||
|
|
||||||
memcpy(dst_channel,
|
|
||||||
((char *)src_channel_s32) + 1,
|
|
||||||
3);
|
|
||||||
}
|
|
||||||
|
|
||||||
tascam->driver_capture_pos =
|
|
||||||
(tascam->driver_capture_pos + 1) %
|
|
||||||
runtime->buffer_size;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
spin_unlock_irqrestore(&tascam->lock, flags);
|
|
||||||
}
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -347,7 +245,6 @@ void capture_urb_complete(struct urb *urb) {
|
||||||
int ret;
|
int ret;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
if (urb->status) {
|
if (urb->status) {
|
||||||
if (urb->status != -ENOENT && urb->status != -ECONNRESET &&
|
if (urb->status != -ENOENT && urb->status != -ECONNRESET &&
|
||||||
urb->status != -ESHUTDOWN && urb->status != -ENODEV &&
|
urb->status != -ESHUTDOWN && urb->status != -ENODEV &&
|
||||||
|
|
@ -358,25 +255,11 @@ void capture_urb_complete(struct urb *urb) {
|
||||||
}
|
}
|
||||||
if (!tascam || !atomic_read(&tascam->capture_active))
|
if (!tascam || !atomic_read(&tascam->capture_active))
|
||||||
goto out;
|
goto out;
|
||||||
=======
|
|
||||||
if (urb->status) {
|
|
||||||
if (urb->status != -ENOENT && urb->status != -ECONNRESET &&
|
|
||||||
urb->status != -ESHUTDOWN && urb->status != -ENODEV &&
|
|
||||||
urb->status != -EPROTO)
|
|
||||||
dev_err_ratelimited(tascam->card->dev,
|
|
||||||
"Capture URB failed: %d\n",
|
|
||||||
urb->status);
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
if (!tascam || !atomic_read(&tascam->capture_active))
|
|
||||||
goto out;
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
if (urb->actual_length > 0) {
|
if (urb->actual_length > 0) {
|
||||||
size_t i;
|
size_t i;
|
||||||
size_t write_ptr;
|
size_t write_ptr;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
spin_lock_irqsave(&tascam->lock, flags);
|
spin_lock_irqsave(&tascam->lock, flags);
|
||||||
write_ptr = tascam->capture_ring_buffer_write_ptr;
|
write_ptr = tascam->capture_ring_buffer_write_ptr;
|
||||||
for (i = 0; i < urb->actual_length; i++) {
|
for (i = 0; i < urb->actual_length; i++) {
|
||||||
|
|
@ -385,22 +268,10 @@ void capture_urb_complete(struct urb *urb) {
|
||||||
}
|
}
|
||||||
tascam->capture_ring_buffer_write_ptr = write_ptr;
|
tascam->capture_ring_buffer_write_ptr = write_ptr;
|
||||||
spin_unlock_irqrestore(&tascam->lock, flags);
|
spin_unlock_irqrestore(&tascam->lock, flags);
|
||||||
=======
|
|
||||||
spin_lock_irqsave(&tascam->lock, flags);
|
|
||||||
write_ptr = tascam->capture_ring_buffer_write_ptr;
|
|
||||||
for (i = 0; i < urb->actual_length; i++) {
|
|
||||||
tascam->capture_ring_buffer[write_ptr] =
|
|
||||||
((u8 *)urb->transfer_buffer)[i];
|
|
||||||
write_ptr = (write_ptr + 1) % CAPTURE_RING_BUFFER_SIZE;
|
|
||||||
}
|
|
||||||
tascam->capture_ring_buffer_write_ptr = write_ptr;
|
|
||||||
spin_unlock_irqrestore(&tascam->lock, flags);
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
schedule_work(&tascam->capture_work);
|
schedule_work(&tascam->capture_work);
|
||||||
}
|
}
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
usb_get_urb(urb);
|
usb_get_urb(urb);
|
||||||
usb_anchor_urb(urb, &tascam->capture_anchor);
|
usb_anchor_urb(urb, &tascam->capture_anchor);
|
||||||
ret = usb_submit_urb(urb, GFP_ATOMIC);
|
ret = usb_submit_urb(urb, GFP_ATOMIC);
|
||||||
|
|
@ -410,18 +281,6 @@ void capture_urb_complete(struct urb *urb) {
|
||||||
usb_unanchor_urb(urb);
|
usb_unanchor_urb(urb);
|
||||||
usb_put_urb(urb);
|
usb_put_urb(urb);
|
||||||
}
|
}
|
||||||
=======
|
|
||||||
usb_get_urb(urb);
|
|
||||||
usb_anchor_urb(urb, &tascam->capture_anchor);
|
|
||||||
ret = usb_submit_urb(urb, GFP_ATOMIC);
|
|
||||||
if (ret < 0) {
|
|
||||||
dev_err_ratelimited(tascam->card->dev,
|
|
||||||
"Failed to resubmit capture URB: %d\n",
|
|
||||||
ret);
|
|
||||||
usb_unanchor_urb(urb);
|
|
||||||
usb_put_urb(urb);
|
|
||||||
}
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
out:
|
out:
|
||||||
usb_put_urb(urb);
|
usb_put_urb(urb);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,13 +9,8 @@
|
||||||
* Used by ALSA kcontrol elements to provide user-friendly names for
|
* Used by ALSA kcontrol elements to provide user-friendly names for
|
||||||
* the playback routing options (e.g., "Playback 1-2", "Playback 3-4").
|
* the playback routing options (e.g., "Playback 1-2", "Playback 3-4").
|
||||||
*/
|
*/
|
||||||
<<<<<<< HEAD
|
|
||||||
static const char *const playback_source_texts[] = {"Playback 1-2",
|
static const char *const playback_source_texts[] = {"Playback 1-2",
|
||||||
"Playback 3-4"};
|
"Playback 3-4"};
|
||||||
=======
|
|
||||||
static const char *const playback_source_texts[] = { "Playback 1-2",
|
|
||||||
"Playback 3-4" };
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Text descriptions for capture input source options.
|
* @brief Text descriptions for capture input source options.
|
||||||
|
|
@ -23,11 +18,7 @@ static const char *const playback_source_texts[] = { "Playback 1-2",
|
||||||
* Used by ALSA kcontrol elements to provide user-friendly names for
|
* Used by ALSA kcontrol elements to provide user-friendly names for
|
||||||
* the capture routing options (e.g., "Analog In", "Digital In").
|
* the capture routing options (e.g., "Analog In", "Digital In").
|
||||||
*/
|
*/
|
||||||
<<<<<<< HEAD
|
|
||||||
static const char *const capture_source_texts[] = {"Analog In", "Digital In"};
|
static const char *const capture_source_texts[] = {"Analog In", "Digital In"};
|
||||||
=======
|
|
||||||
static const char *const capture_source_texts[] = { "Analog In", "Digital In" };
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* tascam_playback_source_info() - ALSA control info callback for playback
|
* tascam_playback_source_info() - ALSA control info callback for playback
|
||||||
|
|
@ -42,7 +33,6 @@ static const char *const capture_source_texts[] = { "Analog In", "Digital In" };
|
||||||
* Return: 0 on success.
|
* Return: 0 on success.
|
||||||
*/
|
*/
|
||||||
static int tascam_playback_source_info(struct snd_kcontrol *kcontrol,
|
static int tascam_playback_source_info(struct snd_kcontrol *kcontrol,
|
||||||
<<<<<<< HEAD
|
|
||||||
struct snd_ctl_elem_info *uinfo) {
|
struct snd_ctl_elem_info *uinfo) {
|
||||||
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
|
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
|
||||||
uinfo->count = 1;
|
uinfo->count = 1;
|
||||||
|
|
@ -53,19 +43,6 @@ static int tascam_playback_source_info(struct snd_kcontrol *kcontrol,
|
||||||
playback_source_texts[uinfo->value.enumerated.item],
|
playback_source_texts[uinfo->value.enumerated.item],
|
||||||
sizeof(uinfo->value.enumerated.name));
|
sizeof(uinfo->value.enumerated.name));
|
||||||
return 0;
|
return 0;
|
||||||
=======
|
|
||||||
struct snd_ctl_elem_info *uinfo)
|
|
||||||
{
|
|
||||||
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
|
|
||||||
uinfo->count = 1;
|
|
||||||
uinfo->value.enumerated.items = 2;
|
|
||||||
if (uinfo->value.enumerated.item >= 2)
|
|
||||||
uinfo->value.enumerated.item = 1;
|
|
||||||
strscpy(uinfo->value.enumerated.name,
|
|
||||||
playback_source_texts[uinfo->value.enumerated.item],
|
|
||||||
sizeof(uinfo->value.enumerated.name));
|
|
||||||
return 0;
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -80,14 +57,8 @@ static int tascam_playback_source_info(struct snd_kcontrol *kcontrol,
|
||||||
* Return: 0 on success.
|
* Return: 0 on success.
|
||||||
*/
|
*/
|
||||||
static int tascam_line_out_get(struct snd_kcontrol *kcontrol,
|
static int tascam_line_out_get(struct snd_kcontrol *kcontrol,
|
||||||
<<<<<<< HEAD
|
|
||||||
struct snd_ctl_elem_value *ucontrol) {
|
struct snd_ctl_elem_value *ucontrol) {
|
||||||
struct tascam_card *tascam = snd_kcontrol_chip(kcontrol);
|
struct tascam_card *tascam = snd_kcontrol_chip(kcontrol);
|
||||||
=======
|
|
||||||
struct snd_ctl_elem_value *ucontrol)
|
|
||||||
{
|
|
||||||
struct tascam_card *tascam = snd_kcontrol_chip(kcontrol);
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
ucontrol->value.enumerated.item[0] = tascam->line_out_source;
|
ucontrol->value.enumerated.item[0] = tascam->line_out_source;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -105,14 +76,8 @@ static int tascam_line_out_get(struct snd_kcontrol *kcontrol,
|
||||||
* Return: 1 if the value was changed, 0 if unchanged, or a negative error code.
|
* Return: 1 if the value was changed, 0 if unchanged, or a negative error code.
|
||||||
*/
|
*/
|
||||||
static int tascam_line_out_put(struct snd_kcontrol *kcontrol,
|
static int tascam_line_out_put(struct snd_kcontrol *kcontrol,
|
||||||
<<<<<<< HEAD
|
|
||||||
struct snd_ctl_elem_value *ucontrol) {
|
struct snd_ctl_elem_value *ucontrol) {
|
||||||
struct tascam_card *tascam = snd_kcontrol_chip(kcontrol);
|
struct tascam_card *tascam = snd_kcontrol_chip(kcontrol);
|
||||||
=======
|
|
||||||
struct snd_ctl_elem_value *ucontrol)
|
|
||||||
{
|
|
||||||
struct tascam_card *tascam = snd_kcontrol_chip(kcontrol);
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
if (ucontrol->value.enumerated.item[0] > 1)
|
if (ucontrol->value.enumerated.item[0] > 1)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
@ -132,19 +97,11 @@ static int tascam_line_out_put(struct snd_kcontrol *kcontrol,
|
||||||
* handling.
|
* handling.
|
||||||
*/
|
*/
|
||||||
static const struct snd_kcontrol_new tascam_line_out_control = {
|
static const struct snd_kcontrol_new tascam_line_out_control = {
|
||||||
<<<<<<< HEAD
|
|
||||||
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
|
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
|
||||||
.name = "Line OUTPUTS Source",
|
.name = "Line OUTPUTS Source",
|
||||||
.info = tascam_playback_source_info,
|
.info = tascam_playback_source_info,
|
||||||
.get = tascam_line_out_get,
|
.get = tascam_line_out_get,
|
||||||
.put = tascam_line_out_put,
|
.put = tascam_line_out_put,
|
||||||
=======
|
|
||||||
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
|
|
||||||
.name = "Line OUTPUTS Source",
|
|
||||||
.info = tascam_playback_source_info,
|
|
||||||
.get = tascam_line_out_get,
|
|
||||||
.put = tascam_line_out_put,
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -160,14 +117,8 @@ static const struct snd_kcontrol_new tascam_line_out_control = {
|
||||||
* Return: 0 on success.
|
* Return: 0 on success.
|
||||||
*/
|
*/
|
||||||
static int tascam_digital_out_get(struct snd_kcontrol *kcontrol,
|
static int tascam_digital_out_get(struct snd_kcontrol *kcontrol,
|
||||||
<<<<<<< HEAD
|
|
||||||
struct snd_ctl_elem_value *ucontrol) {
|
struct snd_ctl_elem_value *ucontrol) {
|
||||||
struct tascam_card *tascam = snd_kcontrol_chip(kcontrol);
|
struct tascam_card *tascam = snd_kcontrol_chip(kcontrol);
|
||||||
=======
|
|
||||||
struct snd_ctl_elem_value *ucontrol)
|
|
||||||
{
|
|
||||||
struct tascam_card *tascam = snd_kcontrol_chip(kcontrol);
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
ucontrol->value.enumerated.item[0] = tascam->digital_out_source;
|
ucontrol->value.enumerated.item[0] = tascam->digital_out_source;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -186,14 +137,8 @@ static int tascam_digital_out_get(struct snd_kcontrol *kcontrol,
|
||||||
* Return: 1 if the value was changed, 0 if unchanged, or a negative error code.
|
* Return: 1 if the value was changed, 0 if unchanged, or a negative error code.
|
||||||
*/
|
*/
|
||||||
static int tascam_digital_out_put(struct snd_kcontrol *kcontrol,
|
static int tascam_digital_out_put(struct snd_kcontrol *kcontrol,
|
||||||
<<<<<<< HEAD
|
|
||||||
struct snd_ctl_elem_value *ucontrol) {
|
struct snd_ctl_elem_value *ucontrol) {
|
||||||
struct tascam_card *tascam = snd_kcontrol_chip(kcontrol);
|
struct tascam_card *tascam = snd_kcontrol_chip(kcontrol);
|
||||||
=======
|
|
||||||
struct snd_ctl_elem_value *ucontrol)
|
|
||||||
{
|
|
||||||
struct tascam_card *tascam = snd_kcontrol_chip(kcontrol);
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
if (ucontrol->value.enumerated.item[0] > 1)
|
if (ucontrol->value.enumerated.item[0] > 1)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
@ -214,19 +159,11 @@ static int tascam_digital_out_put(struct snd_kcontrol *kcontrol,
|
||||||
* handling.
|
* handling.
|
||||||
*/
|
*/
|
||||||
static const struct snd_kcontrol_new tascam_digital_out_control = {
|
static const struct snd_kcontrol_new tascam_digital_out_control = {
|
||||||
<<<<<<< HEAD
|
|
||||||
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
|
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
|
||||||
.name = "Digital OUTPUTS Source",
|
.name = "Digital OUTPUTS Source",
|
||||||
.info = tascam_playback_source_info,
|
.info = tascam_playback_source_info,
|
||||||
.get = tascam_digital_out_get,
|
.get = tascam_digital_out_get,
|
||||||
.put = tascam_digital_out_put,
|
.put = tascam_digital_out_put,
|
||||||
=======
|
|
||||||
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
|
|
||||||
.name = "Digital OUTPUTS Source",
|
|
||||||
.info = tascam_playback_source_info,
|
|
||||||
.get = tascam_digital_out_get,
|
|
||||||
.put = tascam_digital_out_put,
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -241,7 +178,6 @@ static const struct snd_kcontrol_new tascam_digital_out_control = {
|
||||||
* Return: 0 on success.
|
* Return: 0 on success.
|
||||||
*/
|
*/
|
||||||
static int tascam_capture_source_info(struct snd_kcontrol *kcontrol,
|
static int tascam_capture_source_info(struct snd_kcontrol *kcontrol,
|
||||||
<<<<<<< HEAD
|
|
||||||
struct snd_ctl_elem_info *uinfo) {
|
struct snd_ctl_elem_info *uinfo) {
|
||||||
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
|
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
|
||||||
uinfo->count = 1;
|
uinfo->count = 1;
|
||||||
|
|
@ -252,19 +188,6 @@ static int tascam_capture_source_info(struct snd_kcontrol *kcontrol,
|
||||||
capture_source_texts[uinfo->value.enumerated.item],
|
capture_source_texts[uinfo->value.enumerated.item],
|
||||||
sizeof(uinfo->value.enumerated.name));
|
sizeof(uinfo->value.enumerated.name));
|
||||||
return 0;
|
return 0;
|
||||||
=======
|
|
||||||
struct snd_ctl_elem_info *uinfo)
|
|
||||||
{
|
|
||||||
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
|
|
||||||
uinfo->count = 1;
|
|
||||||
uinfo->value.enumerated.items = 2;
|
|
||||||
if (uinfo->value.enumerated.item >= 2)
|
|
||||||
uinfo->value.enumerated.item = 1;
|
|
||||||
strscpy(uinfo->value.enumerated.name,
|
|
||||||
capture_source_texts[uinfo->value.enumerated.item],
|
|
||||||
sizeof(uinfo->value.enumerated.name));
|
|
||||||
return 0;
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -280,14 +203,8 @@ static int tascam_capture_source_info(struct snd_kcontrol *kcontrol,
|
||||||
* Return: 0 on success.
|
* Return: 0 on success.
|
||||||
*/
|
*/
|
||||||
static int tascam_capture_12_get(struct snd_kcontrol *kcontrol,
|
static int tascam_capture_12_get(struct snd_kcontrol *kcontrol,
|
||||||
<<<<<<< HEAD
|
|
||||||
struct snd_ctl_elem_value *ucontrol) {
|
struct snd_ctl_elem_value *ucontrol) {
|
||||||
struct tascam_card *tascam = snd_kcontrol_chip(kcontrol);
|
struct tascam_card *tascam = snd_kcontrol_chip(kcontrol);
|
||||||
=======
|
|
||||||
struct snd_ctl_elem_value *ucontrol)
|
|
||||||
{
|
|
||||||
struct tascam_card *tascam = snd_kcontrol_chip(kcontrol);
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
ucontrol->value.enumerated.item[0] = tascam->capture_12_source;
|
ucontrol->value.enumerated.item[0] = tascam->capture_12_source;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -306,14 +223,8 @@ static int tascam_capture_12_get(struct snd_kcontrol *kcontrol,
|
||||||
* Return: 1 if the value was changed, 0 if unchanged, or a negative error code.
|
* Return: 1 if the value was changed, 0 if unchanged, or a negative error code.
|
||||||
*/
|
*/
|
||||||
static int tascam_capture_12_put(struct snd_kcontrol *kcontrol,
|
static int tascam_capture_12_put(struct snd_kcontrol *kcontrol,
|
||||||
<<<<<<< HEAD
|
|
||||||
struct snd_ctl_elem_value *ucontrol) {
|
struct snd_ctl_elem_value *ucontrol) {
|
||||||
struct tascam_card *tascam = snd_kcontrol_chip(kcontrol);
|
struct tascam_card *tascam = snd_kcontrol_chip(kcontrol);
|
||||||
=======
|
|
||||||
struct snd_ctl_elem_value *ucontrol)
|
|
||||||
{
|
|
||||||
struct tascam_card *tascam = snd_kcontrol_chip(kcontrol);
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
if (ucontrol->value.enumerated.item[0] > 1)
|
if (ucontrol->value.enumerated.item[0] > 1)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
@ -334,19 +245,11 @@ static int tascam_capture_12_put(struct snd_kcontrol *kcontrol,
|
||||||
* handling.
|
* handling.
|
||||||
*/
|
*/
|
||||||
static const struct snd_kcontrol_new tascam_capture_12_control = {
|
static const struct snd_kcontrol_new tascam_capture_12_control = {
|
||||||
<<<<<<< HEAD
|
|
||||||
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
|
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
|
||||||
.name = "ch1 and ch2 Source",
|
.name = "ch1 and ch2 Source",
|
||||||
.info = tascam_capture_source_info,
|
.info = tascam_capture_source_info,
|
||||||
.get = tascam_capture_12_get,
|
.get = tascam_capture_12_get,
|
||||||
.put = tascam_capture_12_put,
|
.put = tascam_capture_12_put,
|
||||||
=======
|
|
||||||
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
|
|
||||||
.name = "ch1 and ch2 Source",
|
|
||||||
.info = tascam_capture_source_info,
|
|
||||||
.get = tascam_capture_12_get,
|
|
||||||
.put = tascam_capture_12_put,
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -362,14 +265,8 @@ static const struct snd_kcontrol_new tascam_capture_12_control = {
|
||||||
* Return: 0 on success.
|
* Return: 0 on success.
|
||||||
*/
|
*/
|
||||||
static int tascam_capture_34_get(struct snd_kcontrol *kcontrol,
|
static int tascam_capture_34_get(struct snd_kcontrol *kcontrol,
|
||||||
<<<<<<< HEAD
|
|
||||||
struct snd_ctl_elem_value *ucontrol) {
|
struct snd_ctl_elem_value *ucontrol) {
|
||||||
struct tascam_card *tascam = snd_kcontrol_chip(kcontrol);
|
struct tascam_card *tascam = snd_kcontrol_chip(kcontrol);
|
||||||
=======
|
|
||||||
struct snd_ctl_elem_value *ucontrol)
|
|
||||||
{
|
|
||||||
struct tascam_card *tascam = snd_kcontrol_chip(kcontrol);
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
ucontrol->value.enumerated.item[0] = tascam->capture_34_source;
|
ucontrol->value.enumerated.item[0] = tascam->capture_34_source;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -388,14 +285,8 @@ static int tascam_capture_34_get(struct snd_kcontrol *kcontrol,
|
||||||
* Return: 1 if the value was changed, 0 if unchanged, or a negative error code.
|
* Return: 1 if the value was changed, 0 if unchanged, or a negative error code.
|
||||||
*/
|
*/
|
||||||
static int tascam_capture_34_put(struct snd_kcontrol *kcontrol,
|
static int tascam_capture_34_put(struct snd_kcontrol *kcontrol,
|
||||||
<<<<<<< HEAD
|
|
||||||
struct snd_ctl_elem_value *ucontrol) {
|
struct snd_ctl_elem_value *ucontrol) {
|
||||||
struct tascam_card *tascam = snd_kcontrol_chip(kcontrol);
|
struct tascam_card *tascam = snd_kcontrol_chip(kcontrol);
|
||||||
=======
|
|
||||||
struct snd_ctl_elem_value *ucontrol)
|
|
||||||
{
|
|
||||||
struct tascam_card *tascam = snd_kcontrol_chip(kcontrol);
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
if (ucontrol->value.enumerated.item[0] > 1)
|
if (ucontrol->value.enumerated.item[0] > 1)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
@ -416,19 +307,11 @@ static int tascam_capture_34_put(struct snd_kcontrol *kcontrol,
|
||||||
* `tascam_capture_34_get`/`tascam_capture_34_put` for value handling.
|
* `tascam_capture_34_get`/`tascam_capture_34_put` for value handling.
|
||||||
*/
|
*/
|
||||||
static const struct snd_kcontrol_new tascam_capture_34_control = {
|
static const struct snd_kcontrol_new tascam_capture_34_control = {
|
||||||
<<<<<<< HEAD
|
|
||||||
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
|
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
|
||||||
.name = "ch3 and ch4 Source",
|
.name = "ch3 and ch4 Source",
|
||||||
.info = tascam_capture_source_info,
|
.info = tascam_capture_source_info,
|
||||||
.get = tascam_capture_34_get,
|
.get = tascam_capture_34_get,
|
||||||
.put = tascam_capture_34_put,
|
.put = tascam_capture_34_put,
|
||||||
=======
|
|
||||||
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
|
|
||||||
.name = "ch3 and ch4 Source",
|
|
||||||
.info = tascam_capture_source_info,
|
|
||||||
.get = tascam_capture_34_get,
|
|
||||||
.put = tascam_capture_34_put,
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -442,22 +325,12 @@ static const struct snd_kcontrol_new tascam_capture_34_control = {
|
||||||
* Return: 0 on success.
|
* Return: 0 on success.
|
||||||
*/
|
*/
|
||||||
static int tascam_samplerate_info(struct snd_kcontrol *kcontrol,
|
static int tascam_samplerate_info(struct snd_kcontrol *kcontrol,
|
||||||
<<<<<<< HEAD
|
|
||||||
struct snd_ctl_elem_info *uinfo) {
|
struct snd_ctl_elem_info *uinfo) {
|
||||||
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
|
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
|
||||||
uinfo->count = 1;
|
uinfo->count = 1;
|
||||||
uinfo->value.integer.min = 0;
|
uinfo->value.integer.min = 0;
|
||||||
uinfo->value.integer.max = 96000;
|
uinfo->value.integer.max = 96000;
|
||||||
return 0;
|
return 0;
|
||||||
=======
|
|
||||||
struct snd_ctl_elem_info *uinfo)
|
|
||||||
{
|
|
||||||
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
|
|
||||||
uinfo->count = 1;
|
|
||||||
uinfo->value.integer.min = 0;
|
|
||||||
uinfo->value.integer.max = 96000;
|
|
||||||
return 0;
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -473,22 +346,12 @@ static int tascam_samplerate_info(struct snd_kcontrol *kcontrol,
|
||||||
* Return: 0 on success, or a negative error code on failure.
|
* Return: 0 on success, or a negative error code on failure.
|
||||||
*/
|
*/
|
||||||
static int tascam_samplerate_get(struct snd_kcontrol *kcontrol,
|
static int tascam_samplerate_get(struct snd_kcontrol *kcontrol,
|
||||||
<<<<<<< HEAD
|
|
||||||
struct snd_ctl_elem_value *ucontrol) {
|
struct snd_ctl_elem_value *ucontrol) {
|
||||||
struct tascam_card *tascam =
|
struct tascam_card *tascam =
|
||||||
(struct tascam_card *)snd_kcontrol_chip(kcontrol);
|
(struct tascam_card *)snd_kcontrol_chip(kcontrol);
|
||||||
u8 *buf;
|
u8 *buf;
|
||||||
int err;
|
int err;
|
||||||
u32 rate = 0;
|
u32 rate = 0;
|
||||||
=======
|
|
||||||
struct snd_ctl_elem_value *ucontrol)
|
|
||||||
{
|
|
||||||
struct tascam_card *tascam =
|
|
||||||
(struct tascam_card *)snd_kcontrol_chip(kcontrol);
|
|
||||||
u8 *buf;
|
|
||||||
int err;
|
|
||||||
u32 rate = 0;
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
if (tascam->current_rate > 0) {
|
if (tascam->current_rate > 0) {
|
||||||
ucontrol->value.integer.value[0] = tascam->current_rate;
|
ucontrol->value.integer.value[0] = tascam->current_rate;
|
||||||
|
|
@ -499,16 +362,9 @@ static int tascam_samplerate_get(struct snd_kcontrol *kcontrol,
|
||||||
if (!buf)
|
if (!buf)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
err = usb_control_msg(tascam->dev, usb_rcvctrlpipe(tascam->dev, 0),
|
err = usb_control_msg(tascam->dev, usb_rcvctrlpipe(tascam->dev, 0),
|
||||||
UAC_GET_CUR, RT_D2H_CLASS_EP, UAC_SAMPLING_FREQ_CONTROL,
|
UAC_GET_CUR, RT_D2H_CLASS_EP, UAC_SAMPLING_FREQ_CONTROL,
|
||||||
EP_AUDIO_IN, buf, 3, USB_CTRL_TIMEOUT_MS);
|
EP_AUDIO_IN, buf, 3, USB_CTRL_TIMEOUT_MS);
|
||||||
=======
|
|
||||||
err = usb_control_msg(tascam->dev, usb_rcvctrlpipe(tascam->dev, 0),
|
|
||||||
UAC_GET_CUR, RT_D2H_CLASS_EP,
|
|
||||||
UAC_SAMPLING_FREQ_CONTROL, EP_AUDIO_IN, buf, 3,
|
|
||||||
USB_CTRL_TIMEOUT_MS);
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
if (err >= 3)
|
if (err >= 3)
|
||||||
rate = buf[0] | (buf[1] << 8) | (buf[2] << 16);
|
rate = buf[0] | (buf[1] << 8) | (buf[2] << 16);
|
||||||
|
|
@ -546,7 +402,6 @@ static const struct snd_kcontrol_new tascam_samplerate_control = {
|
||||||
int tascam_create_controls(struct tascam_card *tascam) {
|
int tascam_create_controls(struct tascam_card *tascam) {
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
err =
|
err =
|
||||||
snd_ctl_add(tascam->card, snd_ctl_new1(&tascam_line_out_control, tascam));
|
snd_ctl_add(tascam->card, snd_ctl_new1(&tascam_line_out_control, tascam));
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
|
|
@ -568,29 +423,6 @@ int tascam_create_controls(struct tascam_card *tascam) {
|
||||||
snd_ctl_new1(&tascam_samplerate_control, tascam));
|
snd_ctl_new1(&tascam_samplerate_control, tascam));
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
return err;
|
return err;
|
||||||
=======
|
|
||||||
err = snd_ctl_add(tascam->card,
|
|
||||||
snd_ctl_new1(&tascam_line_out_control, tascam));
|
|
||||||
if (err < 0)
|
|
||||||
return err;
|
|
||||||
err = snd_ctl_add(tascam->card,
|
|
||||||
snd_ctl_new1(&tascam_digital_out_control, tascam));
|
|
||||||
if (err < 0)
|
|
||||||
return err;
|
|
||||||
err = snd_ctl_add(tascam->card,
|
|
||||||
snd_ctl_new1(&tascam_capture_12_control, tascam));
|
|
||||||
if (err < 0)
|
|
||||||
return err;
|
|
||||||
err = snd_ctl_add(tascam->card,
|
|
||||||
snd_ctl_new1(&tascam_capture_34_control, tascam));
|
|
||||||
if (err < 0)
|
|
||||||
return err;
|
|
||||||
|
|
||||||
err = snd_ctl_add(tascam->card,
|
|
||||||
snd_ctl_new1(&tascam_samplerate_control, tascam));
|
|
||||||
if (err < 0)
|
|
||||||
return err;
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
129
us144mkii_midi.c
129
us144mkii_midi.c
|
|
@ -11,35 +11,19 @@
|
||||||
* the kfifo, processes it by stripping protocol-specific padding bytes, and
|
* the kfifo, processes it by stripping protocol-specific padding bytes, and
|
||||||
* passes the clean MIDI data to the ALSA rawmidi subsystem.
|
* passes the clean MIDI data to the ALSA rawmidi subsystem.
|
||||||
*/
|
*/
|
||||||
<<<<<<< HEAD
|
|
||||||
static void tascam_midi_in_work_handler(struct work_struct *work) {
|
static void tascam_midi_in_work_handler(struct work_struct *work) {
|
||||||
struct tascam_card *tascam =
|
struct tascam_card *tascam =
|
||||||
container_of(work, struct tascam_card, midi_in_work);
|
container_of(work, struct tascam_card, midi_in_work);
|
||||||
u8 buf[MIDI_IN_BUF_SIZE];
|
u8 buf[MIDI_IN_BUF_SIZE];
|
||||||
unsigned int len;
|
unsigned int len;
|
||||||
int i;
|
int i;
|
||||||
=======
|
|
||||||
static void tascam_midi_in_work_handler(struct work_struct *work)
|
|
||||||
{
|
|
||||||
struct tascam_card *tascam =
|
|
||||||
container_of(work, struct tascam_card, midi_in_work);
|
|
||||||
u8 buf[MIDI_IN_BUF_SIZE];
|
|
||||||
unsigned int len;
|
|
||||||
int i;
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
if (!tascam->midi_in_substream)
|
if (!tascam->midi_in_substream)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
while (!kfifo_is_empty(&tascam->midi_in_fifo)) {
|
while (!kfifo_is_empty(&tascam->midi_in_fifo)) {
|
||||||
len = kfifo_out_spinlocked(&tascam->midi_in_fifo, buf, sizeof(buf),
|
len = kfifo_out_spinlocked(&tascam->midi_in_fifo, buf, sizeof(buf),
|
||||||
&tascam->midi_in_lock);
|
&tascam->midi_in_lock);
|
||||||
=======
|
|
||||||
while (!kfifo_is_empty(&tascam->midi_in_fifo)) {
|
|
||||||
len = kfifo_out_spinlocked(&tascam->midi_in_fifo, buf,
|
|
||||||
sizeof(buf), &tascam->midi_in_lock);
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
if (len == 0)
|
if (len == 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -52,7 +36,6 @@ static void tascam_midi_in_work_handler(struct work_struct *work)
|
||||||
if (buf[i] == 0xfd)
|
if (buf[i] == 0xfd)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
/* The last byte is often a terminator (0x00, 0xFF). Ignore it. */
|
/* The last byte is often a terminator (0x00, 0xFF). Ignore it. */
|
||||||
if (i == (len - 1) && (buf[i] == 0x00 || buf[i] == 0xff))
|
if (i == (len - 1) && (buf[i] == 0x00 || buf[i] == 0xff))
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -61,18 +44,6 @@ static void tascam_midi_in_work_handler(struct work_struct *work)
|
||||||
snd_rawmidi_receive(tascam->midi_in_substream, &buf[i], 1);
|
snd_rawmidi_receive(tascam->midi_in_substream, &buf[i], 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
=======
|
|
||||||
/* The last byte is often a terminator (0x00, 0xFF). Ignore it. */
|
|
||||||
if (i == (len - 1) &&
|
|
||||||
(buf[i] == 0x00 || buf[i] == 0xff))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
/* Submit valid MIDI bytes one by one */
|
|
||||||
snd_rawmidi_receive(tascam->midi_in_substream, &buf[i],
|
|
||||||
1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -95,21 +66,12 @@ void tascam_midi_in_urb_complete(struct urb *urb) {
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
if (tascam && atomic_read(&tascam->midi_in_active) &&
|
if (tascam && atomic_read(&tascam->midi_in_active) &&
|
||||||
urb->actual_length > 0) {
|
urb->actual_length > 0) {
|
||||||
kfifo_in_spinlocked(&tascam->midi_in_fifo, urb->transfer_buffer,
|
kfifo_in_spinlocked(&tascam->midi_in_fifo, urb->transfer_buffer,
|
||||||
urb->actual_length, &tascam->midi_in_lock);
|
urb->actual_length, &tascam->midi_in_lock);
|
||||||
schedule_work(&tascam->midi_in_work);
|
schedule_work(&tascam->midi_in_work);
|
||||||
}
|
}
|
||||||
=======
|
|
||||||
if (tascam && atomic_read(&tascam->midi_in_active) &&
|
|
||||||
urb->actual_length > 0) {
|
|
||||||
kfifo_in_spinlocked(&tascam->midi_in_fifo, urb->transfer_buffer,
|
|
||||||
urb->actual_length, &tascam->midi_in_lock);
|
|
||||||
schedule_work(&tascam->midi_in_work);
|
|
||||||
}
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
usb_get_urb(urb);
|
usb_get_urb(urb);
|
||||||
usb_anchor_urb(urb, &tascam->midi_in_anchor);
|
usb_anchor_urb(urb, &tascam->midi_in_anchor);
|
||||||
|
|
@ -161,18 +123,10 @@ static int tascam_midi_in_close(struct snd_rawmidi_substream *substream) {
|
||||||
* associated workqueue.
|
* associated workqueue.
|
||||||
*/
|
*/
|
||||||
static void tascam_midi_in_trigger(struct snd_rawmidi_substream *substream,
|
static void tascam_midi_in_trigger(struct snd_rawmidi_substream *substream,
|
||||||
<<<<<<< HEAD
|
|
||||||
int up) {
|
int up) {
|
||||||
struct tascam_card *tascam = substream->rmidi->private_data;
|
struct tascam_card *tascam = substream->rmidi->private_data;
|
||||||
int i, err;
|
int i, err;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
=======
|
|
||||||
int up)
|
|
||||||
{
|
|
||||||
struct tascam_card *tascam = substream->rmidi->private_data;
|
|
||||||
int i, err;
|
|
||||||
unsigned long flags;
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
if (up) {
|
if (up) {
|
||||||
if (atomic_xchg(&tascam->midi_in_active, 1) == 0) {
|
if (atomic_xchg(&tascam->midi_in_active, 1) == 0) {
|
||||||
|
|
@ -180,7 +134,6 @@ static void tascam_midi_in_trigger(struct snd_rawmidi_substream *substream,
|
||||||
kfifo_reset(&tascam->midi_in_fifo);
|
kfifo_reset(&tascam->midi_in_fifo);
|
||||||
spin_unlock_irqrestore(&tascam->midi_in_lock, flags);
|
spin_unlock_irqrestore(&tascam->midi_in_lock, flags);
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
for (i = 0; i < NUM_MIDI_IN_URBS; i++) {
|
for (i = 0; i < NUM_MIDI_IN_URBS; i++) {
|
||||||
usb_get_urb(tascam->midi_in_urbs[i]);
|
usb_get_urb(tascam->midi_in_urbs[i]);
|
||||||
usb_anchor_urb(tascam->midi_in_urbs[i], &tascam->midi_in_anchor);
|
usb_anchor_urb(tascam->midi_in_urbs[i], &tascam->midi_in_anchor);
|
||||||
|
|
@ -199,30 +152,6 @@ static void tascam_midi_in_trigger(struct snd_rawmidi_substream *substream,
|
||||||
cancel_work_sync(&tascam->midi_in_work);
|
cancel_work_sync(&tascam->midi_in_work);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
=======
|
|
||||||
for (i = 0; i < NUM_MIDI_IN_URBS; i++) {
|
|
||||||
usb_get_urb(tascam->midi_in_urbs[i]);
|
|
||||||
usb_anchor_urb(tascam->midi_in_urbs[i],
|
|
||||||
&tascam->midi_in_anchor);
|
|
||||||
err = usb_submit_urb(tascam->midi_in_urbs[i],
|
|
||||||
GFP_KERNEL);
|
|
||||||
if (err < 0) {
|
|
||||||
dev_err(tascam->card->dev,
|
|
||||||
"Failed to submit MIDI IN URB %d: %d\n",
|
|
||||||
i, err);
|
|
||||||
usb_unanchor_urb(
|
|
||||||
tascam->midi_in_urbs[i]);
|
|
||||||
usb_put_urb(tascam->midi_in_urbs[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (atomic_xchg(&tascam->midi_in_active, 0) == 1) {
|
|
||||||
usb_kill_anchored_urbs(&tascam->midi_in_anchor);
|
|
||||||
cancel_work_sync(&tascam->midi_in_work);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -251,22 +180,12 @@ void tascam_midi_out_urb_complete(struct urb *urb) {
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
int i, urb_index = -1;
|
int i, urb_index = -1;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
if (urb->status) {
|
if (urb->status) {
|
||||||
if (urb->status != -ENOENT && urb->status != -ECONNRESET &&
|
if (urb->status != -ENOENT && urb->status != -ECONNRESET &&
|
||||||
urb->status != -ESHUTDOWN)
|
urb->status != -ESHUTDOWN)
|
||||||
dev_err_ratelimited(tascam->card->dev, "MIDI OUT URB failed: %d\n",
|
dev_err_ratelimited(tascam->card->dev, "MIDI OUT URB failed: %d\n",
|
||||||
urb->status);
|
urb->status);
|
||||||
}
|
}
|
||||||
=======
|
|
||||||
if (urb->status) {
|
|
||||||
if (urb->status != -ENOENT && urb->status != -ECONNRESET &&
|
|
||||||
urb->status != -ESHUTDOWN)
|
|
||||||
dev_err_ratelimited(tascam->card->dev,
|
|
||||||
"MIDI OUT URB failed: %d\n",
|
|
||||||
urb->status);
|
|
||||||
}
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
if (!tascam)
|
if (!tascam)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
@ -278,18 +197,10 @@ void tascam_midi_out_urb_complete(struct urb *urb) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
if (urb_index < 0) {
|
if (urb_index < 0) {
|
||||||
dev_err_ratelimited(tascam->card->dev, "Unknown MIDI OUT URB completed!\n");
|
dev_err_ratelimited(tascam->card->dev, "Unknown MIDI OUT URB completed!\n");
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
=======
|
|
||||||
if (urb_index < 0) {
|
|
||||||
dev_err_ratelimited(tascam->card->dev,
|
|
||||||
"Unknown MIDI OUT URB completed!\n");
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
spin_lock_irqsave(&tascam->midi_out_lock, flags);
|
spin_lock_irqsave(&tascam->midi_out_lock, flags);
|
||||||
clear_bit(urb_index, &tascam->midi_out_urbs_in_flight);
|
clear_bit(urb_index, &tascam->midi_out_urbs_in_flight);
|
||||||
|
|
@ -359,7 +270,6 @@ static void tascam_midi_out_work_handler(struct work_struct *work) {
|
||||||
urb->transfer_buffer_length = 9;
|
urb->transfer_buffer_length = 9;
|
||||||
spin_unlock_irqrestore(&tascam->midi_out_lock, flags);
|
spin_unlock_irqrestore(&tascam->midi_out_lock, flags);
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
usb_get_urb(urb);
|
usb_get_urb(urb);
|
||||||
usb_anchor_urb(urb, &tascam->midi_out_anchor);
|
usb_anchor_urb(urb, &tascam->midi_out_anchor);
|
||||||
if (usb_submit_urb(urb, GFP_KERNEL) < 0) {
|
if (usb_submit_urb(urb, GFP_KERNEL) < 0) {
|
||||||
|
|
@ -373,23 +283,6 @@ static void tascam_midi_out_work_handler(struct work_struct *work) {
|
||||||
break; /* Stop on error */
|
break; /* Stop on error */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
=======
|
|
||||||
usb_get_urb(urb);
|
|
||||||
usb_anchor_urb(urb, &tascam->midi_out_anchor);
|
|
||||||
if (usb_submit_urb(urb, GFP_KERNEL) < 0) {
|
|
||||||
dev_err_ratelimited(
|
|
||||||
tascam->card->dev,
|
|
||||||
"Failed to submit MIDI OUT URB %d\n",
|
|
||||||
urb_index);
|
|
||||||
spin_lock_irqsave(&tascam->midi_out_lock, flags);
|
|
||||||
clear_bit(urb_index, &tascam->midi_out_urbs_in_flight);
|
|
||||||
spin_unlock_irqrestore(&tascam->midi_out_lock, flags);
|
|
||||||
usb_unanchor_urb(urb);
|
|
||||||
usb_put_urb(urb);
|
|
||||||
break; /* Stop on error */
|
|
||||||
}
|
|
||||||
}
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -443,14 +336,8 @@ static void tascam_midi_out_drain(struct snd_rawmidi_substream *substream) {
|
||||||
* 'up' parameter.
|
* 'up' parameter.
|
||||||
*/
|
*/
|
||||||
static void tascam_midi_out_trigger(struct snd_rawmidi_substream *substream,
|
static void tascam_midi_out_trigger(struct snd_rawmidi_substream *substream,
|
||||||
<<<<<<< HEAD
|
|
||||||
int up) {
|
int up) {
|
||||||
struct tascam_card *tascam = substream->rmidi->private_data;
|
struct tascam_card *tascam = substream->rmidi->private_data;
|
||||||
=======
|
|
||||||
int up)
|
|
||||||
{
|
|
||||||
struct tascam_card *tascam = substream->rmidi->private_data;
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
if (up) {
|
if (up) {
|
||||||
atomic_set(&tascam->midi_out_active, 1);
|
atomic_set(&tascam->midi_out_active, 1);
|
||||||
|
|
@ -482,7 +369,6 @@ static const struct snd_rawmidi_ops tascam_midi_out_ops = {
|
||||||
int tascam_create_midi(struct tascam_card *tascam) {
|
int tascam_create_midi(struct tascam_card *tascam) {
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
err =
|
err =
|
||||||
snd_rawmidi_new(tascam->card, "US144MKII MIDI", 0, 1, 1, &tascam->rmidi);
|
snd_rawmidi_new(tascam->card, "US144MKII MIDI", 0, 1, 1, &tascam->rmidi);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
|
|
@ -495,21 +381,6 @@ int tascam_create_midi(struct tascam_card *tascam) {
|
||||||
&tascam_midi_in_ops);
|
&tascam_midi_in_ops);
|
||||||
snd_rawmidi_set_ops(tascam->rmidi, SNDRV_RAWMIDI_STREAM_OUTPUT,
|
snd_rawmidi_set_ops(tascam->rmidi, SNDRV_RAWMIDI_STREAM_OUTPUT,
|
||||||
&tascam_midi_out_ops);
|
&tascam_midi_out_ops);
|
||||||
=======
|
|
||||||
err = snd_rawmidi_new(tascam->card, "US144MKII MIDI", 0, 1, 1,
|
|
||||||
&tascam->rmidi);
|
|
||||||
if (err < 0)
|
|
||||||
return err;
|
|
||||||
|
|
||||||
strscpy(tascam->rmidi->name, "US144MKII MIDI",
|
|
||||||
sizeof(tascam->rmidi->name));
|
|
||||||
tascam->rmidi->private_data = tascam;
|
|
||||||
|
|
||||||
snd_rawmidi_set_ops(tascam->rmidi, SNDRV_RAWMIDI_STREAM_INPUT,
|
|
||||||
&tascam_midi_in_ops);
|
|
||||||
snd_rawmidi_set_ops(tascam->rmidi, SNDRV_RAWMIDI_STREAM_OUTPUT,
|
|
||||||
&tascam_midi_out_ops);
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
tascam->rmidi->info_flags |= SNDRV_RAWMIDI_INFO_INPUT |
|
tascam->rmidi->info_flags |= SNDRV_RAWMIDI_INFO_INPUT |
|
||||||
SNDRV_RAWMIDI_INFO_OUTPUT |
|
SNDRV_RAWMIDI_INFO_OUTPUT |
|
||||||
|
|
|
||||||
230
us144mkii_pcm.c
230
us144mkii_pcm.c
|
|
@ -15,7 +15,6 @@
|
||||||
* which helps the driver adjust the packet size dynamically to match the
|
* which helps the driver adjust the packet size dynamically to match the
|
||||||
* device's consumption rate.
|
* device's consumption rate.
|
||||||
*/
|
*/
|
||||||
<<<<<<< HEAD
|
|
||||||
static const unsigned int patterns_48khz[5][8] = {{5, 6, 6, 6, 6, 6, 6, 6},
|
static const unsigned int patterns_48khz[5][8] = {{5, 6, 6, 6, 6, 6, 6, 6},
|
||||||
{6, 6, 6, 6, 6, 6, 6, 6},
|
{6, 6, 6, 6, 6, 6, 6, 6},
|
||||||
{6, 6, 6, 6, 6, 6, 6, 6},
|
{6, 6, 6, 6, 6, 6, 6, 6},
|
||||||
|
|
@ -55,49 +54,6 @@ const struct snd_pcm_hardware tascam_pcm_hw = {
|
||||||
.period_bytes_max = 1024 * BYTES_PER_FRAME,
|
.period_bytes_max = 1024 * BYTES_PER_FRAME,
|
||||||
.periods_min = 2,
|
.periods_min = 2,
|
||||||
.periods_max = 1024,
|
.periods_max = 1024,
|
||||||
=======
|
|
||||||
static const unsigned int patterns_48khz[5][8] = { { 5, 6, 6, 6, 6, 6, 6, 6 },
|
|
||||||
{ 6, 6, 6, 6, 6, 6, 6, 6 },
|
|
||||||
{ 6, 6, 6, 6, 6, 6, 6, 6 },
|
|
||||||
{ 6, 6, 6, 7, 6, 6, 6, 6 },
|
|
||||||
{ 7, 6, 6, 7, 6, 6, 7, 6 } };
|
|
||||||
static const unsigned int patterns_96khz[5][8] = {
|
|
||||||
{ 11, 12, 12, 12, 12, 12, 12, 12 },
|
|
||||||
{ 12, 12, 12, 12, 12, 12, 12, 12 },
|
|
||||||
{ 12, 12, 12, 12, 12, 12, 12, 12 },
|
|
||||||
{ 12, 12, 13, 12, 12, 12, 12, 12 },
|
|
||||||
{ 13, 12, 12, 13, 12, 12, 13, 12 }
|
|
||||||
};
|
|
||||||
static const unsigned int patterns_88khz[5][8] = {
|
|
||||||
{ 10, 11, 11, 11, 11, 11, 11, 11 },
|
|
||||||
{ 11, 11, 11, 11, 11, 11, 11, 11 },
|
|
||||||
{ 11, 11, 11, 11, 11, 11, 11, 11 },
|
|
||||||
{ 11, 11, 12, 11, 11, 11, 11, 11 },
|
|
||||||
{ 12, 11, 11, 12, 11, 11, 12, 11 }
|
|
||||||
};
|
|
||||||
static const unsigned int patterns_44khz[5][8] = { { 5, 5, 5, 5, 5, 5, 5, 6 },
|
|
||||||
{ 5, 5, 5, 6, 5, 5, 5, 6 },
|
|
||||||
{ 5, 5, 6, 5, 6, 5, 5, 6 },
|
|
||||||
{ 5, 6, 5, 6, 5, 6, 5, 6 },
|
|
||||||
{ 6, 6, 6, 6, 6, 6, 6, 5 } };
|
|
||||||
|
|
||||||
const struct snd_pcm_hardware tascam_pcm_hw = {
|
|
||||||
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
|
|
||||||
SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_MMAP_VALID |
|
|
||||||
SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME),
|
|
||||||
.formats = SNDRV_PCM_FMTBIT_S24_3LE,
|
|
||||||
.rates = (SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 |
|
|
||||||
SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000),
|
|
||||||
.rate_min = 44100,
|
|
||||||
.rate_max = 96000,
|
|
||||||
.channels_min = NUM_CHANNELS,
|
|
||||||
.channels_max = NUM_CHANNELS,
|
|
||||||
.buffer_bytes_max = 1024 * 1024,
|
|
||||||
.period_bytes_min = 48 * BYTES_PER_FRAME,
|
|
||||||
.period_bytes_max = 1024 * BYTES_PER_FRAME,
|
|
||||||
.periods_min = 2,
|
|
||||||
.periods_max = 1024,
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -108,20 +64,11 @@ const struct snd_pcm_hardware tascam_pcm_hw = {
|
||||||
* @frames: Number of frames to process.
|
* @frames: Number of frames to process.
|
||||||
*/
|
*/
|
||||||
void process_playback_routing_us144mkii(struct tascam_card *tascam,
|
void process_playback_routing_us144mkii(struct tascam_card *tascam,
|
||||||
<<<<<<< HEAD
|
|
||||||
const u8 *src_buffer, u8 *dst_buffer,
|
const u8 *src_buffer, u8 *dst_buffer,
|
||||||
size_t frames) {
|
size_t frames) {
|
||||||
size_t f;
|
size_t f;
|
||||||
const u8 *src_12, *src_34;
|
const u8 *src_12, *src_34;
|
||||||
u8 *dst_line, *dst_digital;
|
u8 *dst_line, *dst_digital;
|
||||||
=======
|
|
||||||
const u8 *src_buffer, u8 *dst_buffer,
|
|
||||||
size_t frames)
|
|
||||||
{
|
|
||||||
size_t f;
|
|
||||||
const u8 *src_12, *src_34;
|
|
||||||
u8 *dst_line, *dst_digital;
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
for (f = 0; f < frames; ++f) {
|
for (f = 0; f < frames; ++f) {
|
||||||
src_12 = src_buffer + f * BYTES_PER_FRAME;
|
src_12 = src_buffer + f * BYTES_PER_FRAME;
|
||||||
|
|
@ -150,20 +97,11 @@ void process_playback_routing_us144mkii(struct tascam_card *tascam,
|
||||||
* @routed_block: Buffer to be filled for ALSA.
|
* @routed_block: Buffer to be filled for ALSA.
|
||||||
*/
|
*/
|
||||||
void process_capture_routing_us144mkii(struct tascam_card *tascam,
|
void process_capture_routing_us144mkii(struct tascam_card *tascam,
|
||||||
<<<<<<< HEAD
|
|
||||||
const s32 *decoded_block,
|
const s32 *decoded_block,
|
||||||
s32 *routed_block) {
|
s32 *routed_block) {
|
||||||
int f;
|
int f;
|
||||||
const s32 *src_frame;
|
const s32 *src_frame;
|
||||||
s32 *dst_frame;
|
s32 *dst_frame;
|
||||||
=======
|
|
||||||
const s32 *decoded_block,
|
|
||||||
s32 *routed_block)
|
|
||||||
{
|
|
||||||
int f;
|
|
||||||
const s32 *src_frame;
|
|
||||||
s32 *dst_frame;
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
for (f = 0; f < FRAMES_PER_DECODE_BLOCK; f++) {
|
for (f = 0; f < FRAMES_PER_DECODE_BLOCK; f++) {
|
||||||
src_frame = decoded_block + (f * DECODED_CHANNELS_PER_FRAME);
|
src_frame = decoded_block + (f * DECODED_CHANNELS_PER_FRAME);
|
||||||
|
|
@ -206,7 +144,6 @@ int us144mkii_configure_device_for_rate(struct tascam_card *tascam, int rate) {
|
||||||
int err = 0;
|
int err = 0;
|
||||||
const u8 *current_payload_src;
|
const u8 *current_payload_src;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
static const u8 payload_44100[] = {0x44, 0xac, 0x00};
|
static const u8 payload_44100[] = {0x44, 0xac, 0x00};
|
||||||
static const u8 payload_48000[] = {0x80, 0xbb, 0x00};
|
static const u8 payload_48000[] = {0x80, 0xbb, 0x00};
|
||||||
static const u8 payload_88200[] = {0x88, 0x58, 0x01};
|
static const u8 payload_88200[] = {0x88, 0x58, 0x01};
|
||||||
|
|
@ -233,35 +170,6 @@ int us144mkii_configure_device_for_rate(struct tascam_card *tascam, int rate) {
|
||||||
dev_err(&dev->dev, "Unsupported sample rate %d for configuration\n", rate);
|
dev_err(&dev->dev, "Unsupported sample rate %d for configuration\n", rate);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
=======
|
|
||||||
static const u8 payload_44100[] = { 0x44, 0xac, 0x00 };
|
|
||||||
static const u8 payload_48000[] = { 0x80, 0xbb, 0x00 };
|
|
||||||
static const u8 payload_88200[] = { 0x88, 0x58, 0x01 };
|
|
||||||
static const u8 payload_96000[] = { 0x00, 0x77, 0x01 };
|
|
||||||
|
|
||||||
switch (rate) {
|
|
||||||
case 44100:
|
|
||||||
current_payload_src = payload_44100;
|
|
||||||
rate_vendor_wValue = REG_ADDR_RATE_44100;
|
|
||||||
break;
|
|
||||||
case 48000:
|
|
||||||
current_payload_src = payload_48000;
|
|
||||||
rate_vendor_wValue = REG_ADDR_RATE_48000;
|
|
||||||
break;
|
|
||||||
case 88200:
|
|
||||||
current_payload_src = payload_88200;
|
|
||||||
rate_vendor_wValue = REG_ADDR_RATE_88200;
|
|
||||||
break;
|
|
||||||
case 96000:
|
|
||||||
current_payload_src = payload_96000;
|
|
||||||
rate_vendor_wValue = REG_ADDR_RATE_96000;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
dev_err(&dev->dev,
|
|
||||||
"Unsupported sample rate %d for configuration\n", rate);
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
rate_payload_buf = kmemdup(current_payload_src, 3, GFP_KERNEL);
|
rate_payload_buf = kmemdup(current_payload_src, 3, GFP_KERNEL);
|
||||||
if (!rate_payload_buf)
|
if (!rate_payload_buf)
|
||||||
|
|
@ -269,7 +177,6 @@ int us144mkii_configure_device_for_rate(struct tascam_card *tascam, int rate) {
|
||||||
|
|
||||||
dev_info(&dev->dev, "Configuring device for %d Hz\n", rate);
|
dev_info(&dev->dev, "Configuring device for %d Hz\n", rate);
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
err = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), VENDOR_REQ_MODE_CONTROL,
|
err = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), VENDOR_REQ_MODE_CONTROL,
|
||||||
RT_H2D_VENDOR_DEV, MODE_VAL_CONFIG, 0x0000, NULL, 0,
|
RT_H2D_VENDOR_DEV, MODE_VAL_CONFIG, 0x0000, NULL, 0,
|
||||||
USB_CTRL_TIMEOUT_MS);
|
USB_CTRL_TIMEOUT_MS);
|
||||||
|
|
@ -315,79 +222,15 @@ int us144mkii_configure_device_for_rate(struct tascam_card *tascam, int rate) {
|
||||||
0, USB_CTRL_TIMEOUT_MS);
|
0, USB_CTRL_TIMEOUT_MS);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
=======
|
|
||||||
err = usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
|
|
||||||
VENDOR_REQ_MODE_CONTROL, RT_H2D_VENDOR_DEV,
|
|
||||||
MODE_VAL_CONFIG, 0x0000, NULL, 0,
|
|
||||||
USB_CTRL_TIMEOUT_MS);
|
|
||||||
if (err < 0)
|
|
||||||
goto fail;
|
|
||||||
err = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), UAC_SET_CUR,
|
|
||||||
RT_H2D_CLASS_EP, UAC_SAMPLING_FREQ_CONTROL,
|
|
||||||
EP_AUDIO_IN, rate_payload_buf, 3,
|
|
||||||
USB_CTRL_TIMEOUT_MS);
|
|
||||||
if (err < 0)
|
|
||||||
goto fail;
|
|
||||||
err = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), UAC_SET_CUR,
|
|
||||||
RT_H2D_CLASS_EP, UAC_SAMPLING_FREQ_CONTROL,
|
|
||||||
EP_AUDIO_OUT, rate_payload_buf, 3,
|
|
||||||
USB_CTRL_TIMEOUT_MS);
|
|
||||||
if (err < 0)
|
|
||||||
goto fail;
|
|
||||||
err = usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
|
|
||||||
VENDOR_REQ_REGISTER_WRITE, RT_H2D_VENDOR_DEV,
|
|
||||||
REG_ADDR_UNKNOWN_0D, REG_VAL_ENABLE, NULL, 0,
|
|
||||||
USB_CTRL_TIMEOUT_MS);
|
|
||||||
if (err < 0)
|
|
||||||
goto fail;
|
|
||||||
err = usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
|
|
||||||
VENDOR_REQ_REGISTER_WRITE, RT_H2D_VENDOR_DEV,
|
|
||||||
REG_ADDR_UNKNOWN_0E, REG_VAL_ENABLE, NULL, 0,
|
|
||||||
USB_CTRL_TIMEOUT_MS);
|
|
||||||
if (err < 0)
|
|
||||||
goto fail;
|
|
||||||
err = usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
|
|
||||||
VENDOR_REQ_REGISTER_WRITE, RT_H2D_VENDOR_DEV,
|
|
||||||
REG_ADDR_UNKNOWN_0F, REG_VAL_ENABLE, NULL, 0,
|
|
||||||
USB_CTRL_TIMEOUT_MS);
|
|
||||||
if (err < 0)
|
|
||||||
goto fail;
|
|
||||||
err = usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
|
|
||||||
VENDOR_REQ_REGISTER_WRITE, RT_H2D_VENDOR_DEV,
|
|
||||||
rate_vendor_wValue, REG_VAL_ENABLE, NULL, 0,
|
|
||||||
USB_CTRL_TIMEOUT_MS);
|
|
||||||
if (err < 0)
|
|
||||||
goto fail;
|
|
||||||
err = usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
|
|
||||||
VENDOR_REQ_REGISTER_WRITE, RT_H2D_VENDOR_DEV,
|
|
||||||
REG_ADDR_UNKNOWN_11, REG_VAL_ENABLE, NULL, 0,
|
|
||||||
USB_CTRL_TIMEOUT_MS);
|
|
||||||
if (err < 0)
|
|
||||||
goto fail;
|
|
||||||
err = usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
|
|
||||||
VENDOR_REQ_MODE_CONTROL, RT_H2D_VENDOR_DEV,
|
|
||||||
MODE_VAL_STREAM_START, 0x0000, NULL, 0,
|
|
||||||
USB_CTRL_TIMEOUT_MS);
|
|
||||||
if (err < 0)
|
|
||||||
goto fail;
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
kfree(rate_payload_buf);
|
kfree(rate_payload_buf);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
<<<<<<< HEAD
|
|
||||||
dev_err(&dev->dev, "Device configuration failed at rate %d with error %d\n",
|
dev_err(&dev->dev, "Device configuration failed at rate %d with error %d\n",
|
||||||
rate, err);
|
rate, err);
|
||||||
kfree(rate_payload_buf);
|
kfree(rate_payload_buf);
|
||||||
return err;
|
return err;
|
||||||
=======
|
|
||||||
dev_err(&dev->dev,
|
|
||||||
"Device configuration failed at rate %d with error %d\n", rate,
|
|
||||||
err);
|
|
||||||
kfree(rate_payload_buf);
|
|
||||||
return err;
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -403,18 +246,10 @@ fail:
|
||||||
* Return: 0 on success, or a negative error code on failure.
|
* Return: 0 on success, or a negative error code on failure.
|
||||||
*/
|
*/
|
||||||
int tascam_pcm_hw_params(struct snd_pcm_substream *substream,
|
int tascam_pcm_hw_params(struct snd_pcm_substream *substream,
|
||||||
<<<<<<< HEAD
|
|
||||||
struct snd_pcm_hw_params *params) {
|
struct snd_pcm_hw_params *params) {
|
||||||
struct tascam_card *tascam = snd_pcm_substream_chip(substream);
|
struct tascam_card *tascam = snd_pcm_substream_chip(substream);
|
||||||
int err;
|
int err;
|
||||||
unsigned int rate = params_rate(params);
|
unsigned int rate = params_rate(params);
|
||||||
=======
|
|
||||||
struct snd_pcm_hw_params *params)
|
|
||||||
{
|
|
||||||
struct tascam_card *tascam = snd_pcm_substream_chip(substream);
|
|
||||||
int err;
|
|
||||||
unsigned int rate = params_rate(params);
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(params));
|
err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(params));
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
|
|
@ -516,7 +351,6 @@ int tascam_pcm_trigger(struct snd_pcm_substream *substream, int cmd) {
|
||||||
}
|
}
|
||||||
spin_unlock_irqrestore(&tascam->lock, flags);
|
spin_unlock_irqrestore(&tascam->lock, flags);
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
if (do_start) {
|
if (do_start) {
|
||||||
if (atomic_read(&tascam->active_urbs) > 0) {
|
if (atomic_read(&tascam->active_urbs) > 0) {
|
||||||
dev_WARN(tascam->card->dev, "Cannot start, URBs still active.\n");
|
dev_WARN(tascam->card->dev, "Cannot start, URBs still active.\n");
|
||||||
|
|
@ -563,61 +397,6 @@ int tascam_pcm_trigger(struct snd_pcm_substream *substream, int cmd) {
|
||||||
err);
|
err);
|
||||||
do_stop = true;
|
do_stop = true;
|
||||||
}
|
}
|
||||||
=======
|
|
||||||
if (do_start) {
|
|
||||||
if (atomic_read(&tascam->active_urbs) > 0) {
|
|
||||||
dev_WARN(tascam->card->dev,
|
|
||||||
"Cannot start, URBs still active.\n");
|
|
||||||
return -EAGAIN;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < NUM_FEEDBACK_URBS; i++) {
|
|
||||||
usb_get_urb(tascam->feedback_urbs[i]);
|
|
||||||
usb_anchor_urb(tascam->feedback_urbs[i],
|
|
||||||
&tascam->feedback_anchor);
|
|
||||||
err = usb_submit_urb(tascam->feedback_urbs[i],
|
|
||||||
GFP_ATOMIC);
|
|
||||||
if (err < 0) {
|
|
||||||
usb_unanchor_urb(tascam->feedback_urbs[i]);
|
|
||||||
usb_put_urb(tascam->feedback_urbs[i]);
|
|
||||||
goto start_rollback;
|
|
||||||
}
|
|
||||||
atomic_inc(&tascam->active_urbs);
|
|
||||||
}
|
|
||||||
for (i = 0; i < NUM_PLAYBACK_URBS; i++) {
|
|
||||||
usb_get_urb(tascam->playback_urbs[i]);
|
|
||||||
usb_anchor_urb(tascam->playback_urbs[i],
|
|
||||||
&tascam->playback_anchor);
|
|
||||||
err = usb_submit_urb(tascam->playback_urbs[i],
|
|
||||||
GFP_ATOMIC);
|
|
||||||
if (err < 0) {
|
|
||||||
usb_unanchor_urb(tascam->playback_urbs[i]);
|
|
||||||
usb_put_urb(tascam->playback_urbs[i]);
|
|
||||||
goto start_rollback;
|
|
||||||
}
|
|
||||||
atomic_inc(&tascam->active_urbs);
|
|
||||||
}
|
|
||||||
for (i = 0; i < NUM_CAPTURE_URBS; i++) {
|
|
||||||
usb_get_urb(tascam->capture_urbs[i]);
|
|
||||||
usb_anchor_urb(tascam->capture_urbs[i],
|
|
||||||
&tascam->capture_anchor);
|
|
||||||
err = usb_submit_urb(tascam->capture_urbs[i],
|
|
||||||
GFP_ATOMIC);
|
|
||||||
if (err < 0) {
|
|
||||||
usb_unanchor_urb(tascam->capture_urbs[i]);
|
|
||||||
usb_put_urb(tascam->capture_urbs[i]);
|
|
||||||
goto start_rollback;
|
|
||||||
}
|
|
||||||
atomic_inc(&tascam->active_urbs);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
start_rollback:
|
|
||||||
dev_err(tascam->card->dev,
|
|
||||||
"Failed to submit URBs to start stream: %d\n", err);
|
|
||||||
do_stop = true;
|
|
||||||
}
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
if (do_stop)
|
if (do_stop)
|
||||||
schedule_work(&tascam->stop_work);
|
schedule_work(&tascam->stop_work);
|
||||||
|
|
@ -638,20 +417,11 @@ start_rollback:
|
||||||
int tascam_init_pcm(struct snd_pcm *pcm) {
|
int tascam_init_pcm(struct snd_pcm *pcm) {
|
||||||
struct tascam_card *tascam = pcm->private_data;
|
struct tascam_card *tascam = pcm->private_data;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &tascam_playback_ops);
|
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &tascam_playback_ops);
|
||||||
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &tascam_capture_ops);
|
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &tascam_capture_ops);
|
||||||
snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_CONTINUOUS,
|
snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_CONTINUOUS,
|
||||||
tascam->dev->dev.parent, 64 * 1024,
|
tascam->dev->dev.parent, 64 * 1024,
|
||||||
tascam_pcm_hw.buffer_bytes_max);
|
tascam_pcm_hw.buffer_bytes_max);
|
||||||
=======
|
|
||||||
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &tascam_playback_ops);
|
|
||||||
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &tascam_capture_ops);
|
|
||||||
snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_CONTINUOUS,
|
|
||||||
tascam->dev->dev.parent,
|
|
||||||
64 * 1024,
|
|
||||||
tascam_pcm_hw.buffer_bytes_max);
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
INIT_WORK(&tascam->capture_work, tascam_capture_work_handler);
|
INIT_WORK(&tascam->capture_work, tascam_capture_work_handler);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -97,13 +97,8 @@ int us144mkii_configure_device_for_rate(struct tascam_card *tascam, int rate);
|
||||||
* @frames: Number of frames to process.
|
* @frames: Number of frames to process.
|
||||||
*/
|
*/
|
||||||
void process_playback_routing_us144mkii(struct tascam_card *tascam,
|
void process_playback_routing_us144mkii(struct tascam_card *tascam,
|
||||||
<<<<<<< HEAD
|
|
||||||
const u8 *src_buffer, u8 *dst_buffer,
|
const u8 *src_buffer, u8 *dst_buffer,
|
||||||
size_t frames);
|
size_t frames);
|
||||||
=======
|
|
||||||
const u8 *src_buffer, u8 *dst_buffer,
|
|
||||||
size_t frames);
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* process_capture_routing_us144mkii() - Apply capture routing matrix
|
* process_capture_routing_us144mkii() - Apply capture routing matrix
|
||||||
|
|
@ -112,13 +107,8 @@ void process_playback_routing_us144mkii(struct tascam_card *tascam,
|
||||||
* @routed_block: Buffer to be filled for ALSA.
|
* @routed_block: Buffer to be filled for ALSA.
|
||||||
*/
|
*/
|
||||||
void process_capture_routing_us144mkii(struct tascam_card *tascam,
|
void process_capture_routing_us144mkii(struct tascam_card *tascam,
|
||||||
<<<<<<< HEAD
|
|
||||||
const s32 *decoded_block,
|
const s32 *decoded_block,
|
||||||
s32 *routed_block);
|
s32 *routed_block);
|
||||||
=======
|
|
||||||
const s32 *decoded_block,
|
|
||||||
s32 *routed_block);
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* tascam_pcm_hw_params() - Configures hardware parameters for PCM streams.
|
* tascam_pcm_hw_params() - Configures hardware parameters for PCM streams.
|
||||||
|
|
@ -133,11 +123,7 @@ void process_capture_routing_us144mkii(struct tascam_card *tascam,
|
||||||
* Return: 0 on success, or a negative error code on failure.
|
* Return: 0 on success, or a negative error code on failure.
|
||||||
*/
|
*/
|
||||||
int tascam_pcm_hw_params(struct snd_pcm_substream *substream,
|
int tascam_pcm_hw_params(struct snd_pcm_substream *substream,
|
||||||
<<<<<<< HEAD
|
|
||||||
struct snd_pcm_hw_params *params);
|
struct snd_pcm_hw_params *params);
|
||||||
=======
|
|
||||||
struct snd_pcm_hw_params *params);
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* tascam_pcm_hw_free() - Frees hardware parameters for PCM streams.
|
* tascam_pcm_hw_free() - Frees hardware parameters for PCM streams.
|
||||||
|
|
|
||||||
|
|
@ -66,16 +66,9 @@ static int tascam_playback_prepare(struct snd_pcm_substream *substream) {
|
||||||
tascam->feedback_consecutive_errors = 0;
|
tascam->feedback_consecutive_errors = 0;
|
||||||
tascam->feedback_urb_skip_count = NUM_FEEDBACK_URBS;
|
tascam->feedback_urb_skip_count = NUM_FEEDBACK_URBS;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
nominal_frames_per_packet = runtime->rate / 8000;
|
nominal_frames_per_packet = runtime->rate / 8000;
|
||||||
for (i = 0; i < FEEDBACK_ACCUMULATOR_SIZE; i++)
|
for (i = 0; i < FEEDBACK_ACCUMULATOR_SIZE; i++)
|
||||||
tascam->feedback_accumulator_pattern[i] = nominal_frames_per_packet;
|
tascam->feedback_accumulator_pattern[i] = nominal_frames_per_packet;
|
||||||
=======
|
|
||||||
nominal_frames_per_packet = runtime->rate / 8000;
|
|
||||||
for (i = 0; i < FEEDBACK_ACCUMULATOR_SIZE; i++)
|
|
||||||
tascam->feedback_accumulator_pattern[i] =
|
|
||||||
nominal_frames_per_packet;
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
feedback_packets = 1;
|
feedback_packets = 1;
|
||||||
|
|
||||||
|
|
@ -83,7 +76,6 @@ static int tascam_playback_prepare(struct snd_pcm_substream *substream) {
|
||||||
struct urb *f_urb = tascam->feedback_urbs[i];
|
struct urb *f_urb = tascam->feedback_urbs[i];
|
||||||
int j;
|
int j;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
f_urb->number_of_packets = feedback_packets;
|
f_urb->number_of_packets = feedback_packets;
|
||||||
f_urb->transfer_buffer_length = feedback_packets * FEEDBACK_PACKET_SIZE;
|
f_urb->transfer_buffer_length = feedback_packets * FEEDBACK_PACKET_SIZE;
|
||||||
for (j = 0; j < feedback_packets; j++) {
|
for (j = 0; j < feedback_packets; j++) {
|
||||||
|
|
@ -91,17 +83,6 @@ static int tascam_playback_prepare(struct snd_pcm_substream *substream) {
|
||||||
f_urb->iso_frame_desc[j].length = FEEDBACK_PACKET_SIZE;
|
f_urb->iso_frame_desc[j].length = FEEDBACK_PACKET_SIZE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
=======
|
|
||||||
f_urb->number_of_packets = feedback_packets;
|
|
||||||
f_urb->transfer_buffer_length =
|
|
||||||
feedback_packets * FEEDBACK_PACKET_SIZE;
|
|
||||||
for (j = 0; j < feedback_packets; j++) {
|
|
||||||
f_urb->iso_frame_desc[j].offset =
|
|
||||||
j * FEEDBACK_PACKET_SIZE;
|
|
||||||
f_urb->iso_frame_desc[j].length = FEEDBACK_PACKET_SIZE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
nominal_bytes_per_packet = nominal_frames_per_packet * BYTES_PER_FRAME;
|
nominal_bytes_per_packet = nominal_frames_per_packet * BYTES_PER_FRAME;
|
||||||
total_bytes_in_urb = nominal_bytes_per_packet * PLAYBACK_URB_PACKETS;
|
total_bytes_in_urb = nominal_bytes_per_packet * PLAYBACK_URB_PACKETS;
|
||||||
|
|
@ -109,7 +90,6 @@ static int tascam_playback_prepare(struct snd_pcm_substream *substream) {
|
||||||
for (u = 0; u < NUM_PLAYBACK_URBS; u++) {
|
for (u = 0; u < NUM_PLAYBACK_URBS; u++) {
|
||||||
struct urb *urb = tascam->playback_urbs[u];
|
struct urb *urb = tascam->playback_urbs[u];
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
memset(urb->transfer_buffer, 0, tascam->playback_urb_alloc_size);
|
memset(urb->transfer_buffer, 0, tascam->playback_urb_alloc_size);
|
||||||
urb->transfer_buffer_length = total_bytes_in_urb;
|
urb->transfer_buffer_length = total_bytes_in_urb;
|
||||||
urb->number_of_packets = PLAYBACK_URB_PACKETS;
|
urb->number_of_packets = PLAYBACK_URB_PACKETS;
|
||||||
|
|
@ -118,19 +98,6 @@ static int tascam_playback_prepare(struct snd_pcm_substream *substream) {
|
||||||
urb->iso_frame_desc[i].length = nominal_bytes_per_packet;
|
urb->iso_frame_desc[i].length = nominal_bytes_per_packet;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
=======
|
|
||||||
memset(urb->transfer_buffer, 0,
|
|
||||||
tascam->playback_urb_alloc_size);
|
|
||||||
urb->transfer_buffer_length = total_bytes_in_urb;
|
|
||||||
urb->number_of_packets = PLAYBACK_URB_PACKETS;
|
|
||||||
for (i = 0; i < PLAYBACK_URB_PACKETS; i++) {
|
|
||||||
urb->iso_frame_desc[i].offset =
|
|
||||||
i * nominal_bytes_per_packet;
|
|
||||||
urb->iso_frame_desc[i].length =
|
|
||||||
nominal_bytes_per_packet;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
@ -145,20 +112,11 @@ static int tascam_playback_prepare(struct snd_pcm_substream *substream) {
|
||||||
* Return: The current playback pointer position in frames.
|
* Return: The current playback pointer position in frames.
|
||||||
*/
|
*/
|
||||||
static snd_pcm_uframes_t
|
static snd_pcm_uframes_t
|
||||||
<<<<<<< HEAD
|
|
||||||
tascam_playback_pointer(struct snd_pcm_substream *substream) {
|
tascam_playback_pointer(struct snd_pcm_substream *substream) {
|
||||||
struct tascam_card *tascam = snd_pcm_substream_chip(substream);
|
struct tascam_card *tascam = snd_pcm_substream_chip(substream);
|
||||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||||
u64 pos;
|
u64 pos;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
=======
|
|
||||||
tascam_playback_pointer(struct snd_pcm_substream *substream)
|
|
||||||
{
|
|
||||||
struct tascam_card *tascam = snd_pcm_substream_chip(substream);
|
|
||||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
|
||||||
u64 pos;
|
|
||||||
unsigned long flags;
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
if (!atomic_read(&tascam->playback_active))
|
if (!atomic_read(&tascam->playback_active))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -209,7 +167,6 @@ void playback_urb_complete(struct urb *urb) {
|
||||||
snd_pcm_uframes_t frames_to_copy;
|
snd_pcm_uframes_t frames_to_copy;
|
||||||
int ret, i;
|
int ret, i;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
if (urb->status) {
|
if (urb->status) {
|
||||||
if (urb->status != -ENOENT && urb->status != -ECONNRESET &&
|
if (urb->status != -ENOENT && urb->status != -ECONNRESET &&
|
||||||
urb->status != -ESHUTDOWN && urb->status != -ENODEV)
|
urb->status != -ESHUTDOWN && urb->status != -ENODEV)
|
||||||
|
|
@ -219,18 +176,6 @@ void playback_urb_complete(struct urb *urb) {
|
||||||
}
|
}
|
||||||
if (!tascam || !atomic_read(&tascam->playback_active))
|
if (!tascam || !atomic_read(&tascam->playback_active))
|
||||||
goto out;
|
goto out;
|
||||||
=======
|
|
||||||
if (urb->status) {
|
|
||||||
if (urb->status != -ENOENT && urb->status != -ECONNRESET &&
|
|
||||||
urb->status != -ESHUTDOWN && urb->status != -ENODEV)
|
|
||||||
dev_err_ratelimited(tascam->card->dev,
|
|
||||||
"Playback URB failed: %d\n",
|
|
||||||
urb->status);
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
if (!tascam || !atomic_read(&tascam->playback_active))
|
|
||||||
goto out;
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
substream = tascam->playback_substream;
|
substream = tascam->playback_substream;
|
||||||
if (!substream || !substream->runtime)
|
if (!substream || !substream->runtime)
|
||||||
|
|
@ -243,7 +188,6 @@ void playback_urb_complete(struct urb *urb) {
|
||||||
unsigned int frames_for_packet;
|
unsigned int frames_for_packet;
|
||||||
size_t bytes_for_packet;
|
size_t bytes_for_packet;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
if (tascam->feedback_synced) {
|
if (tascam->feedback_synced) {
|
||||||
frames_for_packet =
|
frames_for_packet =
|
||||||
tascam
|
tascam
|
||||||
|
|
@ -254,19 +198,6 @@ void playback_urb_complete(struct urb *urb) {
|
||||||
frames_for_packet = runtime->rate / 8000;
|
frames_for_packet = runtime->rate / 8000;
|
||||||
}
|
}
|
||||||
bytes_for_packet = frames_for_packet * BYTES_PER_FRAME;
|
bytes_for_packet = frames_for_packet * BYTES_PER_FRAME;
|
||||||
=======
|
|
||||||
if (tascam->feedback_synced) {
|
|
||||||
frames_for_packet =
|
|
||||||
tascam->feedback_accumulator_pattern
|
|
||||||
[tascam->feedback_pattern_out_idx];
|
|
||||||
tascam->feedback_pattern_out_idx =
|
|
||||||
(tascam->feedback_pattern_out_idx + 1) %
|
|
||||||
FEEDBACK_ACCUMULATOR_SIZE;
|
|
||||||
} else {
|
|
||||||
frames_for_packet = runtime->rate / 8000;
|
|
||||||
}
|
|
||||||
bytes_for_packet = frames_for_packet * BYTES_PER_FRAME;
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
urb->iso_frame_desc[i].offset = total_bytes_for_urb;
|
urb->iso_frame_desc[i].offset = total_bytes_for_urb;
|
||||||
urb->iso_frame_desc[i].length = bytes_for_packet;
|
urb->iso_frame_desc[i].length = bytes_for_packet;
|
||||||
|
|
@ -274,21 +205,13 @@ void playback_urb_complete(struct urb *urb) {
|
||||||
}
|
}
|
||||||
urb->transfer_buffer_length = total_bytes_for_urb;
|
urb->transfer_buffer_length = total_bytes_for_urb;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
offset_frames = tascam->driver_playback_pos;
|
offset_frames = tascam->driver_playback_pos;
|
||||||
frames_to_copy = bytes_to_frames(runtime, total_bytes_for_urb);
|
frames_to_copy = bytes_to_frames(runtime, total_bytes_for_urb);
|
||||||
tascam->driver_playback_pos =
|
tascam->driver_playback_pos =
|
||||||
(offset_frames + frames_to_copy) % runtime->buffer_size;
|
(offset_frames + frames_to_copy) % runtime->buffer_size;
|
||||||
=======
|
|
||||||
offset_frames = tascam->driver_playback_pos;
|
|
||||||
frames_to_copy = bytes_to_frames(runtime, total_bytes_for_urb);
|
|
||||||
tascam->driver_playback_pos =
|
|
||||||
(offset_frames + frames_to_copy) % runtime->buffer_size;
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
spin_unlock_irqrestore(&tascam->lock, flags);
|
spin_unlock_irqrestore(&tascam->lock, flags);
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
if (total_bytes_for_urb > 0) {
|
if (total_bytes_for_urb > 0) {
|
||||||
src_buf = runtime->dma_area + frames_to_bytes(runtime, offset_frames);
|
src_buf = runtime->dma_area + frames_to_bytes(runtime, offset_frames);
|
||||||
dst_buf = tascam->playback_routing_buffer;
|
dst_buf = tascam->playback_routing_buffer;
|
||||||
|
|
@ -322,44 +245,6 @@ void playback_urb_complete(struct urb *urb) {
|
||||||
usb_unanchor_urb(urb);
|
usb_unanchor_urb(urb);
|
||||||
usb_put_urb(urb);
|
usb_put_urb(urb);
|
||||||
}
|
}
|
||||||
=======
|
|
||||||
if (total_bytes_for_urb > 0) {
|
|
||||||
src_buf = runtime->dma_area +
|
|
||||||
frames_to_bytes(runtime, offset_frames);
|
|
||||||
dst_buf = tascam->playback_routing_buffer;
|
|
||||||
|
|
||||||
/* Handle ring buffer wrap-around */
|
|
||||||
if (offset_frames + frames_to_copy > runtime->buffer_size) {
|
|
||||||
size_t first_chunk_bytes = frames_to_bytes(
|
|
||||||
runtime, runtime->buffer_size - offset_frames);
|
|
||||||
size_t second_chunk_bytes =
|
|
||||||
total_bytes_for_urb - first_chunk_bytes;
|
|
||||||
|
|
||||||
memcpy(dst_buf, src_buf, first_chunk_bytes);
|
|
||||||
memcpy(dst_buf + first_chunk_bytes, runtime->dma_area,
|
|
||||||
second_chunk_bytes);
|
|
||||||
} else {
|
|
||||||
memcpy(dst_buf, src_buf, total_bytes_for_urb);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Apply routing to the contiguous data in our routing buffer */
|
|
||||||
process_playback_routing_us144mkii(tascam, dst_buf, dst_buf,
|
|
||||||
frames_to_copy);
|
|
||||||
memcpy(urb->transfer_buffer, dst_buf, total_bytes_for_urb);
|
|
||||||
}
|
|
||||||
|
|
||||||
urb->dev = tascam->dev;
|
|
||||||
usb_get_urb(urb);
|
|
||||||
usb_anchor_urb(urb, &tascam->playback_anchor);
|
|
||||||
ret = usb_submit_urb(urb, GFP_ATOMIC);
|
|
||||||
if (ret < 0) {
|
|
||||||
dev_err_ratelimited(tascam->card->dev,
|
|
||||||
"Failed to resubmit playback URB: %d\n",
|
|
||||||
ret);
|
|
||||||
usb_unanchor_urb(urb);
|
|
||||||
usb_put_urb(urb);
|
|
||||||
}
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
out:
|
out:
|
||||||
usb_put_urb(urb);
|
usb_put_urb(urb);
|
||||||
}
|
}
|
||||||
|
|
@ -386,7 +271,6 @@ void feedback_urb_complete(struct urb *urb) {
|
||||||
bool playback_period_elapsed = false;
|
bool playback_period_elapsed = false;
|
||||||
bool capture_period_elapsed = false;
|
bool capture_period_elapsed = false;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
if (urb->status) {
|
if (urb->status) {
|
||||||
if (urb->status != -ENOENT && urb->status != -ECONNRESET &&
|
if (urb->status != -ENOENT && urb->status != -ECONNRESET &&
|
||||||
urb->status != -ESHUTDOWN && urb->status != -ENODEV)
|
urb->status != -ESHUTDOWN && urb->status != -ENODEV)
|
||||||
|
|
@ -396,18 +280,6 @@ void feedback_urb_complete(struct urb *urb) {
|
||||||
}
|
}
|
||||||
if (!tascam || !atomic_read(&tascam->playback_active))
|
if (!tascam || !atomic_read(&tascam->playback_active))
|
||||||
goto out;
|
goto out;
|
||||||
=======
|
|
||||||
if (urb->status) {
|
|
||||||
if (urb->status != -ENOENT && urb->status != -ECONNRESET &&
|
|
||||||
urb->status != -ESHUTDOWN && urb->status != -ENODEV)
|
|
||||||
dev_err_ratelimited(tascam->card->dev,
|
|
||||||
"Feedback URB failed: %d\n",
|
|
||||||
urb->status);
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
if (!tascam || !atomic_read(&tascam->playback_active))
|
|
||||||
goto out;
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
playback_ss = tascam->playback_substream;
|
playback_ss = tascam->playback_substream;
|
||||||
if (!playback_ss || !playback_ss->runtime)
|
if (!playback_ss || !playback_ss->runtime)
|
||||||
|
|
@ -432,7 +304,6 @@ void feedback_urb_complete(struct urb *urb) {
|
||||||
bool packet_ok = (urb->iso_frame_desc[p].status == 0 &&
|
bool packet_ok = (urb->iso_frame_desc[p].status == 0 &&
|
||||||
urb->iso_frame_desc[p].actual_length >= 1);
|
urb->iso_frame_desc[p].actual_length >= 1);
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
if (packet_ok)
|
if (packet_ok)
|
||||||
feedback_value =
|
feedback_value =
|
||||||
*((u8 *)urb->transfer_buffer + urb->iso_frame_desc[p].offset);
|
*((u8 *)urb->transfer_buffer + urb->iso_frame_desc[p].offset);
|
||||||
|
|
@ -481,70 +352,9 @@ void feedback_urb_complete(struct urb *urb) {
|
||||||
tascam->feedback_pattern_in_idx =
|
tascam->feedback_pattern_in_idx =
|
||||||
(tascam->feedback_pattern_in_idx + 8) % FEEDBACK_ACCUMULATOR_SIZE;
|
(tascam->feedback_pattern_in_idx + 8) % FEEDBACK_ACCUMULATOR_SIZE;
|
||||||
}
|
}
|
||||||
=======
|
|
||||||
if (packet_ok)
|
|
||||||
feedback_value = *((u8 *)urb->transfer_buffer +
|
|
||||||
urb->iso_frame_desc[p].offset);
|
|
||||||
|
|
||||||
if (packet_ok &&
|
|
||||||
feedback_value >= tascam->feedback_base_value &&
|
|
||||||
feedback_value <= tascam->feedback_max_value) {
|
|
||||||
pattern = tascam->feedback_patterns
|
|
||||||
[feedback_value -
|
|
||||||
tascam->feedback_base_value];
|
|
||||||
tascam->feedback_consecutive_errors = 0;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < 8; i++) {
|
|
||||||
unsigned int in_idx =
|
|
||||||
(tascam->feedback_pattern_in_idx + i) %
|
|
||||||
FEEDBACK_ACCUMULATOR_SIZE;
|
|
||||||
|
|
||||||
tascam->feedback_accumulator_pattern[in_idx] =
|
|
||||||
pattern[i];
|
|
||||||
total_frames_in_urb += pattern[i];
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
unsigned int nominal_frames = playback_rt->rate / 8000;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
if (tascam->feedback_synced) {
|
|
||||||
tascam->feedback_consecutive_errors++;
|
|
||||||
if (tascam->feedback_consecutive_errors >
|
|
||||||
FEEDBACK_SYNC_LOSS_THRESHOLD) {
|
|
||||||
dev_err(tascam->card->dev,
|
|
||||||
"Fatal: Feedback sync lost. Stopping stream.\n");
|
|
||||||
if (playback_ss)
|
|
||||||
snd_pcm_stop(
|
|
||||||
playback_ss,
|
|
||||||
SNDRV_PCM_STATE_XRUN);
|
|
||||||
if (capture_ss)
|
|
||||||
snd_pcm_stop(
|
|
||||||
capture_ss,
|
|
||||||
SNDRV_PCM_STATE_XRUN);
|
|
||||||
tascam->feedback_synced = false;
|
|
||||||
goto unlock_and_continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (i = 0; i < 8; i++) {
|
|
||||||
unsigned int in_idx =
|
|
||||||
(tascam->feedback_pattern_in_idx + i) %
|
|
||||||
FEEDBACK_ACCUMULATOR_SIZE;
|
|
||||||
|
|
||||||
tascam->feedback_accumulator_pattern[in_idx] =
|
|
||||||
nominal_frames;
|
|
||||||
total_frames_in_urb += nominal_frames;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
tascam->feedback_pattern_in_idx =
|
|
||||||
(tascam->feedback_pattern_in_idx + 8) %
|
|
||||||
FEEDBACK_ACCUMULATOR_SIZE;
|
|
||||||
}
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
new_in_idx = tascam->feedback_pattern_in_idx;
|
new_in_idx = tascam->feedback_pattern_in_idx;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
if (!tascam->feedback_synced) {
|
if (!tascam->feedback_synced) {
|
||||||
unsigned int out_idx = tascam->feedback_pattern_out_idx;
|
unsigned int out_idx = tascam->feedback_pattern_out_idx;
|
||||||
bool is_ahead = (new_in_idx - out_idx) % FEEDBACK_ACCUMULATOR_SIZE <
|
bool is_ahead = (new_in_idx - out_idx) % FEEDBACK_ACCUMULATOR_SIZE <
|
||||||
|
|
@ -559,25 +369,6 @@ void feedback_urb_complete(struct urb *urb) {
|
||||||
tascam->feedback_consecutive_errors = 0;
|
tascam->feedback_consecutive_errors = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
=======
|
|
||||||
if (!tascam->feedback_synced) {
|
|
||||||
unsigned int out_idx = tascam->feedback_pattern_out_idx;
|
|
||||||
bool is_ahead =
|
|
||||||
(new_in_idx - out_idx) % FEEDBACK_ACCUMULATOR_SIZE <
|
|
||||||
(FEEDBACK_ACCUMULATOR_SIZE / 2);
|
|
||||||
bool was_behind =
|
|
||||||
(old_in_idx - out_idx) % FEEDBACK_ACCUMULATOR_SIZE >=
|
|
||||||
(FEEDBACK_ACCUMULATOR_SIZE / 2);
|
|
||||||
|
|
||||||
if (is_ahead && was_behind) {
|
|
||||||
dev_dbg(tascam->card->dev,
|
|
||||||
"Sync Acquired! (in: %u, out: %u)\n",
|
|
||||||
new_in_idx, out_idx);
|
|
||||||
tascam->feedback_synced = true;
|
|
||||||
tascam->feedback_consecutive_errors = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
if (total_frames_in_urb > 0) {
|
if (total_frames_in_urb > 0) {
|
||||||
tascam->playback_frames_consumed += total_frames_in_urb;
|
tascam->playback_frames_consumed += total_frames_in_urb;
|
||||||
|
|
@ -585,15 +376,9 @@ void feedback_urb_complete(struct urb *urb) {
|
||||||
tascam->capture_frames_processed += total_frames_in_urb;
|
tascam->capture_frames_processed += total_frames_in_urb;
|
||||||
}
|
}
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
if (playback_rt->period_size > 0) {
|
if (playback_rt->period_size > 0) {
|
||||||
u64 current_period =
|
u64 current_period =
|
||||||
div_u64(tascam->playback_frames_consumed, playback_rt->period_size);
|
div_u64(tascam->playback_frames_consumed, playback_rt->period_size);
|
||||||
=======
|
|
||||||
if (playback_rt->period_size > 0) {
|
|
||||||
u64 current_period = div_u64(tascam->playback_frames_consumed,
|
|
||||||
playback_rt->period_size);
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
if (current_period > tascam->last_period_pos) {
|
if (current_period > tascam->last_period_pos) {
|
||||||
tascam->last_period_pos = current_period;
|
tascam->last_period_pos = current_period;
|
||||||
|
|
@ -601,7 +386,6 @@ void feedback_urb_complete(struct urb *urb) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
if (atomic_read(&tascam->capture_active) && capture_rt &&
|
if (atomic_read(&tascam->capture_active) && capture_rt &&
|
||||||
capture_rt->period_size > 0) {
|
capture_rt->period_size > 0) {
|
||||||
u64 current_capture_period =
|
u64 current_capture_period =
|
||||||
|
|
@ -612,20 +396,6 @@ void feedback_urb_complete(struct urb *urb) {
|
||||||
capture_period_elapsed = true;
|
capture_period_elapsed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
=======
|
|
||||||
if (atomic_read(&tascam->capture_active) && capture_rt &&
|
|
||||||
capture_rt->period_size > 0) {
|
|
||||||
u64 current_capture_period =
|
|
||||||
div_u64(tascam->capture_frames_processed,
|
|
||||||
capture_rt->period_size);
|
|
||||||
|
|
||||||
if (current_capture_period > tascam->last_capture_period_pos) {
|
|
||||||
tascam->last_capture_period_pos =
|
|
||||||
current_capture_period;
|
|
||||||
capture_period_elapsed = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
|
|
||||||
unlock_and_continue:
|
unlock_and_continue:
|
||||||
spin_unlock_irqrestore(&tascam->lock, flags);
|
spin_unlock_irqrestore(&tascam->lock, flags);
|
||||||
|
|
@ -635,7 +405,6 @@ unlock_and_continue:
|
||||||
if (capture_period_elapsed)
|
if (capture_period_elapsed)
|
||||||
snd_pcm_period_elapsed(capture_ss);
|
snd_pcm_period_elapsed(capture_ss);
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
urb->dev = tascam->dev;
|
urb->dev = tascam->dev;
|
||||||
usb_get_urb(urb);
|
usb_get_urb(urb);
|
||||||
usb_anchor_urb(urb, &tascam->feedback_anchor);
|
usb_anchor_urb(urb, &tascam->feedback_anchor);
|
||||||
|
|
@ -646,19 +415,6 @@ unlock_and_continue:
|
||||||
usb_unanchor_urb(urb);
|
usb_unanchor_urb(urb);
|
||||||
usb_put_urb(urb);
|
usb_put_urb(urb);
|
||||||
}
|
}
|
||||||
=======
|
|
||||||
urb->dev = tascam->dev;
|
|
||||||
usb_get_urb(urb);
|
|
||||||
usb_anchor_urb(urb, &tascam->feedback_anchor);
|
|
||||||
ret = usb_submit_urb(urb, GFP_ATOMIC);
|
|
||||||
if (ret < 0) {
|
|
||||||
dev_err_ratelimited(tascam->card->dev,
|
|
||||||
"Failed to resubmit feedback URB: %d\n",
|
|
||||||
ret);
|
|
||||||
usb_unanchor_urb(urb);
|
|
||||||
usb_put_urb(urb);
|
|
||||||
}
|
|
||||||
>>>>>>> f44b75094c078b0354fac280d769bc9a1bb6133b
|
|
||||||
out:
|
out:
|
||||||
usb_put_urb(urb);
|
usb_put_urb(urb);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue