From: Benjamin Tissoires <benjamin.tissoi...@redhat.com>

Since fd5f92b ("HID: wacom: reuse wacom_parse_and_register() in
wireless_work"), wacom->shared->type is not set.
Send the information of the battery if we have one.

Signed-off-by: Benjamin Tissoires <benjamin.tissoi...@redhat.com>
Acked-by: Ping Cheng <pi...@wacom.com>
Signed-off-by: Jiri Kosina <jkos...@suse.cz>
[aaron.sko...@wacom.com: Imported into input-wacom repository (d453b87)]
Signed-off-by: Aaron Armstrong Skomra <aaron.sko...@wacom.com>
[aaron.sko...@wacom.com: Backported from input-wacom repository (ea3af31)]
Signed-off-by: Aaron Armstrong Skomra <aaron.sko...@wacom.com>
---
 2.6.38/wacom_wac.c | 3 ++-
 3.17/wacom_wac.c   | 3 ++-
 3.7/wacom_wac.c    | 3 ++-
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/2.6.38/wacom_wac.c b/2.6.38/wacom_wac.c
index 91bf137..379bfdb 100644
--- a/2.6.38/wacom_wac.c
+++ b/2.6.38/wacom_wac.c
@@ -1547,6 +1547,7 @@ static int wacom_bpt_irq(struct wacom_wac *wacom, size_t 
len)
 
 static int wacom_wireless_irq(struct wacom_wac *wacom, size_t len)
 {
+       struct wacom *w = container_of(wacom, struct wacom, wacom_wac);
        unsigned char *data = wacom->data;
        int connected;
 
@@ -1574,7 +1575,7 @@ static int wacom_wireless_irq(struct wacom_wac *wacom, 
size_t len)
                        wacom_schedule_work(wacom);
                }
 
-               if (wacom->shared->type)
+               if (w->battery.dev)
                        wacom_notify_battery(wacom, battery, charging, 1, 0);
 
        } else if (wacom->pid != 0) {
diff --git a/3.17/wacom_wac.c b/3.17/wacom_wac.c
index 81df74e..89cbe51 100644
--- a/3.17/wacom_wac.c
+++ b/3.17/wacom_wac.c
@@ -2131,6 +2131,7 @@ static int wacom_bamboo_pad_irq(struct wacom_wac *wacom, 
size_t len)
 
 static int wacom_wireless_irq(struct wacom_wac *wacom, size_t len)
 {
+       struct wacom *w = container_of(wacom, struct wacom, wacom_wac);
        unsigned char *data = wacom->data;
        int connected;
 
@@ -2158,7 +2159,7 @@ static int wacom_wireless_irq(struct wacom_wac *wacom, 
size_t len)
                        wacom_schedule_work(wacom);
                }
 
-               if (wacom->shared->type)
+               if (WACOM_POWERSUPPLY_DEVICE(w->battery))
                        wacom_notify_battery(wacom, battery, charging, 1, 0);
 
        } else if (wacom->pid != 0) {
diff --git a/3.7/wacom_wac.c b/3.7/wacom_wac.c
index 3aac8ea..2a9e173 100644
--- a/3.7/wacom_wac.c
+++ b/3.7/wacom_wac.c
@@ -1528,6 +1528,7 @@ static int wacom_bpt_irq(struct wacom_wac *wacom, size_t 
len)
 
 static int wacom_wireless_irq(struct wacom_wac *wacom, size_t len)
 {
+       struct wacom *w = container_of(wacom, struct wacom, wacom_wac);
        unsigned char *data = wacom->data;
        int connected;
 
@@ -1555,7 +1556,7 @@ static int wacom_wireless_irq(struct wacom_wac *wacom, 
size_t len)
                        wacom_schedule_work(wacom);
                }
 
-               if (wacom->shared->type)
+               if (w->battery.dev)
                        wacom_notify_battery(wacom, battery, charging, 1, 0);
 
        } else if (wacom->pid != 0) {
-- 
2.7.4


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to