#include <linux/auxiliary_bus.h>
#include <linux/bits.h>
#include <linux/cleanup.h>
#include <linux/delay.h>
#include <linux/jiffies.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/notifier.h>
#include <linux/power_supply.h>
#include <linux/platform_data/lenovo-yoga-c630.h>
struct yoga_c630_psy { … };
#define LENOVO_EC_CACHE_TIME …
#define LENOVO_EC_ADPT_STATUS …
#define LENOVO_EC_ADPT_STATUS_PRESENT …
#define LENOVO_EC_BAT_ATTRIBUTES …
#define LENOVO_EC_BAT_ATTRIBUTES_UNIT_IS_MA …
#define LENOVO_EC_BAT_STATUS …
#define LENOVO_EC_BAT_STATUS_DISCHARGING …
#define LENOVO_EC_BAT_STATUS_CHARGING …
#define LENOVO_EC_BAT_REMAIN_CAPACITY …
#define LENOVO_EC_BAT_VOLTAGE …
#define LENOVO_EC_BAT_DESIGN_VOLTAGE …
#define LENOVO_EC_BAT_DESIGN_CAPACITY …
#define LENOVO_EC_BAT_FULL_CAPACITY …
#define LENOVO_EC_BAT_CURRENT …
#define LENOVO_EC_BAT_FULL_FACTORY …
#define LENOVO_EC_BAT_PRESENT …
#define LENOVO_EC_BAT_PRESENT_IS_PRESENT …
#define LENOVO_EC_BAT_FULL_REGISTER …
#define LENOVO_EC_BAT_FULL_REGISTER_IS_FACTORY …
static int yoga_c630_psy_update_bat_info(struct yoga_c630_psy *ecbat)
{ … }
static int yoga_c630_psy_maybe_update_bat_status(struct yoga_c630_psy *ecbat)
{ … }
static int yoga_c630_psy_update_adapter_status(struct yoga_c630_psy *ecbat)
{ … }
static bool yoga_c630_psy_is_charged(struct yoga_c630_psy *ecbat)
{ … }
static int yoga_c630_psy_bat_get_property(struct power_supply *psy,
enum power_supply_property psp,
union power_supply_propval *val)
{ … }
static enum power_supply_property yoga_c630_psy_bat_mA_properties[] = …;
static enum power_supply_property yoga_c630_psy_bat_mWh_properties[] = …;
static const struct power_supply_desc yoga_c630_psy_bat_psy_desc_mA = …;
static const struct power_supply_desc yoga_c630_psy_bat_psy_desc_mWh = …;
static int yoga_c630_psy_adpt_get_property(struct power_supply *psy,
enum power_supply_property psp,
union power_supply_propval *val)
{ … }
static enum power_supply_property yoga_c630_psy_adpt_properties[] = …;
static const enum power_supply_usb_type yoga_c630_psy_adpt_usb_type[] = …;
static const struct power_supply_desc yoga_c630_psy_adpt_psy_desc = …;
static int yoga_c630_psy_register_bat_psy(struct yoga_c630_psy *ecbat)
{ … }
static void yoga_c630_ec_refresh_bat_info(struct yoga_c630_psy *ecbat)
{ … }
static int yoga_c630_psy_notify(struct notifier_block *nb,
unsigned long action, void *data)
{ … }
static int yoga_c630_psy_probe(struct auxiliary_device *adev,
const struct auxiliary_device_id *id)
{ … }
static void yoga_c630_psy_remove(struct auxiliary_device *adev)
{ … }
static const struct auxiliary_device_id yoga_c630_psy_id_table[] = …;
MODULE_DEVICE_TABLE(auxiliary, yoga_c630_psy_id_table);
static struct auxiliary_driver yoga_c630_psy_driver = …;
module_auxiliary_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;