aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/ttpci/av7110_hw.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb/ttpci/av7110_hw.c')
-rw-r--r--drivers/media/dvb/ttpci/av7110_hw.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/drivers/media/dvb/ttpci/av7110_hw.c b/drivers/media/dvb/ttpci/av7110_hw.c
index b2e63e9fc053..3c5366d15a8a 100644
--- a/drivers/media/dvb/ttpci/av7110_hw.c
+++ b/drivers/media/dvb/ttpci/av7110_hw.c
@@ -324,10 +324,10 @@ int av7110_wait_msgstate(struct av7110 *av7110, u16 flags)
324 start = jiffies; 324 start = jiffies;
325 for (;;) { 325 for (;;) {
326 err = time_after(jiffies, start + ARM_WAIT_FREE); 326 err = time_after(jiffies, start + ARM_WAIT_FREE);
327 if (down_interruptible(&av7110->dcomlock)) 327 if (mutex_lock_interruptible(&av7110->dcomlock))
328 return -ERESTARTSYS; 328 return -ERESTARTSYS;
329 stat = rdebi(av7110, DEBINOSWAP, MSGSTATE, 0, 2); 329 stat = rdebi(av7110, DEBINOSWAP, MSGSTATE, 0, 2);
330 up(&av7110->dcomlock); 330 mutex_unlock(&av7110->dcomlock);
331 if ((stat & flags) == 0) 331 if ((stat & flags) == 0)
332 break; 332 break;
333 if (err) { 333 if (err) {
@@ -484,11 +484,11 @@ static int av7110_send_fw_cmd(struct av7110 *av7110, u16* buf, int length)
484 dprintk(1, "arm not ready.\n"); 484 dprintk(1, "arm not ready.\n");
485 return -1; 485 return -1;
486 } 486 }
487 if (down_interruptible(&av7110->dcomlock)) 487 if (mutex_lock_interruptible(&av7110->dcomlock))
488 return -ERESTARTSYS; 488 return -ERESTARTSYS;
489 489
490 ret = __av7110_send_fw_cmd(av7110, buf, length); 490 ret = __av7110_send_fw_cmd(av7110, buf, length);
491 up(&av7110->dcomlock); 491 mutex_unlock(&av7110->dcomlock);
492 if (ret && ret!=-ERESTARTSYS) 492 if (ret && ret!=-ERESTARTSYS)
493 printk(KERN_ERR "dvb-ttpci: %s(): av7110_send_fw_cmd error %d\n", 493 printk(KERN_ERR "dvb-ttpci: %s(): av7110_send_fw_cmd error %d\n",
494 __FUNCTION__, ret); 494 __FUNCTION__, ret);
@@ -560,11 +560,11 @@ int av7110_fw_request(struct av7110 *av7110, u16 *request_buf,
560 return -1; 560 return -1;
561 } 561 }
562 562
563 if (down_interruptible(&av7110->dcomlock)) 563 if (mutex_lock_interruptible(&av7110->dcomlock))
564 return -ERESTARTSYS; 564 return -ERESTARTSYS;
565 565
566 if ((err = __av7110_send_fw_cmd(av7110, request_buf, request_buf_len)) < 0) { 566 if ((err = __av7110_send_fw_cmd(av7110, request_buf, request_buf_len)) < 0) {
567 up(&av7110->dcomlock); 567 mutex_unlock(&av7110->dcomlock);
568 printk(KERN_ERR "dvb-ttpci: av7110_fw_request error %d\n", err); 568 printk(KERN_ERR "dvb-ttpci: av7110_fw_request error %d\n", err);
569 return err; 569 return err;
570 } 570 }
@@ -576,7 +576,7 @@ int av7110_fw_request(struct av7110 *av7110, u16 *request_buf,
576 break; 576 break;
577 if (err) { 577 if (err) {
578 printk(KERN_ERR "%s: timeout waiting for COMMAND to complete\n", __FUNCTION__); 578 printk(KERN_ERR "%s: timeout waiting for COMMAND to complete\n", __FUNCTION__);
579 up(&av7110->dcomlock); 579 mutex_unlock(&av7110->dcomlock);
580 return -ETIMEDOUT; 580 return -ETIMEDOUT;
581 } 581 }
582#ifdef _NOHANDSHAKE 582#ifdef _NOHANDSHAKE
@@ -592,7 +592,7 @@ int av7110_fw_request(struct av7110 *av7110, u16 *request_buf,
592 break; 592 break;
593 if (err) { 593 if (err) {
594 printk(KERN_ERR "%s: timeout waiting for HANDSHAKE_REG\n", __FUNCTION__); 594 printk(KERN_ERR "%s: timeout waiting for HANDSHAKE_REG\n", __FUNCTION__);
595 up(&av7110->dcomlock); 595 mutex_unlock(&av7110->dcomlock);
596 return -ETIMEDOUT; 596 return -ETIMEDOUT;
597 } 597 }
598 msleep(1); 598 msleep(1);
@@ -603,12 +603,12 @@ int av7110_fw_request(struct av7110 *av7110, u16 *request_buf,
603 stat = rdebi(av7110, DEBINOSWAP, MSGSTATE, 0, 2); 603 stat = rdebi(av7110, DEBINOSWAP, MSGSTATE, 0, 2);
604 if (stat & GPMQOver) { 604 if (stat & GPMQOver) {
605 printk(KERN_ERR "%s: GPMQOver\n", __FUNCTION__); 605 printk(KERN_ERR "%s: GPMQOver\n", __FUNCTION__);
606 up(&av7110->dcomlock); 606 mutex_unlock(&av7110->dcomlock);
607 return -1; 607 return -1;
608 } 608 }
609 else if (stat & OSDQOver) { 609 else if (stat & OSDQOver) {
610 printk(KERN_ERR "%s: OSDQOver\n", __FUNCTION__); 610 printk(KERN_ERR "%s: OSDQOver\n", __FUNCTION__);
611 up(&av7110->dcomlock); 611 mutex_unlock(&av7110->dcomlock);
612 return -1; 612 return -1;
613 } 613 }
614#endif 614#endif
@@ -616,7 +616,7 @@ int av7110_fw_request(struct av7110 *av7110, u16 *request_buf,
616 for (i = 0; i < reply_buf_len; i++) 616 for (i = 0; i < reply_buf_len; i++)
617 reply_buf[i] = rdebi(av7110, DEBINOSWAP, COM_BUFF + 2 * i, 0, 2); 617 reply_buf[i] = rdebi(av7110, DEBINOSWAP, COM_BUFF + 2 * i, 0, 2);
618 618
619 up(&av7110->dcomlock); 619 mutex_unlock(&av7110->dcomlock);
620 return 0; 620 return 0;
621} 621}
622 622
@@ -732,7 +732,7 @@ static int FlushText(struct av7110 *av7110)
732 unsigned long start; 732 unsigned long start;
733 int err; 733 int err;
734 734
735 if (down_interruptible(&av7110->dcomlock)) 735 if (mutex_lock_interruptible(&av7110->dcomlock))
736 return -ERESTARTSYS; 736 return -ERESTARTSYS;
737 start = jiffies; 737 start = jiffies;
738 while (1) { 738 while (1) {
@@ -742,12 +742,12 @@ static int FlushText(struct av7110 *av7110)
742 if (err) { 742 if (err) {
743 printk(KERN_ERR "dvb-ttpci: %s(): timeout waiting for BUFF1_BASE == 0\n", 743 printk(KERN_ERR "dvb-ttpci: %s(): timeout waiting for BUFF1_BASE == 0\n",
744 __FUNCTION__); 744 __FUNCTION__);
745 up(&av7110->dcomlock); 745 mutex_unlock(&av7110->dcomlock);
746 return -ETIMEDOUT; 746 return -ETIMEDOUT;
747 } 747 }
748 msleep(1); 748 msleep(1);
749 } 749 }
750 up(&av7110->dcomlock); 750 mutex_unlock(&av7110->dcomlock);
751 return 0; 751 return 0;
752} 752}
753 753
@@ -758,7 +758,7 @@ static int WriteText(struct av7110 *av7110, u8 win, u16 x, u16 y, u8* buf)
758 int length = strlen(buf) + 1; 758 int length = strlen(buf) + 1;
759 u16 cbuf[5] = { (COMTYPE_OSD << 8) + DText, 3, win, x, y }; 759 u16 cbuf[5] = { (COMTYPE_OSD << 8) + DText, 3, win, x, y };
760 760
761 if (down_interruptible(&av7110->dcomlock)) 761 if (mutex_lock_interruptible(&av7110->dcomlock))
762 return -ERESTARTSYS; 762 return -ERESTARTSYS;
763 763
764 start = jiffies; 764 start = jiffies;
@@ -769,7 +769,7 @@ static int WriteText(struct av7110 *av7110, u8 win, u16 x, u16 y, u8* buf)
769 if (ret) { 769 if (ret) {
770 printk(KERN_ERR "dvb-ttpci: %s: timeout waiting for BUFF1_BASE == 0\n", 770 printk(KERN_ERR "dvb-ttpci: %s: timeout waiting for BUFF1_BASE == 0\n",
771 __FUNCTION__); 771 __FUNCTION__);
772 up(&av7110->dcomlock); 772 mutex_unlock(&av7110->dcomlock);
773 return -ETIMEDOUT; 773 return -ETIMEDOUT;
774 } 774 }
775 msleep(1); 775 msleep(1);
@@ -783,7 +783,7 @@ static int WriteText(struct av7110 *av7110, u8 win, u16 x, u16 y, u8* buf)
783 if (ret) { 783 if (ret) {
784 printk(KERN_ERR "dvb-ttpci: %s: timeout waiting for HANDSHAKE_REG\n", 784 printk(KERN_ERR "dvb-ttpci: %s: timeout waiting for HANDSHAKE_REG\n",
785 __FUNCTION__); 785 __FUNCTION__);
786 up(&av7110->dcomlock); 786 mutex_unlock(&av7110->dcomlock);
787 return -ETIMEDOUT; 787 return -ETIMEDOUT;
788 } 788 }
789 msleep(1); 789 msleep(1);
@@ -795,7 +795,7 @@ static int WriteText(struct av7110 *av7110, u8 win, u16 x, u16 y, u8* buf)
795 if (length & 1) 795 if (length & 1)
796 wdebi(av7110, DEBINOSWAP, BUFF1_BASE + i * 2, 0, 2); 796 wdebi(av7110, DEBINOSWAP, BUFF1_BASE + i * 2, 0, 2);
797 ret = __av7110_send_fw_cmd(av7110, cbuf, 5); 797 ret = __av7110_send_fw_cmd(av7110, cbuf, 5);
798 up(&av7110->dcomlock); 798 mutex_unlock(&av7110->dcomlock);
799 if (ret && ret!=-ERESTARTSYS) 799 if (ret && ret!=-ERESTARTSYS)
800 printk(KERN_ERR "dvb-ttpci: WriteText error %d\n", ret); 800 printk(KERN_ERR "dvb-ttpci: WriteText error %d\n", ret);
801 return ret; 801 return ret;
@@ -1059,7 +1059,7 @@ int av7110_osd_cmd(struct av7110 *av7110, osd_cmd_t *dc)
1059{ 1059{
1060 int ret; 1060 int ret;
1061 1061
1062 if (down_interruptible(&av7110->osd_sema)) 1062 if (mutex_lock_interruptible(&av7110->osd_mutex))
1063 return -ERESTARTSYS; 1063 return -ERESTARTSYS;
1064 1064
1065 switch (dc->cmd) { 1065 switch (dc->cmd) {
@@ -1195,7 +1195,7 @@ int av7110_osd_cmd(struct av7110 *av7110, osd_cmd_t *dc)
1195 break; 1195 break;
1196 } 1196 }
1197 1197
1198 up(&av7110->osd_sema); 1198 mutex_unlock(&av7110->osd_mutex);
1199 if (ret==-ERESTARTSYS) 1199 if (ret==-ERESTARTSYS)
1200 dprintk(1, "av7110_osd_cmd(%d) returns with -ERESTARTSYS\n",dc->cmd); 1200 dprintk(1, "av7110_osd_cmd(%d) returns with -ERESTARTSYS\n",dc->cmd);
1201 else if (ret) 1201 else if (ret)