Merge branch 'bkl-removal' into next
[pandora-kernel.git] / drivers / net / irda / pxaficp_ir.c
index 60b94bb..f76b0b6 100644 (file)
  *
  */
 #include <linux/module.h>
-#include <linux/types.h>
-#include <linux/init.h>
-#include <linux/errno.h>
 #include <linux/netdevice.h>
-#include <linux/slab.h>
-#include <linux/rtnetlink.h>
-#include <linux/interrupt.h>
-#include <linux/dma-mapping.h>
 #include <linux/platform_device.h>
-#include <linux/pm.h>
 #include <linux/clk.h>
 
 #include <net/irda/irda.h>
 #include <net/irda/wrapper.h>
 #include <net/irda/irda_device.h>
 
-#include <asm/irq.h>
 #include <asm/dma.h>
-#include <asm/delay.h>
-#include <asm/hardware.h>
 #include <asm/arch/irda.h>
 #include <asm/arch/pxa-regs.h>
 
-#ifdef CONFIG_MACH_MAINSTONE
-#include <asm/arch/mainstone.h>
-#endif
-
 #define IrSR_RXPL_NEG_IS_ZERO (1<<4)
 #define IrSR_RXPL_POS_IS_ZERO 0x0
 #define IrSR_TXPL_NEG_IS_ZERO (1<<3)
@@ -162,10 +147,6 @@ static int pxa_irda_set_speed(struct pxa_irda *si, int speed)
                        /* set board transceiver to SIR mode */
                        si->pdata->transceiver_mode(si->dev, IR_SIRMODE);
 
-                       /* configure GPIO46/47 */
-                       pxa_gpio_mode(GPIO46_STRXD_MD);
-                       pxa_gpio_mode(GPIO47_STTXD_MD);
-
                        /* enable the STUART clock */
                        pxa_irda_enable_sirclk(si);
                }
@@ -200,10 +181,6 @@ static int pxa_irda_set_speed(struct pxa_irda *si, int speed)
                /* set board transceiver to FIR mode */
                si->pdata->transceiver_mode(si->dev, IR_FIRMODE);
 
-               /* configure GPIO46/47 */
-               pxa_gpio_mode(GPIO46_ICPRXD_MD);
-               pxa_gpio_mode(GPIO47_ICPTXD_MD);
-
                /* enable the FICP clock */
                pxa_irda_enable_firclk(si);
 
@@ -831,6 +808,11 @@ static int pxa_irda_probe(struct platform_device *pdev)
        if (err)
                goto err_mem_5;
 
+       if (si->pdata->startup)
+               err = si->pdata->startup(si->dev);
+       if (err)
+               goto err_startup;
+
        dev->hard_start_xmit    = pxa_irda_hard_xmit;
        dev->open               = pxa_irda_start;
        dev->stop               = pxa_irda_stop;
@@ -856,6 +838,9 @@ static int pxa_irda_probe(struct platform_device *pdev)
                dev_set_drvdata(&pdev->dev, dev);
 
        if (err) {
+               if (si->pdata->shutdown)
+                       si->pdata->shutdown(si->dev);
+err_startup:
                kfree(si->tx_buff.head);
 err_mem_5:
                kfree(si->rx_buff.head);
@@ -881,6 +866,8 @@ static int pxa_irda_remove(struct platform_device *_dev)
        if (dev) {
                struct pxa_irda *si = netdev_priv(dev);
                unregister_netdev(dev);
+               if (si->pdata->shutdown)
+                       si->pdata->shutdown(si->dev);
                kfree(si->tx_buff.head);
                kfree(si->rx_buff.head);
                clk_put(si->fir_clk);