summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorWayne Zou <b36644@freescale.com>2012-08-22 10:22:42 +0800
committerWayne Zou <b36644@freescale.com>2012-08-22 10:36:28 +0800
commit5d30947312b8e0069f0fa1786be87a1d1c2fd409 (patch)
treea50f68f30f77c173bec032f761d101b067d91360 /drivers
parent16f59122554e61c69e8d01f051608f527da27e5a (diff)
ENGR00221012 IPU: Clean up dead code
IPU: Clean up dead code Signed-off-by: Wayne Zou <b36644@freescale.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mxc/ipu3/ipu_common.c168
1 files changed, 0 insertions, 168 deletions
diff --git a/drivers/mxc/ipu3/ipu_common.c b/drivers/mxc/ipu3/ipu_common.c
index 4e3526c81839..c97d15999301 100644
--- a/drivers/mxc/ipu3/ipu_common.c
+++ b/drivers/mxc/ipu3/ipu_common.c
@@ -176,174 +176,6 @@ static int __devinit ipu_clk_setup_enable(struct ipu_soc *ipu,
return 0;
}
-#if 0
-static void ipu_irq_handler(unsigned int irq, struct irq_desc *desc)
-{
- struct ipu_soc *ipu = irq_desc_get_handler_data(desc);
- const int int_reg[] = { 1, 2, 3, 4, 11, 12, 13, 14, 15, 0 };
- u32 status;
- int i, line;
-
- for (i = 0;; i++) {
- if (int_reg[i] == 0)
- break;
-
- status = ipu_cm_read(ipu, IPU_INT_STAT(int_reg[i]));
- status &= ipu_cm_read(ipu, IPU_INT_CTRL(int_reg[i]));
-
- while ((line = ffs(status))) {
- line--;
- status &= ~(1UL << line);
- line += ipu->irq_start + (int_reg[i] - 1) * 32;
- generic_handle_irq(line);
- }
-
- }
-}
-
-static void ipu_err_irq_handler(unsigned int irq, struct irq_desc *desc)
-{
- struct ipu_soc *ipu = irq_desc_get_handler_data(desc);
- const int int_reg[] = { 5, 6, 9, 10, 0 };
- u32 status;
- int i, line;
-
- for (i = 0;; i++) {
- if (int_reg[i] == 0)
- break;
-
- status = ipu_cm_read(ipu, IPU_INT_STAT(int_reg[i]));
- status &= ipu_cm_read(ipu, IPU_INT_CTRL(int_reg[i]));
-
- while ((line = ffs(status))) {
- line--;
- status &= ~(1UL << line);
- line += ipu->irq_start + (int_reg[i] - 1) * 32;
- generic_handle_irq(line);
- }
-
- }
-}
-
-static void ipu_ack_irq(struct irq_data *d)
-{
- struct ipu_soc *ipu = irq_data_get_irq_chip_data(d);
- unsigned int irq = d->irq - ipu->irq_start;
- unsigned long flags;
-
- spin_lock_irqsave(&ipu->ipu_lock, flags);
- ipu_cm_write(ipu, 1 << (irq % 32), IPU_INT_STAT(irq / 32 + 1));
- spin_unlock_irqrestore(&ipu->ipu_lock, flags);
-}
-
-static void ipu_unmask_irq(struct irq_data *d)
-{
- struct ipu_soc *ipu = irq_data_get_irq_chip_data(d);
- unsigned int irq = d->irq - ipu->irq_start;
- unsigned long flags;
- u32 reg;
-
- spin_lock_irqsave(&ipu->ipu_lock, flags);
- reg = ipu_cm_read(ipu, IPU_INT_CTRL(irq / 32 + 1));
- reg |= 1 << (irq % 32);
- ipu_cm_write(ipu, reg, IPU_INT_CTRL(irq / 32 + 1));
- spin_unlock_irqrestore(&ipu->ipu_lock, flags);
-}
-
-static void ipu_mask_irq(struct irq_data *d)
-{
- struct ipu_soc *ipu = irq_data_get_irq_chip_data(d);
- unsigned int irq = d->irq - ipu->irq_start;
- unsigned long flags;
- u32 reg;
-
- spin_lock_irqsave(&ipu->ipu_lock, flags);
- reg = ipu_cm_read(ipu, IPU_INT_CTRL(irq / 32 + 1));
- reg &= ~(1 << (irq % 32));
- ipu_cm_write(ipu, reg, IPU_INT_CTRL(irq / 32 + 1));
- spin_unlock_irqrestore(&ipu->ipu_lock, flags);
-}
-
-static struct irq_chip ipu_irq_chip = {
- .name = "IPU",
- .irq_ack = ipu_ack_irq,
- .irq_mask = ipu_mask_irq,
- .irq_unmask = ipu_unmask_irq,
-};
-
-static void __devinit ipu_irq_setup(struct ipu_soc *ipu)
-{
- int i;
-
- for (i = ipu->irq_start; i < ipu->irq_start + MX5_IPU_IRQS; i++) {
- irq_set_chip_and_handler(i, &ipu_irq_chip, handle_level_irq);
- set_irq_flags(i, IRQF_VALID);
- irq_set_chip_data(i, ipu);
- }
-
- irq_set_chained_handler(ipu->irq_sync, ipu_irq_handler);
- irq_set_handler_data(ipu->irq_sync, ipu);
- irq_set_chained_handler(ipu->irq_err, ipu_err_irq_handler);
- irq_set_handler_data(ipu->irq_err, ipu);
-}
-
-int ipu_request_irq(struct ipu_soc *ipu, unsigned int irq,
- irq_handler_t handler, unsigned long flags,
- const char *name, void *dev)
-{
- return request_irq(ipu->irq_start + irq, handler, flags, name, dev);
-}
-EXPORT_SYMBOL_GPL(ipu_request_irq);
-
-void ipu_enable_irq(struct ipu_soc *ipu, unsigned int irq)
-{
- return enable_irq(ipu->irq_start + irq);
-}
-EXPORT_SYMBOL_GPL(ipu_disable_irq);
-
-void ipu_disable_irq(struct ipu_soc *ipu, unsigned int irq)
-{
- return disable_irq(ipu->irq_start + irq);
-}
-EXPORT_SYMBOL_GPL(ipu_disable_irq);
-
-void ipu_free_irq(struct ipu_soc *ipu, unsigned int irq, void *dev_id)
-{
- free_irq(ipu->irq_start + irq, dev_id);
-}
-EXPORT_SYMBOL_GPL(ipu_free_irq);
-
-static irqreturn_t ipu_completion_handler(int irq, void *dev)
-{
- struct completion *completion = dev;
-
- complete(completion);
- return IRQ_HANDLED;
-}
-
-int ipu_wait_for_interrupt(struct ipu_soc *ipu, int interrupt, int timeout_ms)
-{
- DECLARE_COMPLETION_ONSTACK(completion);
- int ret;
-
- ret = ipu_request_irq(ipu, interrupt, ipu_completion_handler,
- 0, NULL, &completion);
- if (ret) {
- dev_err(ipu->dev,
- "ipu request irq %d fail\n", interrupt);
- return ret;
- }
-
- ret = wait_for_completion_timeout(&completion,
- msecs_to_jiffies(timeout_ms));
-
- ipu_free_irq(ipu, interrupt, &completion);
-
- return ret > 0 ? 0 : -ETIMEDOUT;
-}
-EXPORT_SYMBOL_GPL(ipu_wait_for_interrupt);
-#endif
-
struct ipu_soc *ipu_get_soc(int id)
{
if (id >= MXC_IPU_MAX_NUM)