aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Blechmann <tim@klingt.org>2009-09-21 09:00:22 -0400
committerTakashi Iwai <tiwai@suse.de>2009-09-21 09:13:53 -0400
commit95eff499c96ac728307fd34cbf1a28ea20a5b615 (patch)
treefa1ede61041eaf3e128b03985e24bc20150c65d8
parentd3a7dcfeeb6856215412065bd0f774de83f43414 (diff)
ALSA: lx6464es - cleanup of rmh message bus function
the rmh bus is not used asynchronously, so it is safe to remove the specific code pieces. Signed-off-by: Tim Blechmann <tim@klingt.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/pci/lx6464es/lx6464es.h1
-rw-r--r--sound/pci/lx6464es/lx_core.c98
2 files changed, 1 insertions, 98 deletions
diff --git a/sound/pci/lx6464es/lx6464es.h b/sound/pci/lx6464es/lx6464es.h
index 012c010c8c89..16442dad58d1 100644
--- a/sound/pci/lx6464es/lx6464es.h
+++ b/sound/pci/lx6464es/lx6464es.h
@@ -86,7 +86,6 @@ struct lx6464es {
86 86
87 /* messaging */ 87 /* messaging */
88 spinlock_t msg_lock; /* message spinlock */ 88 spinlock_t msg_lock; /* message spinlock */
89 atomic_t send_message_locked;
90 struct lx_rmh rmh; 89 struct lx_rmh rmh;
91 90
92 /* configuration */ 91 /* configuration */
diff --git a/sound/pci/lx6464es/lx_core.c b/sound/pci/lx6464es/lx_core.c
index 5812780d6e89..3086b751da4a 100644
--- a/sound/pci/lx6464es/lx_core.c
+++ b/sound/pci/lx6464es/lx_core.c
@@ -314,98 +314,6 @@ static inline void lx_message_dump(struct lx_rmh *rmh)
314#define XILINX_POLL_NO_SLEEP 100 314#define XILINX_POLL_NO_SLEEP 100
315#define XILINX_POLL_ITERATIONS 150 315#define XILINX_POLL_ITERATIONS 150
316 316
317#if 0 /* not used now */
318static int lx_message_send(struct lx6464es *chip, struct lx_rmh *rmh)
319{
320 u32 reg = ED_DSP_TIMED_OUT;
321 int dwloop;
322 int answer_received;
323
324 if (lx_dsp_reg_read(chip, eReg_CSM) & (Reg_CSM_MC | Reg_CSM_MR)) {
325 snd_printk(KERN_ERR LXP "PIOSendMessage eReg_CSM %x\n", reg);
326 return -EBUSY;
327 }
328
329 /* write command */
330 lx_dsp_reg_writebuf(chip, eReg_CRM1, rmh->cmd, rmh->cmd_len);
331
332 snd_BUG_ON(atomic_read(&chip->send_message_locked) != 0);
333 atomic_set(&chip->send_message_locked, 1);
334
335 /* MicoBlaze gogogo */
336 lx_dsp_reg_write(chip, eReg_CSM, Reg_CSM_MC);
337
338 /* wait for interrupt to answer */
339 for (dwloop = 0; dwloop != XILINX_TIMEOUT_MS; ++dwloop) {
340 answer_received = atomic_read(&chip->send_message_locked);
341 if (answer_received == 0)
342 break;
343 msleep(1);
344 }
345
346 if (answer_received == 0) {
347 /* in Debug mode verify Reg_CSM_MR */
348 snd_BUG_ON(!(lx_dsp_reg_read(chip, eReg_CSM) & Reg_CSM_MR));
349
350 /* command finished, read status */
351 if (rmh->dsp_stat == 0)
352 reg = lx_dsp_reg_read(chip, eReg_CRM1);
353 else
354 reg = 0;
355 } else {
356 int i;
357 snd_printk(KERN_WARNING LXP "TIMEOUT lx_message_send! "
358 "Interrupts disabled?\n");
359
360 /* attente bit Reg_CSM_MR */
361 for (i = 0; i != XILINX_POLL_ITERATIONS; i++) {
362 if ((lx_dsp_reg_read(chip, eReg_CSM) & Reg_CSM_MR)) {
363 if (rmh->dsp_stat == 0)
364 reg = lx_dsp_reg_read(chip, eReg_CRM1);
365 else
366 reg = 0;
367 goto polling_successful;
368 }
369
370 if (i > XILINX_POLL_NO_SLEEP)
371 msleep(1);
372 }
373 snd_printk(KERN_WARNING LXP "TIMEOUT lx_message_send! "
374 "polling failed\n");
375
376polling_successful:
377 atomic_set(&chip->send_message_locked, 0);
378 }
379
380 if ((reg & ERROR_VALUE) == 0) {
381 /* read response */
382 if (rmh->stat_len) {
383 snd_BUG_ON(rmh->stat_len >= (REG_CRM_NUMBER-1));
384
385 lx_dsp_reg_readbuf(chip, eReg_CRM2, rmh->stat,
386 rmh->stat_len);
387 }
388 } else
389 snd_printk(KERN_WARNING LXP "lx_message_send: error_value %x\n",
390 reg);
391
392 /* clear Reg_CSM_MR */
393 lx_dsp_reg_write(chip, eReg_CSM, 0);
394
395 switch (reg) {
396 case ED_DSP_TIMED_OUT:
397 snd_printk(KERN_WARNING LXP "lx_message_send: dsp timeout\n");
398 return -ETIMEDOUT;
399
400 case ED_DSP_CRASHED:
401 snd_printk(KERN_WARNING LXP "lx_message_send: dsp crashed\n");
402 return -EAGAIN;
403 }
404
405 lx_message_dump(rmh);
406 return 0;
407}
408#endif /* not used now */
409 317
410static int lx_message_send_atomic(struct lx6464es *chip, struct lx_rmh *rmh) 318static int lx_message_send_atomic(struct lx6464es *chip, struct lx_rmh *rmh)
411{ 319{
@@ -423,7 +331,7 @@ static int lx_message_send_atomic(struct lx6464es *chip, struct lx_rmh *rmh)
423 /* MicoBlaze gogogo */ 331 /* MicoBlaze gogogo */
424 lx_dsp_reg_write(chip, eReg_CSM, Reg_CSM_MC); 332 lx_dsp_reg_write(chip, eReg_CSM, Reg_CSM_MC);
425 333
426 /* wait for interrupt to answer */ 334 /* wait for device to answer */
427 for (dwloop = 0; dwloop != XILINX_TIMEOUT_MS * 1000; ++dwloop) { 335 for (dwloop = 0; dwloop != XILINX_TIMEOUT_MS * 1000; ++dwloop) {
428 if (lx_dsp_reg_read(chip, eReg_CSM) & Reg_CSM_MR) { 336 if (lx_dsp_reg_read(chip, eReg_CSM) & Reg_CSM_MR) {
429 if (rmh->dsp_stat == 0) 337 if (rmh->dsp_stat == 0)
@@ -1175,10 +1083,6 @@ static int lx_interrupt_ack(struct lx6464es *chip, u32 *r_irqsrc,
1175 *r_async_escmd = 1; 1083 *r_async_escmd = 1;
1176 } 1084 }
1177 1085
1178 if (irqsrc & MASK_SYS_STATUS_CMD_DONE)
1179 /* xilinx command notification */
1180 atomic_set(&chip->send_message_locked, 0);
1181
1182 if (irq_async) { 1086 if (irq_async) {
1183 /* snd_printd("interrupt: async event pending\n"); */ 1087 /* snd_printd("interrupt: async event pending\n"); */
1184 *r_async_pending = 1; 1088 *r_async_pending = 1;