#include <linux/completion.h>
#include <linux/debugfs.h>
#include <linux/spinlock.h>
#include <linux/mutex.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/workqueue.h>
#include <linux/init.h>
#include <linux/list.h>
#include <linux/regulator/driver.h>
#include <linux/olpc-ec.h>
struct ec_cmd_desc { … };
struct olpc_ec_priv { … };
static struct olpc_ec_driver *ec_driver;
static struct olpc_ec_priv *ec_priv;
static void *ec_cb_arg;
void olpc_ec_driver_register(struct olpc_ec_driver *drv, void *arg)
{ … }
EXPORT_SYMBOL_GPL(…);
static void olpc_ec_worker(struct work_struct *w)
{ … }
static void queue_ec_descriptor(struct ec_cmd_desc *desc,
struct olpc_ec_priv *ec)
{ … }
int olpc_ec_cmd(u8 cmd, u8 *inbuf, size_t inlen, u8 *outbuf, size_t outlen)
{ … }
EXPORT_SYMBOL_GPL(…);
void olpc_ec_wakeup_set(u16 value)
{ … }
EXPORT_SYMBOL_GPL(…);
void olpc_ec_wakeup_clear(u16 value)
{ … }
EXPORT_SYMBOL_GPL(…);
int olpc_ec_mask_write(u16 bits)
{ … }
EXPORT_SYMBOL_GPL(…);
bool olpc_ec_wakeup_available(void)
{ … }
EXPORT_SYMBOL_GPL(…);
int olpc_ec_sci_query(u16 *sci_value)
{ … }
EXPORT_SYMBOL_GPL(…);
#ifdef CONFIG_DEBUG_FS
#define EC_MAX_CMD_ARGS …
#define EC_MAX_CMD_REPLY …
static DEFINE_MUTEX(ec_dbgfs_lock);
static unsigned char ec_dbgfs_resp[EC_MAX_CMD_REPLY];
static unsigned int ec_dbgfs_resp_bytes;
static ssize_t ec_dbgfs_cmd_write(struct file *file, const char __user *buf,
size_t size, loff_t *ppos)
{ … }
static ssize_t ec_dbgfs_cmd_read(struct file *file, char __user *buf,
size_t size, loff_t *ppos)
{ … }
static const struct file_operations ec_dbgfs_ops = …;
static struct dentry *olpc_ec_setup_debugfs(void)
{ … }
#else
static struct dentry *olpc_ec_setup_debugfs(void)
{
return NULL;
}
#endif
static int olpc_ec_set_dcon_power(struct olpc_ec_priv *ec, bool state)
{ … }
static int dcon_regulator_enable(struct regulator_dev *rdev)
{ … }
static int dcon_regulator_disable(struct regulator_dev *rdev)
{ … }
static int dcon_regulator_is_enabled(struct regulator_dev *rdev)
{ … }
static const struct regulator_ops dcon_regulator_ops = …;
static const struct regulator_desc dcon_desc = …;
static int olpc_ec_probe(struct platform_device *pdev)
{ … }
static int olpc_ec_suspend(struct device *dev)
{ … }
static int olpc_ec_resume(struct device *dev)
{ … }
static const struct dev_pm_ops olpc_ec_pm_ops = …;
static struct platform_driver olpc_ec_plat_driver = …;
static int __init olpc_ec_init_module(void)
{ … }
arch_initcall(olpc_ec_init_module);