Lines Matching full:clk

23 	struct posix_clock *clk = pccontext->clk;  in get_posix_clock()  local
25 down_read(&clk->rwsem); in get_posix_clock()
27 if (!clk->zombie) in get_posix_clock()
28 return clk; in get_posix_clock()
30 up_read(&clk->rwsem); in get_posix_clock()
35 static void put_posix_clock(struct posix_clock *clk) in put_posix_clock() argument
37 up_read(&clk->rwsem); in put_posix_clock()
44 struct posix_clock *clk = get_posix_clock(fp); in posix_clock_read() local
47 if (!clk) in posix_clock_read()
50 if (clk->ops.read) in posix_clock_read()
51 err = clk->ops.read(pccontext, fp->f_flags, buf, count); in posix_clock_read()
53 put_posix_clock(clk); in posix_clock_read()
61 struct posix_clock *clk = get_posix_clock(fp); in posix_clock_poll() local
64 if (!clk) in posix_clock_poll()
67 if (clk->ops.poll) in posix_clock_poll()
68 result = clk->ops.poll(pccontext, fp, wait); in posix_clock_poll()
70 put_posix_clock(clk); in posix_clock_poll()
79 struct posix_clock *clk = get_posix_clock(fp); in posix_clock_ioctl() local
82 if (!clk) in posix_clock_ioctl()
85 if (clk->ops.ioctl) in posix_clock_ioctl()
86 err = clk->ops.ioctl(pccontext, cmd, arg); in posix_clock_ioctl()
88 put_posix_clock(clk); in posix_clock_ioctl()
98 struct posix_clock *clk = get_posix_clock(fp); in posix_clock_compat_ioctl() local
101 if (!clk) in posix_clock_compat_ioctl()
104 if (clk->ops.ioctl) in posix_clock_compat_ioctl()
105 err = clk->ops.ioctl(pccontext, cmd, arg); in posix_clock_compat_ioctl()
107 put_posix_clock(clk); in posix_clock_compat_ioctl()
116 struct posix_clock *clk = in posix_clock_open() local
120 down_read(&clk->rwsem); in posix_clock_open()
122 if (clk->zombie) { in posix_clock_open()
131 pccontext->clk = clk; in posix_clock_open()
132 if (clk->ops.open) { in posix_clock_open()
133 err = clk->ops.open(pccontext, fp->f_mode); in posix_clock_open()
141 get_device(clk->dev); in posix_clock_open()
144 up_read(&clk->rwsem); in posix_clock_open()
151 struct posix_clock *clk; in posix_clock_release() local
156 clk = pccontext->clk; in posix_clock_release()
158 if (clk->ops.release) in posix_clock_release()
159 err = clk->ops.release(pccontext); in posix_clock_release()
161 put_device(clk->dev); in posix_clock_release()
181 int posix_clock_register(struct posix_clock *clk, struct device *dev) in posix_clock_register() argument
185 init_rwsem(&clk->rwsem); in posix_clock_register()
187 cdev_init(&clk->cdev, &posix_clock_file_operations); in posix_clock_register()
188 err = cdev_device_add(&clk->cdev, dev); in posix_clock_register()
194 clk->cdev.owner = clk->ops.owner; in posix_clock_register()
195 clk->dev = dev; in posix_clock_register()
201 void posix_clock_unregister(struct posix_clock *clk) in posix_clock_unregister() argument
203 cdev_device_del(&clk->cdev, clk->dev); in posix_clock_unregister()
205 down_write(&clk->rwsem); in posix_clock_unregister()
206 clk->zombie = true; in posix_clock_unregister()
207 up_write(&clk->rwsem); in posix_clock_unregister()
209 put_device(clk->dev); in posix_clock_unregister()
215 struct posix_clock *clk; member
230 cd->clk = get_posix_clock(fp); in get_clock_desc()
232 err = cd->clk ? 0 : -ENODEV; in get_clock_desc()
241 put_posix_clock(cd->clk); in put_clock_desc()
259 if (cd.clk->ops.clock_adjtime) in pc_clock_adjtime()
260 err = cd.clk->ops.clock_adjtime(cd.clk, tx); in pc_clock_adjtime()
278 if (cd.clk->ops.clock_gettime) in pc_clock_gettime()
279 err = cd.clk->ops.clock_gettime(cd.clk, ts); in pc_clock_gettime()
297 if (cd.clk->ops.clock_getres) in pc_clock_getres()
298 err = cd.clk->ops.clock_getres(cd.clk, ts); in pc_clock_getres()
324 if (cd.clk->ops.clock_settime) in pc_clock_settime()
325 err = cd.clk->ops.clock_settime(cd.clk, ts); in pc_clock_settime()