Re: [Linuxwacom-devel] [PATCH 01/25] backport: HID: wacom: actually report the battery level for wireless connected

2016-10-24 Thread Ping Cheng
Thank you Aaron for the heavy backward lifting! It is a big bonus for
those users who don't/can't upgrade their systems...

The patchset looks fine to me.

Acked-by: Ping Cheng 

Ping

On Thu, Oct 20, 2016 at 11:42 AM, Aaron Armstrong Skomra
 wrote:
> From: Benjamin Tissoires 
>
> 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 
> Acked-by: Ping Cheng 
> Signed-off-by: Jiri Kosina 
> [aaron.sko...@wacom.com: Imported into input-wacom repository (d453b87)]
> Signed-off-by: Aaron Armstrong Skomra 
> [aaron.sko...@wacom.com: Backported from input-wacom repository (ea3af31)]
> Signed-off-by: Aaron Armstrong Skomra 
> ---
>  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
>

--
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


[Linuxwacom-devel] [PATCH 01/25] backport: HID: wacom: actually report the battery level for wireless connected

2016-10-20 Thread Aaron Armstrong Skomra
From: Benjamin Tissoires 

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 
Acked-by: Ping Cheng 
Signed-off-by: Jiri Kosina 
[aaron.sko...@wacom.com: Imported into input-wacom repository (d453b87)]
Signed-off-by: Aaron Armstrong Skomra 
[aaron.sko...@wacom.com: Backported from input-wacom repository (ea3af31)]
Signed-off-by: Aaron Armstrong Skomra 
---
 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