Lines Matching +full:charge +full:- +full:ctrl +full:- +full:value

4  * Permission is hereby granted, free of charge, to any person obtaining
40 struct drm_info_node *node = (struct drm_info_node *) m->private; in nouveau_debugfs_vbios_image()
41 struct nouveau_drm *drm = nouveau_drm(node->minor->dev); in nouveau_debugfs_vbios_image()
44 for (i = 0; i < drm->vbios.length; i++) in nouveau_debugfs_vbios_image()
45 seq_printf(m, "%c", drm->vbios.data[i]); in nouveau_debugfs_vbios_image()
52 struct drm_info_node *node = m->private; in nouveau_debugfs_strap_peek()
53 struct nouveau_drm *drm = nouveau_drm(node->minor->dev); in nouveau_debugfs_strap_peek()
56 ret = pm_runtime_get_sync(drm->dev->dev); in nouveau_debugfs_strap_peek()
57 if (ret < 0 && ret != -EACCES) { in nouveau_debugfs_strap_peek()
58 pm_runtime_put_autosuspend(drm->dev->dev); in nouveau_debugfs_strap_peek()
63 nvif_rd32(&drm->client.device.object, 0x101000)); in nouveau_debugfs_strap_peek()
65 pm_runtime_mark_last_busy(drm->dev->dev); in nouveau_debugfs_strap_peek()
66 pm_runtime_put_autosuspend(drm->dev->dev); in nouveau_debugfs_strap_peek()
74 struct drm_device *drm = m->private; in nouveau_debugfs_pstate_get()
76 struct nvif_object *ctrl = &debugfs->ctrl; in nouveau_debugfs_pstate_get() local
81 return -ENODEV; in nouveau_debugfs_pstate_get()
83 ret = nvif_mthd(ctrl, NVIF_CONTROL_PSTATE_INFO, &info, sizeof(info)); in nouveau_debugfs_pstate_get()
95 ret = nvif_mthd(ctrl, NVIF_CONTROL_PSTATE_ATTR, in nouveau_debugfs_pstate_get()
104 info.pwrsrc == 1 ? "AC" : "--"); in nouveau_debugfs_pstate_get()
109 ret = nvif_mthd(ctrl, NVIF_CONTROL_PSTATE_ATTR, in nouveau_debugfs_pstate_get()
116 seq_printf(m, "-%d", attr.max); in nouveau_debugfs_pstate_get()
128 if (info.ustate_ac < -1) in nouveau_debugfs_pstate_get()
130 if (info.ustate_dc < -1) in nouveau_debugfs_pstate_get()
144 struct seq_file *m = file->private_data; in nouveau_debugfs_pstate_set()
145 struct drm_device *drm = m->private; in nouveau_debugfs_pstate_set()
147 struct nvif_object *ctrl = &debugfs->ctrl; in nouveau_debugfs_pstate_set() local
148 struct nvif_control_pstate_user_v0 args = { .pwrsrc = -EINVAL }; in nouveau_debugfs_pstate_set()
150 long value, ret; in nouveau_debugfs_pstate_set() local
153 return -ENODEV; in nouveau_debugfs_pstate_set()
156 return -EINVAL; in nouveau_debugfs_pstate_set()
159 return -EFAULT; in nouveau_debugfs_pstate_set()
179 ret = kstrtol(cur, 16, &value); in nouveau_debugfs_pstate_set()
182 args.ustate = value; in nouveau_debugfs_pstate_set()
185 ret = pm_runtime_get_sync(drm->dev); in nouveau_debugfs_pstate_set()
186 if (ret < 0 && ret != -EACCES) { in nouveau_debugfs_pstate_set()
187 pm_runtime_put_autosuspend(drm->dev); in nouveau_debugfs_pstate_set()
191 ret = nvif_mthd(ctrl, NVIF_CONTROL_PSTATE_USER, &args, sizeof(args)); in nouveau_debugfs_pstate_set()
192 pm_runtime_put_autosuspend(drm->dev); in nouveau_debugfs_pstate_set()
202 return single_open(file, nouveau_debugfs_pstate_get, inode->i_private); in nouveau_debugfs_pstate_open()
228 struct nouveau_drm *drm = nouveau_drm(minor->dev); in nouveau_drm_debugfs_init()
235 minor->debugfs_root, minor->dev, in nouveau_drm_debugfs_init()
241 minor->debugfs_root, minor); in nouveau_drm_debugfs_init()
246 dentry = debugfs_lookup("vbios.rom", minor->debugfs_root); in nouveau_drm_debugfs_init()
250 d_inode(dentry)->i_size = drm->vbios.length; in nouveau_drm_debugfs_init()
259 drm->debugfs = kzalloc(sizeof(*drm->debugfs), GFP_KERNEL); in nouveau_debugfs_init()
260 if (!drm->debugfs) in nouveau_debugfs_init()
261 return -ENOMEM; in nouveau_debugfs_init()
263 ret = nvif_object_ctor(&drm->client.device.object, "debugfsCtrl", 0, in nouveau_debugfs_init()
265 &drm->debugfs->ctrl); in nouveau_debugfs_init()
275 if (drm->debugfs && drm->debugfs->ctrl.priv) in nouveau_debugfs_fini()
276 nvif_object_dtor(&drm->debugfs->ctrl); in nouveau_debugfs_fini()
278 kfree(drm->debugfs); in nouveau_debugfs_fini()
279 drm->debugfs = NULL; in nouveau_debugfs_fini()