Lines Matching refs:cip

77 	struct pvr2_sysfs_ctl_item *cip;
79 cip = container_of(attr, struct pvr2_sysfs_ctl_item, attr_name);
80 name = pvr2_ctrl_get_desc(cip->cptr);
82 cip->chptr, cip->ctl_id, name);
91 struct pvr2_sysfs_ctl_item *cip;
94 cip = container_of(attr, struct pvr2_sysfs_ctl_item, attr_type);
95 tp = pvr2_ctrl_get_type(cip->cptr);
104 cip->chptr, cip->ctl_id, name);
112 struct pvr2_sysfs_ctl_item *cip;
114 cip = container_of(attr, struct pvr2_sysfs_ctl_item, attr_min);
115 val = pvr2_ctrl_get_min(cip->cptr);
117 cip->chptr, cip->ctl_id, val);
125 struct pvr2_sysfs_ctl_item *cip;
127 cip = container_of(attr, struct pvr2_sysfs_ctl_item, attr_max);
128 val = pvr2_ctrl_get_max(cip->cptr);
130 cip->chptr, cip->ctl_id, val);
138 struct pvr2_sysfs_ctl_item *cip;
142 cip = container_of(attr, struct pvr2_sysfs_ctl_item, attr_def);
143 ret = pvr2_ctrl_get_def(cip->cptr, &val);
145 ret = pvr2_ctrl_value_to_sym(cip->cptr, ~0, val,
148 cip->chptr, cip->ctl_id, cnt, buf, val);
157 struct pvr2_sysfs_ctl_item *cip;
161 cip = container_of(attr, struct pvr2_sysfs_ctl_item, attr_val);
162 ret = pvr2_ctrl_get_value(cip->cptr, &val);
164 ret = pvr2_ctrl_value_to_sym(cip->cptr, ~0, val,
167 cip->chptr, cip->ctl_id, cnt, buf, val);
176 struct pvr2_sysfs_ctl_item *cip;
180 cip = container_of(attr, struct pvr2_sysfs_ctl_item, attr_custom);
181 ret = pvr2_ctrl_get_value(cip->cptr, &val);
183 ret = pvr2_ctrl_custom_value_to_sym(cip->cptr, ~0, val,
186 cip->chptr, cip->ctl_id, cnt, buf, val);
195 struct pvr2_sysfs_ctl_item *cip;
198 cip = container_of(attr, struct pvr2_sysfs_ctl_item, attr_enum);
199 ecnt = pvr2_ctrl_get_cnt(cip->cptr);
202 pvr2_ctrl_get_valname(cip->cptr, val, buf + bcnt,
211 cip->chptr, cip->ctl_id);
219 struct pvr2_sysfs_ctl_item *cip;
222 cip = container_of(attr, struct pvr2_sysfs_ctl_item, attr_bits);
223 valid_bits = pvr2_ctrl_get_mask(cip->cptr);
228 pvr2_ctrl_get_valname(cip->cptr, msk, buf + bcnt,
236 cip->chptr, cip->ctl_id);
240 static int store_val_any(struct pvr2_sysfs_ctl_item *cip, int customfl,
246 ret = pvr2_ctrl_custom_sym_to_value(cip->cptr, buf, count,
249 ret = pvr2_ctrl_sym_to_value(cip->cptr, buf, count,
253 ret = pvr2_ctrl_set_mask_value(cip->cptr, mask, val);
254 pvr2_hdw_commit_ctl(cip->chptr->channel.hdw);
262 struct pvr2_sysfs_ctl_item *cip;
264 cip = container_of(attr, struct pvr2_sysfs_ctl_item, attr_val);
266 cip->chptr, cip->ctl_id, (int)count, buf);
267 ret = store_val_any(cip, 0, buf, count);
276 struct pvr2_sysfs_ctl_item *cip;
278 cip = container_of(attr, struct pvr2_sysfs_ctl_item, attr_custom);
280 cip->chptr, cip->ctl_id, (int)count, buf);
281 ret = store_val_any(cip, 1, buf, count);
288 struct pvr2_sysfs_ctl_item *cip;
296 cip = kzalloc(sizeof(*cip),GFP_KERNEL);
297 if (!cip) return;
298 pvr2_sysfs_trace("Creating pvr2_sysfs_ctl_item id=%p",cip);
300 cip->cptr = cptr;
301 cip->ctl_id = ctl_id;
303 cip->chptr = sfp;
304 cip->item_next = NULL;
306 sfp->item_last->item_next = cip;
308 sfp->item_first = cip;
310 sfp->item_last = cip;
312 sysfs_attr_init(&cip->attr_name.attr);
313 cip->attr_name.attr.name = "name";
314 cip->attr_name.attr.mode = S_IRUGO;
315 cip->attr_name.show = show_name;
317 sysfs_attr_init(&cip->attr_type.attr);
318 cip->attr_type.attr.name = "type";
319 cip->attr_type.attr.mode = S_IRUGO;
320 cip->attr_type.show = show_type;
322 sysfs_attr_init(&cip->attr_min.attr);
323 cip->attr_min.attr.name = "min_val";
324 cip->attr_min.attr.mode = S_IRUGO;
325 cip->attr_min.show = show_min;
327 sysfs_attr_init(&cip->attr_max.attr);
328 cip->attr_max.attr.name = "max_val";
329 cip->attr_max.attr.mode = S_IRUGO;
330 cip->attr_max.show = show_max;
332 sysfs_attr_init(&cip->attr_def.attr);
333 cip->attr_def.attr.name = "def_val";
334 cip->attr_def.attr.mode = S_IRUGO;
335 cip->attr_def.show = show_def;
337 sysfs_attr_init(&cip->attr_val.attr);
338 cip->attr_val.attr.name = "cur_val";
339 cip->attr_val.attr.mode = S_IRUGO;
341 sysfs_attr_init(&cip->attr_custom.attr);
342 cip->attr_custom.attr.name = "custom_val";
343 cip->attr_custom.attr.mode = S_IRUGO;
345 sysfs_attr_init(&cip->attr_enum.attr);
346 cip->attr_enum.attr.name = "enum_val";
347 cip->attr_enum.attr.mode = S_IRUGO;
348 cip->attr_enum.show = show_enum;
350 sysfs_attr_init(&cip->attr_bits.attr);
351 cip->attr_bits.attr.name = "bit_val";
352 cip->attr_bits.attr.mode = S_IRUGO;
353 cip->attr_bits.show = show_bits;
356 cip->attr_val.attr.mode |= S_IWUSR|S_IWGRP;
357 cip->attr_custom.attr.mode |= S_IWUSR|S_IWGRP;
361 cip->attr_gen[acnt++] = &cip->attr_name.attr;
362 cip->attr_gen[acnt++] = &cip->attr_type.attr;
363 cip->attr_gen[acnt++] = &cip->attr_val.attr;
364 cip->attr_gen[acnt++] = &cip->attr_def.attr;
365 cip->attr_val.show = show_val_norm;
366 cip->attr_val.store = store_val_norm;
368 cip->attr_gen[acnt++] = &cip->attr_custom.attr;
369 cip->attr_custom.show = show_val_custom;
370 cip->attr_custom.store = store_val_custom;
375 cip->attr_gen[acnt++] = &cip->attr_enum.attr;
379 cip->attr_gen[acnt++] = &cip->attr_min.attr;
380 cip->attr_gen[acnt++] = &cip->attr_max.attr;
384 cip->attr_gen[acnt++] = &cip->attr_bits.attr;
389 cnt = scnprintf(cip->name,sizeof(cip->name)-1,"ctl_%s",
391 cip->name[cnt] = 0;
392 cip->grp.name = cip->name;
393 cip->grp.attrs = cip->attr_gen;
395 ret = sysfs_create_group(&sfp->class_dev->kobj,&cip->grp);
402 cip->created_ok = !0;