Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | drivers/bus/fsl-mc/mc-io.c |
static int fsl_mc_io_set_dpmcp(struct fsl_mc_io *mc_io,
struct fsl_mc_device *dpmcp_dev) {
int error;
if (mc_io->dpmcp_dev)
return -EINVAL;
if (dpmcp_dev->mc_io)
return -EINVAL;
error = dpmcp_open(mc_io, 0, dpmcp_dev->obj_desc.id, &dpmcp_dev->mc_handle);
if (error < ... | [
0,
0
] |
Linux Kernel | drivers/bus/fsl-mc/mc-io.c | void fsl_destroy_mc_io(struct fsl_mc_io *mc_io) {
struct fsl_mc_device *dpmcp_dev;
if (!mc_io)
return;
dpmcp_dev = mc_io->dpmcp_dev;
if (dpmcp_dev)
fsl_mc_io_unset_dpmcp(mc_io);
devm_iounmap(mc_io->dev, mc_io->portal_virt_addr);
devm_release_mem_region(mc_io->dev, mc_io->portal_phys_addr,
... | [
0,
0
] |
Linux Kernel | drivers/bus/fsl-mc/mc-io.c | void fsl_mc_portal_free(struct fsl_mc_io *mc_io) {
struct fsl_mc_device *dpmcp_dev;
struct fsl_mc_resource *resource;
dpmcp_dev = mc_io->dpmcp_dev;
resource = dpmcp_dev->resource;
if (!resource || resource->type != FSL_MC_POOL_DPMCP)
return;
if (resource->data != dpmcp_dev)
return;
fsl_destroy... | [
1,
0
] |
Linux Kernel | drivers/bus/fsl-mc/mc-io.c | int fsl_mc_portal_reset(struct fsl_mc_io *mc_io) {
int error;
struct fsl_mc_device *dpmcp_dev = mc_io->dpmcp_dev;
error = dpmcp_reset(mc_io, 0, dpmcp_dev->mc_handle);
if (error < 0) {
dev_err(&dpmcp_dev->dev, "dpmcp_reset() failed: %d\n", error);
return error;
}
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/bus/fsl-mc/mc-sys.c |
static const char *mc_status_to_string(enum mc_cmd_status status) {
static const char *const status_strings[] = {
[MC_CMD_STATUS_OK] = "Command completed successfully",
[MC_CMD_STATUS_READY] = "Command ready to be processed",
[MC_CMD_STATUS_AUTH_ERR] = "Authentication error",
[MC_CMD_STATUS_N... | [
1,
0
] |
Linux Kernel | drivers/bus/fsl-mc/mc-sys.c | static inline enum mc_cmd_status
mc_read_response(struct fsl_mc_command __iomem *portal,
struct fsl_mc_command *resp) {
int i;
enum mc_cmd_status status;
resp->header = cpu_to_le64(readq_relaxed(&portal->header));
status = mc_cmd_hdr_read_status(resp);
if (status != MC_CMD_STATUS_OK)
ret... | [
0,
0
] |
Linux Kernel | drivers/bus/fsl-mc/obj-api.c | int fsl_mc_obj_open(struct fsl_mc_io *mc_io, u32 cmd_flags, int obj_id,
char *obj_type, u16 *token) {
struct fsl_mc_command cmd = {0};
struct fsl_mc_obj_cmd_open *cmd_params;
int err = 0;
int cmd_id = fsl_mc_get_open_cmd_id(obj_type);
if (cmd_id == -1)
return -ENODEV;
cmd.header = ... | [
0,
0
] |
Linux Kernel | drivers/bus/hisi_lpc.c | static int hisi_lpc_acpi_set_io_res(struct acpi_device *adev,
struct device *hostdev,
const struct resource **res, int *num_res) {
struct acpi_device *host = to_acpi_device(adev->dev.parent);
struct resource_entry *rentry;
LIST_HEAD(resource_... | [
1,
0
] |
Linux Kernel | drivers/bus/hisi_lpc.c |
static int hisi_lpc_acpi_clear_enumerated(struct acpi_device *adev,
void *not_used) {
acpi_device_clear_enumerated(adev);
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/bus/hisi_lpc.c | static void hisi_lpc_acpi_remove(struct device *hostdev) {}
#endif | [
0,
0
] |
Linux Kernel | drivers/bus/imx-weim.c |
static int weim_parse_dt(struct platform_device *pdev) {
const struct of_device_id *of_id = of_match_device(weim_id_table, &pdev->dev);
const struct imx_weim_devtype *devtype = of_id->data;
struct device_node *child;
int ret, have_child = 0;
struct weim_priv *priv;
void __iomem *base;
u32 reg;
if (dev... | [
0,
0
] |
Linux Kernel | drivers/bus/imx-weim.c | static int weim_probe(struct platform_device *pdev) {
struct weim_priv *priv;
struct resource *res;
struct clk *clk;
void __iomem *base;
int ret;
priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
if (!priv)
return -ENOMEM;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
base = de... | [
1,
0
] |
Linux Kernel | drivers/bus/imx-weim.c | static void __exit weim_exit(void) {
#if IS_ENABLED(CONFIG_OF_DYNAMIC)
of_reconfig_notifier_unregister(&weim_of_notifier);
#endif
return platform_driver_unregister(&weim_driver);
} | [
0,
0
] |
Linux Kernel | drivers/bus/mhi/ep/main.c |
int mhi_ep_send_state_change_event(struct mhi_ep_cntrl *mhi_cntrl,
enum mhi_state state) {
struct mhi_ring_element event = {};
event.dword[0] = MHI_SC_EV_DWORD0(state);
event.dword[1] = MHI_SC_EV_DWORD1(MHI_PKT_TYPE_STATE_CHANGE_EVENT);
return mhi_ep_send_event(mhi_cntrl, 0... | [
0,
0
] |
Linux Kernel | drivers/bus/mhi/ep/main.c |
static int mhi_ep_send_cmd_comp_event(struct mhi_ep_cntrl *mhi_cntrl,
enum mhi_ev_ccs code) {
struct mhi_ep_ring *ring = &mhi_cntrl->mhi_cmd->ring;
struct mhi_ring_element event = {};
event.ptr = cpu_to_le64(ring->rbase +
ring->rd_offset * sizeof(s... | [
1,
0
] |
Linux Kernel | drivers/bus/mhi/ep/main.c | static void mhi_ep_enable_int(struct mhi_ep_cntrl *mhi_cntrl) {
mhi_ep_mmio_enable_ctrl_interrupt(mhi_cntrl);
mhi_ep_mmio_enable_cmdb_interrupt(mhi_cntrl);
} | [
0,
0
] |
Linux Kernel | drivers/bus/mhi/ep/main.c |
static void mhi_ep_state_worker(struct work_struct *work) {
struct mhi_ep_cntrl *mhi_cntrl =
container_of(work, struct mhi_ep_cntrl, state_work);
struct device *dev = &mhi_cntrl->mhi_dev->dev;
struct mhi_ep_state_transition *itr, *tmp;
unsigned long flags;
LIST_HEAD(head);
int ret;
spin_lock_irqsa... | [
0,
0
] |
Linux Kernel | drivers/bus/mhi/ep/main.c | static void mhi_ep_queue_channel_db(struct mhi_ep_cntrl *mhi_cntrl,
unsigned long ch_int, u32 ch_idx) {
struct mhi_ep_ring_item *item;
struct mhi_ep_ring *ring;
bool work = !!ch_int;
LIST_HEAD(head);
u32 i;
for_each_set_bit(i, &ch_int, 32) {
/* Channel index varies f... | [
0,
0
] |
Linux Kernel | drivers/bus/mhi/ep/main.c | int mhi_ep_power_up(struct mhi_ep_cntrl *mhi_cntrl) {
struct device *dev = &mhi_cntrl->mhi_dev->dev;
int ret, i;
mhi_ep_mmio_mask_interrupts(mhi_cntrl);
mhi_ep_mmio_init(mhi_cntrl);
mhi_cntrl->mhi_event = kzalloc(
mhi_cntrl->event_rings * (sizeof(*mhi_cntrl->mhi_event)), GFP_KERNEL);
if (!mhi_cntrl-... | [
0,
0
] |
Linux Kernel | drivers/bus/mhi/ep/main.c | void mhi_ep_resume_channels(struct mhi_ep_cntrl *mhi_cntrl) {
struct mhi_ep_chan *mhi_chan;
u32 tmp;
int i;
for (i = 0; i < mhi_cntrl->max_chan; i++) {
mhi_chan = &mhi_cntrl->mhi_chan[i];
if (!mhi_chan->mhi_dev)
continue;
mutex_lock(&mhi_chan->lock);
tmp = le32_to_cpu(mhi_cntrl->ch_ctx... | [
0,
0
] |
Linux Kernel | drivers/bus/mhi/ep/main.c | void mhi_ep_unregister_controller(struct mhi_ep_cntrl *mhi_cntrl) {
struct mhi_ep_device *mhi_dev = mhi_cntrl->mhi_dev;
destroy_workqueue(mhi_cntrl->wq);
free_irq(mhi_cntrl->irq, mhi_cntrl);
kfree(mhi_cntrl->mhi_cmd);
kfree(mhi_cntrl->mhi_chan);
device_del(&mhi_dev->dev);
put_device(&mhi_dev->dev);
... | [
0,
0
] |
Linux Kernel | drivers/bus/mhi/ep/main.c | int __mhi_ep_driver_register(struct mhi_ep_driver *mhi_drv,
struct module *owner) {
struct device_driver *driver = &mhi_drv->driver;
if (!mhi_drv->probe || !mhi_drv->remove)
return -EINVAL;
if (!mhi_drv->ul_xfer_cb || !mhi_drv->dl_xfer_cb)
return -EINVAL;
driver->bus = &m... | [
0,
0
] |
Linux Kernel | drivers/bus/mhi/ep/main.c |
static int __init mhi_ep_init(void) { return bus_register(&mhi_ep_bus_type); } | [
0,
0
] |
Linux Kernel | drivers/bus/mhi/ep/mmio.c |
static void mhi_ep_mmio_set_chdb_interrupts(struct mhi_ep_cntrl *mhi_cntrl,
bool enable) {
u32 val, i;
val = enable ? MHI_CHDB_INT_MASK_n_EN_ALL : 0;
for (i = 0; i < MHI_MASK_ROWS_CH_DB; i++) {
mhi_ep_mmio_write(mhi_cntrl, MHI_CHDB_INT_MASK_n(i), val);
mhi_cn... | [
0,
0
] |
Linux Kernel | drivers/bus/mhi/ep/mmio.c |
void mhi_ep_mmio_mask_interrupts(struct mhi_ep_cntrl *mhi_cntrl) {
mhi_ep_mmio_disable_ctrl_interrupt(mhi_cntrl);
mhi_ep_mmio_disable_cmdb_interrupt(mhi_cntrl);
mhi_ep_mmio_mask_chdb_interrupts(mhi_cntrl);
mhi_ep_mmio_mask_erdb_interrupts(mhi_cntrl);
} | [
0,
0
] |
Linux Kernel | drivers/bus/mhi/ep/mmio.c |
void mhi_ep_mmio_get_erc_base(struct mhi_ep_cntrl *mhi_cntrl) {
u32 regval;
regval = mhi_ep_mmio_read(mhi_cntrl, EP_ECABAP_HIGHER);
mhi_cntrl->ev_ctx_host_pa = regval;
mhi_cntrl->ev_ctx_host_pa <<= 32;
regval = mhi_ep_mmio_read(mhi_cntrl, EP_ECABAP_LOWER);
mhi_cntrl->ev_ctx_host_pa |= regval;
} | [
1,
0
] |
Linux Kernel | drivers/bus/mhi/ep/ring.c |
static u32 mhi_ep_ring_num_elems(struct mhi_ep_ring *ring) {
__le64 rlen;
memcpy_fromio(&rlen, (void __iomem *)&ring->ring_ctx->generic.rlen,
sizeof(u64));
return le64_to_cpu(rlen) / sizeof(struct mhi_ring_element);
} | [
1,
0
] |
Linux Kernel | drivers/bus/mhi/ep/ring.c | static int __mhi_ep_cache_ring(struct mhi_ep_ring *ring, size_t end) {
struct mhi_ep_cntrl *mhi_cntrl = ring->mhi_cntrl;
struct device *dev = &mhi_cntrl->mhi_dev->dev;
size_t start, copy_size;
int ret;
if (ring->type == RING_TYPE_ER)
return 0;
/* No need to cache the ring if write pointer is unmodifie... | [
1,
0
] |
Linux Kernel | drivers/bus/mhi/ep/ring.c |
int mhi_ep_update_wr_offset(struct mhi_ep_ring *ring) {
u64 wr_ptr;
wr_ptr = mhi_ep_mmio_get_db(ring);
return mhi_ep_cache_ring(ring, wr_ptr);
} | [
0,
0
] |
Linux Kernel | drivers/bus/mhi/ep/ring.c | int mhi_ep_ring_add_element(struct mhi_ep_ring *ring,
struct mhi_ring_element *el) {
struct mhi_ep_cntrl *mhi_cntrl = ring->mhi_cntrl;
struct device *dev = &mhi_cntrl->mhi_dev->dev;
size_t old_offset = 0;
u32 num_free_elem;
__le64 rp;
int ret;
ret = mhi_ep_update_wr_offset(rin... | [
1,
1
] |
Linux Kernel | drivers/bus/mhi/ep/ring.c | int mhi_ep_ring_start(struct mhi_ep_cntrl *mhi_cntrl, struct mhi_ep_ring *ring,
union mhi_ep_ring_ctx *ctx) {
struct device *dev = &mhi_cntrl->mhi_dev->dev;
__le64 val;
int ret;
ring->mhi_cntrl = mhi_cntrl;
ring->ring_ctx = ctx;
ring->ring_size = mhi_ep_ring_num_elems(ring);
memcpy_... | [
1,
0
] |
Linux Kernel | drivers/bus/mhi/ep/ring.c |
void mhi_ep_ring_reset(struct mhi_ep_cntrl *mhi_cntrl,
struct mhi_ep_ring *ring) {
ring->started = false;
kfree(ring->ring_cache);
ring->ring_cache = NULL;
} | [
0,
0
] |
Linux Kernel | drivers/bus/mhi/ep/sm.c | int mhi_ep_set_m0_state(struct mhi_ep_cntrl *mhi_cntrl) {
struct device *dev = &mhi_cntrl->mhi_dev->dev;
enum mhi_state old_state;
int ret;
spin_lock_bh(&mhi_cntrl->state_lock);
old_state = mhi_cntrl->mhi_state;
if (old_state == MHI_STATE_M3)
mhi_ep_resume_channels(mhi_cntrl);
ret = mhi_ep_set_mhi_s... | [
0,
0
] |
Linux Kernel | drivers/bus/mhi/ep/sm.c | int mhi_ep_set_m3_state(struct mhi_ep_cntrl *mhi_cntrl) {
struct device *dev = &mhi_cntrl->mhi_dev->dev;
int ret;
spin_lock_bh(&mhi_cntrl->state_lock);
ret = mhi_ep_set_mhi_state(mhi_cntrl, MHI_STATE_M3);
spin_unlock_bh(&mhi_cntrl->state_lock);
if (ret) {
mhi_ep_handle_syserr(mhi_cntrl);
return re... | [
0,
0
] |
Linux Kernel | drivers/bus/mhi/host/boot.c | int mhi_download_rddm_image(struct mhi_controller *mhi_cntrl, bool in_panic) {
void __iomem *base = mhi_cntrl->bhie;
struct device *dev = &mhi_cntrl->mhi_dev->dev;
u32 rx_status;
if (in_panic)
return __mhi_download_rddm_in_panic(mhi_cntrl);
dev_dbg(dev, "Waiting for RDDM image download via BHIe\n");
... | [
0,
0
] |
Linux Kernel | drivers/bus/mhi/host/boot.c |
void mhi_free_bhie_table(struct mhi_controller *mhi_cntrl,
struct image_info *image_info) {
int i;
struct mhi_buf *mhi_buf = image_info->mhi_buf;
for (i = 0; i < image_info->entries; i++, mhi_buf++)
dma_free_coherent(mhi_cntrl->cntrl_dev, mhi_buf->len, mhi_buf->buf,
... | [
0,
0
] |
Linux Kernel | drivers/bus/mhi/host/boot.c | int mhi_download_amss_image(struct mhi_controller *mhi_cntrl) {
struct image_info *image_info = mhi_cntrl->fbc_image;
struct device *dev = &mhi_cntrl->mhi_dev->dev;
int ret;
if (!image_info)
return -EIO;
ret = mhi_fw_load_bhie(mhi_cntrl,
&image_info->mhi_buf[image_info->entries... | [
1,
0
] |
Linux Kernel | drivers/bus/mhi/host/debugfs.c | static int mhi_debugfs_states_show(struct seq_file *m, void *d) {
struct mhi_controller *mhi_cntrl = m->private;
seq_printf(m, "PM state: %s Device: %s MHI state: %s EE: %s wake: %s\n",
to_mhi_pm_state_str(mhi_cntrl->pm_state),
mhi_is_active(mhi_cntrl) ? "Active" : "Inactive",
... | [
1,
0
] |
Linux Kernel | drivers/bus/mhi/host/debugfs.c | static int mhi_debugfs_devices_show(struct seq_file *m, void *d) {
struct mhi_controller *mhi_cntrl = m->private;
if (!mhi_is_active(mhi_cntrl)) {
seq_puts(m, "Device not ready\n");
return -ENODEV;
}
mhi_device_info_show(&mhi_cntrl->mhi_dev->dev, m);
device_for_each_child(&mhi_cntrl->mhi_dev->dev, m... | [
0,
0
] |
Linux Kernel | drivers/bus/mhi/host/debugfs.c |
static ssize_t mhi_debugfs_timeout_ms_write(struct file *file,
const char __user *ubuf,
size_t count, loff_t *ppos) {
struct seq_file *m = file->private_data;
struct mhi_controller *mhi_cntrl = m->private;
u32 timeout_ms;
... | [
0,
0
] |
Linux Kernel | drivers/bus/mhi/host/debugfs.c |
static int mhi_debugfs_states_open(struct inode *inode, struct file *fp) {
return single_open(fp, mhi_debugfs_states_show, inode->i_private);
} | [
0,
0
] |
Linux Kernel | drivers/bus/mhi/host/debugfs.c |
static int mhi_debugfs_regdump_open(struct inode *inode, struct file *fp) {
return single_open(fp, mhi_debugfs_regdump_show, inode->i_private);
} | [
0,
0
] |
Linux Kernel | drivers/bus/mhi/host/debugfs.c |
static int mhi_debugfs_timeout_ms_open(struct inode *inode, struct file *fp) {
return single_open(fp, mhi_debugfs_timeout_ms_show, inode->i_private);
} | [
0,
0
] |
Linux Kernel | drivers/bus/mhi/host/debugfs.c |
void mhi_destroy_debugfs(struct mhi_controller *mhi_cntrl) {
debugfs_remove_recursive(mhi_cntrl->debugfs_dentry);
mhi_cntrl->debugfs_dentry = NULL;
} | [
0,
0
] |
Linux Kernel | drivers/bus/mhi/host/debugfs.c |
void mhi_debugfs_init(void) {
mhi_debugfs_root = debugfs_create_dir(mhi_bus_type.name, NULL);
} | [
0,
0
] |
Linux Kernel | drivers/bus/mhi/host/init.c |
const char *to_mhi_pm_state_str(u32 state) {
int index;
if (state)
index = __fls(state);
if (!state || index >= ARRAY_SIZE(mhi_pm_state_str))
return "Invalid State";
return mhi_pm_state_str[index];
} | [
1,
0
] |
Linux Kernel | drivers/bus/mhi/host/init.c |
static ssize_t oem_pk_hash_show(struct device *dev,
struct device_attribute *attr, char *buf) {
struct mhi_device *mhi_dev = to_mhi_device(dev);
struct mhi_controller *mhi_cntrl = mhi_dev->mhi_cntrl;
int i, cnt = 0;
for (i = 0; i < ARRAY_SIZE(mhi_cntrl->oem_pk_hash); i++)
c... | [
0,
0
] |
Linux Kernel | drivers/bus/mhi/host/init.c |
void mhi_driver_unregister(struct mhi_driver *mhi_drv) {
driver_unregister(&mhi_drv->driver);
} | [
0,
0
] |
Linux Kernel | drivers/bus/mhi/host/init.c | static int mhi_match(struct device *dev, struct device_driver *drv) {
struct mhi_device *mhi_dev = to_mhi_device(dev);
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++... | [
1,
0
] |
Linux Kernel | drivers/bus/mhi/host/internal.h |
static inline void mhi_debugfs_exit(void) {}
#endif | [
0,
0
] |
Linux Kernel | drivers/bus/mhi/host/main.c |
int __must_check mhi_poll_reg_field(struct mhi_controller *mhi_cntrl,
void __iomem *base, u32 offset, u32 mask,
u32 val, u32 delayus) {
int ret;
u32 out, retry = (mhi_cntrl->timeout_ms * 1000) / delayus;
while (retry--) {
ret = mhi_read... | [
0,
0
] |
Linux Kernel | drivers/bus/mhi/host/main.c |
void mhi_db_brstmode(struct mhi_controller *mhi_cntrl, struct db_cfg *db_cfg,
void __iomem *db_addr, dma_addr_t db_val) {
if (db_cfg->db_mode) {
db_cfg->db_val = db_val;
mhi_write_db(mhi_cntrl, db_addr, db_val);
db_cfg->db_mode = 0;
}
} | [
0,
0
] |
Linux Kernel | drivers/bus/mhi/host/main.c | void mhi_ring_chan_db(struct mhi_controller *mhi_cntrl,
struct mhi_chan *mhi_chan) {
struct mhi_ring *ring = &mhi_chan->tre_ring;
dma_addr_t db;
db = ring->iommu_base + (ring->wp - ring->base);
dma_wmb();
*ring->ctxt_wp = cpu_to_le64(db);
mhi_chan->db_cfg.process_db(mhi_cntrl, &mhi_... | [
0,
0
] |
Linux Kernel | drivers/bus/mhi/host/main.c |
enum mhi_ee_type mhi_get_exec_env(struct mhi_controller *mhi_cntrl) {
u32 exec;
int ret = mhi_read_reg(mhi_cntrl, mhi_cntrl->bhi, BHI_EXECENV, &exec);
return (ret) ? MHI_EE_MAX : exec;
} | [
0,
0
] |
Linux Kernel | drivers/bus/mhi/host/main.c |
static int get_nr_avail_ring_elements(struct mhi_controller *mhi_cntrl,
struct mhi_ring *ring) {
int nr_el;
if (ring->wp < ring->rp) {
nr_el = ((ring->rp - ring->wp) / ring->el_size) - 1;
} else {
nr_el = (ring->rp - ring->base) / ring->el_size;
nr_el += ((ring-... | [
1,
0
] |
Linux Kernel | drivers/bus/mhi/host/main.c |
static bool is_valid_ring_ptr(struct mhi_ring *ring, dma_addr_t addr) {
return addr >= ring->iommu_base && addr < ring->iommu_base + ring->len;
} | [
1,
0
] |
Linux Kernel | drivers/bus/mhi/host/main.c | int mhi_destroy_device(struct device *dev, void *data) {
struct mhi_chan *ul_chan, *dl_chan;
struct mhi_device *mhi_dev;
struct mhi_controller *mhi_cntrl;
enum mhi_ee_type ee = MHI_EE_MAX;
if (dev->bus != &mhi_bus_type)
return 0;
mhi_dev = to_mhi_device(dev);
mhi_cntrl = mhi_dev->mhi_cntrl;
if (m... | [
1,
0
] |
Linux Kernel | drivers/bus/mhi/host/main.c | irqreturn_t mhi_intvec_handler(int irq_number, void *dev) {
struct mhi_controller *mhi_cntrl = dev;
wake_up_all(&mhi_cntrl->state_event);
return IRQ_WAKE_THREAD;
} | [
0,
0
] |
Linux Kernel | drivers/bus/mhi/host/main.c |
static bool mhi_is_ring_full(struct mhi_controller *mhi_cntrl,
struct mhi_ring *ring) {
void *tmp = ring->wp + ring->el_size;
if (tmp >= (ring->base + ring->len))
tmp = ring->base;
return (tmp == ring->rp);
} | [
0,
0
] |
Linux Kernel | drivers/bus/mhi/host/pci_generic.c |
static void mhi_pci_write_reg(struct mhi_controller *mhi_cntrl,
void __iomem *addr, u32 val) {
writel(val, addr);
} | [
0,
0
] |
Linux Kernel | drivers/bus/mhi/host/pci_generic.c | static void mhi_pci_status_cb(struct mhi_controller *mhi_cntrl,
enum mhi_callback cb) {
struct pci_dev *pdev = to_pci_dev(mhi_cntrl->cntrl_dev);
switch (cb) {
case MHI_CB_FATAL_ERROR:
case MHI_CB_SYS_ERROR:
dev_warn(&pdev->dev, "firmware crashed (%u)\n", cb);
pm_runtime_fo... | [
0,
0
] |
Linux Kernel | drivers/bus/mhi/host/pci_generic.c |
static bool mhi_pci_is_alive(struct mhi_controller *mhi_cntrl) {
struct pci_dev *pdev = to_pci_dev(mhi_cntrl->cntrl_dev);
u16 vendor = 0;
if (pci_read_config_word(pdev, PCI_VENDOR_ID, &vendor))
return false;
if (vendor == (u16)~0 || vendor == 0)
return false;
return true;
} | [
0,
0
] |
Linux Kernel | drivers/bus/mhi/host/pci_generic.c | static int
mhi_pci_get_irqs(struct mhi_controller *mhi_cntrl,
const struct mhi_controller_config *mhi_cntrl_config) {
struct pci_dev *pdev = to_pci_dev(mhi_cntrl->cntrl_dev);
int nr_vectors, i;
int *irq;
mhi_cntrl->nr_irqs = 1 + mhi_cntrl_config->num_events;
nr_vectors = pci_alloc_irq_vecto... | [
1,
0
] |
Linux Kernel | drivers/bus/mhi/host/pci_generic.c | static void mhi_pci_recovery_work(struct work_struct *work) {
struct mhi_pci_device *mhi_pdev =
container_of(work, struct mhi_pci_device, recovery_work);
struct mhi_controller *mhi_cntrl = &mhi_pdev->mhi_cntrl;
struct pci_dev *pdev = to_pci_dev(mhi_cntrl->cntrl_dev);
int err;
dev_warn(&pdev->dev, "devi... | [
0,
0
] |
Linux Kernel | drivers/bus/mhi/host/pci_generic.c | static int __maybe_unused mhi_pci_runtime_suspend(struct device *dev) {
struct pci_dev *pdev = to_pci_dev(dev);
struct mhi_pci_device *mhi_pdev = dev_get_drvdata(dev);
struct mhi_controller *mhi_cntrl = &mhi_pdev->mhi_cntrl;
int err;
if (test_and_set_bit(MHI_PCI_DEV_SUSPENDED, &mhi_pdev->status))
return ... | [
0,
0
] |
Linux Kernel | drivers/bus/mhi/host/pm.c |
enum mhi_pm_state __must_check
mhi_tryset_pm_state(struct mhi_controller *mhi_cntrl, enum mhi_pm_state state) {
unsigned long cur_state = mhi_cntrl->pm_state;
int index = find_last_bit(&cur_state, 32);
if (unlikely(index >= ARRAY_SIZE(dev_state_transitions)))
return cur_state;
if (unlikely(dev_state_tran... | [
1,
0
] |
Linux Kernel | drivers/bus/mhi/host/pm.c |
void mhi_set_mhi_state(struct mhi_controller *mhi_cntrl, enum mhi_state state) {
struct device *dev = &mhi_cntrl->mhi_dev->dev;
int ret;
if (state == MHI_STATE_RESET) {
ret = mhi_write_reg_field(mhi_cntrl, mhi_cntrl->regs, MHICTRL,
MHICTRL_RESET_MASK, 1);
} else {
ret = m... | [
0,
0
] |
Linux Kernel | drivers/bus/mhi/host/pm.c |
int mhi_pm_resume(struct mhi_controller *mhi_cntrl) {
return __mhi_pm_resume(mhi_cntrl, false);
} | [
0,
0
] |
Linux Kernel | drivers/bus/mhi/host/pm.c | static void mhi_deassert_dev_wake(struct mhi_controller *mhi_cntrl,
bool override) {
unsigned long flags;
if (likely(atomic_add_unless(&mhi_cntrl->dev_wake, -1, 1)))
return;
spin_lock_irqsave(&mhi_cntrl->wlock, flags);
if ((atomic_dec_return(&mhi_cntrl->dev_wake) == 0) &&... | [
0,
0
] |
Linux Kernel | drivers/bus/mhi/host/pm.c |
void mhi_device_get(struct mhi_device *mhi_dev) {
struct mhi_controller *mhi_cntrl = mhi_dev->mhi_cntrl;
mhi_dev->dev_wake++;
read_lock_bh(&mhi_cntrl->pm_lock);
if (MHI_PM_IN_SUSPEND_STATE(mhi_cntrl->pm_state))
mhi_trigger_resume(mhi_cntrl);
mhi_cntrl->wake_get(mhi_cntrl, true);
read_unlock_bh(&mhi_c... | [
0,
0
] |
Linux Kernel | drivers/bus/mhi/host/pm.c |
void mhi_device_put(struct mhi_device *mhi_dev) {
struct mhi_controller *mhi_cntrl = mhi_dev->mhi_cntrl;
mhi_dev->dev_wake--;
read_lock_bh(&mhi_cntrl->pm_lock);
if (MHI_PM_IN_SUSPEND_STATE(mhi_cntrl->pm_state))
mhi_trigger_resume(mhi_cntrl);
mhi_cntrl->wake_put(mhi_cntrl, false);
read_unlock_bh(&mhi_... | [
0,
0
] |
Linux Kernel | drivers/bus/mips_cdmm.c | void __iomem *mips_cdmm_early_probe(unsigned int dev_type) {
struct mips_cdmm_bus *bus;
void __iomem *cdmm;
u32 acsr;
unsigned int drb, type, size;
int err;
if (WARN_ON(!dev_type))
return IOMEM_ERR_PTR(-ENODEV);
bus = mips_cdmm_get_bus();
err = mips_cdmm_setup(bus);
if (err)
return IOMEM_ERR... | [
1,
0
] |
Linux Kernel | drivers/bus/moxtet.c |
static inline const char *mox_module_name(unsigned int id) {
if (mox_module_known(id))
return mox_module_table[id].name;
else
return "unknown";
}
#define DEF_MODULE_ATTR(name, fmt, ...) \
static ssize_t module_##name##_show(struct device *dev, ... | [
1,
0
] |
Linux Kernel | drivers/bus/moxtet.c |
static int moxtet_dev_check(struct device *dev, void *data) {
struct moxtet_device *mdev = to_moxtet_device(dev);
struct moxtet_device *new_dev = data;
if (mdev->moxtet == new_dev->moxtet && mdev->id == new_dev->id &&
mdev->idx == new_dev->idx)
return -EBUSY;
return 0;
} | [
1,
0
] |
Linux Kernel | drivers/bus/moxtet.c |
static void moxtet_dev_release(struct device *dev) {
struct moxtet_device *mdev = to_moxtet_device(dev);
put_device(mdev->moxtet->dev);
kfree(mdev);
} | [
0,
0
] |
Linux Kernel | drivers/bus/moxtet.c |
static struct moxtet_device *of_register_moxtet_device(struct moxtet *moxtet,
struct device_node *nc) {
struct moxtet_device *dev;
u32 val;
int ret;
dev = moxtet_alloc_device(moxtet);
if (!dev) {
dev_err(moxtet->dev, "Moxtet device alloc error for %... | [
0,
0
] |
Linux Kernel | drivers/bus/moxtet.c |
static void moxtet_register_devices_from_topology(struct moxtet *moxtet) {
struct moxtet_device *dev;
int i, ret;
for (i = 0; i < moxtet->count; ++i) {
dev = moxtet_alloc_device(moxtet);
if (!dev) {
dev_err(moxtet->dev, "Moxtet device %u alloc error\n", i);
continue;
}
dev->idx = i;... | [
1,
0
] |
Linux Kernel | drivers/bus/moxtet.c | static int moxtet_set_irq(struct moxtet *moxtet, int idx, int id, int nsame) {
int i, first;
struct moxtet_irqpos *pos;
first = mox_module_table[id].hwirq_base + nsame * mox_module_table[id].nirqs;
if (first + mox_module_table[id].nirqs > MOXTET_NIRQS)
return -EINVAL;
for (i = 0; i < mox_module_table[i... | [
0,
0
] |
Linux Kernel | drivers/bus/moxtet.c |
static int moxtet_find_topology(struct moxtet *moxtet) {
u8 buf[TURRIS_MOX_MAX_MODULES];
int cnts[TURRIS_MOX_MODULE_LAST];
int i, ret;
memset(cnts, 0, sizeof(cnts));
ret = spi_read(to_spi_device(moxtet->dev), buf, TURRIS_MOX_MAX_MODULES);
if (ret < 0)
return ret;
if (buf[0] == TURRIS_MOX_CPU_ID_EM... | [
1,
0
] |
Linux Kernel | drivers/bus/moxtet.c |
int moxtet_device_read(struct device *dev) {
struct moxtet_device *mdev = to_moxtet_device(dev);
struct moxtet *moxtet = mdev->moxtet;
u8 buf[TURRIS_MOX_MAX_MODULES];
int ret;
if (mdev->idx >= moxtet->count)
return -EINVAL;
ret = moxtet_spi_read(moxtet, buf);
if (ret < 0)
return ret;
return ... | [
0,
0
] |
Linux Kernel | drivers/bus/moxtet.c |
int moxtet_device_write(struct device *dev, u8 val) {
struct moxtet_device *mdev = to_moxtet_device(dev);
struct moxtet *moxtet = mdev->moxtet;
int ret;
if (mdev->idx >= moxtet->count)
return -EINVAL;
mutex_lock(&moxtet->lock);
moxtet->tx[moxtet->count - mdev->idx] = val;
ret = spi_write(to_spi_d... | [
1,
0
] |
Linux Kernel | drivers/bus/moxtet.c |
int moxtet_device_written(struct device *dev) {
struct moxtet_device *mdev = to_moxtet_device(dev);
struct moxtet *moxtet = mdev->moxtet;
if (mdev->idx >= moxtet->count)
return -EINVAL;
return moxtet->tx[moxtet->count - mdev->idx];
} | [
1,
0
] |
Linux Kernel | drivers/bus/moxtet.c |
static ssize_t input_read(struct file *file, char __user *buf, size_t len,
loff_t *ppos) {
struct moxtet *moxtet = file->private_data;
u8 bin[TURRIS_MOX_MAX_MODULES];
u8 hex[sizeof(bin) * 2 + 1];
int ret, n;
ret = moxtet_spi_read(moxtet, bin);
if (ret < 0)
return ret;
n = ... | [
0,
0
] |
Linux Kernel | drivers/bus/moxtet.c |
static ssize_t output_write(struct file *file, const char __user *buf,
size_t len, loff_t *ppos) {
struct moxtet *moxtet = file->private_data;
u8 bin[TURRIS_MOX_MAX_MODULES];
u8 hex[sizeof(bin) * 2 + 1];
ssize_t res;
loff_t dummy = 0;
int err, i;
if (len > 2 * moxtet->count +... | [
1,
0
] |
Linux Kernel | drivers/bus/moxtet.c |
static int moxtet_register_debugfs(struct moxtet *moxtet) {
struct dentry *root, *entry;
root = debugfs_create_dir("moxtet", NULL);
if (IS_ERR(root))
return PTR_ERR(root);
entry = debugfs_create_file_unsafe("input", 0444, root, moxtet, &input_fops);
if (IS_ERR(entry))
goto err_remove;
entry =
... | [
0,
0
] |
Linux Kernel | drivers/bus/moxtet.c |
static void moxtet_unregister_debugfs(struct moxtet *moxtet) {
debugfs_remove_recursive(moxtet->debugfs_root);
}
#else | [
0,
0
] |
Linux Kernel | drivers/bus/moxtet.c |
static int moxtet_irq_domain_map(struct irq_domain *d, unsigned int irq,
irq_hw_number_t hw) {
struct moxtet *moxtet = d->host_data;
if (hw >= MOXTET_NIRQS || !(moxtet->irq.exists & BIT(hw))) {
dev_err(moxtet->dev, "Invalid hw irq number\n");
return -EINVAL;
}
irq_set... | [
1,
0
] |
Linux Kernel | drivers/bus/moxtet.c |
static int moxtet_irq_domain_xlate(struct irq_domain *d,
struct device_node *ctrlr,
const u32 *intspec, unsigned int intsize,
unsigned long *out_hwirq,
unsigned int *out_type) {
... | [
1,
0
] |
Linux Kernel | drivers/bus/moxtet.c |
static int moxtet_irq_read(struct moxtet *moxtet, unsigned long *map) {
struct moxtet_irqpos *pos = moxtet->irq.position;
u8 buf[TURRIS_MOX_MAX_MODULES];
int i, ret;
ret = moxtet_spi_read(moxtet, buf);
if (ret < 0)
return ret;
*map = 0;
for_each_set_bit(i, &moxtet->irq.exists, MOXTET_NIRQS) {
... | [
0,
0
] |
Linux Kernel | drivers/bus/moxtet.c |
static irqreturn_t moxtet_irq_thread_fn(int irq, void *data) {
struct moxtet *moxtet = data;
unsigned long set;
int nhandled = 0, i, sub_irq, ret;
ret = moxtet_irq_read(moxtet, &set);
if (ret < 0)
goto out;
set &= ~moxtet->irq.masked;
do {
for_each_set_bit(i, &set, MOXTET_NIRQS) {
sub_ir... | [
0,
0
] |
Linux Kernel | drivers/bus/moxtet.c |
static int __init moxtet_init(void) {
int ret;
ret = bus_register(&moxtet_bus_type);
if (ret < 0) {
pr_err("moxtet bus registration failed: %d\n", ret);
goto error;
}
ret = spi_register_driver(&moxtet_spi_driver);
if (ret < 0) {
pr_err("moxtet spi driver registration failed: %d\n", ret);
... | [
0,
0
] |
Linux Kernel | drivers/bus/mvebu-mbus.c | static void mvebu_mbus_read_window(struct mvebu_mbus_state *mbus, int win,
int *enabled, u64 *base, u32 *size,
u8 *target, u8 *attr, u64 *remap) {
void __iomem *addr = mbus->mbuswins_base + mbus->soc->win_cfg_offset(win);
u32 basereg = readl(addr... | [
1,
0
] |
Linux Kernel | drivers/bus/mvebu-mbus.c |
static int mvebu_mbus_find_window(struct mvebu_mbus_state *mbus,
phys_addr_t base, size_t size) {
int win;
for (win = 0; win < mbus->soc->num_wins; win++) {
u64 wbase;
u32 wsize;
int enabled;
mvebu_mbus_read_window(mbus, win, &enabled, &wbase, &wsize, NULL, NULL,... | [
1,
0
] |
Linux Kernel | drivers/bus/mvebu-mbus.c |
static int mvebu_mbus_setup_window(struct mvebu_mbus_state *mbus, int win,
phys_addr_t base, size_t size,
phys_addr_t remap, u8 target, u8 attr) {
void __iomem *addr = mbus->mbuswins_base + mbus->soc->win_cfg_offset(win);
u32 ctrl, remap_addr;
... | [
0,
0
] |
Linux Kernel | drivers/bus/mvebu-mbus.c | static int mvebu_mbus_alloc_window(struct mvebu_mbus_state *mbus,
phys_addr_t base, size_t size,
phys_addr_t remap, u8 target, u8 attr) {
int win;
if (remap == MVEBU_MBUS_NO_REMAP) {
for (win = 0; win < mbus->soc->num_wins; win++) {
if... | [
1,
0
] |
Linux Kernel | drivers/bus/mvebu-mbus.c | static unsigned int armada_370_xp_mbus_win_cfg_offset(int win) {
if (win < 8)
return win << 4;
else
return 0x90 + ((win - 8) << 3);
} | [
0,
0
] |
Linux Kernel | drivers/bus/mvebu-mbus.c |
int mvebu_mbus_save_cpu_target(u32 __iomem *store_addr) {
return mbus_state.soc->save_cpu_target(&mbus_state, store_addr);
} | [
0,
0
] |
Linux Kernel | drivers/bus/mvebu-mbus.c | int mvebu_mbus_get_dram_win_info(phys_addr_t phyaddr, u8 *target, u8 *attr) {
const struct mbus_dram_target_info *dram;
int i;
dram = mv_mbus_dram_info();
if (!dram) {
pr_err("missing DRAM information\n");
return -ENODEV;
}
/* Try to find matching DRAM window for phyaddr */
for (i = 0; i < dram-... | [
0,
0
] |
Linux Kernel | drivers/bus/mvebu-mbus.c | static __init int mvebu_mbus_debugfs_init(void) {
struct mvebu_mbus_state *s = &mbus_state;
if (!s->mbuswins_base)
return 0;
s->debugfs_root = debugfs_create_dir("mvebu-mbus", NULL);
if (s->debugfs_root) {
s->debugfs_sdram = debugfs_create_file("sdram", S_IRUGO, s->debugfs_root,
... | [
0,
0
] |
Linux Kernel | drivers/bus/mvebu-mbus.c | static int __init mbus_parse_ranges(struct device_node *node, int *addr_cells,
int *c_addr_cells, int *c_size_cells,
int *cell_count,
const __be32 **ranges_start,
const __be32 ... | [
1,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.