]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00221012 IPU: Clean up dead code
authorWayne Zou <b36644@freescale.com>
Wed, 22 Aug 2012 02:22:42 +0000 (10:22 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:35:17 +0000 (08:35 +0200)
IPU: Clean up dead code

Signed-off-by: Wayne Zou <b36644@freescale.com>
drivers/mxc/ipu3/ipu_common.c

index 4e3526c818399d8de2f349bb58fd64b64df9474d..c97d159993018e3dabda978446facded8e417a95 100644 (file)
@@ -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)