From: Chris Zhong <zyw@rock-chips.com>
To: heiko@sntech.de, dianders@chromium.org, dtor@chromium.org,
djkurtz@chromium.org, sonnyrao@chromium.org
Cc: linux-rockchip@lists.infradead.org,
Chris Zhong <zyw@rock-chips.com>,
Sebastian Reichel <sre@kernel.org>,
Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>,
David Woodhouse <dwmw2@infradead.org>,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] power: gpio-charger: support disable the wakeup event
Date: Tue, 10 Feb 2015 16:12:25 +0800 [thread overview]
Message-ID: <1423555945-24289-3-git-send-email-zyw@rock-chips.com> (raw)
In-Reply-To: <1423555945-24289-1-git-send-email-zyw@rock-chips.com>
Support disable the wakeup event of gpio-charger by setting device tree.
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
---
drivers/power/gpio-charger.c | 5 ++++-
include/linux/power/gpio-charger.h | 1 +
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/power/gpio-charger.c b/drivers/power/gpio-charger.c
index b7424c8..06ed22e 100644
--- a/drivers/power/gpio-charger.c
+++ b/drivers/power/gpio-charger.c
@@ -98,6 +98,9 @@ struct gpio_charger_platform_data *gpio_charger_parse_dt(struct device *dev)
pdata->gpio_active_low = !!(flags & OF_GPIO_ACTIVE_LOW);
+ pdata->wakeup = !of_get_property(np, "gpio-charger,disable-wakeup",
+ NULL);
+
pdata->type = POWER_SUPPLY_TYPE_UNKNOWN;
ret = of_property_read_string(np, "charger-type", &chargetype);
if (ret >= 0) {
@@ -198,7 +201,7 @@ static int gpio_charger_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, gpio_charger);
- device_init_wakeup(&pdev->dev, 1);
+ device_init_wakeup(&pdev->dev, pdata->wakeup);
return 0;
diff --git a/include/linux/power/gpio-charger.h b/include/linux/power/gpio-charger.h
index de1dfe0..a5fdef3 100644
--- a/include/linux/power/gpio-charger.h
+++ b/include/linux/power/gpio-charger.h
@@ -33,6 +33,7 @@ struct gpio_charger_platform_data {
int gpio;
int gpio_active_low;
+ int wakeup;
char **supplied_to;
size_t num_supplicants;
--
1.9.1
next prev parent reply other threads:[~2015-02-10 8:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-10 8:12 [PATCH 0/2] Support disable the wakeup event of gpio-charger Chris Zhong
2015-02-10 8:12 ` [PATCH 1/2] dt-bindings: add disable-wakeup property for gpio-charger Chris Zhong
2015-02-10 12:00 ` Mark Rutland
2015-02-10 12:14 ` Heiko Stübner
2015-02-10 12:33 ` Mark Rutland
2015-02-10 8:12 ` Chris Zhong [this message]
2015-02-10 8:42 ` [PATCH 2/2] power: gpio-charger: support disable the wakeup event Dmitry Eremin-Solenikov
2015-02-10 10:50 ` Chris Zhong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1423555945-24289-3-git-send-email-zyw@rock-chips.com \
--to=zyw@rock-chips.com \
--cc=dbaryshkov@gmail.com \
--cc=dianders@chromium.org \
--cc=djkurtz@chromium.org \
--cc=dtor@chromium.org \
--cc=dwmw2@infradead.org \
--cc=heiko@sntech.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=sonnyrao@chromium.org \
--cc=sre@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®