misc: tegra-cec: Updates for T124

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-on: http://git-master/r/1164137
(cherry picked from commit b890e7f50d3d032fc3ede4c4935fdf2c4501f063)
This commit is contained in:
Ankita Garg
2013-09-17 14:29:09 -07:00
committed by Prafull Suryawanshi
parent 9723602a96
commit b268d2ef29
2 changed files with 5 additions and 6 deletions

View File

@@ -100,7 +100,6 @@ ssize_t tegra_cec_read(struct file *file, char __user *buffer,
size_t count, loff_t *ppos) size_t count, loff_t *ppos)
{ {
struct tegra_cec *cec = file->private_data; struct tegra_cec *cec = file->private_data;
unsigned short rx_buffer;
count = 2; count = 2;
if (cec->rx_wake == 0) if (cec->rx_wake == 0)
@@ -109,12 +108,10 @@ ssize_t tegra_cec_read(struct file *file, char __user *buffer,
wait_event_interruptible(cec->rx_waitq, cec->rx_wake == 1); 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, &(cec->rx_buffer), count))
if (copy_to_user(buffer, &rx_buffer, count))
return -EFAULT; return -EFAULT;
rx_buffer = 0x0; cec->rx_buffer = 0x0;
cec->rx_wake = 0; cec->rx_wake = 0;
return count; return count;
} }
@@ -142,6 +139,7 @@ static irqreturn_t tegra_cec_irq_handler(int irq, void *data)
} else if (status & TEGRA_CEC_INT_STAT_RX_REGISTER_FULL) { } else if (status & TEGRA_CEC_INT_STAT_RX_REGISTER_FULL) {
writel((TEGRA_CEC_INT_STAT_RX_REGISTER_FULL), writel((TEGRA_CEC_INT_STAT_RX_REGISTER_FULL),
cec->cec_base + TEGRA_CEC_INT_STAT); cec->cec_base + TEGRA_CEC_INT_STAT);
cec->rx_buffer = readw(cec->cec_base + TEGRA_CEC_RX_REGISTER);
cec->rx_wake = 1; cec->rx_wake = 1;
wake_up_interruptible(&cec->rx_waitq); wake_up_interruptible(&cec->rx_waitq);
} else if ((status & TEGRA_CEC_INT_STAT_TX_REGISTER_UNDERRUN) || } else if ((status & TEGRA_CEC_INT_STAT_TX_REGISTER_UNDERRUN) ||

View File

@@ -1,7 +1,7 @@
/* /*
* drivers/misc/tegra-cec/tegra_cec.h * 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 * This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License, * under the terms and conditions of the GNU General Public License,
@@ -29,6 +29,7 @@ struct tegra_cec {
wait_queue_head_t tx_waitq; wait_queue_head_t tx_waitq;
unsigned int rx_wake; unsigned int rx_wake;
unsigned int tx_wake; unsigned int tx_wake;
unsigned short rx_buffer;
}; };
static int tegra_cec_remove(struct platform_device *pdev); static int tegra_cec_remove(struct platform_device *pdev);