summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeikki Krogerus <heikki.krogerus@linux.intel.com>2013-10-16 10:53:41 (GMT)
committerBeomho Seo <beomho.seo@samsung.com>2014-05-08 06:18:43 (GMT)
commitec21a6012953561228b0833361d065f1efd2a318 (patch)
treef77f653721d01ad5dad3155fc0be77f71b80b2a2
parent01b99d3ca0a8909a928c8e56062419b20cdb7549 (diff)
downloadlinux-3.10-ec21a6012953561228b0833361d065f1efd2a318.zip
linux-3.10-ec21a6012953561228b0833361d065f1efd2a318.tar.gz
linux-3.10-ec21a6012953561228b0833361d065f1efd2a318.tar.bz2
net: rfkill: gpio: spinlock-safe GPIO accessrefs/changes/79/20479/1
This sets the direction of the gpio once when it's requested, and uses the spinlock-safe gpio_set_state() to change the state. Change-Id: I1e9e9035dc9451d7531d230645d5f1572130a77b Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Acked-by: Rhyland Klein <rklein@nvidia.com> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r--net/rfkill/rfkill-gpio.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/net/rfkill/rfkill-gpio.c b/net/rfkill/rfkill-gpio.c
index 1d104e7..aa4ac10 100644
--- a/net/rfkill/rfkill-gpio.c
+++ b/net/rfkill/rfkill-gpio.c
@@ -42,18 +42,18 @@ static int rfkill_gpio_set_power(void *data, bool blocked)
if (blocked) {
if (gpio_is_valid(rfkill->pdata->shutdown_gpio))
- gpio_direction_output(rfkill->pdata->shutdown_gpio, 0);
+ gpio_set_value(rfkill->pdata->shutdown_gpio, 0);
if (gpio_is_valid(rfkill->pdata->reset_gpio))
- gpio_direction_output(rfkill->pdata->reset_gpio, 0);
+ gpio_set_value(rfkill->pdata->reset_gpio, 0);
if (!IS_ERR(rfkill->clk) && rfkill->clk_enabled)
clk_disable(rfkill->clk);
} else {
if (!IS_ERR(rfkill->clk) && !rfkill->clk_enabled)
clk_enable(rfkill->clk);
if (gpio_is_valid(rfkill->pdata->reset_gpio))
- gpio_direction_output(rfkill->pdata->reset_gpio, 1);
+ gpio_set_value(rfkill->pdata->reset_gpio, 1);
if (gpio_is_valid(rfkill->pdata->shutdown_gpio))
- gpio_direction_output(rfkill->pdata->shutdown_gpio, 1);
+ gpio_set_value(rfkill->pdata->shutdown_gpio, 1);
}
rfkill->clk_enabled = blocked;
@@ -114,8 +114,8 @@ static int rfkill_gpio_probe(struct platform_device *pdev)
rfkill->clk = devm_clk_get(&pdev->dev, pdata->power_clk_name);
if (gpio_is_valid(pdata->reset_gpio)) {
- ret = devm_gpio_request(&pdev->dev, pdata->reset_gpio,
- rfkill->reset_name);
+ ret = devm_gpio_request_one(&pdev->dev, pdata->reset_gpio,
+ 0, rfkill->reset_name);
if (ret) {
pr_warn("%s: failed to get reset gpio.\n", __func__);
return ret;
@@ -123,8 +123,8 @@ static int rfkill_gpio_probe(struct platform_device *pdev)
}
if (gpio_is_valid(pdata->shutdown_gpio)) {
- ret = devm_gpio_request(&pdev->dev, pdata->shutdown_gpio,
- rfkill->shutdown_name);
+ ret = devm_gpio_request_one(&pdev->dev, pdata->shutdown_gpio,
+ 0, rfkill->shutdown_name);
if (ret) {
pr_warn("%s: failed to get shutdown gpio.\n", __func__);
return ret;