diff options
author | Rob Herring <rob.herring@calxeda.com> | 2012-08-29 11:31:14 -0400 |
---|---|---|
committer | Rob Herring <rob.herring@calxeda.com> | 2012-09-14 10:21:57 -0400 |
commit | 121f3f9b42eb1e1e9edb6ab0f8672e92dd610a31 (patch) | |
tree | 5b1abee308b1661a33284be1a1280f6804c7b822 /drivers/net/irda | |
parent | ef61440375b0b27661348922a6615e018c5ff143 (diff) |
net: pxaficp_ir: add irq resources
In order to remove dependency on mach/irqs.h, add platform device
resources for irqs.
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Cc: Samuel Ortiz <samuel@sortiz.org>
Acked-by: Eric Miao <eric.y.miao@gmail.com>
Cc: Haojian Zhuang <haojian.zhuang@gmail.com>
Cc: netdev@vger.kernel.org
Acked-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/irda')
-rw-r--r-- | drivers/net/irda/pxaficp_ir.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/drivers/net/irda/pxaficp_ir.c b/drivers/net/irda/pxaficp_ir.c index 8d5476707912..cb0a5d3c0b64 100644 --- a/drivers/net/irda/pxaficp_ir.c +++ b/drivers/net/irda/pxaficp_ir.c | |||
@@ -29,8 +29,8 @@ | |||
29 | 29 | ||
30 | #include <mach/dma.h> | 30 | #include <mach/dma.h> |
31 | #include <mach/irda.h> | 31 | #include <mach/irda.h> |
32 | #include <mach/regs-uart.h> | ||
33 | #include <mach/regs-ost.h> | 32 | #include <mach/regs-ost.h> |
33 | #include <mach/regs-uart.h> | ||
34 | 34 | ||
35 | #define FICP __REG(0x40800000) /* Start of FICP area */ | 35 | #define FICP __REG(0x40800000) /* Start of FICP area */ |
36 | #define ICCR0 __REG(0x40800000) /* ICP Control Register 0 */ | 36 | #define ICCR0 __REG(0x40800000) /* ICP Control Register 0 */ |
@@ -112,6 +112,9 @@ struct pxa_irda { | |||
112 | int txdma; | 112 | int txdma; |
113 | int rxdma; | 113 | int rxdma; |
114 | 114 | ||
115 | int uart_irq; | ||
116 | int icp_irq; | ||
117 | |||
115 | struct irlap_cb *irlap; | 118 | struct irlap_cb *irlap; |
116 | struct qos_info qos; | 119 | struct qos_info qos; |
117 | 120 | ||
@@ -672,19 +675,19 @@ static int pxa_irda_start(struct net_device *dev) | |||
672 | 675 | ||
673 | si->speed = 9600; | 676 | si->speed = 9600; |
674 | 677 | ||
675 | err = request_irq(IRQ_STUART, pxa_irda_sir_irq, 0, dev->name, dev); | 678 | err = request_irq(si->uart_irq, pxa_irda_sir_irq, 0, dev->name, dev); |
676 | if (err) | 679 | if (err) |
677 | goto err_irq1; | 680 | goto err_irq1; |
678 | 681 | ||
679 | err = request_irq(IRQ_ICP, pxa_irda_fir_irq, 0, dev->name, dev); | 682 | err = request_irq(si->icp_irq, pxa_irda_fir_irq, 0, dev->name, dev); |
680 | if (err) | 683 | if (err) |
681 | goto err_irq2; | 684 | goto err_irq2; |
682 | 685 | ||
683 | /* | 686 | /* |
684 | * The interrupt must remain disabled for now. | 687 | * The interrupt must remain disabled for now. |
685 | */ | 688 | */ |
686 | disable_irq(IRQ_STUART); | 689 | disable_irq(si->uart_irq); |
687 | disable_irq(IRQ_ICP); | 690 | disable_irq(si->icp_irq); |
688 | 691 | ||
689 | err = -EBUSY; | 692 | err = -EBUSY; |
690 | si->rxdma = pxa_request_dma("FICP_RX",DMA_PRIO_LOW, pxa_irda_fir_dma_rx_irq, dev); | 693 | si->rxdma = pxa_request_dma("FICP_RX",DMA_PRIO_LOW, pxa_irda_fir_dma_rx_irq, dev); |
@@ -720,8 +723,8 @@ static int pxa_irda_start(struct net_device *dev) | |||
720 | /* | 723 | /* |
721 | * Now enable the interrupt and start the queue | 724 | * Now enable the interrupt and start the queue |
722 | */ | 725 | */ |
723 | enable_irq(IRQ_STUART); | 726 | enable_irq(si->uart_irq); |
724 | enable_irq(IRQ_ICP); | 727 | enable_irq(si->icp_irq); |
725 | netif_start_queue(dev); | 728 | netif_start_queue(dev); |
726 | 729 | ||
727 | printk(KERN_DEBUG "pxa_ir: irda driver opened\n"); | 730 | printk(KERN_DEBUG "pxa_ir: irda driver opened\n"); |
@@ -738,9 +741,9 @@ err_dma_rx_buff: | |||
738 | err_tx_dma: | 741 | err_tx_dma: |
739 | pxa_free_dma(si->rxdma); | 742 | pxa_free_dma(si->rxdma); |
740 | err_rx_dma: | 743 | err_rx_dma: |
741 | free_irq(IRQ_ICP, dev); | 744 | free_irq(si->icp_irq, dev); |
742 | err_irq2: | 745 | err_irq2: |
743 | free_irq(IRQ_STUART, dev); | 746 | free_irq(si->uart_irq, dev); |
744 | err_irq1: | 747 | err_irq1: |
745 | 748 | ||
746 | return err; | 749 | return err; |
@@ -760,8 +763,8 @@ static int pxa_irda_stop(struct net_device *dev) | |||
760 | si->irlap = NULL; | 763 | si->irlap = NULL; |
761 | } | 764 | } |
762 | 765 | ||
763 | free_irq(IRQ_STUART, dev); | 766 | free_irq(si->uart_irq, dev); |
764 | free_irq(IRQ_ICP, dev); | 767 | free_irq(si->icp_irq, dev); |
765 | 768 | ||
766 | pxa_free_dma(si->rxdma); | 769 | pxa_free_dma(si->rxdma); |
767 | pxa_free_dma(si->txdma); | 770 | pxa_free_dma(si->txdma); |
@@ -851,6 +854,9 @@ static int pxa_irda_probe(struct platform_device *pdev) | |||
851 | si->dev = &pdev->dev; | 854 | si->dev = &pdev->dev; |
852 | si->pdata = pdev->dev.platform_data; | 855 | si->pdata = pdev->dev.platform_data; |
853 | 856 | ||
857 | si->uart_irq = platform_get_irq(pdev, 0); | ||
858 | si->icp_irq = platform_get_irq(pdev, 1); | ||
859 | |||
854 | si->sir_clk = clk_get(&pdev->dev, "UARTCLK"); | 860 | si->sir_clk = clk_get(&pdev->dev, "UARTCLK"); |
855 | si->fir_clk = clk_get(&pdev->dev, "FICPCLK"); | 861 | si->fir_clk = clk_get(&pdev->dev, "FICPCLK"); |
856 | if (IS_ERR(si->sir_clk) || IS_ERR(si->fir_clk)) { | 862 | if (IS_ERR(si->sir_clk) || IS_ERR(si->fir_clk)) { |