David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 2 | /* |
| 3 | * Common power driver for PDAs and phones with one or two external |
| 4 | * power supplies (AC/USB) connected to main and backup batteries, |
| 5 | * and optional builtin charger. |
| 6 | * |
| 7 | * Copyright © 2007 Anton Vorontsov <cbou@mail.ru> |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 8 | */ |
| 9 | |
| 10 | #ifndef __PDA_POWER_H__ |
| 11 | #define __PDA_POWER_H__ |
| 12 | |
| 13 | #define PDA_POWER_CHARGE_AC (1 << 0) |
| 14 | #define PDA_POWER_CHARGE_USB (1 << 1) |
| 15 | |
| 16 | struct device; |
| 17 | |
| 18 | struct pda_power_pdata { |
| 19 | int (*init)(struct device *dev); |
| 20 | int (*is_ac_online)(void); |
| 21 | int (*is_usb_online)(void); |
| 22 | void (*set_charge)(int flags); |
| 23 | void (*exit)(struct device *dev); |
| 24 | int (*suspend)(pm_message_t state); |
| 25 | int (*resume)(void); |
| 26 | |
| 27 | char **supplied_to; |
| 28 | size_t num_supplicants; |
| 29 | |
| 30 | unsigned int wait_for_status; /* msecs, default is 500 */ |
| 31 | unsigned int wait_for_charger; /* msecs, default is 500 */ |
| 32 | unsigned int polling_interval; /* msecs, default is 2000 */ |
| 33 | |
| 34 | unsigned long ac_max_uA; /* current to draw when on AC */ |
| 35 | |
| 36 | bool use_otg_notifier; |
| 37 | }; |
| 38 | |
| 39 | #endif /* __PDA_POWER_H__ */ |