| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright 2008-2010 Freescale Semiconductor, Inc. All Rights Reserved. |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 6 | 7 | * Authors: Hongjun Chen <hong-jun.chen@freescale.com> |
|---|
| 7 | 8 | * Porting to 2.6.35 by DENX Software Engineering, |
|---|
| 8 | 9 | * Anatolij Gustschin <agust@denx.de> |
|---|
| 9 | | - * |
|---|
| 10 | | - * This program is free software; you can redistribute it and/or modify it |
|---|
| 11 | | - * under the terms of the GNU General Public License as published by the |
|---|
| 12 | | - * Free Software Foundation; either version 2 of the License, or (at your |
|---|
| 13 | | - * option) any later version. |
|---|
| 14 | | - * |
|---|
| 15 | 10 | */ |
|---|
| 16 | 11 | |
|---|
| 17 | 12 | #include <linux/module.h> |
|---|
| .. | .. |
|---|
| 37 | 32 | #define VIU_VERSION "0.5.1" |
|---|
| 38 | 33 | |
|---|
| 39 | 34 | /* Allow building this driver with COMPILE_TEST */ |
|---|
| 40 | | -#if !defined(CONFIG_PPC) && !defined(CONFIG_MICROBLAZE) |
|---|
| 35 | +#if !defined(CONFIG_PPC) && !defined(CONFIG_MICROBLAZE) && !defined(CONFIG_M68K) |
|---|
| 41 | 36 | #define out_be32(v, a) iowrite32be(a, (void __iomem *)v) |
|---|
| 42 | 37 | #define in_be32(a) ioread32be((void __iomem *)a) |
|---|
| 43 | 38 | #endif |
|---|
| .. | .. |
|---|
| 219 | 214 | FIELD_NO = 0x01 << 28, /* Field number */ |
|---|
| 220 | 215 | DITHER_ON = 0x01 << 29, /* Dithering is on */ |
|---|
| 221 | 216 | ROUND_ON = 0x01 << 30, /* Round is on */ |
|---|
| 222 | | - MODE_32BIT = 0x01 << 31, /* Data in RGBa888, |
|---|
| 217 | + MODE_32BIT = 1UL << 31, /* Data in RGBa888, |
|---|
| 223 | 218 | * 0 in RGB565 |
|---|
| 224 | 219 | */ |
|---|
| 225 | 220 | }; |
|---|
| .. | .. |
|---|
| 565 | 560 | static int vidioc_querycap(struct file *file, void *priv, |
|---|
| 566 | 561 | struct v4l2_capability *cap) |
|---|
| 567 | 562 | { |
|---|
| 568 | | - strcpy(cap->driver, "viu"); |
|---|
| 569 | | - strcpy(cap->card, "viu"); |
|---|
| 570 | | - strcpy(cap->bus_info, "platform:viu"); |
|---|
| 571 | | - cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | |
|---|
| 572 | | - V4L2_CAP_STREAMING | |
|---|
| 573 | | - V4L2_CAP_VIDEO_OVERLAY | |
|---|
| 574 | | - V4L2_CAP_READWRITE; |
|---|
| 575 | | - cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS; |
|---|
| 563 | + strscpy(cap->driver, "viu", sizeof(cap->driver)); |
|---|
| 564 | + strscpy(cap->card, "viu", sizeof(cap->card)); |
|---|
| 565 | + strscpy(cap->bus_info, "platform:viu", sizeof(cap->bus_info)); |
|---|
| 576 | 566 | return 0; |
|---|
| 577 | 567 | } |
|---|
| 578 | 568 | |
|---|
| .. | .. |
|---|
| 941 | 931 | |
|---|
| 942 | 932 | inp->type = V4L2_INPUT_TYPE_CAMERA; |
|---|
| 943 | 933 | inp->std = fh->dev->vdev->tvnorms; |
|---|
| 944 | | - strcpy(inp->name, "Camera"); |
|---|
| 934 | + strscpy(inp->name, "Camera", sizeof(inp->name)); |
|---|
| 945 | 935 | return 0; |
|---|
| 946 | 936 | } |
|---|
| 947 | 937 | |
|---|
| .. | .. |
|---|
| 1090 | 1080 | |
|---|
| 1091 | 1081 | if (waitqueue_active(&buf->vb.done)) { |
|---|
| 1092 | 1082 | list_del(&buf->vb.queue); |
|---|
| 1093 | | - v4l2_get_timestamp(&buf->vb.ts); |
|---|
| 1083 | + buf->vb.ts = ktime_get_ns(); |
|---|
| 1094 | 1084 | buf->vb.state = VIDEOBUF_DONE; |
|---|
| 1095 | 1085 | buf->vb.field_count++; |
|---|
| 1096 | 1086 | wake_up(&buf->vb.done); |
|---|
| .. | .. |
|---|
| 1385 | 1375 | .release = video_device_release, |
|---|
| 1386 | 1376 | |
|---|
| 1387 | 1377 | .tvnorms = V4L2_STD_NTSC_M | V4L2_STD_PAL, |
|---|
| 1378 | + .device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING | |
|---|
| 1379 | + V4L2_CAP_VIDEO_OVERLAY | V4L2_CAP_READWRITE, |
|---|
| 1388 | 1380 | }; |
|---|
| 1389 | 1381 | |
|---|
| 1390 | 1382 | static int viu_of_probe(struct platform_device *op) |
|---|
| .. | .. |
|---|
| 1494 | 1486 | |
|---|
| 1495 | 1487 | mutex_lock(&viu_dev->lock); |
|---|
| 1496 | 1488 | |
|---|
| 1497 | | - ret = video_register_device(viu_dev->vdev, VFL_TYPE_GRABBER, -1); |
|---|
| 1489 | + ret = video_register_device(viu_dev->vdev, VFL_TYPE_VIDEO, -1); |
|---|
| 1498 | 1490 | if (ret < 0) { |
|---|
| 1499 | 1491 | video_device_release(viu_dev->vdev); |
|---|
| 1500 | 1492 | goto err_unlock; |
|---|