162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci *
462306a36Sopenharmony_ci *  Copyright (C) 2005 Mike Isely <isely@pobox.com>
562306a36Sopenharmony_ci */
662306a36Sopenharmony_ci#ifndef __PVRUSB2_STD_H
762306a36Sopenharmony_ci#define __PVRUSB2_STD_H
862306a36Sopenharmony_ci
962306a36Sopenharmony_ci#include <linux/videodev2.h>
1062306a36Sopenharmony_ci
1162306a36Sopenharmony_ci// Convert string describing one or more video standards into a mask of V4L
1262306a36Sopenharmony_ci// standard bits.  Return true if conversion succeeds otherwise return
1362306a36Sopenharmony_ci// false.  String is expected to be of the form: C1-x/y;C2-a/b where C1 and
1462306a36Sopenharmony_ci// C2 are color system names (e.g. "PAL", "NTSC") and x, y, a, and b are
1562306a36Sopenharmony_ci// modulation schemes (e.g. "M", "B", "G", etc).
1662306a36Sopenharmony_ciint pvr2_std_str_to_id(v4l2_std_id *idPtr,const char *bufPtr,
1762306a36Sopenharmony_ci		       unsigned int bufSize);
1862306a36Sopenharmony_ci
1962306a36Sopenharmony_ci// Convert any arbitrary set of video standard bits into an unambiguous
2062306a36Sopenharmony_ci// readable string.  Return value is the number of bytes consumed in the
2162306a36Sopenharmony_ci// buffer.  The formatted string is of a form that can be parsed by our
2262306a36Sopenharmony_ci// sibling std_std_to_id() function.
2362306a36Sopenharmony_ciunsigned int pvr2_std_id_to_str(char *bufPtr, unsigned int bufSize,
2462306a36Sopenharmony_ci				v4l2_std_id id);
2562306a36Sopenharmony_ci
2662306a36Sopenharmony_ci// Create an array of suitable v4l2_standard structures given a bit mask of
2762306a36Sopenharmony_ci// video standards to support.  The array is allocated from the heap, and
2862306a36Sopenharmony_ci// the number of elements is returned in the first argument.
2962306a36Sopenharmony_cistruct v4l2_standard *pvr2_std_create_enum(unsigned int *countptr,
3062306a36Sopenharmony_ci					   v4l2_std_id id);
3162306a36Sopenharmony_ci
3262306a36Sopenharmony_ci// Return mask of which video standard bits are valid
3362306a36Sopenharmony_civ4l2_std_id pvr2_std_get_usable(void);
3462306a36Sopenharmony_ci
3562306a36Sopenharmony_ci#endif /* __PVRUSB2_STD_H */
36