]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
BT: Sync hcih4p with Nokia N810 driver and fix compile
authorTony Lindgren <tony@atomide.com>
Wed, 23 Apr 2008 23:39:36 +0000 (16:39 -0700)
committerTony Lindgren <tony@atomide.com>
Wed, 30 Apr 2008 00:20:00 +0000 (17:20 -0700)
Sync hcih4p with kernel-source-rx-34-2.6.21.0 and fix compile.

Signed-off-by: Tony Lindgren <tony@atomide.com>
drivers/bluetooth/hci_h4p/core.c
drivers/bluetooth/hci_h4p/hci_h4p.h
drivers/bluetooth/hci_h4p/uart.c

index 09c1f939d747540a3a54ad3fe930d6055369170a..7fb5d123db09b098bb9a69573729ada3c06e3f06 100644 (file)
@@ -144,7 +144,7 @@ static void hci_h4p_enable_rx(struct hci_h4p_info *info)
        if (info->rx_pm_enabled) {
                hci_h4p_set_clk(info, &info->rx_clocks_en, 1);
                hci_h4p_outb(info, UART_IER, hci_h4p_inb(info, UART_IER) | UART_IER_RDI);
-               hci_h4p_set_auto_ctsrts(info, 1, UART_EFR_RTS);
+               __hci_h4p_set_auto_ctsrts(info, 1, UART_EFR_RTS);
                info->rx_pm_enabled = 0;
        }
        spin_unlock_irqrestore(&info->lock, flags);
@@ -157,7 +157,7 @@ static void hci_h4p_rx_pm_timer(unsigned long data)
 
        spin_lock_irqsave(&info->lock, flags);
        if (!(hci_h4p_inb(info, UART_LSR) & UART_LSR_DR)) {
-               hci_h4p_set_auto_ctsrts(info, 0, UART_EFR_RTS);
+               __hci_h4p_set_auto_ctsrts(info, 0, UART_EFR_RTS);
                hci_h4p_set_rts(info, 0);
                hci_h4p_outb(info, UART_IER, hci_h4p_inb(info, UART_IER) & ~UART_IER_RDI);
                hci_h4p_set_clk(info, &info->rx_clocks_en, 0);
@@ -231,7 +231,6 @@ static void hci_h4p_negotiation_packet(struct hci_h4p_info *info,
                        goto neg_ret;
 
                hci_h4p_change_speed(info, MAX_BAUD_RATE);
-               hci_h4p_set_rts(info, 1);
 
                err = hci_h4p_wait_for_cts(info, 1, 100);
                if (err < 0)
@@ -252,8 +251,8 @@ static void hci_h4p_negotiation_packet(struct hci_h4p_info *info,
        return;
 
 neg_ret:
-       complete(&info->init_completion);
        info->init_error = err;
+       complete(&info->init_completion);
        kfree_skb(skb);
 }
 
@@ -511,7 +510,6 @@ static irqreturn_t hci_h4p_interrupt(int irq, void *data)
                ret = IRQ_HANDLED;
        }
 
-
        return ret;
 }
 
@@ -545,7 +543,6 @@ static int hci_h4p_reset(struct hci_h4p_info *info)
        int err;
 
        hci_h4p_init_uart(info);
-       hci_h4p_set_auto_ctsrts(info, 0, UART_EFR_CTS | UART_EFR_RTS);
        hci_h4p_set_rts(info, 0);
 
        omap_set_gpio_dataout(info->reset_gpio, 0);
@@ -626,8 +623,6 @@ static int hci_h4p_hci_open(struct hci_dev *hdev)
        if (err < 0)
                goto err_clean;
 
