#include <linux/bitfield.h>
#include <linux/debugfs.h>
#include <linux/device.h>
#include <linux/dma-direction.h>
#include <linux/dma-mapping.h>
#include <linux/idr.h>
#include <linux/interrupt.h>
#include <linux/list.h>
#include <linux/mhi.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <linux/wait.h>
#include "internal.h"
#define CREATE_TRACE_POINTS
#include "trace.h"
static DEFINE_IDA(mhi_controller_ida);
#undef mhi_ee
#undef mhi_ee_end
#define mhi_ee(a, b) …
#define mhi_ee_end(a, b) …
const char * const mhi_ee_str[MHI_EE_MAX] = …;
#undef dev_st_trans
#undef dev_st_trans_end
#define dev_st_trans(a, b) …
#define dev_st_trans_end(a, b) …
const char * const dev_state_tran_str[DEV_ST_TRANSITION_MAX] = …;
#undef ch_state_type
#undef ch_state_type_end
#define ch_state_type(a, b) …
#define ch_state_type_end(a, b) …
const char * const mhi_ch_state_type_str[MHI_CH_STATE_TYPE_MAX] = …;
#undef mhi_pm_state
#undef mhi_pm_state_end
#define mhi_pm_state(a, b) …
#define mhi_pm_state_end(a, b) …
static const char * const mhi_pm_state_str[] = …;
const char *to_mhi_pm_state_str(u32 state)
{ … }
static ssize_t serial_number_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR_RO(serial_number);
static ssize_t oem_pk_hash_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR_RO(oem_pk_hash);
static ssize_t soc_reset_store(struct device *dev,
struct device_attribute *attr,
const char *buf,
size_t count)
{ … }
static DEVICE_ATTR_WO(soc_reset);
static ssize_t trigger_edl_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR_WO(trigger_edl);
static struct attribute *mhi_dev_attrs[] = …;
ATTRIBUTE_GROUPS(…);
static int mhi_alloc_aligned_ring(struct mhi_controller *mhi_cntrl,
struct mhi_ring *ring,
u64 len)
{ … }
void mhi_deinit_free_irq(struct mhi_controller *mhi_cntrl)
{ … }
int mhi_init_irq_setup(struct mhi_controller *mhi_cntrl)
{ … }
void mhi_deinit_dev_ctxt(struct mhi_controller *mhi_cntrl)
{ … }
int mhi_init_dev_ctxt(struct mhi_controller *mhi_cntrl)
{ … }
int mhi_init_mmio(struct mhi_controller *mhi_cntrl)
{ … }
void mhi_deinit_chan_ctxt(struct mhi_controller *mhi_cntrl,
struct mhi_chan *mhi_chan)
{ … }
int mhi_init_chan_ctxt(struct mhi_controller *mhi_cntrl,
struct mhi_chan *mhi_chan)
{ … }
static int parse_ev_cfg(struct mhi_controller *mhi_cntrl,
const struct mhi_controller_config *config)
{ … }
static int parse_ch_cfg(struct mhi_controller *mhi_cntrl,
const struct mhi_controller_config *config)
{ … }
static int parse_config(struct mhi_controller *mhi_cntrl,
const struct mhi_controller_config *config)
{ … }
int mhi_register_controller(struct mhi_controller *mhi_cntrl,
const struct mhi_controller_config *config)
{ … }
EXPORT_SYMBOL_GPL(…);
void mhi_unregister_controller(struct mhi_controller *mhi_cntrl)
{ … }
EXPORT_SYMBOL_GPL(…);
struct mhi_controller *mhi_alloc_controller(void)
{ … }
EXPORT_SYMBOL_GPL(…);
void mhi_free_controller(struct mhi_controller *mhi_cntrl)
{ … }
EXPORT_SYMBOL_GPL(…);
int mhi_prepare_for_power_up(struct mhi_controller *mhi_cntrl)
{ … }
EXPORT_SYMBOL_GPL(…);
void mhi_unprepare_after_power_down(struct mhi_controller *mhi_cntrl)
{ … }
EXPORT_SYMBOL_GPL(…);
static void mhi_release_device(struct device *dev)
{ … }
struct mhi_device *mhi_alloc_device(struct mhi_controller *mhi_cntrl)
{ … }
static int mhi_driver_probe(struct device *dev)
{ … }
static int mhi_driver_remove(struct device *dev)
{ … }
int __mhi_driver_register(struct mhi_driver *mhi_drv, struct module *owner)
{ … }
EXPORT_SYMBOL_GPL(…);
void mhi_driver_unregister(struct mhi_driver *mhi_drv)
{ … }
EXPORT_SYMBOL_GPL(…);
static int mhi_uevent(const struct device *dev, struct kobj_uevent_env *env)
{ … }
static int mhi_match(struct device *dev, const struct device_driver *drv)
{
struct mhi_device *mhi_dev = to_mhi_device(dev);
const struct mhi_driver *mhi_drv = to_mhi_driver(drv);
const struct mhi_device_id *id;
if (mhi_dev->dev_type == MHI_DEVICE_CONTROLLER)
return 0;
for (id = mhi_drv->id_table; id->chan[0]; id++)
if (!strcmp(mhi_dev->name, id->chan)) {
mhi_dev->id = id;
return 1;
}
return 0;
};
struct bus_type mhi_bus_type = …;
static int __init mhi_init(void)
{ … }
static void __exit mhi_exit(void)
{ … }
postcore_initcall(mhi_init);
module_exit(mhi_exit);
MODULE_LICENSE(…) …;
MODULE_DESCRIPTION(…) …;