2536
2537
2538
2539static void pvr2_hdw_internal_set_std_avail(struct pvr2_hdw *hdw)
2540{
2541 struct v4l2_standard *newstd;
2542 unsigned int std_cnt;
2543 unsigned int idx;
2544
2545 newstd = pvr2_std_create_enum(&std_cnt,hdw->std_mask_avail);
2546
2547 if (hdw->std_defs) {
2548 kfree(hdw->std_defs);
2549 hdw->std_defs = NULL;
2550 }
2551 hdw->std_enum_cnt = 0;
2552 if (hdw->std_enum_names) {
2553 kfree(hdw->std_enum_names);
2554 hdw->std_enum_names = NULL;
2555 }
2556
2557 if (!std_cnt) {
2558 pvr2_trace(
2559 PVR2_TRACE_ERROR_LEGS,
2560 "WARNING: Failed to identify any viable standards");
2561 }
2562 hdw->std_enum_names = kmalloc(sizeof(char *)*(std_cnt+1),GFP_KERNEL);
2563 hdw->std_enum_names[0] = "none";
2564 for (idx = 0; idx < std_cnt; idx++) {
2565 hdw->std_enum_names[idx+1] =
2566 newstd[idx].name;
2567 }
2568
2569 hdw->std_info_enum.def.type_enum.value_names = hdw->std_enum_names;
2570 hdw->std_info_enum.def.type_enum.count = std_cnt+1;
2571 hdw->std_defs = newstd;
2572 hdw->std_enum_cnt = std_cnt+1;
2573 hdw->std_enum_cur = 0;
2574 hdw->std_info_cur.def.type_bitmask.valid_bits = hdw->std_mask_avail;
2575}
2576