Lines Matching refs:mhi_cntrl
17 struct mhi_controller *mhi_cntrl = m->private; in mhi_debugfs_states_show() local
21 to_mhi_pm_state_str(mhi_cntrl->pm_state), in mhi_debugfs_states_show()
22 mhi_is_active(mhi_cntrl) ? "Active" : "Inactive", in mhi_debugfs_states_show()
23 TO_MHI_STATE_STR(mhi_cntrl->dev_state), in mhi_debugfs_states_show()
24 TO_MHI_EXEC_STR(mhi_cntrl->ee), in mhi_debugfs_states_show()
25 mhi_cntrl->wake_set ? "true" : "false"); in mhi_debugfs_states_show()
28 seq_printf(m, "M0: %u M2: %u M3: %u", mhi_cntrl->M0, mhi_cntrl->M2, in mhi_debugfs_states_show()
29 mhi_cntrl->M3); in mhi_debugfs_states_show()
32 atomic_read(&mhi_cntrl->dev_wake), in mhi_debugfs_states_show()
33 atomic_read(&mhi_cntrl->pending_pkts)); in mhi_debugfs_states_show()
40 struct mhi_controller *mhi_cntrl = m->private; in mhi_debugfs_events_show() local
45 if (!mhi_is_active(mhi_cntrl)) { in mhi_debugfs_events_show()
50 er_ctxt = mhi_cntrl->mhi_ctxt->er_ctxt; in mhi_debugfs_events_show()
51 mhi_event = mhi_cntrl->mhi_event; in mhi_debugfs_events_show()
52 for (i = 0; i < mhi_cntrl->total_ev_rings; in mhi_debugfs_events_show()
83 struct mhi_controller *mhi_cntrl = m->private; in mhi_debugfs_channels_show() local
88 if (!mhi_is_active(mhi_cntrl)) { in mhi_debugfs_channels_show()
93 mhi_chan = mhi_cntrl->mhi_chan; in mhi_debugfs_channels_show()
94 chan_ctxt = mhi_cntrl->mhi_ctxt->chan_ctxt; in mhi_debugfs_channels_show()
95 for (i = 0; i < mhi_cntrl->max_chan; i++, chan_ctxt++, mhi_chan++) { in mhi_debugfs_channels_show()
155 struct mhi_controller *mhi_cntrl = m->private; in mhi_debugfs_devices_show() local
157 if (!mhi_is_active(mhi_cntrl)) { in mhi_debugfs_devices_show()
163 mhi_device_info_show(&mhi_cntrl->mhi_dev->dev, m); in mhi_debugfs_devices_show()
164 device_for_each_child(&mhi_cntrl->mhi_dev->dev, m, mhi_device_info_show); in mhi_debugfs_devices_show()
171 struct mhi_controller *mhi_cntrl = m->private; in mhi_debugfs_regdump_show() local
176 void __iomem *mhi_base = mhi_cntrl->regs; in mhi_debugfs_regdump_show()
177 void __iomem *bhi_base = mhi_cntrl->bhi; in mhi_debugfs_regdump_show()
178 void __iomem *bhie_base = mhi_cntrl->bhie; in mhi_debugfs_regdump_show()
179 void __iomem *wake_db = mhi_cntrl->wake_db; in mhi_debugfs_regdump_show()
204 if (!MHI_REG_ACCESS_VALID(mhi_cntrl->pm_state)) in mhi_debugfs_regdump_show()
208 to_mhi_pm_state_str(mhi_cntrl->pm_state), in mhi_debugfs_regdump_show()
209 TO_MHI_STATE_STR(mhi_cntrl->dev_state), in mhi_debugfs_regdump_show()
210 TO_MHI_EXEC_STR(mhi_cntrl->ee)); in mhi_debugfs_regdump_show()
212 state = mhi_get_mhi_state(mhi_cntrl); in mhi_debugfs_regdump_show()
213 ee = mhi_get_exec_env(mhi_cntrl); in mhi_debugfs_regdump_show()
220 ret = mhi_read_reg(mhi_cntrl, regs[i].base, regs[i].offset, in mhi_debugfs_regdump_show()
233 struct mhi_controller *mhi_cntrl = m->private; in mhi_debugfs_device_wake_show() local
234 struct mhi_device *mhi_dev = mhi_cntrl->mhi_dev; in mhi_debugfs_device_wake_show()
236 if (!mhi_is_active(mhi_cntrl)) { in mhi_debugfs_device_wake_show()
253 struct mhi_controller *mhi_cntrl = m->private; in mhi_debugfs_device_wake_write() local
254 struct mhi_device *mhi_dev = mhi_cntrl->mhi_dev; in mhi_debugfs_device_wake_write()
273 struct mhi_controller *mhi_cntrl = m->private; in mhi_debugfs_timeout_ms_show() local
275 seq_printf(m, "%u ms\n", mhi_cntrl->timeout_ms); in mhi_debugfs_timeout_ms_show()
285 struct mhi_controller *mhi_cntrl = m->private; in mhi_debugfs_timeout_ms_write() local
291 mhi_cntrl->timeout_ms = timeout_ms; in mhi_debugfs_timeout_ms_write()
377 void mhi_create_debugfs(struct mhi_controller *mhi_cntrl) in mhi_create_debugfs() argument
379 mhi_cntrl->debugfs_dentry = in mhi_create_debugfs()
380 debugfs_create_dir(dev_name(&mhi_cntrl->mhi_dev->dev), in mhi_create_debugfs()
383 debugfs_create_file("states", 0444, mhi_cntrl->debugfs_dentry, in mhi_create_debugfs()
384 mhi_cntrl, &debugfs_states_fops); in mhi_create_debugfs()
385 debugfs_create_file("events", 0444, mhi_cntrl->debugfs_dentry, in mhi_create_debugfs()
386 mhi_cntrl, &debugfs_events_fops); in mhi_create_debugfs()
387 debugfs_create_file("channels", 0444, mhi_cntrl->debugfs_dentry, in mhi_create_debugfs()
388 mhi_cntrl, &debugfs_channels_fops); in mhi_create_debugfs()
389 debugfs_create_file("devices", 0444, mhi_cntrl->debugfs_dentry, in mhi_create_debugfs()
390 mhi_cntrl, &debugfs_devices_fops); in mhi_create_debugfs()
391 debugfs_create_file("regdump", 0444, mhi_cntrl->debugfs_dentry, in mhi_create_debugfs()
392 mhi_cntrl, &debugfs_regdump_fops); in mhi_create_debugfs()
393 debugfs_create_file("device_wake", 0644, mhi_cntrl->debugfs_dentry, in mhi_create_debugfs()
394 mhi_cntrl, &debugfs_device_wake_fops); in mhi_create_debugfs()
395 debugfs_create_file("timeout_ms", 0644, mhi_cntrl->debugfs_dentry, in mhi_create_debugfs()
396 mhi_cntrl, &debugfs_timeout_ms_fops); in mhi_create_debugfs()
399 void mhi_destroy_debugfs(struct mhi_controller *mhi_cntrl) in mhi_destroy_debugfs() argument
401 debugfs_remove_recursive(mhi_cntrl->debugfs_dentry); in mhi_destroy_debugfs()
402 mhi_cntrl->debugfs_dentry = NULL; in mhi_destroy_debugfs()