Lines Matching refs:cip
73 struct pvr2_sysfs_ctl_item *cip; in show_name() local
75 cip = container_of(attr, struct pvr2_sysfs_ctl_item, attr_name); in show_name()
76 name = pvr2_ctrl_get_desc(cip->cptr); in show_name()
78 cip->chptr, cip->ctl_id, name); in show_name()
87 struct pvr2_sysfs_ctl_item *cip; in show_type() local
90 cip = container_of(attr, struct pvr2_sysfs_ctl_item, attr_type); in show_type()
91 tp = pvr2_ctrl_get_type(cip->cptr); in show_type()
100 cip->chptr, cip->ctl_id, name); in show_type()
108 struct pvr2_sysfs_ctl_item *cip; in show_min() local
110 cip = container_of(attr, struct pvr2_sysfs_ctl_item, attr_min); in show_min()
111 val = pvr2_ctrl_get_min(cip->cptr); in show_min()
113 cip->chptr, cip->ctl_id, val); in show_min()
121 struct pvr2_sysfs_ctl_item *cip; in show_max() local
123 cip = container_of(attr, struct pvr2_sysfs_ctl_item, attr_max); in show_max()
124 val = pvr2_ctrl_get_max(cip->cptr); in show_max()
126 cip->chptr, cip->ctl_id, val); in show_max()
134 struct pvr2_sysfs_ctl_item *cip; in show_def() local
138 cip = container_of(attr, struct pvr2_sysfs_ctl_item, attr_def); in show_def()
139 ret = pvr2_ctrl_get_def(cip->cptr, &val); in show_def()
141 ret = pvr2_ctrl_value_to_sym(cip->cptr, ~0, val, in show_def()
144 cip->chptr, cip->ctl_id, cnt, buf, val); in show_def()
153 struct pvr2_sysfs_ctl_item *cip; in show_val_norm() local
157 cip = container_of(attr, struct pvr2_sysfs_ctl_item, attr_val); in show_val_norm()
158 ret = pvr2_ctrl_get_value(cip->cptr, &val); in show_val_norm()
160 ret = pvr2_ctrl_value_to_sym(cip->cptr, ~0, val, in show_val_norm()
163 cip->chptr, cip->ctl_id, cnt, buf, val); in show_val_norm()
172 struct pvr2_sysfs_ctl_item *cip; in show_val_custom() local
176 cip = container_of(attr, struct pvr2_sysfs_ctl_item, attr_custom); in show_val_custom()
177 ret = pvr2_ctrl_get_value(cip->cptr, &val); in show_val_custom()
179 ret = pvr2_ctrl_custom_value_to_sym(cip->cptr, ~0, val, in show_val_custom()
182 cip->chptr, cip->ctl_id, cnt, buf, val); in show_val_custom()
191 struct pvr2_sysfs_ctl_item *cip; in show_enum() local
194 cip = container_of(attr, struct pvr2_sysfs_ctl_item, attr_enum); in show_enum()
195 ecnt = pvr2_ctrl_get_cnt(cip->cptr); in show_enum()
198 pvr2_ctrl_get_valname(cip->cptr, val, buf + bcnt, in show_enum()
207 cip->chptr, cip->ctl_id); in show_enum()
215 struct pvr2_sysfs_ctl_item *cip; in show_bits() local
218 cip = container_of(attr, struct pvr2_sysfs_ctl_item, attr_bits); in show_bits()
219 valid_bits = pvr2_ctrl_get_mask(cip->cptr); in show_bits()
224 pvr2_ctrl_get_valname(cip->cptr, msk, buf + bcnt, in show_bits()
232 cip->chptr, cip->ctl_id); in show_bits()
236 static int store_val_any(struct pvr2_sysfs_ctl_item *cip, int customfl, in store_val_any() argument
242 ret = pvr2_ctrl_custom_sym_to_value(cip->cptr, buf, count, in store_val_any()
245 ret = pvr2_ctrl_sym_to_value(cip->cptr, buf, count, in store_val_any()
249 ret = pvr2_ctrl_set_mask_value(cip->cptr, mask, val); in store_val_any()
250 pvr2_hdw_commit_ctl(cip->chptr->channel.hdw); in store_val_any()
258 struct pvr2_sysfs_ctl_item *cip; in store_val_norm() local
260 cip = container_of(attr, struct pvr2_sysfs_ctl_item, attr_val); in store_val_norm()
262 cip->chptr, cip->ctl_id, (int)count, buf); in store_val_norm()
263 ret = store_val_any(cip, 0, buf, count); in store_val_norm()
272 struct pvr2_sysfs_ctl_item *cip; in store_val_custom() local
274 cip = container_of(attr, struct pvr2_sysfs_ctl_item, attr_custom); in store_val_custom()
276 cip->chptr, cip->ctl_id, (int)count, buf); in store_val_custom()
277 ret = store_val_any(cip, 1, buf, count); in store_val_custom()
284 struct pvr2_sysfs_ctl_item *cip; in pvr2_sysfs_add_control() local
292 cip = kzalloc(sizeof(*cip),GFP_KERNEL); in pvr2_sysfs_add_control()
293 if (!cip) return; in pvr2_sysfs_add_control()
294 pvr2_sysfs_trace("Creating pvr2_sysfs_ctl_item id=%p",cip); in pvr2_sysfs_add_control()
296 cip->cptr = cptr; in pvr2_sysfs_add_control()
297 cip->ctl_id = ctl_id; in pvr2_sysfs_add_control()
299 cip->chptr = sfp; in pvr2_sysfs_add_control()
300 cip->item_next = NULL; in pvr2_sysfs_add_control()
302 sfp->item_last->item_next = cip; in pvr2_sysfs_add_control()
304 sfp->item_first = cip; in pvr2_sysfs_add_control()
306 sfp->item_last = cip; in pvr2_sysfs_add_control()
308 sysfs_attr_init(&cip->attr_name.attr); in pvr2_sysfs_add_control()
309 cip->attr_name.attr.name = "name"; in pvr2_sysfs_add_control()
310 cip->attr_name.attr.mode = S_IRUGO; in pvr2_sysfs_add_control()
311 cip->attr_name.show = show_name; in pvr2_sysfs_add_control()
313 sysfs_attr_init(&cip->attr_type.attr); in pvr2_sysfs_add_control()
314 cip->attr_type.attr.name = "type"; in pvr2_sysfs_add_control()
315 cip->attr_type.attr.mode = S_IRUGO; in pvr2_sysfs_add_control()
316 cip->attr_type.show = show_type; in pvr2_sysfs_add_control()
318 sysfs_attr_init(&cip->attr_min.attr); in pvr2_sysfs_add_control()
319 cip->attr_min.attr.name = "min_val"; in pvr2_sysfs_add_control()
320 cip->attr_min.attr.mode = S_IRUGO; in pvr2_sysfs_add_control()
321 cip->attr_min.show = show_min; in pvr2_sysfs_add_control()
323 sysfs_attr_init(&cip->attr_max.attr); in pvr2_sysfs_add_control()
324 cip->attr_max.attr.name = "max_val"; in pvr2_sysfs_add_control()
325 cip->attr_max.attr.mode = S_IRUGO; in pvr2_sysfs_add_control()
326 cip->attr_max.show = show_max; in pvr2_sysfs_add_control()
328 sysfs_attr_init(&cip->attr_def.attr); in pvr2_sysfs_add_control()
329 cip->attr_def.attr.name = "def_val"; in pvr2_sysfs_add_control()
330 cip->attr_def.attr.mode = S_IRUGO; in pvr2_sysfs_add_control()
331 cip->attr_def.show = show_def; in pvr2_sysfs_add_control()
333 sysfs_attr_init(&cip->attr_val.attr); in pvr2_sysfs_add_control()
334 cip->attr_val.attr.name = "cur_val"; in pvr2_sysfs_add_control()
335 cip->attr_val.attr.mode = S_IRUGO; in pvr2_sysfs_add_control()
337 sysfs_attr_init(&cip->attr_custom.attr); in pvr2_sysfs_add_control()
338 cip->attr_custom.attr.name = "custom_val"; in pvr2_sysfs_add_control()
339 cip->attr_custom.attr.mode = S_IRUGO; in pvr2_sysfs_add_control()
341 sysfs_attr_init(&cip->attr_enum.attr); in pvr2_sysfs_add_control()
342 cip->attr_enum.attr.name = "enum_val"; in pvr2_sysfs_add_control()
343 cip->attr_enum.attr.mode = S_IRUGO; in pvr2_sysfs_add_control()
344 cip->attr_enum.show = show_enum; in pvr2_sysfs_add_control()
346 sysfs_attr_init(&cip->attr_bits.attr); in pvr2_sysfs_add_control()
347 cip->attr_bits.attr.name = "bit_val"; in pvr2_sysfs_add_control()
348 cip->attr_bits.attr.mode = S_IRUGO; in pvr2_sysfs_add_control()
349 cip->attr_bits.show = show_bits; in pvr2_sysfs_add_control()
352 cip->attr_val.attr.mode |= S_IWUSR|S_IWGRP; in pvr2_sysfs_add_control()
353 cip->attr_custom.attr.mode |= S_IWUSR|S_IWGRP; in pvr2_sysfs_add_control()
357 cip->attr_gen[acnt++] = &cip->attr_name.attr; in pvr2_sysfs_add_control()
358 cip->attr_gen[acnt++] = &cip->attr_type.attr; in pvr2_sysfs_add_control()
359 cip->attr_gen[acnt++] = &cip->attr_val.attr; in pvr2_sysfs_add_control()
360 cip->attr_gen[acnt++] = &cip->attr_def.attr; in pvr2_sysfs_add_control()
361 cip->attr_val.show = show_val_norm; in pvr2_sysfs_add_control()
362 cip->attr_val.store = store_val_norm; in pvr2_sysfs_add_control()
364 cip->attr_gen[acnt++] = &cip->attr_custom.attr; in pvr2_sysfs_add_control()
365 cip->attr_custom.show = show_val_custom; in pvr2_sysfs_add_control()
366 cip->attr_custom.store = store_val_custom; in pvr2_sysfs_add_control()
371 cip->attr_gen[acnt++] = &cip->attr_enum.attr; in pvr2_sysfs_add_control()
375 cip->attr_gen[acnt++] = &cip->attr_min.attr; in pvr2_sysfs_add_control()
376 cip->attr_gen[acnt++] = &cip->attr_max.attr; in pvr2_sysfs_add_control()
380 cip->attr_gen[acnt++] = &cip->attr_bits.attr; in pvr2_sysfs_add_control()
385 cnt = scnprintf(cip->name,sizeof(cip->name)-1,"ctl_%s", in pvr2_sysfs_add_control()
387 cip->name[cnt] = 0; in pvr2_sysfs_add_control()
388 cip->grp.name = cip->name; in pvr2_sysfs_add_control()
389 cip->grp.attrs = cip->attr_gen; in pvr2_sysfs_add_control()
391 ret = sysfs_create_group(&sfp->class_dev->kobj,&cip->grp); in pvr2_sysfs_add_control()
398 cip->created_ok = !0; in pvr2_sysfs_add_control()