#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/power_supply.h>
#include <linux/slab.h>
#include <linux/greybus.h>
#define PROP_MAX …
struct gb_power_supply_prop { … };
struct gb_power_supply { … };
struct gb_power_supplies { … };
#define to_gb_power_supply(x) …
#ifndef POWER_SUPPLY_PROP_VOLTAGE_BOOT
#define POWER_SUPPLY_PROP_VOLTAGE_BOOT …
#endif
#ifndef POWER_SUPPLY_PROP_CURRENT_BOOT
#define POWER_SUPPLY_PROP_CURRENT_BOOT …
#endif
#ifndef POWER_SUPPLY_PROP_CALIBRATE
#define POWER_SUPPLY_PROP_CALIBRATE …
#endif
static unsigned int cache_time = …;
static unsigned int update_interval_init = …;
static unsigned int update_interval_max = …;
struct gb_power_supply_changes { … };
static void gb_power_supply_state_change(struct gb_power_supply *gbpsy,
struct gb_power_supply_prop *prop);
static const struct gb_power_supply_changes psy_props_changes[] = …;
static int get_psp_from_gb_prop(int gb_prop, enum power_supply_property *psp)
{ … }
static struct gb_connection *get_conn_from_psy(struct gb_power_supply *gbpsy)
{ … }
static struct gb_power_supply_prop *get_psy_prop(struct gb_power_supply *gbpsy,
enum power_supply_property psp)
{ … }
static int is_psy_prop_writeable(struct gb_power_supply *gbpsy,
enum power_supply_property psp)
{ … }
static int is_prop_valint(enum power_supply_property psp)
{ … }
static void next_interval(struct gb_power_supply *gbpsy)
{ … }
static void __gb_power_supply_changed(struct gb_power_supply *gbpsy)
{ … }
static void gb_power_supply_state_change(struct gb_power_supply *gbpsy,
struct gb_power_supply_prop *prop)
{ … }
static void check_changed(struct gb_power_supply *gbpsy,
struct gb_power_supply_prop *prop)
{ … }
static int total_props(struct gb_power_supply *gbpsy)
{ … }
static void prop_append(struct gb_power_supply *gbpsy,
enum power_supply_property prop)
{ … }
static int __gb_power_supply_set_name(char *init_name, char *name, size_t len)
{ … }
static void _gb_power_supply_append_props(struct gb_power_supply *gbpsy)
{ … }
static int gb_power_supply_description_get(struct gb_power_supply *gbpsy)
{ … }
static int gb_power_supply_prop_descriptors_get(struct gb_power_supply *gbpsy)
{ … }
static int __gb_power_supply_property_update(struct gb_power_supply *gbpsy,
enum power_supply_property psp)
{ … }
static int __gb_power_supply_property_get(struct gb_power_supply *gbpsy,
enum power_supply_property psp,
union power_supply_propval *val)
{ … }
static int __gb_power_supply_property_strval_get(struct gb_power_supply *gbpsy,
enum power_supply_property psp,
union power_supply_propval *val)
{ … }
static int _gb_power_supply_property_get(struct gb_power_supply *gbpsy,
enum power_supply_property psp,
union power_supply_propval *val)
{ … }
static int is_cache_valid(struct gb_power_supply *gbpsy)
{ … }
static int gb_power_supply_status_get(struct gb_power_supply *gbpsy)
{ … }
static void gb_power_supply_status_update(struct gb_power_supply *gbpsy)
{ … }
static void gb_power_supply_work(struct work_struct *work)
{ … }
static int get_property(struct power_supply *b,
enum power_supply_property psp,
union power_supply_propval *val)
{ … }
static int gb_power_supply_property_set(struct gb_power_supply *gbpsy,
enum power_supply_property psp,
int val)
{ … }
static int set_property(struct power_supply *b,
enum power_supply_property psp,
const union power_supply_propval *val)
{ … }
static int property_is_writeable(struct power_supply *b,
enum power_supply_property psp)
{ … }
static int gb_power_supply_register(struct gb_power_supply *gbpsy)
{ … }
static void _gb_power_supply_free(struct gb_power_supply *gbpsy)
{ … }
static void _gb_power_supply_release(struct gb_power_supply *gbpsy)
{ … }
static void _gb_power_supplies_release(struct gb_power_supplies *supplies)
{ … }
static int gb_power_supplies_get_count(struct gb_power_supplies *supplies)
{ … }
static int gb_power_supply_config(struct gb_power_supplies *supplies, int id)
{ … }
static int gb_power_supply_enable(struct gb_power_supply *gbpsy)
{ … }
static int gb_power_supplies_setup(struct gb_power_supplies *supplies)
{ … }
static int gb_power_supplies_register(struct gb_power_supplies *supplies)
{ … }
static int gb_supplies_request_handler(struct gb_operation *op)
{ … }
static int gb_power_supply_probe(struct gb_bundle *bundle,
const struct greybus_bundle_id *id)
{ … }
static void gb_power_supply_disconnect(struct gb_bundle *bundle)
{ … }
static const struct greybus_bundle_id gb_power_supply_id_table[] = …;
MODULE_DEVICE_TABLE(greybus, gb_power_supply_id_table);
static struct greybus_driver gb_power_supply_driver = …;
module_greybus_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;