Loading drivers/bus/mhi/core/mhi_init.c +14 −0 Original line number Diff line number Diff line Loading @@ -352,6 +352,11 @@ static int mhi_init_debugfs_mhi_chan_open(struct inode *inode, struct file *fp) return single_open(fp, mhi_debugfs_mhi_chan_show, inode->i_private); } static int mhi_init_debugfs_mhi_vote_open(struct inode *inode, struct file *fp) { return single_open(fp, mhi_debugfs_mhi_vote_show, inode->i_private); } static const struct file_operations debugfs_state_ops = { .open = mhi_init_debugfs_mhi_states_open, .release = single_release, Loading @@ -370,6 +375,12 @@ static const struct file_operations debugfs_chan_ops = { .read = seq_read, }; static const struct file_operations debugfs_vote_ops = { .open = mhi_init_debugfs_mhi_vote_open, .release = single_release, .read = seq_read, }; DEFINE_DEBUGFS_ATTRIBUTE(debugfs_trigger_reset_fops, NULL, mhi_debugfs_trigger_reset, "%llu\n"); Loading @@ -395,6 +406,8 @@ void mhi_init_debugfs(struct mhi_controller *mhi_cntrl) &debugfs_ev_ops); debugfs_create_file_unsafe("chan", 0444, dentry, mhi_cntrl, &debugfs_chan_ops); debugfs_create_file_unsafe("vote", 0444, dentry, mhi_cntrl, &debugfs_vote_ops); debugfs_create_file_unsafe("reset", 0444, dentry, mhi_cntrl, &debugfs_trigger_reset_fops); mhi_cntrl->dentry = dentry; Loading Loading @@ -1474,6 +1487,7 @@ int of_register_mhi_controller(struct mhi_controller *mhi_cntrl) } mhi_dev->dev_type = MHI_CONTROLLER_TYPE; mhi_dev->chan_name = mhi_cntrl->name; mhi_dev->mhi_cntrl = mhi_cntrl; dev_set_name(&mhi_dev->dev, "%04x_%02u.%02u.%02u", mhi_dev->dev_id, mhi_dev->domain, mhi_dev->bus, mhi_dev->slot); Loading drivers/bus/mhi/core/mhi_internal.h +1 −0 Original line number Diff line number Diff line Loading @@ -752,6 +752,7 @@ extern struct mhi_bus mhi_bus; struct mhi_controller *find_mhi_controller_by_name(const char *name); /* debug fs related functions */ int mhi_debugfs_mhi_vote_show(struct seq_file *m, void *d); int mhi_debugfs_mhi_chan_show(struct seq_file *m, void *d); int mhi_debugfs_mhi_event_show(struct seq_file *m, void *d); int mhi_debugfs_mhi_states_show(struct seq_file *m, void *d); Loading drivers/bus/mhi/core/mhi_main.c +43 −0 Original line number Diff line number Diff line Loading @@ -2270,6 +2270,49 @@ int mhi_debugfs_mhi_chan_show(struct seq_file *m, void *d) return 0; } /* show bus/device votes for a specific device */ int mhi_device_vote_show(struct device *dev, void *data) { struct mhi_device *mhi_dev; struct mhi_controller *mhi_cntrl; if (dev->bus != &mhi_bus_type) return 0; mhi_dev = to_mhi_device(dev); mhi_cntrl = mhi_dev->mhi_cntrl; /* we dont care about timesync or similar special devices */ if (mhi_dev->dev_type == MHI_TIMESYNC_TYPE) return 0; seq_printf((struct seq_file *)data, "%s: device:%u, bus:%u\n", mhi_dev->chan_name, atomic_read(&mhi_dev->dev_vote), atomic_read(&mhi_dev->bus_vote)); return 0; } int mhi_debugfs_mhi_vote_show(struct seq_file *m, void *d) { struct mhi_controller *mhi_cntrl = m->private; struct mhi_device *mhi_dev; if (!mhi_cntrl) return 0; mhi_dev = mhi_cntrl->mhi_dev; seq_printf(m, "At %llu ns:\n", sched_clock()); seq_printf(m, "%s: device:%u, bus:%u\n", mhi_dev->chan_name, atomic_read(&mhi_dev->dev_vote), atomic_read(&mhi_dev->bus_vote)); device_for_each_child(mhi_cntrl->dev, m, mhi_device_vote_show); return 0; } /* move channel to start state */ int mhi_prepare_for_transfer(struct mhi_device *mhi_dev) { Loading Loading
drivers/bus/mhi/core/mhi_init.c +14 −0 Original line number Diff line number Diff line Loading @@ -352,6 +352,11 @@ static int mhi_init_debugfs_mhi_chan_open(struct inode *inode, struct file *fp) return single_open(fp, mhi_debugfs_mhi_chan_show, inode->i_private); } static int mhi_init_debugfs_mhi_vote_open(struct inode *inode, struct file *fp) { return single_open(fp, mhi_debugfs_mhi_vote_show, inode->i_private); } static const struct file_operations debugfs_state_ops = { .open = mhi_init_debugfs_mhi_states_open, .release = single_release, Loading @@ -370,6 +375,12 @@ static const struct file_operations debugfs_chan_ops = { .read = seq_read, }; static const struct file_operations debugfs_vote_ops = { .open = mhi_init_debugfs_mhi_vote_open, .release = single_release, .read = seq_read, }; DEFINE_DEBUGFS_ATTRIBUTE(debugfs_trigger_reset_fops, NULL, mhi_debugfs_trigger_reset, "%llu\n"); Loading @@ -395,6 +406,8 @@ void mhi_init_debugfs(struct mhi_controller *mhi_cntrl) &debugfs_ev_ops); debugfs_create_file_unsafe("chan", 0444, dentry, mhi_cntrl, &debugfs_chan_ops); debugfs_create_file_unsafe("vote", 0444, dentry, mhi_cntrl, &debugfs_vote_ops); debugfs_create_file_unsafe("reset", 0444, dentry, mhi_cntrl, &debugfs_trigger_reset_fops); mhi_cntrl->dentry = dentry; Loading Loading @@ -1474,6 +1487,7 @@ int of_register_mhi_controller(struct mhi_controller *mhi_cntrl) } mhi_dev->dev_type = MHI_CONTROLLER_TYPE; mhi_dev->chan_name = mhi_cntrl->name; mhi_dev->mhi_cntrl = mhi_cntrl; dev_set_name(&mhi_dev->dev, "%04x_%02u.%02u.%02u", mhi_dev->dev_id, mhi_dev->domain, mhi_dev->bus, mhi_dev->slot); Loading
drivers/bus/mhi/core/mhi_internal.h +1 −0 Original line number Diff line number Diff line Loading @@ -752,6 +752,7 @@ extern struct mhi_bus mhi_bus; struct mhi_controller *find_mhi_controller_by_name(const char *name); /* debug fs related functions */ int mhi_debugfs_mhi_vote_show(struct seq_file *m, void *d); int mhi_debugfs_mhi_chan_show(struct seq_file *m, void *d); int mhi_debugfs_mhi_event_show(struct seq_file *m, void *d); int mhi_debugfs_mhi_states_show(struct seq_file *m, void *d); Loading
drivers/bus/mhi/core/mhi_main.c +43 −0 Original line number Diff line number Diff line Loading @@ -2270,6 +2270,49 @@ int mhi_debugfs_mhi_chan_show(struct seq_file *m, void *d) return 0; } /* show bus/device votes for a specific device */ int mhi_device_vote_show(struct device *dev, void *data) { struct mhi_device *mhi_dev; struct mhi_controller *mhi_cntrl; if (dev->bus != &mhi_bus_type) return 0; mhi_dev = to_mhi_device(dev); mhi_cntrl = mhi_dev->mhi_cntrl; /* we dont care about timesync or similar special devices */ if (mhi_dev->dev_type == MHI_TIMESYNC_TYPE) return 0; seq_printf((struct seq_file *)data, "%s: device:%u, bus:%u\n", mhi_dev->chan_name, atomic_read(&mhi_dev->dev_vote), atomic_read(&mhi_dev->bus_vote)); return 0; } int mhi_debugfs_mhi_vote_show(struct seq_file *m, void *d) { struct mhi_controller *mhi_cntrl = m->private; struct mhi_device *mhi_dev; if (!mhi_cntrl) return 0; mhi_dev = mhi_cntrl->mhi_dev; seq_printf(m, "At %llu ns:\n", sched_clock()); seq_printf(m, "%s: device:%u, bus:%u\n", mhi_dev->chan_name, atomic_read(&mhi_dev->dev_vote), atomic_read(&mhi_dev->bus_vote)); device_for_each_child(mhi_cntrl->dev, m, mhi_device_vote_show); return 0; } /* move channel to start state */ int mhi_prepare_for_transfer(struct mhi_device *mhi_dev) { Loading