]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
misc: tegra-cec: Updates for T124
authorAnkita Garg <ankitag@nvidia.com>
Tue, 17 Sep 2013 21:29:09 +0000 (14:29 -0700)
committerDan Willemsen <dwillemsen@nvidia.com>
Fri, 27 Sep 2013 19:53:56 +0000 (12:53 -0700)
In T124, the RX_REGISTER_FULL interrupt is cleared
by reading the RX_REGISTER instead of writing to the
INT_STAT register as before.

Bug 1364229

Change-Id: Ib080a48910304553b0752a3ede55ab0d7653dd77
Signed-off-by: Ankita Garg <ankitag@nvidia.com>
Reviewed-on: http://git-master/r/275982
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Tested-by: Bharat Nihalani <bnihalani@nvidia.com>
drivers/misc/tegra-cec/tegra_cec.c
drivers/misc/tegra-cec/tegra_cec.h

index b4e0a30877beeefbfae08d46af5b78c8cd825af6..85eb47a4607b8adeaa8aac1ba136a823507ef883 100644 (file)
@@ -99,7 +99,6 @@ ssize_t tegra_cec_read(struct file *file, char  __user *buffer,
        size_t count, loff_t *ppos)
 {
        struct tegra_cec *cec = file->private_data;
-       unsigned short rx_buffer;
        count = 2;
 
        if (cec->rx_wake == 0)
@@ -108,12 +107,10 @@ ssize_t tegra_cec_read(struct file *file, char  __user *buffer,
 
        wait_event_interruptible(cec->rx_waitq, cec->rx_wake == 1);
 
-       rx_buffer = readw(cec->cec_base + TEGRA_CEC_RX_REGISTER);
-
-       if (copy_to_user(buffer, &rx_buffer, count))
+       if (copy_to_user(buffer, &(cec->rx_buffer), count))
                return -EFAULT;
 
-       rx_buffer = 0x0;
+       cec->rx_buffer = 0x0;
        cec->rx_wake = 0;
        return count;
 }
@@ -141,6 +138,7 @@ static irqreturn_t tegra_cec_irq_handler(int irq, void *data)
        } else if (status & TEGRA_CEC_INT_STAT_RX_REGISTER_FULL) {
                writel((TEGRA_CEC_INT_STAT_RX_REGISTER_FULL),
                        cec->cec_base + TEGRA_CEC_INT_STAT);
+               cec->rx_buffer = readw(cec->cec_base + TEGRA_CEC_RX_REGISTER);
                cec->rx_wake = 1;
                wake_up_interruptible(&cec->rx_waitq);
        } else if ((status & TEGRA_CEC_INT_STAT_TX_REGISTER_UNDERRUN) ||
index acc94dc6196523ed1782c4821fab9a94cabe9c93..4f908cc606775dc6e96efa5fa009b1b64af887c7 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * drivers/misc/tegra-cec/tegra_cec.h
  *
- * Copyright (c) 2012, NVIDIA CORPORATION.  All rights reserved.
+ * Copyright (c) 2012-2013, NVIDIA CORPORATION.  All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
@@ -29,6 +29,7 @@ struct tegra_cec {
        wait_queue_head_t       tx_waitq;
        unsigned int            rx_wake;
        unsigned int            tx_wake;
+       unsigned short          rx_buffer;
 };
 static int tegra_cec_remove(struct platform_device *pdev);