summaryrefslogtreecommitdiff
path: root/drivers/misc
diff options
context:
space:
mode:
authorNagarjuna Kristam <nkristam@nvidia.com>2012-05-14 12:20:05 +0530
committerSimone Willett <swillett@nvidia.com>2012-05-15 15:12:28 -0700
commit2c6ab704f63563a1119ded418d1ad1d280c6588f (patch)
treef38a4072c9f963846a96dea10010a58f4fc75421 /drivers/misc
parent9143c5b26abf8e4cbbd12fbb4554524866717e67 (diff)
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 <nkristam@nvidia.com> Reviewed-on: http://git-master/r/102190 Reviewed-by: Rakesh Kumar <krakesh@nvidia.com> Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/bcm4329_rfkill.c7
1 files changed, 7 insertions, 0 deletions
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);