Commit 9e0e45e6 authored by Tony Lindgren's avatar Tony Lindgren

BT: Sync hcih4p with Nokia N810 driver and fix compile

Sync hcih4p with kernel-source-rx-34-2.6.21.0 and fix compile.
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 7a54510c
...@@ -144,7 +144,7 @@ static void hci_h4p_enable_rx(struct hci_h4p_info *info) ...@@ -144,7 +144,7 @@ static void hci_h4p_enable_rx(struct hci_h4p_info *info)
if (info->rx_pm_enabled) { if (info->rx_pm_enabled) {
hci_h4p_set_clk(info, &info->rx_clocks_en, 1); 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_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; info->rx_pm_enabled = 0;
} }
spin_unlock_irqrestore(&info->lock, flags); spin_unlock_irqrestore(&info->lock, flags);
...@@ -157,7 +157,7 @@ static void hci_h4p_rx_pm_timer(unsigned long data) ...@@ -157,7 +157,7 @@ static void hci_h4p_rx_pm_timer(unsigned long data)
spin_lock_irqsave(&info->lock, flags); spin_lock_irqsave(&info->lock, flags);
if (!(hci_h4p_inb(info, UART_LSR) & UART_LSR_DR)) { 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_set_rts(info, 0);
hci_h4p_outb(info, UART_IER, hci_h4p_inb(info, UART_IER) & ~UART_IER_RDI); 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); 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, ...@@ -231,7 +231,6 @@ static void hci_h4p_negotiation_packet(struct hci_h4p_info *info,
goto neg_ret; goto neg_ret;
hci_h4p_change_speed(info, MAX_BAUD_RATE); hci_h4p_change_speed(info, MAX_BAUD_RATE);
hci_h4p_set_rts(info, 1);
err = hci_h4p_wait_for_cts(info, 1, 100); err = hci_h4p_wait_for_cts(info, 1, 100);
if (err < 0) if (err < 0)
...@@ -252,8 +251,8 @@ static void hci_h4p_negotiation_packet(struct hci_h4p_info *info, ...@@ -252,8 +251,8 @@ static void hci_h4p_negotiation_packet(struct hci_h4p_info *info,
return; return;
neg_ret: neg_ret:
complete(&info->init_completion);
info->init_error = err; info->init_error = err;
complete(&info->init_completion);
kfree_skb(skb); kfree_skb(skb);
} }
...@@ -511,7 +510,6 @@ static irqreturn_t hci_h4p_interrupt(int irq, void *data) ...@@ -511,7 +510,6 @@ static irqreturn_t hci_h4p_interrupt(int irq, void *data)
ret = IRQ_HANDLED; ret = IRQ_HANDLED;
} }
return ret; return ret;
} }
...@@ -545,7 +543,6 @@ static int hci_h4p_reset(struct hci_h4p_info *info) ...@@ -545,7 +543,6 @@ static int hci_h4p_reset(struct hci_h4p_info *info)
int err; int err;
hci_h4p_init_uart(info); hci_h4p_init_uart(info);
hci_h4p_set_auto_ctsrts(info, 0, UART_EFR_CTS | UART_EFR_RTS);
hci_h4p_set_rts(info, 0); hci_h4p_set_rts(info, 0);
omap_set_gpio_dataout(info->reset_gpio, 0); omap_set_gpio_dataout(info->reset_gpio, 0);
...@@ -626,8 +623,6 @@ static int hci_h4p_hci_open(struct hci_dev *hdev) ...@@ -626,8 +623,6 @@ static int hci_h4p_hci_open(struct hci_dev *hdev)
if (err < 0) if (err < 0)
goto err_clean; goto err_clean;
hci_h4p_set_auto_ctsrts(info, 1, UART_EFR_CTS | UART_EFR_RTS);
err = hci_h4p_send_fw(info, &fw_queue); err = hci_h4p_send_fw(info, &fw_queue);
if (err < 0) { if (err < 0) {
dev_err(info->dev, "Sending firmware failed.\n"); dev_err(info->dev, "Sending firmware failed.\n");
...@@ -675,6 +670,8 @@ static int hci_h4p_hci_close(struct hci_dev *hdev) ...@@ -675,6 +670,8 @@ static int hci_h4p_hci_close(struct hci_dev *hdev)
del_timer_sync(&info->rx_pm_timer); del_timer_sync(&info->rx_pm_timer);
tasklet_disable(&info->tx_task); tasklet_disable(&info->tx_task);
tasklet_disable(&info->rx_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_reset_uart(info);
hci_h4p_set_clk(info, &info->tx_clocks_en, 0); hci_h4p_set_clk(info, &info->tx_clocks_en, 0);
hci_h4p_set_clk(info, &info->rx_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) ...@@ -906,7 +903,8 @@ static int hci_h4p_probe(struct platform_device *pdev)
} }
err = request_irq(OMAP_GPIO_IRQ(info->host_wakeup_gpio), 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); "hci_h4p_wkup", (void *)info);
if (err < 0) { if (err < 0) {
dev_err(info->dev, "hci_h4p: unable to get wakeup IRQ %d\n", 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) ...@@ -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_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); err = hci_h4p_init_uart(info);
if (err < 0) if (err < 0)
goto cleanup_irq; 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); err = hci_h4p_reset(info);
if (err < 0) if (err < 0)
goto cleanup_irq; goto cleanup_irq;
......
...@@ -174,6 +174,7 @@ void hci_h4p_outb(struct hci_h4p_info *info, unsigned int offset, u8 val); ...@@ -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); u8 hci_h4p_inb(struct hci_h4p_info *info, unsigned int offset);
void hci_h4p_set_rts(struct hci_h4p_info *info, int active); 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); 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_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); void hci_h4p_change_speed(struct hci_h4p_info *info, unsigned long speed);
int hci_h4p_reset_uart(struct hci_h4p_info *info); int hci_h4p_reset_uart(struct hci_h4p_info *info);
......
...@@ -75,7 +75,7 @@ int hci_h4p_wait_for_cts(struct hci_h4p_info *info, int active, ...@@ -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; u8 lcr, b;
...@@ -90,6 +90,15 @@ void hci_h4p_set_auto_ctsrts(struct hci_h4p_info *info, int on, u8 which) ...@@ -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); 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) void hci_h4p_change_speed(struct hci_h4p_info *info, unsigned long speed)
{ {
unsigned int divisor; unsigned int divisor;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment