blob: b6d90d4dbedbe4b29d358fee1c011341cd556611 [file] [log] [blame]
Suraj Sumangalab3190df2010-07-19 12:34:07 +05301/*
2 * Atheros Communication Bluetooth HCIATH3K UART protocol
3 *
4 * HCIATH3K (HCI Atheros AR300x Protocol) is a Atheros Communication's
5 * power management protocol extension to H4 to support AR300x Bluetooth Chip.
6 *
7 * Copyright (c) 2009-2010 Atheros Communications Inc.
Duy Truong790f06d2013-02-13 16:38:12 -08008 * Copyright (c) 2012, The Linux Foundation. All rights reserved.
Suraj Sumangalab3190df2010-07-19 12:34:07 +05309 *
10 * Acknowledgements:
11 * This file is based on hci_h4.c, which was written
12 * by Maxim Krasnyansky and Marcel Holtmann.
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 *
28 */
29
30#include <linux/module.h>
31#include <linux/kernel.h>
32
33#include <linux/init.h>
34#include <linux/slab.h>
35#include <linux/tty.h>
36#include <linux/errno.h>
37#include <linux/ioctl.h>
38#include <linux/skbuff.h>
Santosh Sajjan55efc7f2012-06-27 19:10:49 +053039#include <linux/platform_device.h>
40#include <linux/gpio.h>
Suraj Sumangalab3190df2010-07-19 12:34:07 +053041
42#include <net/bluetooth/bluetooth.h>
43#include <net/bluetooth/hci_core.h>
44
45#include "hci_uart.h"
Ram Mohan Korukondaeff0e072012-11-19 16:05:52 +053046#ifdef CONFIG_SERIAL_MSM_HS
47#include <mach/msm_serial_hs.h>
48#endif
Suraj Sumangalab3190df2010-07-19 12:34:07 +053049
Ram Mohan Korukondaeb530d192012-08-08 16:54:51 +053050unsigned int enableuartsleep = 1;
Santosh Sajjan55efc7f2012-06-27 19:10:49 +053051module_param(enableuartsleep, uint, 0644);
52/*
53 * Global variables
54 */
55/** Global state flags */
56static unsigned long flags;
57
Ram Mohan Korukondaeff0e072012-11-19 16:05:52 +053058/** Workqueue to respond to change in hostwake line */
59static void wakeup_host_work(struct work_struct *work);
Santosh Sajjan55efc7f2012-06-27 19:10:49 +053060
61/** Transmission timer */
62static void bluesleep_tx_timer_expire(unsigned long data);
63static DEFINE_TIMER(tx_timer, bluesleep_tx_timer_expire, 0, 0);
64
65/** Lock for state transitions */
66static spinlock_t rw_lock;
67
68#define POLARITY_LOW 0
69#define POLARITY_HIGH 1
70
71struct bluesleep_info {
72 unsigned host_wake; /* wake up host */
73 unsigned ext_wake; /* wake up device */
74 unsigned host_wake_irq;
75 int irq_polarity;
76};
77
78/* 1 second timeout */
79#define TX_TIMER_INTERVAL 1
80
81/* state variable names and bit positions */
82#define BT_TXEXPIRED 0x01
83#define BT_SLEEPENABLE 0x02
84#define BT_SLEEPCMD 0x03
85
86/* global pointer to a single hci device. */
87static struct bluesleep_info *bsi;
88
Suraj Sumangalab3190df2010-07-19 12:34:07 +053089struct ath_struct {
90 struct hci_uart *hu;
91 unsigned int cur_sleep;
92
93 struct sk_buff_head txq;
94 struct work_struct ctxtsw;
Ram Mohan Korukondaeff0e072012-11-19 16:05:52 +053095 struct work_struct ws_sleep;
Suraj Sumangalab3190df2010-07-19 12:34:07 +053096};
97
Ram Mohan Korukondaeff0e072012-11-19 16:05:52 +053098static void hsuart_serial_clock_on(struct tty_struct *tty)
Santosh Sajjan55efc7f2012-06-27 19:10:49 +053099{
Ram Mohan Korukondaeff0e072012-11-19 16:05:52 +0530100 struct uart_state *state = tty->driver_data;
101 struct uart_port *port = state->uart_port;
102 BT_DBG("");
103 msm_hs_request_clock_on(port);
104}
105
106static void hsuart_serial_clock_off(struct tty_struct *tty)
107{
108 struct uart_state *state = tty->driver_data;
109 struct uart_port *port = state->uart_port;
110 BT_DBG("");
111 msm_hs_request_clock_off(port);
Santosh Sajjan55efc7f2012-06-27 19:10:49 +0530112}
113
114static void modify_timer_task(void)
115{
116 spin_lock(&rw_lock);
117 mod_timer(&tx_timer, jiffies + (TX_TIMER_INTERVAL * HZ));
118 clear_bit(BT_TXEXPIRED, &flags);
119 spin_unlock(&rw_lock);
120
121}
122
Suraj Sumangalab3190df2010-07-19 12:34:07 +0530123static int ath_wakeup_ar3k(struct tty_struct *tty)
124{
Santosh Sajjan55efc7f2012-06-27 19:10:49 +0530125 int status = 0;
126 if (test_bit(BT_TXEXPIRED, &flags)) {
Ram Mohan Korukondaeff0e072012-11-19 16:05:52 +0530127 hsuart_serial_clock_on(tty);
Ram Mohan Korukondae359d862012-08-18 21:12:17 +0530128 BT_INFO("wakeup device\n");
Santosh Sajjan55efc7f2012-06-27 19:10:49 +0530129 gpio_set_value(bsi->ext_wake, 0);
Ram Mohan Korukondaeb530d192012-08-08 16:54:51 +0530130 msleep(20);
131 gpio_set_value(bsi->ext_wake, 1);
Santosh Sajjan55efc7f2012-06-27 19:10:49 +0530132 }
133 modify_timer_task();
Suraj Sumangalab3190df2010-07-19 12:34:07 +0530134 return status;
135}
136
Ram Mohan Korukondaeff0e072012-11-19 16:05:52 +0530137static void wakeup_host_work(struct work_struct *work)
138{
139 struct ath_struct *ath =
140 container_of(work, struct ath_struct, ws_sleep);
141
142 BT_INFO("wake up host");
143 if (test_bit(BT_SLEEPENABLE, &flags)) {
144 if (test_bit(BT_TXEXPIRED, &flags))
145 hsuart_serial_clock_on(ath->hu->tty);
146 }
147 modify_timer_task();
148}
149
Suraj Sumangalab3190df2010-07-19 12:34:07 +0530150static void ath_hci_uart_work(struct work_struct *work)
151{
152 int status;
153 struct ath_struct *ath;
154 struct hci_uart *hu;
155 struct tty_struct *tty;
156
157 ath = container_of(work, struct ath_struct, ctxtsw);
158
159 hu = ath->hu;
160 tty = hu->tty;
161
162 /* verify and wake up controller */
Santosh Sajjan55efc7f2012-06-27 19:10:49 +0530163 if (test_bit(BT_SLEEPENABLE, &flags))
Suraj Sumangalab3190df2010-07-19 12:34:07 +0530164 status = ath_wakeup_ar3k(tty);
Suraj Sumangalab3190df2010-07-19 12:34:07 +0530165 /* Ready to send Data */
166 clear_bit(HCI_UART_SENDING, &hu->tx_state);
167 hci_uart_tx_wakeup(hu);
168}
169
Ram Mohan Korukondae359d862012-08-18 21:12:17 +0530170static irqreturn_t bluesleep_hostwake_isr(int irq, void *dev_id)
171{
172 /* schedule a tasklet to handle the change in the host wake line */
Ram Mohan Korukondaeff0e072012-11-19 16:05:52 +0530173 struct ath_struct *ath = (struct ath_struct *)dev_id;
174
175 schedule_work(&ath->ws_sleep);
176
Ram Mohan Korukondae359d862012-08-18 21:12:17 +0530177 return IRQ_HANDLED;
178}
179
Ram Mohan Korukondaeff0e072012-11-19 16:05:52 +0530180static int ath_bluesleep_gpio_config(struct ath_struct *ath, int on)
Ram Mohan Korukondae359d862012-08-18 21:12:17 +0530181{
182 int ret = 0;
183
184 BT_INFO("%s config: %d", __func__, on);
185 if (!on) {
186 if (disable_irq_wake(bsi->host_wake_irq))
187 BT_ERR("Couldn't disable hostwake IRQ wakeup mode\n");
188 goto free_host_wake_irq;
189 }
190
191 ret = gpio_request(bsi->host_wake, "bt_host_wake");
192 if (ret < 0) {
193 BT_ERR("failed to request gpio pin %d, error %d\n",
194 bsi->host_wake, ret);
195 goto gpio_config_failed;
196 }
197
198 /* configure host_wake as input */
199 ret = gpio_direction_input(bsi->host_wake);
200 if (ret < 0) {
201 BT_ERR("failed to config GPIO %d as input pin, err %d\n",
202 bsi->host_wake, ret);
203 goto gpio_host_wake;
204 }
205
206 ret = gpio_request(bsi->ext_wake, "bt_ext_wake");
207 if (ret < 0) {
208 BT_ERR("failed to request gpio pin %d, error %d\n",
209 bsi->ext_wake, ret);
210 goto gpio_host_wake;
211 }
212
213 ret = gpio_direction_output(bsi->ext_wake, 1);
214 if (ret < 0) {
215 BT_ERR("failed to config GPIO %d as output pin, err %d\n",
216 bsi->ext_wake, ret);
217 goto gpio_ext_wake;
218 }
219
220 gpio_set_value(bsi->ext_wake, 1);
221
222 /* Initialize spinlock. */
223 spin_lock_init(&rw_lock);
224
225 /* Initialize timer */
226 init_timer(&tx_timer);
227 tx_timer.function = bluesleep_tx_timer_expire;
Ram Mohan Korukondaeff0e072012-11-19 16:05:52 +0530228 tx_timer.data = (u_long)ath->hu;
Ram Mohan Korukondae359d862012-08-18 21:12:17 +0530229
230 if (bsi->irq_polarity == POLARITY_LOW) {
231 ret = request_irq(bsi->host_wake_irq, bluesleep_hostwake_isr,
232 IRQF_DISABLED | IRQF_TRIGGER_FALLING,
Ram Mohan Korukondaeff0e072012-11-19 16:05:52 +0530233 "bluetooth hostwake", (void *)ath);
Ram Mohan Korukondae359d862012-08-18 21:12:17 +0530234 } else {
235 ret = request_irq(bsi->host_wake_irq, bluesleep_hostwake_isr,
236 IRQF_DISABLED | IRQF_TRIGGER_RISING,
Ram Mohan Korukondaeff0e072012-11-19 16:05:52 +0530237 "bluetooth hostwake", (void *)ath);
Ram Mohan Korukondae359d862012-08-18 21:12:17 +0530238 }
239 if (ret < 0) {
240 BT_ERR("Couldn't acquire BT_HOST_WAKE IRQ");
241 goto delete_timer;
242 }
243
244 ret = enable_irq_wake(bsi->host_wake_irq);
245 if (ret < 0) {
246 BT_ERR("Couldn't enable BT_HOST_WAKE as wakeup interrupt");
247 goto free_host_wake_irq;
248 }
249
250 return 0;
251
252free_host_wake_irq:
Ram Mohan Korukondaeff0e072012-11-19 16:05:52 +0530253 free_irq(bsi->host_wake_irq, (void *)ath);
Ram Mohan Korukondae359d862012-08-18 21:12:17 +0530254delete_timer:
255 del_timer(&tx_timer);
256gpio_ext_wake:
257 gpio_free(bsi->ext_wake);
258gpio_host_wake:
259 gpio_free(bsi->host_wake);
260gpio_config_failed:
261 return ret;
262}
263
Suraj Sumangalab3190df2010-07-19 12:34:07 +0530264/* Initialize protocol */
265static int ath_open(struct hci_uart *hu)
266{
267 struct ath_struct *ath;
268
Ram Mohan Korukondae359d862012-08-18 21:12:17 +0530269 BT_DBG("hu %p, bsi %p", hu, bsi);
270
271 if (!bsi)
272 return -EIO;
273
Suraj Sumangalab3190df2010-07-19 12:34:07 +0530274 ath = kzalloc(sizeof(*ath), GFP_ATOMIC);
275 if (!ath)
276 return -ENOMEM;
277
278 skb_queue_head_init(&ath->txq);
279
280 hu->priv = ath;
281 ath->hu = hu;
282
Ram Mohan Korukondaeff0e072012-11-19 16:05:52 +0530283 if (ath_bluesleep_gpio_config(ath, 1) < 0) {
284 BT_ERR("HCIATH3K GPIO Config failed");
285 hu->priv = NULL;
286 kfree(ath);
287 return -EIO;
288 }
289
Santosh Sajjan55efc7f2012-06-27 19:10:49 +0530290 ath->cur_sleep = enableuartsleep;
291 if (ath->cur_sleep == 1) {
292 set_bit(BT_SLEEPENABLE, &flags);
293 modify_timer_task();
294 }
Suraj Sumangalab3190df2010-07-19 12:34:07 +0530295 INIT_WORK(&ath->ctxtsw, ath_hci_uart_work);
Ram Mohan Korukondaeff0e072012-11-19 16:05:52 +0530296 INIT_WORK(&ath->ws_sleep, wakeup_host_work);
Suraj Sumangalab3190df2010-07-19 12:34:07 +0530297 return 0;
298}
299
300/* Flush protocol data */
301static int ath_flush(struct hci_uart *hu)
302{
303 struct ath_struct *ath = hu->priv;
304
305 BT_DBG("hu %p", hu);
306
307 skb_queue_purge(&ath->txq);
308
309 return 0;
310}
311
312/* Close protocol */
313static int ath_close(struct hci_uart *hu)
314{
315 struct ath_struct *ath = hu->priv;
316
317 BT_DBG("hu %p", hu);
318
319 skb_queue_purge(&ath->txq);
320
321 cancel_work_sync(&ath->ctxtsw);
322
Ram Mohan Korukondaeff0e072012-11-19 16:05:52 +0530323 cancel_work_sync(&ath->ws_sleep);
Suraj Sumangalab3190df2010-07-19 12:34:07 +0530324
Ram Mohan Korukondae359d862012-08-18 21:12:17 +0530325 if (bsi)
Ram Mohan Korukondaeff0e072012-11-19 16:05:52 +0530326 ath_bluesleep_gpio_config(ath, 0);
327
328 hu->priv = NULL;
329 kfree(ath);
Ram Mohan Korukondae359d862012-08-18 21:12:17 +0530330
Suraj Sumangalab3190df2010-07-19 12:34:07 +0530331 return 0;
332}
333
334#define HCI_OP_ATH_SLEEP 0xFC04
335
336/* Enqueue frame for transmittion */
337static int ath_enqueue(struct hci_uart *hu, struct sk_buff *skb)
338{
339 struct ath_struct *ath = hu->priv;
340
Ram Mohan Korukondae359d862012-08-18 21:12:17 +0530341 BT_DBG("");
342
Suraj Sumangalab3190df2010-07-19 12:34:07 +0530343 if (bt_cb(skb)->pkt_type == HCI_SCODATA_PKT) {
Dan Carpenter4ebaa4e2010-07-23 12:11:04 +0200344 kfree_skb(skb);
Suraj Sumangalab3190df2010-07-19 12:34:07 +0530345 return 0;
346 }
347
348 /*
349 * Update power management enable flag with parameters of
350 * HCI sleep enable vendor specific HCI command.
351 */
352 if (bt_cb(skb)->pkt_type == HCI_COMMAND_PKT) {
353 struct hci_command_hdr *hdr = (void *)skb->data;
Santosh Sajjan55efc7f2012-06-27 19:10:49 +0530354 if (__le16_to_cpu(hdr->opcode) == HCI_OP_ATH_SLEEP) {
355 set_bit(BT_SLEEPCMD, &flags);
Suraj Sumangalab3190df2010-07-19 12:34:07 +0530356 ath->cur_sleep = skb->data[HCI_COMMAND_HDR_SIZE];
Santosh Sajjan55efc7f2012-06-27 19:10:49 +0530357 }
Suraj Sumangalab3190df2010-07-19 12:34:07 +0530358 }
359
360 BT_DBG("hu %p skb %p", hu, skb);
361
362 /* Prepend skb with frame type */
363 memcpy(skb_push(skb, 1), &bt_cb(skb)->pkt_type, 1);
364
365 skb_queue_tail(&ath->txq, skb);
366 set_bit(HCI_UART_SENDING, &hu->tx_state);
367
368 schedule_work(&ath->ctxtsw);
369
370 return 0;
371}
372
373static struct sk_buff *ath_dequeue(struct hci_uart *hu)
374{
375 struct ath_struct *ath = hu->priv;
376
377 return skb_dequeue(&ath->txq);
378}
379
380/* Recv data */
381static int ath_recv(struct hci_uart *hu, void *data, int count)
382{
Santosh Sajjan55efc7f2012-06-27 19:10:49 +0530383 struct ath_struct *ath = hu->priv;
384 unsigned int type;
Jiejing Zhang78b4a562011-04-07 20:37:06 +0800385
Ram Mohan Korukondae359d862012-08-18 21:12:17 +0530386 BT_DBG("");
387
Santosh Sajjan55efc7f2012-06-27 19:10:49 +0530388 if (hci_recv_stream_fragment(hu->hdev, data, count) < 0)
Suraj Sumangalab3190df2010-07-19 12:34:07 +0530389 BT_ERR("Frame Reassembly Failed");
390
Santosh Sajjan55efc7f2012-06-27 19:10:49 +0530391 if (count & test_bit(BT_SLEEPCMD, &flags)) {
392 struct sk_buff *skb = hu->hdev->reassembly[0];
393
394 if (!skb) {
395 struct { char type; } *pkt;
396
397 /* Start of the frame */
398 pkt = data;
399 type = pkt->type;
400 } else
401 type = bt_cb(skb)->pkt_type;
402
403 if (type == HCI_EVENT_PKT) {
404 clear_bit(BT_SLEEPCMD, &flags);
Ram Mohan Korukondae359d862012-08-18 21:12:17 +0530405 BT_INFO("cur_sleep:%d\n", ath->cur_sleep);
Santosh Sajjan55efc7f2012-06-27 19:10:49 +0530406 if (ath->cur_sleep == 1)
407 set_bit(BT_SLEEPENABLE, &flags);
408 else
409 clear_bit(BT_SLEEPENABLE, &flags);
410 }
411 if (test_bit(BT_SLEEPENABLE, &flags))
412 modify_timer_task();
413 }
Suraj Sumangalab3190df2010-07-19 12:34:07 +0530414 return count;
415}
416
Santosh Sajjan55efc7f2012-06-27 19:10:49 +0530417static void bluesleep_tx_timer_expire(unsigned long data)
418{
Ram Mohan Korukondaeff0e072012-11-19 16:05:52 +0530419 struct hci_uart *hu = (struct hci_uart *) data;
420
Santosh Sajjan55efc7f2012-06-27 19:10:49 +0530421 if (!test_bit(BT_SLEEPENABLE, &flags))
422 return;
Ram Mohan Korukondae359d862012-08-18 21:12:17 +0530423 BT_INFO("Tx timer expired\n");
Santosh Sajjan55efc7f2012-06-27 19:10:49 +0530424
425 set_bit(BT_TXEXPIRED, &flags);
Ram Mohan Korukondaeff0e072012-11-19 16:05:52 +0530426 hsuart_serial_clock_off(hu->tty);
Santosh Sajjan55efc7f2012-06-27 19:10:49 +0530427}
428
Suraj Sumangalab3190df2010-07-19 12:34:07 +0530429static struct hci_uart_proto athp = {
430 .id = HCI_UART_ATH3K,
431 .open = ath_open,
432 .close = ath_close,
433 .recv = ath_recv,
434 .enqueue = ath_enqueue,
435 .dequeue = ath_dequeue,
436 .flush = ath_flush,
437};
438
Santosh Sajjan55efc7f2012-06-27 19:10:49 +0530439static int __init bluesleep_probe(struct platform_device *pdev)
440{
441 int ret;
442 struct resource *res;
443
Ram Mohan Korukondae359d862012-08-18 21:12:17 +0530444 BT_DBG("");
445
Santosh Sajjan55efc7f2012-06-27 19:10:49 +0530446 bsi = kzalloc(sizeof(struct bluesleep_info), GFP_KERNEL);
447 if (!bsi) {
448 ret = -ENOMEM;
449 goto failed;
450 }
451
452 res = platform_get_resource_byname(pdev, IORESOURCE_IO,
453 "gpio_host_wake");
454 if (!res) {
455 BT_ERR("couldn't find host_wake gpio\n");
456 ret = -ENODEV;
457 goto free_bsi;
458 }
459 bsi->host_wake = res->start;
460
Santosh Sajjan55efc7f2012-06-27 19:10:49 +0530461 res = platform_get_resource_byname(pdev, IORESOURCE_IO,
462 "gpio_ext_wake");
463 if (!res) {
464 BT_ERR("couldn't find ext_wake gpio\n");
465 ret = -ENODEV;
Ram Mohan Korukondae359d862012-08-18 21:12:17 +0530466 goto free_bsi;
Santosh Sajjan55efc7f2012-06-27 19:10:49 +0530467 }
468 bsi->ext_wake = res->start;
469
Santosh Sajjan55efc7f2012-06-27 19:10:49 +0530470 bsi->host_wake_irq = platform_get_irq_byname(pdev, "host_wake");
471 if (bsi->host_wake_irq < 0) {
472 BT_ERR("couldn't find host_wake irq\n");
473 ret = -ENODEV;
Ram Mohan Korukondae359d862012-08-18 21:12:17 +0530474 goto free_bsi;
Santosh Sajjan55efc7f2012-06-27 19:10:49 +0530475 }
476
477 bsi->irq_polarity = POLARITY_LOW; /* low edge (falling edge) */
478
Santosh Sajjan55efc7f2012-06-27 19:10:49 +0530479 return 0;
480
Santosh Sajjan55efc7f2012-06-27 19:10:49 +0530481free_bsi:
482 kfree(bsi);
Ram Mohan Korukondae359d862012-08-18 21:12:17 +0530483 bsi = NULL;
Santosh Sajjan55efc7f2012-06-27 19:10:49 +0530484failed:
485 return ret;
486}
487
488static int bluesleep_remove(struct platform_device *pdev)
489{
Santosh Sajjan55efc7f2012-06-27 19:10:49 +0530490 kfree(bsi);
491 return 0;
492}
493
494static struct platform_driver bluesleep_driver = {
495 .remove = bluesleep_remove,
496 .driver = {
497 .name = "bluesleep",
498 .owner = THIS_MODULE,
499 },
500};
501
Gustavo F. Padovanf2b94bb2010-07-24 02:04:44 -0300502int __init ath_init(void)
Suraj Sumangalab3190df2010-07-19 12:34:07 +0530503{
Santosh Sajjan55efc7f2012-06-27 19:10:49 +0530504 int ret;
Suraj Sumangalab3190df2010-07-19 12:34:07 +0530505
Santosh Sajjan55efc7f2012-06-27 19:10:49 +0530506 ret = hci_uart_register_proto(&athp);
507
508 if (!ret)
Suraj Sumangalab3190df2010-07-19 12:34:07 +0530509 BT_INFO("HCIATH3K protocol initialized");
Santosh Sajjan55efc7f2012-06-27 19:10:49 +0530510 else {
Suraj Sumangalab3190df2010-07-19 12:34:07 +0530511 BT_ERR("HCIATH3K protocol registration failed");
Santosh Sajjan55efc7f2012-06-27 19:10:49 +0530512 return ret;
513 }
514 ret = platform_driver_probe(&bluesleep_driver, bluesleep_probe);
515 if (ret)
516 return ret;
517 return 0;
Suraj Sumangalab3190df2010-07-19 12:34:07 +0530518}
519
Gustavo F. Padovanf2b94bb2010-07-24 02:04:44 -0300520int __exit ath_deinit(void)
Suraj Sumangalab3190df2010-07-19 12:34:07 +0530521{
Santosh Sajjan55efc7f2012-06-27 19:10:49 +0530522 platform_driver_unregister(&bluesleep_driver);
Suraj Sumangalab3190df2010-07-19 12:34:07 +0530523 return hci_uart_unregister_proto(&athp);
524}