From: 黄涛 Date: Sat, 30 Jul 2011 14:43:35 +0000 (+0800) Subject: Revert "wl127x-rfkill: Add power control driver for TI WL127X Bluetooth chips" X-Git-Tag: firefly_0821_release~9948 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=25b99082829e85eb6ef8d78cdf7e5c9b9e66535b;p=firefly-linux-kernel-4.4.55.git Revert "wl127x-rfkill: Add power control driver for TI WL127X Bluetooth chips" This reverts commit 6adc27186cf59e8d50e96f6873002f081ee2d111. Conflicts: drivers/misc/Kconfig drivers/misc/Makefile --- diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig index af690da5db6c..af0db380c366 100755 --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig @@ -261,14 +261,6 @@ config UID_STAT bool "UID based statistics tracking exported to /proc/uid_stat" default n -config WL127X_RFKILL - tristate "Bluetooth power control driver for TI wl127x" - depends on RFKILL - default n - ---help--- - Creates an rfkill entry in sysfs for power control of Bluetooth - TI wl127x chips. - config STE bool "STE modem control driver" default n diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile index d2e8b6ce3b29..9df50c17f226 100755 --- a/drivers/misc/Makefile +++ b/drivers/misc/Makefile @@ -26,7 +26,6 @@ obj-$(CONFIG_UID_STAT) += uid_stat.o obj-$(CONFIG_C2PORT) += c2port/ obj-y += eeprom/ obj-y += cb710/ -obj-$(CONFIG_WL127X_RFKILL) += wl127x-rfkill.o obj-$(CONFIG_MTK23D) += mtk23d.o obj-$(CONFIG_FM580X) += fm580x.o obj-$(CONFIG_MU509) += mu509.o diff --git a/drivers/misc/wl127x-rfkill.c b/drivers/misc/wl127x-rfkill.c deleted file mode 100644 index f5b95152948b..000000000000 --- a/drivers/misc/wl127x-rfkill.c +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Bluetooth TI wl127x rfkill power control via GPIO - * - * Copyright (C) 2009 Motorola, Inc. - * Copyright (C) 2008 Texas Instruments - * Initial code: Pavan Savoy (wl127x_power.c) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#include -#include -#include -#include -#include -#include - -static int wl127x_rfkill_set_power(void *data, enum rfkill_state state) -{ - int nshutdown_gpio = (int) data; - - switch (state) { - case RFKILL_STATE_UNBLOCKED: - gpio_set_value(nshutdown_gpio, 1); - break; - case RFKILL_STATE_SOFT_BLOCKED: - gpio_set_value(nshutdown_gpio, 0); - break; - default: - printk(KERN_ERR "invalid bluetooth rfkill state %d\n", state); - } - return 0; -} - -static int wl127x_rfkill_probe(struct platform_device *pdev) -{ - int rc = 0; - struct wl127x_rfkill_platform_data *pdata = pdev->dev.platform_data; - enum rfkill_state default_state = RFKILL_STATE_SOFT_BLOCKED; /* off */ - - rc = gpio_request(pdata->nshutdown_gpio, "wl127x_nshutdown_gpio"); - if (unlikely(rc)) - return rc; - - rc = gpio_direction_output(pdata->nshutdown_gpio, 0); - if (unlikely(rc)) - return rc; - - rfkill_set_default(RFKILL_TYPE_BLUETOOTH, default_state); - wl127x_rfkill_set_power(NULL, default_state); - - pdata->rfkill = rfkill_allocate(&pdev->dev, RFKILL_TYPE_BLUETOOTH); - if (unlikely(!pdata->rfkill)) - return -ENOMEM; - - pdata->rfkill->name = "wl127x"; - pdata->rfkill->state = default_state; - /* userspace cannot take exclusive control */ - pdata->rfkill->user_claim_unsupported = 1; - pdata->rfkill->user_claim = 0; - pdata->rfkill->data = (void *) pdata->nshutdown_gpio; - pdata->rfkill->toggle_radio = wl127x_rfkill_set_power; - - rc = rfkill_register(pdata->rfkill); - - if (unlikely(rc)) - rfkill_free(pdata->rfkill); - - return 0; -} - -static int wl127x_rfkill_remove(struct platform_device *pdev) -{ - struct wl127x_rfkill_platform_data *pdata = pdev->dev.platform_data; - - rfkill_unregister(pdata->rfkill); - rfkill_free(pdata->rfkill); - gpio_free(pdata->nshutdown_gpio); - - return 0; -} - -static struct platform_driver wl127x_rfkill_platform_driver = { - .probe = wl127x_rfkill_probe, - .remove = wl127x_rfkill_remove, - .driver = { - .name = "wl127x-rfkill", - .owner = THIS_MODULE, - }, -}; - -static int __init wl127x_rfkill_init(void) -{ - return platform_driver_register(&wl127x_rfkill_platform_driver); -} - -static void __exit wl127x_rfkill_exit(void) -{ - platform_driver_unregister(&wl127x_rfkill_platform_driver); -} - -module_init(wl127x_rfkill_init); -module_exit(wl127x_rfkill_exit); - -MODULE_ALIAS("platform:wl127x"); -MODULE_DESCRIPTION("wl127x-rfkill"); -MODULE_AUTHOR("Motorola"); -MODULE_LICENSE("GPL"); diff --git a/include/linux/wl127x-rfkill.h b/include/linux/wl127x-rfkill.h deleted file mode 100644 index 9057ec63d5d3..000000000000 --- a/include/linux/wl127x-rfkill.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Bluetooth TI wl127x rfkill power control via GPIO - * - * Copyright (C) 2009 Motorola, Inc. - * Copyright (C) 2008 Texas Instruments - * Initial code: Pavan Savoy (wl127x_power.c) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#ifndef _LINUX_WL127X_RFKILL_H -#define _LINUX_WL127X_RFKILL_H - -#include - -struct wl127x_rfkill_platform_data { - int nshutdown_gpio; - - struct rfkill *rfkill; /* for driver only */ -}; - -#endif