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>
This commit is contained in:

zatwierdzone przez
Jiri Kosina

rodzic
7c35dc3cd4
commit
59d69bc821
@@ -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;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user