From 2c6ab704f63563a1119ded418d1ad1d280c6588f Mon Sep 17 00:00:00 2001 From: Nagarjuna Kristam Date: Mon, 14 May 2012 12:20:05 +0530 Subject: misc: bt rfkill: toggle power GPIO based on current power state check if requested state and current BT power state is same, if yes, do not toggle BT power GPIO's. if not, set requested power state. Bug 982600 Bug 928604 Change-Id: I82c65fd6d43940c86cc3de440295ba179a4ade33 Signed-off-by: Nagarjuna Kristam Reviewed-on: http://git-master/r/102190 Reviewed-by: Rakesh Kumar Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Bharat Nihalani --- drivers/misc/bcm4329_rfkill.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'drivers/misc/bcm4329_rfkill.c') diff --git a/drivers/misc/bcm4329_rfkill.c b/drivers/misc/bcm4329_rfkill.c index a077326f2553..cf56768e2baa 100644 --- a/drivers/misc/bcm4329_rfkill.c +++ b/drivers/misc/bcm4329_rfkill.c @@ -44,6 +44,13 @@ static struct bcm4329_rfkill_data *bcm4329_rfkill; static int bcm4329_bt_rfkill_set_power(void *data, bool blocked) { + /* + * check if BT gpio_shutdown line status and current request are same. + * If same, then return, else perform requested operation. + */ + if (gpio_get_value(bcm4329_rfkill->gpio_shutdown) && !blocked) + return 0; + if (blocked) { if (bcm4329_rfkill->gpio_shutdown) gpio_direction_output(bcm4329_rfkill->gpio_shutdown, 0); -- cgit v1.2.3 From ab96dd56b3e6bb1fb278cf42e81e7191cfb501b7 Mon Sep 17 00:00:00 2001 From: Preetham Chandru Date: Mon, 4 Jun 2012 13:59:31 +0530 Subject: misc: rfkill: rephrase gpio warning messages The current BCM4329 rfkill driver assumes usage of 2 GPIOs known as RST and SHUTDOWN and the driver makes a particular GPIO mandatory. Some of the platforms does not define both GPIOs, instead a single either RST/SHUTDOWN GPIO is used to setup the chip. Hence print a less alarming message if gpio is not found. Bug 975333 Signed-off-by: Preetham Chandru r Change-Id: I229844d9d5dfc94ea00bb086d1091ac41bf97b99 Reviewed-on: http://git-master/r/106158 Tested-by: Preetham Chandru Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Kiran Adduri Reviewed-by: Rakesh Goyal Reviewed-by: Bharat Nihalani GVS: Gerrit_Virtual_Submit --- drivers/misc/bcm4329_rfkill.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'drivers/misc/bcm4329_rfkill.c') diff --git a/drivers/misc/bcm4329_rfkill.c b/drivers/misc/bcm4329_rfkill.c index cf56768e2baa..9dc33fd51e59 100644 --- a/drivers/misc/bcm4329_rfkill.c +++ b/drivers/misc/bcm4329_rfkill.c @@ -111,7 +111,9 @@ static int bcm4329_rfkill_probe(struct platform_device *pdev) ret = gpio_request(bcm4329_rfkill->gpio_reset, "bcm4329_nreset_gpio"); } else { - pr_warn("%s : can't find reset gpio.\n", __func__); + pr_warn("%s : can't find reset gpio. " + "reset gpio may not be defined for " + "this platform \n", __func__); bcm4329_rfkill->gpio_reset = 0; } @@ -123,7 +125,9 @@ static int bcm4329_rfkill_probe(struct platform_device *pdev) ret = gpio_request(bcm4329_rfkill->gpio_shutdown, "bcm4329_nshutdown_gpio"); } else { - pr_warn("%s : can't find shutdown gpio.\n", __func__); + pr_warn("%s : can't find shutdown gpio " + "shutdown gpio may not be defined for " + "this platform \n", __func__); bcm4329_rfkill->gpio_shutdown = 0; } -- cgit v1.2.3