|
@@ -366,10 +366,10 @@ static struct uvc_menu_info exposure_auto_controls[] = {
|
|
|
{ 8, "Aperture Priority Mode" },
|
|
|
};
|
|
|
|
|
|
-static __s32 uvc_ctrl_get_zoom(struct uvc_control_mapping *mapping,
|
|
|
- __u8 query, const __u8 *data)
|
|
|
+static s32 uvc_ctrl_get_zoom(struct uvc_control_mapping *mapping,
|
|
|
+ u8 query, const u8 *data)
|
|
|
{
|
|
|
- __s8 zoom = (__s8)data[0];
|
|
|
+ s8 zoom = (s8)data[0];
|
|
|
|
|
|
switch (query) {
|
|
|
case UVC_GET_CUR:
|
|
@@ -385,17 +385,17 @@ static __s32 uvc_ctrl_get_zoom(struct uvc_control_mapping *mapping,
|
|
|
}
|
|
|
|
|
|
static void uvc_ctrl_set_zoom(struct uvc_control_mapping *mapping,
|
|
|
- __s32 value, __u8 *data)
|
|
|
+ s32 value, u8 *data)
|
|
|
{
|
|
|
data[0] = value == 0 ? 0 : (value > 0) ? 1 : 0xff;
|
|
|
data[2] = min((int)abs(value), 0xff);
|
|
|
}
|
|
|
|
|
|
-static __s32 uvc_ctrl_get_rel_speed(struct uvc_control_mapping *mapping,
|
|
|
- __u8 query, const __u8 *data)
|
|
|
+static s32 uvc_ctrl_get_rel_speed(struct uvc_control_mapping *mapping,
|
|
|
+ u8 query, const u8 *data)
|
|
|
{
|
|
|
unsigned int first = mapping->offset / 8;
|
|
|
- __s8 rel = (__s8)data[first];
|
|
|
+ s8 rel = (s8)data[first];
|
|
|
|
|
|
switch (query) {
|
|
|
case UVC_GET_CUR:
|
|
@@ -412,7 +412,7 @@ static __s32 uvc_ctrl_get_rel_speed(struct uvc_control_mapping *mapping,
|
|
|
}
|
|
|
|
|
|
static void uvc_ctrl_set_rel_speed(struct uvc_control_mapping *mapping,
|
|
|
- __s32 value, __u8 *data)
|
|
|
+ s32 value, u8 *data)
|
|
|
{
|
|
|
unsigned int first = mapping->offset / 8;
|
|
|
|
|
@@ -745,17 +745,17 @@ static struct uvc_control_mapping uvc_ctrl_mappings[] = {
|
|
|
* Utility functions
|
|
|
*/
|
|
|
|
|
|
-static inline __u8 *uvc_ctrl_data(struct uvc_control *ctrl, int id)
|
|
|
+static inline u8 *uvc_ctrl_data(struct uvc_control *ctrl, int id)
|
|
|
{
|
|
|
return ctrl->uvc_data + id * ctrl->info.size;
|
|
|
}
|
|
|
|
|
|
-static inline int uvc_test_bit(const __u8 *data, int bit)
|
|
|
+static inline int uvc_test_bit(const u8 *data, int bit)
|
|
|
{
|
|
|
return (data[bit >> 3] >> (bit & 7)) & 1;
|
|
|
}
|
|
|
|
|
|
-static inline void uvc_clear_bit(__u8 *data, int bit)
|
|
|
+static inline void uvc_clear_bit(u8 *data, int bit)
|
|
|
{
|
|
|
data[bit >> 3] &= ~(1 << (bit & 7));
|
|
|
}
|
|
@@ -765,20 +765,20 @@ static inline void uvc_clear_bit(__u8 *data, int bit)
|
|
|
* a signed 32bit integer. Sign extension will be performed if the mapping
|
|
|
* references a signed data type.
|
|
|
*/
|
|
|
-static __s32 uvc_get_le_value(struct uvc_control_mapping *mapping,
|
|
|
- __u8 query, const __u8 *data)
|
|
|
+static s32 uvc_get_le_value(struct uvc_control_mapping *mapping,
|
|
|
+ u8 query, const u8 *data)
|
|
|
{
|
|
|
int bits = mapping->size;
|
|
|
int offset = mapping->offset;
|
|
|
- __s32 value = 0;
|
|
|
- __u8 mask;
|
|
|
+ s32 value = 0;
|
|
|
+ u8 mask;
|
|
|
|
|
|
data += offset / 8;
|
|
|
offset &= 7;
|
|
|
mask = ((1LL << bits) - 1) << offset;
|
|
|
|
|
|
for (; bits > 0; data++) {
|
|
|
- __u8 byte = *data & mask;
|
|
|
+ u8 byte = *data & mask;
|
|
|
value |= offset > 0 ? (byte >> offset) : (byte << (-offset));
|
|
|
bits -= 8 - (offset > 0 ? offset : 0);
|
|
|
offset -= 8;
|
|
@@ -796,11 +796,11 @@ static __s32 uvc_get_le_value(struct uvc_control_mapping *mapping,
|
|
|
* in the little-endian data stored at 'data' to the value 'value'.
|
|
|
*/
|
|
|
static void uvc_set_le_value(struct uvc_control_mapping *mapping,
|
|
|
- __s32 value, __u8 *data)
|
|
|
+ s32 value, u8 *data)
|
|
|
{
|
|
|
int bits = mapping->size;
|
|
|
int offset = mapping->offset;
|
|
|
- __u8 mask;
|
|
|
+ u8 mask;
|
|
|
|
|
|
/* According to the v4l2 spec, writing any value to a button control
|
|
|
* should result in the action belonging to the button control being
|
|
@@ -826,13 +826,13 @@ static void uvc_set_le_value(struct uvc_control_mapping *mapping,
|
|
|
* Terminal and unit management
|
|
|
*/
|
|
|
|
|
|
-static const __u8 uvc_processing_guid[16] = UVC_GUID_UVC_PROCESSING;
|
|
|
-static const __u8 uvc_camera_guid[16] = UVC_GUID_UVC_CAMERA;
|
|
|
-static const __u8 uvc_media_transport_input_guid[16] =
|
|
|
+static const u8 uvc_processing_guid[16] = UVC_GUID_UVC_PROCESSING;
|
|
|
+static const u8 uvc_camera_guid[16] = UVC_GUID_UVC_CAMERA;
|
|
|
+static const u8 uvc_media_transport_input_guid[16] =
|
|
|
UVC_GUID_UVC_MEDIA_TRANSPORT_INPUT;
|
|
|
|
|
|
static int uvc_entity_match_guid(const struct uvc_entity *entity,
|
|
|
- const __u8 guid[16])
|
|
|
+ const u8 guid[16])
|
|
|
{
|
|
|
switch (UVC_ENTITY_TYPE(entity)) {
|
|
|
case UVC_ITT_CAMERA:
|
|
@@ -857,7 +857,7 @@ static int uvc_entity_match_guid(const struct uvc_entity *entity,
|
|
|
* UVC Controls
|
|
|
*/
|
|
|
|
|
|
-static void __uvc_find_control(struct uvc_entity *entity, __u32 v4l2_id,
|
|
|
+static void __uvc_find_control(struct uvc_entity *entity, u32 v4l2_id,
|
|
|
struct uvc_control_mapping **mapping, struct uvc_control **control,
|
|
|
int next)
|
|
|
{
|
|
@@ -890,7 +890,7 @@ static void __uvc_find_control(struct uvc_entity *entity, __u32 v4l2_id,
|
|
|
}
|
|
|
|
|
|
static struct uvc_control *uvc_find_control(struct uvc_video_chain *chain,
|
|
|
- __u32 v4l2_id, struct uvc_control_mapping **mapping)
|
|
|
+ u32 v4l2_id, struct uvc_control_mapping **mapping)
|
|
|
{
|
|
|
struct uvc_control *ctrl = NULL;
|
|
|
struct uvc_entity *entity;
|
|
@@ -1742,9 +1742,9 @@ int uvc_xu_ctrl_query(struct uvc_video_chain *chain,
|
|
|
struct uvc_entity *entity;
|
|
|
struct uvc_control *ctrl;
|
|
|
unsigned int i, found = 0;
|
|
|
- __u32 reqflags;
|
|
|
- __u16 size;
|
|
|
- __u8 *data = NULL;
|
|
|
+ u32 reqflags;
|
|
|
+ u16 size;
|
|
|
+ u8 *data = NULL;
|
|
|
int ret;
|
|
|
|
|
|
/* Find the extension unit. */
|
|
@@ -2176,7 +2176,7 @@ int uvc_ctrl_init_device(struct uvc_device *dev)
|
|
|
list_for_each_entry(entity, &dev->entities, list) {
|
|
|
struct uvc_control *ctrl;
|
|
|
unsigned int bControlSize = 0, ncontrols;
|
|
|
- __u8 *bmControls = NULL;
|
|
|
+ u8 *bmControls = NULL;
|
|
|
|
|
|
if (UVC_ENTITY_TYPE(entity) == UVC_VC_EXTENSION_UNIT) {
|
|
|
bmControls = entity->extension.bmControls;
|