#ifndef _LINUX_SPMI_H
#define _LINUX_SPMI_H
#include <linux/types.h>
#include <linux/device.h>
#include <linux/mod_devicetable.h>
#define SPMI_MAX_SLAVE_ID …
#define SPMI_CMD_EXT_WRITE …
#define SPMI_CMD_RESET …
#define SPMI_CMD_SLEEP …
#define SPMI_CMD_SHUTDOWN …
#define SPMI_CMD_WAKEUP …
#define SPMI_CMD_AUTHENTICATE …
#define SPMI_CMD_MSTR_READ …
#define SPMI_CMD_MSTR_WRITE …
#define SPMI_CMD_TRANSFER_BUS_OWNERSHIP …
#define SPMI_CMD_DDB_MASTER_READ …
#define SPMI_CMD_DDB_SLAVE_READ …
#define SPMI_CMD_EXT_READ …
#define SPMI_CMD_EXT_WRITEL …
#define SPMI_CMD_EXT_READL …
#define SPMI_CMD_WRITE …
#define SPMI_CMD_READ …
#define SPMI_CMD_ZERO_WRITE …
struct spmi_device { … };
static inline struct spmi_device *to_spmi_device(struct device *d)
{ … }
static inline void *spmi_device_get_drvdata(const struct spmi_device *sdev)
{ … }
static inline void spmi_device_set_drvdata(struct spmi_device *sdev, void *data)
{ … }
struct spmi_device *spmi_device_alloc(struct spmi_controller *ctrl);
static inline void spmi_device_put(struct spmi_device *sdev)
{ … }
int spmi_device_add(struct spmi_device *sdev);
void spmi_device_remove(struct spmi_device *sdev);
struct spmi_controller { … };
static inline struct spmi_controller *to_spmi_controller(struct device *d)
{ … }
static inline
void *spmi_controller_get_drvdata(const struct spmi_controller *ctrl)
{ … }
static inline void spmi_controller_set_drvdata(struct spmi_controller *ctrl,
void *data)
{ … }
struct spmi_controller *spmi_controller_alloc(struct device *parent,
size_t size);
static inline void spmi_controller_put(struct spmi_controller *ctrl)
{ … }
int spmi_controller_add(struct spmi_controller *ctrl);
void spmi_controller_remove(struct spmi_controller *ctrl);
struct spmi_controller *devm_spmi_controller_alloc(struct device *parent, size_t size);
int devm_spmi_controller_add(struct device *parent, struct spmi_controller *ctrl);
struct spmi_driver { … };
static inline struct spmi_driver *to_spmi_driver(struct device_driver *d)
{ … }
#define spmi_driver_register(sdrv) …
int __spmi_driver_register(struct spmi_driver *sdrv, struct module *owner);
static inline void spmi_driver_unregister(struct spmi_driver *sdrv)
{ … }
#define module_spmi_driver(__spmi_driver) …
struct device_node;
struct spmi_device *spmi_find_device_by_of_node(struct device_node *np);
int spmi_register_read(struct spmi_device *sdev, u8 addr, u8 *buf);
int spmi_ext_register_read(struct spmi_device *sdev, u8 addr, u8 *buf,
size_t len);
int spmi_ext_register_readl(struct spmi_device *sdev, u16 addr, u8 *buf,
size_t len);
int spmi_register_write(struct spmi_device *sdev, u8 addr, u8 data);
int spmi_register_zero_write(struct spmi_device *sdev, u8 data);
int spmi_ext_register_write(struct spmi_device *sdev, u8 addr,
const u8 *buf, size_t len);
int spmi_ext_register_writel(struct spmi_device *sdev, u16 addr,
const u8 *buf, size_t len);
int spmi_command_reset(struct spmi_device *sdev);
int spmi_command_sleep(struct spmi_device *sdev);
int spmi_command_wakeup(struct spmi_device *sdev);
int spmi_command_shutdown(struct spmi_device *sdev);
#endif