#include <linux/device.h>
#include <linux/kernel.h>
#include <linux/platform_data/wilco-ec.h>
#include <linux/string.h>
#include <linux/sysfs.h>
#include <linux/types.h>
#define CMD_KB_CMOS …
#define SUB_CMD_KB_CMOS_AUTO_ON …
struct boot_on_ac_request { … } __packed;
#define CMD_USB_CHARGE …
enum usb_charge_op { … };
struct usb_charge_request { … } __packed;
struct usb_charge_response { … } __packed;
#define CMD_EC_INFO …
enum get_ec_info_op { … };
struct get_ec_info_req { … } __packed;
struct get_ec_info_resp { … } __packed;
static ssize_t boot_on_ac_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR_WO(boot_on_ac);
static ssize_t get_info(struct device *dev, char *buf, enum get_ec_info_op op)
{ … }
static ssize_t version_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR_RO(version);
static ssize_t build_revision_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(build_revision);
static ssize_t build_date_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(build_date);
static ssize_t model_number_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(model_number);
static int send_usb_charge(struct wilco_ec_device *ec,
struct usb_charge_request *rq,
struct usb_charge_response *rs)
{ … }
static ssize_t usb_charge_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t usb_charge_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR_RW(usb_charge);
static struct attribute *wilco_dev_attrs[] = …;
static const struct attribute_group wilco_dev_attr_group = …;
int wilco_ec_add_sysfs(struct wilco_ec_device *ec)
{ … }
void wilco_ec_remove_sysfs(struct wilco_ec_device *ec)
{ … }