size_t count, loff_t *ppos)
{
struct tegra_cec *cec = file->private_data;
- unsigned short rx_buffer;
count = 2;
if (cec->rx_wake == 0)
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;
}
} 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) ||
/*
* 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,
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);