-       hci_h4p_set_auto_ctsrts(info, 1, UART_EFR_CTS | UART_EFR_RTS);
-
        err = hci_h4p_send_fw(info, &fw_queue);
        if (err < 0) {
                dev_err(info->dev, "Sending firmware failed.\n");
@@ -675,6 +670,8 @@ static int hci_h4p_hci_close(struct hci_dev *hdev)
        del_timer_sync(&info->rx_pm_timer);
        tasklet_disable(&info->tx_task);
        tasklet_disable(&info->rx_task);
+       hci_h4p_set_clk(info, &info->tx_clocks_en, 1);
+       hci_h4p_set_clk(info, &info->rx_clocks_en, 1);
        hci_h4p_reset_uart(info);
        hci_h4p_set_clk(info, &info->tx_clocks_en, 0);
        hci_h4p_set_clk(info, &info->rx_clocks_en, 0);
@@ -906,7 +903,8 @@ static int hci_h4p_probe(struct platform_device *pdev)
        }
 
        err = request_irq(OMAP_GPIO_IRQ(info->host_wakeup_gpio),
-                         hci_h4p_wakeup_interrupt, SA_TRIGGER_FALLING | SA_TRIGGER_RISING,
+                         hci_h4p_wakeup_interrupt,
+                               IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING,
                          "hci_h4p_wkup", (void *)info);
        if (err < 0) {
                dev_err(info->dev, "hci_h4p: unable to get wakeup IRQ %d\n",
@@ -916,11 +914,10 @@ static int hci_h4p_probe(struct platform_device *pdev)
        }
 
        hci_h4p_set_clk(info, &info->tx_clocks_en, 1);
+       hci_h4p_set_auto_ctsrts(info, 0, UART_EFR_CTS | UART_EFR_RTS);
        err = hci_h4p_init_uart(info);
        if (err < 0)
                goto cleanup_irq;
-       hci_h4p_set_auto_ctsrts(info, 0, UART_EFR_CTS | UART_EFR_RTS);
-       hci_h4p_set_rts(info, 0);
        err = hci_h4p_reset(info);
        if (err < 0)
                goto cleanup_irq;
index af9da25d07c23ee0c126759e879ee412b496d4db..eed5205cce31a96dd0b8c515336ba683bbb2077a 100644 (file)
@@ -174,6 +174,7 @@ void hci_h4p_outb(struct hci_h4p_info *info, unsigned int offset, u8 val);
 u8 hci_h4p_inb(struct hci_h4p_info *info, unsigned int offset);
 void hci_h4p_set_rts(struct hci_h4p_info *info, int active);
 int hci_h4p_wait_for_cts(struct hci_h4p_info *info, int active, int timeout_ms);
+void __hci_h4p_set_auto_ctsrts(struct hci_h4p_info *info, int on, u8 which);
 void hci_h4p_set_auto_ctsrts(struct hci_h4p_info *info, int on, u8 which);
 void hci_h4p_change_speed(struct hci_h4p_info *info, unsigned long speed);
 int hci_h4p_reset_uart(struct hci_h4p_info *info);
index 67220fb46322c65e8dda69942bed4c7a05d124ac..1b75a4204dd60a1a1649b4f4b6e465ec9e2023e3 100644 (file)
@@ -75,7 +75,7 @@ int hci_h4p_wait_for_cts(struct hci_h4p_info *info, int active,
        }
 }
 
-void hci_h4p_set_auto_ctsrts(struct hci_h4p_info *info, int on, u8 which)
+void __hci_h4p_set_auto_ctsrts(struct hci_h4p_info *info, int on, u8 which)
 {
        u8 lcr, b;
 
@@ -90,6 +90,15 @@ void hci_h4p_set_auto_ctsrts(struct hci_h4p_info *info, int on, u8 which)
        hci_h4p_outb(info, UART_LCR, lcr);
 }
 
+void hci_h4p_set_auto_ctsrts(struct hci_h4p_info *info, int on, u8 which)
+{
+       unsigned long flags;
+
+       spin_lock_irqsave(&info->lock, flags);
+       __hci_h4p_set_auto_ctsrts(info, on, which);
+       spin_unlock_irqrestore(&info->lock, flags);
+}
+
 void hci_h4p_change_speed(struct hci_h4p_info *info, unsigned long speed)
 {
        unsigned int divisor;