diff options
author | Benjamin Tissoires <benjamin.tissoires@redhat.com> | 2016-07-13 18:06:08 +0200 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2016-08-05 13:39:18 +0200 |
commit | 59d69bc8215478af6b89d4ae9ab0baf6d91eb870 (patch) | |
tree | 704ecbae967c3914376213d83376d17fcd96979f /drivers/hid/wacom.h | |
parent | 7c35dc3cd4d114019ed4b26cab313e253396d7c9 (diff) | |
download | linux-59d69bc8215478af6b89d4ae9ab0baf6d91eb870.tar.bz2 |
HID: wacom: EKR: have one power_supply per remote
Previously, all the remotes attached to the same receiver would share the
same power_supply. That's not good as the remotes will constantly change
the battery information according to their own state.
To have something generic enough, we introduce struct wacom_battery
which regroups all the information we need for a battery.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Acked-by: Ping Cheng <pingc@wacom.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/wacom.h')
-rw-r--r-- | drivers/hid/wacom.h | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/drivers/hid/wacom.h b/drivers/hid/wacom.h index 393b5af871d9..768d69602e7a 100644 --- a/drivers/hid/wacom.h +++ b/drivers/hid/wacom.h @@ -116,6 +116,19 @@ struct wacom_group_leds { u8 select; /* status led selector (0..3) */ }; +struct wacom_battery { + struct power_supply_desc bat_desc; + struct power_supply_desc ac_desc; + struct power_supply *battery; + struct power_supply *ac; + char bat_name[WACOM_NAME_MAX]; + char ac_name[WACOM_NAME_MAX]; + int battery_capacity; + int bat_charging; + int bat_connected; + int ps_connected; +}; + struct wacom_remote { spinlock_t remote_lock; struct kfifo remote_fifo; @@ -125,6 +138,7 @@ struct wacom_remote { u32 serial; struct input_dev *input; bool registered; + struct wacom_battery battery; } remotes[WACOM_MAX_REMOTES]; }; @@ -144,10 +158,7 @@ struct wacom { u8 hlv; /* status led brightness button pressed (1..127) */ u8 img_lum; /* OLED matrix display brightness */ } led; - struct power_supply *battery; - struct power_supply *ac; - struct power_supply_desc battery_desc; - struct power_supply_desc ac_desc; + struct wacom_battery battery; bool resources; }; |