linux-2.6-microblaze.git
3 years agomedia: ccs: Use longer pre-I²C sleep for CCS compliant devices
Sakari Ailus [Mon, 21 Sep 2020 16:08:20 +0000 (18:08 +0200)]
media: ccs: Use longer pre-I²C sleep for CCS compliant devices

Longer idle period is required on I²C bus before the first transaction
after lifting xshutdown.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: ccs: Wrap long lines, unwrap short ones
Sakari Ailus [Fri, 18 Sep 2020 09:36:38 +0000 (11:36 +0200)]
media: ccs: Wrap long lines, unwrap short ones

Over the years (and renaming) some lines that may well be wrapped ended up
being over 80 characters, likewise there are shorter lines that can be
merged. Do that.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: ccs: Clean up runtime PM usage
Sakari Ailus [Fri, 18 Sep 2020 09:23:39 +0000 (11:23 +0200)]
media: ccs: Clean up runtime PM usage

If pm_runtime_get_sync() fails, there's no need to set the device active
again. Also, in the same case to return the usage_count to zero,
pm_runtime_put_noidle() is enough.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: ccs: Use static data read-only registers
Sakari Ailus [Thu, 3 Sep 2020 19:52:29 +0000 (21:52 +0200)]
media: ccs: Use static data read-only registers

Access read-only registers from CCS static data.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: ccs: Add support for manufacturer regs from sensor and module files
Sakari Ailus [Thu, 3 Sep 2020 09:32:56 +0000 (11:32 +0200)]
media: ccs: Add support for manufacturer regs from sensor and module files

Write manufacturer specific registers (MSRs) from file to the sensor on
sensor power-on.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: ccs: Allow range in between I²C retries
Sakari Ailus [Fri, 13 Nov 2020 15:07:28 +0000 (16:07 +0100)]
media: ccs: Allow range in between I²C retries

Make the delay between I²C access retries a range between 1 and 2 ms. Also
make the number of retries 10 instead of 5, in order not to reduce the
total amount of time.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: ccs: Change my e-mail address
Sakari Ailus [Wed, 24 Jun 2020 21:57:46 +0000 (23:57 +0200)]
media: ccs: Change my e-mail address

Use my @linux.intel.com e-mail address in the CCS driver.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: ccs-pll: Fix MODULE_LICENSE
Sakari Ailus [Fri, 2 Oct 2020 11:36:14 +0000 (13:36 +0200)]
media: ccs-pll: Fix MODULE_LICENSE

Change MODULE_LICENSE to "GPL v2" as indicated by the SPDX tag.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: smiapp-pll: Rename as ccs-pll
Sakari Ailus [Wed, 27 May 2020 21:59:40 +0000 (23:59 +0200)]
media: smiapp-pll: Rename as ccs-pll

MIPI CCS replaces SMIA and SMIA++ as the current standard. CCS brings new
features while existing functionality will be supported. Rename the
smiapp-pll as ccs-pll accordingly.

Also add Intel copyright to the files.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: ccs: Read ireal numbers correctly
Sakari Ailus [Wed, 24 Jun 2020 13:39:05 +0000 (15:39 +0200)]
media: ccs: Read ireal numbers correctly

Some limit values are available in q16.q16 format, referred to as 32-bit
unsigned ireal in CCS. Read these correctly.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: ccs: Move limit value real to integer conversion from read to access time
Sakari Ailus [Wed, 2 Sep 2020 10:46:59 +0000 (12:46 +0200)]
media: ccs: Move limit value real to integer conversion from read to access time

Instead of converting the limit values at register read time, do that at
access time instead.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: ccs: Make real to integer number conversion optional
Sakari Ailus [Wed, 2 Sep 2020 10:23:40 +0000 (12:23 +0200)]
media: ccs: Make real to integer number conversion optional

The limit values will be raw soon, and the conversion takes place later
on. Prepare for that.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: ccs: Refactor register reading a little
Sakari Ailus [Wed, 2 Sep 2020 10:09:03 +0000 (12:09 +0200)]
media: ccs: Refactor register reading a little

Rework quirk and 8-bit only access functions with a single function that
takes arguments. This is later extensible to support yet more flags.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: ccs: Replace somewhat harsh internal checks based on BUG with WARN_ON
Sakari Ailus [Wed, 27 May 2020 23:00:29 +0000 (01:00 +0200)]
media: ccs: Replace somewhat harsh internal checks based on BUG with WARN_ON

If an internal driver error was encountered, BUG was issued. Instead, do
less harsh WARN_ON_ONCE and try to manage with the consequences.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: ccs: The functions to get compose or crop rectangle never return NULL
Sakari Ailus [Wed, 27 May 2020 23:02:07 +0000 (01:02 +0200)]
media: ccs: The functions to get compose or crop rectangle never return NULL

The NULL check is not needed as the functions do not return NULL. Remove
the check (and BUG).

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: ccs: Stop reading arrays after the first zero
Sakari Ailus [Wed, 27 May 2020 08:35:01 +0000 (10:35 +0200)]
media: ccs: Stop reading arrays after the first zero

The register arrays have a certain size but not all the entries will be
relevant. In practice reading can be stopped after encountering a zero
value in the array. Do that to avoid extra reads.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: ccs: Read CCS static data from firmware binaries
Sakari Ailus [Fri, 14 Feb 2020 13:49:42 +0000 (14:49 +0100)]
media: ccs: Read CCS static data from firmware binaries

Read the CCS static data for sensors and modules. The files are expected
to be found in "ccs" directory.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: ccs: Combine revision number major and minor into one
Sakari Ailus [Fri, 14 Feb 2020 13:14:18 +0000 (14:14 +0100)]
media: ccs: Combine revision number major and minor into one

The module revision number major and minor are both 8 bits while the
sensor revision number is 16 bits. Combine the module revision into one
number.

This also adds printing the lowest 8 bits of the module version through
the sysfs attribute.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: ccs: Add CCS static data parser library
Sakari Ailus [Fri, 14 Feb 2020 09:00:35 +0000 (10:00 +0100)]
media: ccs: Add CCS static data parser library

Add a parser library for parsing the CCS static data format.

The library may be also compiled in user space as the format has uses also
in the user space. Therefore it is dual licensed under the 3-clause BSD
license as well.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: ccs: Fix obtaining bus information from firmware
Sakari Ailus [Wed, 30 Sep 2020 16:20:42 +0000 (18:20 +0200)]
media: ccs: Fix obtaining bus information from firmware

Let v4l2_fwnode_endpoint_alloc_parse to figure out the type of the data
bus. As the old bindings did not require the "bus-type" property, we need
to rely on guessing between CSI-2 D-PHY and CCP2. Setting the type to
CSI-2 D-PHY will parse just that and succeed even if no data-lanes are
set.

Also add a comment on the matter to the driver to avoid breaking this in
the future.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: ccs: Make hwcfg part of the device specific struct
Sakari Ailus [Tue, 11 Feb 2020 21:41:39 +0000 (22:41 +0100)]
media: ccs: Make hwcfg part of the device specific struct

There's no need to allocate the hardware configuration struct separately.
Put it in struct ccs_sensor.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: ccs: Remove remaining support for platform data
Sakari Ailus [Tue, 11 Feb 2020 21:35:40 +0000 (22:35 +0100)]
media: ccs: Remove remaining support for platform data

No need to support platform data; remove support for conveying hardware
configuration that way.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: ccs: Remove the I²C ID table
Sakari Ailus [Tue, 11 Feb 2020 21:32:36 +0000 (22:32 +0100)]
media: ccs: Remove the I²C ID table

The I²C ID table is no longer needed; remove it.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: ccs: Add CCS ACPI device ID
Sakari Ailus [Mon, 3 Feb 2020 11:44:35 +0000 (12:44 +0100)]
media: ccs: Add CCS ACPI device ID

The CCS compliant sensors use device ID "MIPI0200". Use this id for ACPI
device matching.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: ccs: Add device compatible identifiers for telling SMIA and CCS apart
Sakari Ailus [Mon, 21 Sep 2020 16:04:47 +0000 (18:04 +0200)]
media: ccs: Add device compatible identifiers for telling SMIA and CCS apart

Add device data specific to DT compatible ID to tell SMIA and CCS devices
apart already in power-up.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: ccs: Add MIPI CCS compatible strings
Sakari Ailus [Tue, 11 Feb 2020 21:31:51 +0000 (22:31 +0100)]
media: ccs: Add MIPI CCS compatible strings

Add "mipi-ccs-1.0" and "mipi-ccs-1.1" compatible strings to the CCS
driver.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: Documentation: ccs: Reorder SPDX and copyright notice lines
Sakari Ailus [Wed, 2 Dec 2020 14:18:19 +0000 (15:18 +0100)]
media: Documentation: ccs: Reorder SPDX and copyright notice lines

Move the SPDX tag to the top, placing the copyright notice after that.
This aligns the file with existing practices.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: Documentation: ccs: Rename ccs-regs.txt as ccs-regs.asc
Sakari Ailus [Wed, 2 Dec 2020 14:16:57 +0000 (15:16 +0100)]
media: Documentation: ccs: Rename ccs-regs.txt as ccs-regs.asc

As documentation used to be in .txt files before converting to ReST,
rename ccs-regs.txt to avoid it being taken as documentation that
pre-dates ReST conversion and so target for further conversion to ReST.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: rockchip: rkisp1: remove useless debugfs checks
Dan Carpenter [Tue, 1 Dec 2020 14:30:58 +0000 (15:30 +0100)]
media: rockchip: rkisp1: remove useless debugfs checks

The debugfs_create_dir() function never returns NULLs so this code will
never be executed.  It's not intended that callers will check for
debugfs errors in the normal case and it's not necessary in this driver,
so we can just delete this code.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Helen Koike <helen.koike@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: stop pretending to maintain cafe and ov7670
Jonathan Corbet [Mon, 30 Nov 2020 22:52:21 +0000 (23:52 +0100)]
media: stop pretending to maintain cafe and ov7670

It's been a long time since I could credibly claim to be maintaining these
drivers; I'm not even sure my hardware works anymore.  Mark them orphan.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: saa7146: switch from 'pci_' to 'dma_' API
Christophe JAILLET [Sun, 29 Nov 2020 12:30:11 +0000 (13:30 +0100)]
media: saa7146: switch from 'pci_' to 'dma_' API

The wrappers in include/linux/pci-dma-compat.h should go away.

The patch has been generated with the coccinelle script below and has been
hand modified to replace GFP_ with a correct flag.
It has been compile tested.

When memory is allocated in 'saa7146_pgtable_alloc()' GFP_KERNEL can be
used because the callers are either .buf_prepare functions or function that
already use GFP_KERNEL (hidden in a 'vmalloc_32()' call).

When memory is allocated in 'saa7146_init_one()' GFP_KERNEL can be used
because it is probe function and no lock is taken in the between.

When memory is allocated in 'saa7146_vv_init()' GFP_KERNEL can be used
because this function already uses GFP_KERNEL and no lock is taken in the
between.

When memory is allocated in 'vbi_workaround()' GFP_KERNEL can be used
because it is only called from a .open function.

@@
@@
-    PCI_DMA_BIDIRECTIONAL
+    DMA_BIDIRECTIONAL

@@
@@
-    PCI_DMA_TODEVICE
+    DMA_TO_DEVICE

@@
@@
-    PCI_DMA_FROMDEVICE
+    DMA_FROM_DEVICE

@@
@@
-    PCI_DMA_NONE
+    DMA_NONE

@@
expression e1, e2, e3;
@@
-    pci_alloc_consistent(e1, e2, e3)
+    dma_alloc_coherent(&e1->dev, e2, e3, GFP_)

@@
expression e1, e2, e3;
@@
-    pci_zalloc_consistent(e1, e2, e3)
+    dma_alloc_coherent(&e1->dev, e2, e3, GFP_)

@@
expression e1, e2, e3, e4;
@@
-    pci_free_consistent(e1, e2, e3, e4)
+    dma_free_coherent(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_map_single(e1, e2, e3, e4)
+    dma_map_single(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_unmap_single(e1, e2, e3, e4)
+    dma_unmap_single(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4, e5;
@@
-    pci_map_page(e1, e2, e3, e4, e5)
+    dma_map_page(&e1->dev, e2, e3, e4, e5)

@@
expression e1, e2, e3, e4;
@@
-    pci_unmap_page(e1, e2, e3, e4)
+    dma_unmap_page(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_map_sg(e1, e2, e3, e4)
+    dma_map_sg(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_unmap_sg(e1, e2, e3, e4)
+    dma_unmap_sg(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_dma_sync_single_for_cpu(e1, e2, e3, e4)
+    dma_sync_single_for_cpu(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_dma_sync_single_for_device(e1, e2, e3, e4)
+    dma_sync_single_for_device(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_dma_sync_sg_for_cpu(e1, e2, e3, e4)
+    dma_sync_sg_for_cpu(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_dma_sync_sg_for_device(e1, e2, e3, e4)
+    dma_sync_sg_for_device(&e1->dev, e2, e3, e4)

@@
expression e1, e2;
@@
-    pci_dma_mapping_error(e1, e2)
+    dma_mapping_error(&e1->dev, e2)

@@
expression e1, e2;
@@
-    pci_set_dma_mask(e1, e2)
+    dma_set_mask(&e1->dev, e2)

@@
expression e1, e2;
@@
-    pci_set_consistent_dma_mask(e1, e2)
+    dma_set_coherent_mask(&e1->dev, e2)

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: ttpci: switch from 'pci_' to 'dma_' API
Christophe JAILLET [Fri, 27 Nov 2020 20:58:01 +0000 (21:58 +0100)]
media: ttpci: switch from 'pci_' to 'dma_' API

The wrappers in include/linux/pci-dma-compat.h should go away.

The patch has been generated with the coccinelle script below and has been
hand modified to replace GFP_ with a correct flag.
It has been compile tested.

When memory is allocated in 'av7110_attach()' GFP_KERNEL can be used
because this flag is already used above in the same function and no lock is
taken in the between.

@@
@@
-    PCI_DMA_BIDIRECTIONAL
+    DMA_BIDIRECTIONAL

@@
@@
-    PCI_DMA_TODEVICE
+    DMA_TO_DEVICE

@@
@@
-    PCI_DMA_FROMDEVICE
+    DMA_FROM_DEVICE

@@
@@
-    PCI_DMA_NONE
+    DMA_NONE

@@
expression e1, e2, e3;
@@
-    pci_alloc_consistent(e1, e2, e3)
+    dma_alloc_coherent(&e1->dev, e2, e3, GFP_)

@@
expression e1, e2, e3;
@@
-    pci_zalloc_consistent(e1, e2, e3)
+    dma_alloc_coherent(&e1->dev, e2, e3, GFP_)

@@
expression e1, e2, e3, e4;
@@
-    pci_free_consistent(e1, e2, e3, e4)
+    dma_free_coherent(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_map_single(e1, e2, e3, e4)
+    dma_map_single(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_unmap_single(e1, e2, e3, e4)
+    dma_unmap_single(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4, e5;
@@
-    pci_map_page(e1, e2, e3, e4, e5)
+    dma_map_page(&e1->dev, e2, e3, e4, e5)

@@
expression e1, e2, e3, e4;
@@
-    pci_unmap_page(e1, e2, e3, e4)
+    dma_unmap_page(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_map_sg(e1, e2, e3, e4)
+    dma_map_sg(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_unmap_sg(e1, e2, e3, e4)
+    dma_unmap_sg(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_dma_sync_single_for_cpu(e1, e2, e3, e4)
+    dma_sync_single_for_cpu(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_dma_sync_single_for_device(e1, e2, e3, e4)
+    dma_sync_single_for_device(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_dma_sync_sg_for_cpu(e1, e2, e3, e4)
+    dma_sync_sg_for_cpu(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_dma_sync_sg_for_device(e1, e2, e3, e4)
+    dma_sync_sg_for_device(&e1->dev, e2, e3, e4)

@@
expression e1, e2;
@@
-    pci_dma_mapping_error(e1, e2)
+    dma_mapping_error(&e1->dev, e2)

@@
expression e1, e2;
@@
-    pci_set_dma_mask(e1, e2)
+    dma_set_mask(&e1->dev, e2)

@@
expression e1, e2;
@@
-    pci_set_consistent_dma_mask(e1, e2)
+    dma_set_coherent_mask(&e1->dev, e2)

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: solo6x10: switch from 'pci_' to 'dma_' API
Christophe JAILLET [Fri, 27 Nov 2020 20:34:40 +0000 (21:34 +0100)]
media: solo6x10: switch from 'pci_' to 'dma_' API

The wrappers in include/linux/pci-dma-compat.h should go away.

The patch has been generated with the coccinelle script below and has been
hand modified to replace GFP_ with a correct flag.
It has been compile tested.

When memory is allocated in 'snd_solo_pcm_open()' (solo6x10-g723.c)
GFP_KERNEL can be used because this flag is already used jew a few lines
above.

When memory is allocated in 'solo_enc_alloc()' (solo6x10-v4l2-enc.c)
GFP_KERNEL can be used because this flag is already used jew a few lines
above.

When memory is allocated in 'solo_enc_v4l2_init()' (solo6x10-v4l2-enc.c)
GFP_KERNEL can be used because calls 'solo_enc_alloc()' which already uses
this flag.

@@
@@
-    PCI_DMA_BIDIRECTIONAL
+    DMA_BIDIRECTIONAL

@@
@@
-    PCI_DMA_TODEVICE
+    DMA_TO_DEVICE

@@
@@
-    PCI_DMA_FROMDEVICE
+    DMA_FROM_DEVICE

@@
@@
-    PCI_DMA_NONE
+    DMA_NONE

@@
expression e1, e2, e3;
@@
-    pci_alloc_consistent(e1, e2, e3)
+    dma_alloc_coherent(&e1->dev, e2, e3, GFP_)

@@
expression e1, e2, e3;
@@
-    pci_zalloc_consistent(e1, e2, e3)
+    dma_alloc_coherent(&e1->dev, e2, e3, GFP_)

@@
expression e1, e2, e3, e4;
@@
-    pci_free_consistent(e1, e2, e3, e4)
+    dma_free_coherent(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_map_single(e1, e2, e3, e4)
+    dma_map_single(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_unmap_single(e1, e2, e3, e4)
+    dma_unmap_single(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4, e5;
@@
-    pci_map_page(e1, e2, e3, e4, e5)
+    dma_map_page(&e1->dev, e2, e3, e4, e5)

@@
expression e1, e2, e3, e4;
@@
-    pci_unmap_page(e1, e2, e3, e4)
+    dma_unmap_page(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_map_sg(e1, e2, e3, e4)
+    dma_map_sg(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_unmap_sg(e1, e2, e3, e4)
+    dma_unmap_sg(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_dma_sync_single_for_cpu(e1, e2, e3, e4)
+    dma_sync_single_for_cpu(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_dma_sync_single_for_device(e1, e2, e3, e4)
+    dma_sync_single_for_device(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_dma_sync_sg_for_cpu(e1, e2, e3, e4)
+    dma_sync_sg_for_cpu(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_dma_sync_sg_for_device(e1, e2, e3, e4)
+    dma_sync_sg_for_device(&e1->dev, e2, e3, e4)

@@
expression e1, e2;
@@
-    pci_dma_mapping_error(e1, e2)
+    dma_mapping_error(&e1->dev, e2)

@@
expression e1, e2;
@@
-    pci_set_dma_mask(e1, e2)
+    dma_set_mask(&e1->dev, e2)

@@
expression e1, e2;
@@
-    pci_set_consistent_dma_mask(e1, e2)
+    dma_set_coherent_mask(&e1->dev, e2)

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Ismael Luceno <ismael@iodev.co.uk>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: si4713: remove trailing semicolon in macro definition
Tom Rix [Fri, 27 Nov 2020 16:44:08 +0000 (17:44 +0100)]
media: si4713: remove trailing semicolon in macro definition

The macro use will already have a semicolon.

[hverkuil: also add () around p in the macro]

Signed-off-by: Tom Rix <trix@redhat.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: staging/imx: Increase IMX_MEDIA_EOF_TIMEOUT
Fabio Estevam [Fri, 27 Nov 2020 16:09:45 +0000 (17:09 +0100)]
media: staging/imx: Increase IMX_MEDIA_EOF_TIMEOUT

When trying to capture video on a imx6dl-based board with an ADV7280,
the following timeout error is observed:

v4l2-ctl --stream-mmap -d /dev/video2
[   22.792049] ipu1_csi1: EOF timeout
VIDIOC_DQBUF: failed: Input/output error

Increase the IMX_MEDIA_EOF_TIMEOUT to avoid such problem.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: camss: Make use of V4L2_CAP_IO_MC
Andrey Konovalov [Thu, 26 Nov 2020 15:01:57 +0000 (16:01 +0100)]
media: camss: Make use of V4L2_CAP_IO_MC

Implement mbus_code filtering for format enumeration.

Without this patch libcamera errors out with:
"ERROR V4L2 v4l2_videodevice.cpp:982 /dev/video0[cap]: Media bus code
filtering not supported by the device"

This is the second version of this change which handles the case of
several pixel formats corresponding to one media bus format correctly.

Signed-off-by: Andrey Konovalov <andrey.konovalov@linaro.org>
Reviewed-by: Robert Foss <robert.foss@linaro.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: Revert "media: camss: Make use of V4L2_CAP_IO_MC"
Andrey Konovalov [Thu, 26 Nov 2020 15:01:56 +0000 (16:01 +0100)]
media: Revert "media: camss: Make use of V4L2_CAP_IO_MC"

This reverts commit c90f1178dcac30dee5ddd29ec0513e7589aa866e.

The assumption of "Each entry in formats[] table has unique mbus_code"
is valid for the RDI entities, but not for the PIX ones.

Reverting this patch and creating a new one which handles the PIX entities
correctly results in smaller and more straightforward patch than doing the
changes on top of the current version.

Signed-off-by: Andrey Konovalov <andrey.konovalov@linaro.org>
Reviewed-by: Robert Foss <robert.foss@linaro.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: rockchip: rkisp1: Fix typos in comments and macro definitions
Peilin Ye [Thu, 26 Nov 2020 12:21:48 +0000 (13:21 +0100)]
media: rockchip: rkisp1: Fix typos in comments and macro definitions

Fix 4 typos under drivers/media/platform/rockchip/rkisp1/ found by
checkpatch, including the RKISP1_CIF_MI_{M,S}P_PINGPONG_ENABLE macro
definitions.

Signed-off-by: Peilin Ye <yepeilin.cs@gmail.com>
Acked-by: Helen Koike <helen.koike@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: rcar-vin: Remove unused macro
Jacopo Mondi [Thu, 26 Nov 2020 07:47:56 +0000 (08:47 +0100)]
media: rcar-vin: Remove unused macro

The VNCSI_IFMD_CSI_CHSEL_MASK is not used: remove it.

Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: fsl-viu: Use the ioread/write32be() accessors
Fabio Estevam [Wed, 25 Nov 2020 12:04:47 +0000 (13:04 +0100)]
media: fsl-viu: Use the ioread/write32be() accessors

Since commit 29d750686331 ("media: fsl-viu: allow building it with
COMPILE_TEST") there were several attempts to fix build failures on
PPC, MICROBLAZE and M68K.

However, such errors are still present as reported by kbuild robot.

Fix the problem by using the ioread/write32be() accessors, which build
fine on all platforms.

Reported-by: kernel test robot <lkp@intel.com>
Suggested-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Reviewed-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: platform: exynos4-is: remove all references to physical addresses
Marek Szyprowski [Tue, 24 Nov 2020 08:41:28 +0000 (09:41 +0100)]
media: platform: exynos4-is: remove all references to physical addresses

This driver always operates on the DMA/IOVA addresses, so calling them
physical addresses is misleading, although when no IOMMU is used they
equal each other. Fix this by renaming all such entries to 'addr' and
adjusting comments.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: adv748x: Configure device when resuming from sleep
Niklas Söderlund [Sun, 22 Nov 2020 16:36:37 +0000 (17:36 +0100)]
media: adv748x: Configure device when resuming from sleep

If the device is powered off (for example during system suspend to ram)
the devices loses its configuration, especially the slave i2c mappings
and other configuration set at probe time. This renders the device
unusable and the only way to recover is to unbind and rebind the device
to the driver to run the probe setup again.

Add an early resume callback that reinitializes the device and setup the
slave i2c address mappings and other probe time configuration.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: adv748x: csi2: Set virtual channel when device is reset
Niklas Söderlund [Sun, 22 Nov 2020 16:36:36 +0000 (17:36 +0100)]
media: adv748x: csi2: Set virtual channel when device is reset

It's not enough to set the CSI-2 virtual channel for TXA and TXB during
probe: it also needs to be set when the device is reset. Move the virtual
channel selection to adv748x_reset() that is called during probe and
when the device needs to be reset.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: adv748x: afe: Select input port when device is reset
Niklas Söderlund [Sun, 22 Nov 2020 16:36:35 +0000 (17:36 +0100)]
media: adv748x: afe: Select input port when device is reset

It's not enough to select the AFE input port during probe: it also needs
to be set when the device is reset. Move the port selection to
adv748x_reset() that is called during probe and when the device needs to
be reset.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: adv748x: Only set i2c addresses once during probe
Niklas Söderlund [Sun, 22 Nov 2020 16:30:48 +0000 (17:30 +0100)]
media: adv748x: Only set i2c addresses once during probe

During probe the i2c slave addresses are set two times in a row, once in
adv748x_initialise_clients() and once directly after in adv748x_reset().
Remove the call to adv748x_set_slave_addresses() in
adv748x_initialise_clients() as it's only called during probe while
adv748x_reset() is called during probe and normal operation.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: saa7146: fix array overflow in vidioc_s_audio()
Dan Carpenter [Tue, 17 Nov 2020 07:23:40 +0000 (08:23 +0100)]
media: saa7146: fix array overflow in vidioc_s_audio()

The "a->index" value comes from the user via the ioctl.  The problem is
that the shift can wrap resulting in setting "mxb->cur_audinput" to an
invalid value, which later results in an array overflow.

Fixes: 6680427791c9 ("[media] mxb: fix audio handling")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: meson: vdec: add G12/SM1 to module description
Christian Hewitt [Mon, 16 Nov 2020 04:30:55 +0000 (05:30 +0100)]
media: meson: vdec: add G12/SM1 to module description

The meson vdec driver also supports Amlogic G12/SM1 hardware.

Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: s5p-jpeg: handle error condition in s5p_jpeg_probe
Baskov Evgeniy [Fri, 13 Nov 2020 16:06:25 +0000 (17:06 +0100)]
media: s5p-jpeg: handle error condition in s5p_jpeg_probe

If an error happens in jpeg_get_drv_data(), i.e. match fails,
jpeg->variant field is NULL, so we cannot access it.

Consider device probe failed if jpeg->variant is NULL.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Baskov Evgeniy <baskov@ispras.ru>
Acked-by: Andrzej Pietrasiewicz <andrzejtp2010@gmail.com>
Acked-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: cedrus: Add support for VP8 decoding
Jernej Skrabec [Tue, 10 Nov 2020 22:35:40 +0000 (23:35 +0100)]
media: cedrus: Add support for VP8 decoding

VP8 in Cedrus shares same engine as H264.

Note that it seems necessary to call bitstream parsing functions,
to parse frame header, otherwise decoded image is garbage. This is
contrary to what is driver supposed to do. However, values are not
really used, so this might be acceptable. It's possible that bitstream
parsing functions set some internal VPU state, which is later necessary
for proper decoding. Biggest suspect is "VP8 probs update" trigger.

Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Signed-off-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: hantro: Use VP8 lengths defined in uapi
Emmanuel Gil Peyrot [Mon, 9 Nov 2020 16:22:44 +0000 (17:22 +0100)]
media: hantro: Use VP8 lengths defined in uapi

Use the new defines instead of hardcoding the VP8 lengths.

[hverkuil: add commit log]

Signed-off-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: uapi: Expose VP8 probability lengths as defines
Emmanuel Gil Peyrot [Mon, 9 Nov 2020 16:22:43 +0000 (17:22 +0100)]
media: uapi: Expose VP8 probability lengths as defines

These values will be used by various drivers implementing the VP8
stateless API.

This had been suggested by Ezequiel Garcia for the Cedrus VP8 driver.

Signed-off-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: mtk-vpu: dump VPU status when IPI times out
Irui Wang [Thu, 29 Oct 2020 01:17:21 +0000 (02:17 +0100)]
media: mtk-vpu: dump VPU status when IPI times out

when IPI time out, dump VPU status to get more debug information

Signed-off-by: Irui Wang <irui.wang@mediatek.com>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: mtk-vpu: VPU should be in idle state before system is suspended
Irui Wang [Thu, 29 Oct 2020 01:17:20 +0000 (02:17 +0100)]
media: mtk-vpu: VPU should be in idle state before system is suspended

VPU should be in idle state before system is suspended
or it will work abnormally like VPU program counter not
in a correct address or VPU reset

Signed-off-by: Irui Wang <irui.wang@mediatek.com>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: coda: Convert the driver to DT-only
Fabio Estevam [Wed, 2 Dec 2020 14:13:26 +0000 (15:13 +0100)]
media: coda: Convert the driver to DT-only

Since 5.10-rc1 i.MX is a devicetree-only platform, so simplify the code
by removing the unused non-DT support.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: tvp5150: Fix wrong return value of tvp5150_parse_dt()
Zhang Xiaoxu [Mon, 16 Nov 2020 14:18:01 +0000 (15:18 +0100)]
media: tvp5150: Fix wrong return value of tvp5150_parse_dt()

If of_graph_get_endpoint_by_regs() return NULL, it will return 0 rather
than an errno, because we doesn't initialize the return value.

Fixes: 0556f1d580d4 ("media: tvp5150: add input source selection of_graph support")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhang Xiaoxu <zhangxiaoxu5@huawei.com>
Reviewed-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: cx88: use ARRAY_SIZE
Xu Wang [Fri, 13 Nov 2020 07:21:11 +0000 (08:21 +0100)]
media: cx88: use ARRAY_SIZE

Use ARRAY_SIZE instead of dividing sizeof array with sizeof an element

Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: cedrus: Add support for V3s
Martin Cerveny [Mon, 16 Nov 2020 12:56:15 +0000 (13:56 +0100)]
media: cedrus: Add support for V3s

V3s video engine runs at lower speed and support video decoder
for H.264 and JPEG/MJPEG only.

Signed-off-by: Martin Cerveny <m.cerveny@computer.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: dt-bindings: media: cedrus: Add V3s compatible
Martin Cerveny [Mon, 16 Nov 2020 12:56:16 +0000 (13:56 +0100)]
media: dt-bindings: media: cedrus: Add V3s compatible

Allwinner V3s SoC contains video engine. Add compatible for it.

Signed-off-by: Martin Cerveny <m.cerveny@computer.org>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: cedrus: Register all codecs as capability
Martin Cerveny [Mon, 16 Nov 2020 12:56:12 +0000 (13:56 +0100)]
media: cedrus: Register all codecs as capability

All codecs should have capabilities.
For example "Allwinner V3s" does not support "MPEG2".

Signed-off-by: Martin Cerveny <m.cerveny@computer.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: cx23885: add more quirks for reset DMA on some AMD IOMMU
Daniel Lee Kruse [Wed, 30 Sep 2020 03:36:35 +0000 (05:36 +0200)]
media: cx23885: add more quirks for reset DMA on some AMD IOMMU

On AMD Family 15h (Models 30h-3fh), I/O Memory Management Unit
RiSC engine sometimes stalls, requiring a reset.

As result, MythTV and w-scan won't scan channels on the AMD Kaveri
APU with the Hauppauge QuadHD TV tuner card.

For the solution I added the Input/Output Memory Management Unit's PCI
Identity of 0x1423 to the broken_dev_id[] array, which is used by
a quirks logic meant to fix similar problems with other AMD
chipsets.

Signed-off-by: Daniel Lee Kruse <daniel.lee.kruse@protonmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: rockchip: rkisp1: Constify static structs
Rikard Falkeborn [Thu, 19 Nov 2020 22:18:49 +0000 (23:18 +0100)]
media: rockchip: rkisp1: Constify static structs

These 'ops' structs are never modified, so make them const to allow the
compiler to put them in read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Reviewed-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: i2c: imx219: Selection compliance fixes
Hans Verkuil [Wed, 5 Aug 2020 10:57:21 +0000 (12:57 +0200)]
media: i2c: imx219: Selection compliance fixes

To comply with the intended usage of the V4L2 selection target when
used to retrieve a sensor image properties, adjust the rectangles
returned by the imx219 driver.

The top/left crop coordinates of the TGT_CROP rectangle were set to
(0, 0) instead of (8, 8) which is the offset from the larger physical
pixel array rectangle. This was also a mismatch with the default values
crop rectangle value, so this is corrected. Found with v4l2-compliance.

While at it, add V4L2_SEL_TGT_CROP_BOUNDS support: CROP_DEFAULT and
CROP_BOUNDS have the same size as the non-active pixels are not readable
using the selection API. Found with v4l2-compliance.

[reword commit message, use macros for pixel offsets]

Fixes: e6d4ef7d58aa7 ("media: i2c: imx219: Implement get_selection")
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: dt-bindings: media: Use OF graph schema
Rob Herring [Tue, 17 Nov 2020 01:39:47 +0000 (02:39 +0100)]
media: dt-bindings: media: Use OF graph schema

Now that we have a graph schema, rework the media related schemas to
use it. Mostly this is adding a reference to graph.yaml and dropping
duplicate parts from schemas.

Cc: Maxime Ripard <mripard@kernel.org>
Cc: Jacopo Mondi <jacopo@jmondi.org>
Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: rdacm20: Enable GPIO1 explicitly
Jacopo Mondi [Fri, 20 Nov 2020 16:15:29 +0000 (17:15 +0100)]
media: rdacm20: Enable GPIO1 explicitly

The MAX9271 GPIO1 line that controls the sensor reset is by default
enabled after a serializer chip reset.

As rdacm20 does not go through an explicit serializer reset, make sure
GPIO1 is enabled to make the camera module driver more robust.

Fixes: 34009bffc1c6 ("media: i2c: Add RDACM20 driver")
Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: max9271: Fix GPIO enable/disable
Jacopo Mondi [Fri, 20 Nov 2020 16:15:28 +0000 (17:15 +0100)]
media: max9271: Fix GPIO enable/disable

Fix GPIO enable/disable operations which wrongly read the 0x0f register
to obtain the current mask of the enabled lines instead of using
the correct 0x0e register.

Also fix access to bit 0 of the register which is marked as reserved.

Fixes: 34009bffc1c6 ("media: i2c: Add RDACM20 driver")
Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: v4l2-fwnode: Remove v4l2_async_notifier_parse_fwnode_endpoints_by_port()
Niklas Söderlund [Wed, 25 Nov 2020 16:44:50 +0000 (17:44 +0100)]
media: v4l2-fwnode: Remove v4l2_async_notifier_parse_fwnode_endpoints_by_port()

There are no users left of this helper and as it implements an
undesirable and too simple behaviour that should instead be implemented
directly by drivers remove it to prevent future uses of it.

Suggested-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: rcar-vin: Rework CSI-2 firmware parsing
Niklas Söderlund [Wed, 25 Nov 2020 16:44:49 +0000 (17:44 +0100)]
media: rcar-vin: Rework CSI-2 firmware parsing

Rework the CSI-2 firmware parsing code to not use the soon to be
removed v4l2_async_notifier_parse_fwnode_endpoints_by_port() helper. The
change only aims to prepare for the removing of the old helper and there
are no functional change.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: rcar-vin: Use v4l2_async_subdev instead of fwnode_handle to match subdevices
Niklas Söderlund [Wed, 25 Nov 2020 16:44:48 +0000 (17:44 +0100)]
media: rcar-vin: Use v4l2_async_subdev instead of fwnode_handle to match subdevices

In preparation of removing the usage of the old helper
v4l2_async_notifier_parse_fwnode_endpoints_by_port() use the
v4l2_async_subdev instead of fwnode_handle to match subdevices.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: rcar-vin: Rework parallel firmware parsing
Niklas Söderlund [Wed, 25 Nov 2020 16:44:47 +0000 (17:44 +0100)]
media: rcar-vin: Rework parallel firmware parsing

Rework the parallel firmware parsing code to not use the soon to be
removed v4l2_async_notifier_parse_fwnode_endpoints_by_port() helper. The
change only aims to prepare for the removing of the old helper and there
are no functional change.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: rcar-vin: Only dynamically allocate v4l2_async_subdev
Niklas Söderlund [Wed, 25 Nov 2020 16:44:46 +0000 (17:44 +0100)]
media: rcar-vin: Only dynamically allocate v4l2_async_subdev

In preparation of removing the usage of the old helper
v4l2_async_notifier_parse_fwnode_endpoints_by_port() do not dynamically
allocate the whole structure containing the parameters for the parallel
interface, instead only allocate the v4l2_async_subdev structure. There
is no functional change.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: ov2740: fix dereference before null check on pointer nvm
Colin Ian King [Thu, 26 Nov 2020 11:49:32 +0000 (12:49 +0100)]
media: ov2740: fix dereference before null check on pointer nvm

Currently pointer nvm is being dereferenced before it is being null
checked.  Fix this by moving the assignments of pointers client and
ov2740 so that are after the null check hence avoiding any potential
null pointer dereferences on pointer nvm.

Fixes: 5e6fd339b68d ("media: ov2740: allow OTP data access during streaming")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: i2c: add OV02A10 image sensor driver
Dongchun Zhu [Wed, 25 Nov 2020 14:17:56 +0000 (15:17 +0100)]
media: i2c: add OV02A10 image sensor driver

Add a V4L2 sub-device driver for OmniVision OV02A10 image sensor.

Signed-off-by: Dongchun Zhu <dongchun.zhu@mediatek.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: dt-bindings: media: i2c: document OV02A10 DT bindings
Dongchun Zhu [Wed, 25 Nov 2020 14:17:55 +0000 (15:17 +0100)]
media: dt-bindings: media: i2c: document OV02A10 DT bindings

Add device-tree binding documentation for OV02A10 image sensor driver,
and the relevant MAINTAINERS entries.

Signed-off-by: Dongchun Zhu <dongchun.zhu@mediatek.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: ov9734: hold lock to check streaming state
Bingbu Cao [Fri, 27 Nov 2020 03:48:12 +0000 (04:48 +0100)]
media: ov9734: hold lock to check streaming state

The lock in ov9734 is used to protect the streaming state and
serialize the stream on and off callbacks, it should be hold before
checking the streaming state in ov9734_set_stream().

Reported-by: Tomasz Figa <tfiga@chromium.org>
Reported-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Signed-off-by: Bingbu Cao <bingbu.cao@intel.com>
Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: v4l: subdev: Set sd->devnode before registering the subdev
Sakari Ailus [Thu, 15 Aug 2019 07:36:49 +0000 (09:36 +0200)]
media: v4l: subdev: Set sd->devnode before registering the subdev

The subdev's video device node was only assigned after registering the
device node in the system. While it is unlikely that a driver needed to
use this field in handling system calls to its file handle, there remains
a slim chance the devnode field remains NULL while the driver expects to
find a video node there.

Assign the devnode field before registering the device, and assign it back
to NULL if the registration failed.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: omap3isp: Remove misleading comment
Thomas Gleixner [Fri, 13 Nov 2020 14:28:31 +0000 (15:28 +0100)]
media: omap3isp: Remove misleading comment

in_interrupt() covers hard and soft interrupt servicing and bottom half
disabled contexts, which is semantically undefined and useless.

The comment for __ccdc_lsc_configure() "Context: in_interrupt()" is
therefore as useful as "Context: unknown'. Remove it.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: ccs: Request for "reset" GPIO
Sakari Ailus [Thu, 18 Jun 2020 11:12:51 +0000 (13:12 +0200)]
media: ccs: Request for "reset" GPIO

The DT bindings documented "reset-gpios" property but the driver never
made use of it. Instead it used a GPIO called "xshutdown", with apprently
wrong polarity.

Fix this by requesting "reset" GPIO with the right polarity first, and if
that fails, then request "xshutdown" GPIO with the old polarity. This way
it works for new users as expected while if someone, somewhere, depended
on "xshutdown" GPIO, that continues to work as well.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: dt-bindings: mipi-ccs: Add bus-type for C-PHY support
Sakari Ailus [Tue, 29 Sep 2020 12:51:29 +0000 (14:51 +0200)]
media: dt-bindings: mipi-ccs: Add bus-type for C-PHY support

The bus-type property is required for C-PHY support. Add it, including
values for CCP2 and CSI-2 D-PHY.

Also require the bus-type property. Effectively all new sensors are MIPI
D-PHY or C-PHY that cannot be told apart without the bus-type property.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: dt-bindings: nokia,smia: Amend SMIA bindings with MIPI CCS support
Sakari Ailus [Tue, 11 Feb 2020 21:26:25 +0000 (22:26 +0100)]
media: dt-bindings: nokia,smia: Amend SMIA bindings with MIPI CCS support

Amend the existing SMIA bindings by adding MIPI CCS support, with separate
compatible strings for CCS 1.0 and CCS 1.1. Rename the old bindings
accordingly as CCS is the current standard.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: dt-bindings: nokia,smia: Use better active polarity for reset
Sakari Ailus [Tue, 29 Sep 2020 12:40:40 +0000 (14:40 +0200)]
media: dt-bindings: nokia,smia: Use better active polarity for reset

Generally reset signal is active low on camera sensors. The example had it
high. Make it low, and use GPIO_ACTIVE_LOW in gpio.h for that.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: dt-bindings: nokia,smia: Convert to YAML
Sakari Ailus [Tue, 29 Sep 2020 11:32:17 +0000 (13:32 +0200)]
media: dt-bindings: nokia,smia: Convert to YAML

Convert nokia,smia DT bindings to YAML.

Also add explicit license to bindings.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: dt-bindings: nokia,smia: Remove nokia,nvm-size property
Sakari Ailus [Thu, 1 Oct 2020 11:50:44 +0000 (13:50 +0200)]
media: dt-bindings: nokia,smia: Remove nokia,nvm-size property

nokia,nvm-size property was removed from the bindings but it was left in
the example. Remove it from the example, too.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: dt-bindings: nokia,smia: Make vana-supply optional
Sakari Ailus [Tue, 29 Sep 2020 11:28:28 +0000 (13:28 +0200)]
media: dt-bindings: nokia,smia: Make vana-supply optional

vana-supply is optional in the spec, therefore make it optional in
bindings, too.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: dt-bindings: nokia,smia: Fix link-frequencies documentation
Sakari Ailus [Tue, 29 Sep 2020 11:14:00 +0000 (13:14 +0200)]
media: dt-bindings: nokia,smia: Fix link-frequencies documentation

The link-frequencies property belongs to the endpoint, not to the node
representing the device.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: ccs: Give all subdevs a function
Sakari Ailus [Tue, 11 Feb 2020 21:01:14 +0000 (22:01 +0100)]
media: ccs: Give all subdevs a function

This removes a warning at driver probe time telling that one or two
entities have no function set. The function used for both the binner and
scaler is the scaler.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: ccs: Remove profile concept
Sakari Ailus [Tue, 11 Feb 2020 19:22:26 +0000 (20:22 +0100)]
media: ccs: Remove profile concept

The driver doesn't do anything tangible with profiles. Remove the notion,
and use the capabilities directly.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: smiapp: Rename as "ccs"
Sakari Ailus [Tue, 11 Feb 2020 18:05:57 +0000 (19:05 +0100)]
media: smiapp: Rename as "ccs"

Rename the "smiapp" driver as "ccs". MIPI CCS is the contemporary standard
for raw Bayer camera sensors. The driver retains support for the SMIA++
and SMIA compliant camera sensors. A module alias is added for old user
space using "smiapp" module name.

Add Intel copyright while at it.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: smiapp: Differentiate CCS sensors from SMIA in subdev naming
Sakari Ailus [Wed, 2 Sep 2020 13:51:29 +0000 (15:51 +0200)]
media: smiapp: Differentiate CCS sensors from SMIA in subdev naming

Call CCS compliant sensors as "ccs" instead of "smiapp" in absence of a
device specific name. This is done based on the value of the manufacturer
ID register that is only present in CCS.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: smiapp: Internal rename to CCS
Sakari Ailus [Tue, 11 Feb 2020 13:19:13 +0000 (14:19 +0100)]
media: smiapp: Internal rename to CCS

Rename internal names to reflect the driver's new reference. The module
name remains the same.

Also fix trivial coding style issues on the way related to e.g. alignment
changes due to the rename.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: smiapp: Rename register access functions
Sakari Ailus [Tue, 11 Feb 2020 11:16:14 +0000 (12:16 +0100)]
media: smiapp: Rename register access functions

Rename register access functions by changing smiapp to ccs.

The functions operating on register addresses have "addr" appended to the
name.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: smiapp: Remove quirk function for writing a single 8-bit register
Sakari Ailus [Tue, 11 Feb 2020 10:14:10 +0000 (11:14 +0100)]
media: smiapp: Remove quirk function for writing a single 8-bit register

This function is no longer needed as the smiapp_write() function can be
used to write 8-bit registers with plain register addresses.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: smiapp: Use CCS registers
Sakari Ailus [Tue, 11 Feb 2020 09:18:31 +0000 (10:18 +0100)]
media: smiapp: Use CCS registers

Switch to CCS standard registers where they exist. The still relevant SMIA
registers are left as-is and the redundant ones are removed.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: smiapp: Use CCS limits in reading binning capabilities
Sakari Ailus [Tue, 11 Feb 2020 09:37:47 +0000 (10:37 +0100)]
media: smiapp: Use CCS limits in reading binning capabilities

Use CCS limits for obtaining binning capabilities and subtypes.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: smiapp: Use CCS limits in reading data format descriptors
Sakari Ailus [Mon, 10 Feb 2020 14:02:32 +0000 (15:02 +0100)]
media: smiapp: Use CCS limits in reading data format descriptors

The CCS limits have the information so use it instead.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: smiapp: Obtain frame descriptor from CCS limits
Sakari Ailus [Mon, 10 Feb 2020 11:53:14 +0000 (12:53 +0100)]
media: smiapp: Obtain frame descriptor from CCS limits

Obtain the frame descriptor from the CCS limits, instead of reading them
directly from the frame descriptor registers.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: smiapp: Switch to CCS limits
Sakari Ailus [Mon, 10 Feb 2020 09:09:03 +0000 (10:09 +0100)]
media: smiapp: Switch to CCS limits

Use the CCS limit definitions instead of the SMIA ones. This allows
accessing CCS capabilities where needed as well as dropping the old SMIA
limits.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: smiapp: Read CCS limit values
Sakari Ailus [Thu, 6 Feb 2020 14:06:12 +0000 (15:06 +0100)]
media: smiapp: Read CCS limit values

Read limit and capability values into a driver allocated buffer. This will
later replace (most of) the existing SMIA limits.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: smiapp: Use MIPI CCS version and manufacturer ID information
Sakari Ailus [Mon, 3 Feb 2020 14:54:53 +0000 (15:54 +0100)]
media: smiapp: Use MIPI CCS version and manufacturer ID information

Read MIPI CCS manufacturer and version information, and use the CCS IDs
over SMIA whenever they are set.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: smiapp: Add macros for accessing CCS registers
Sakari Ailus [Mon, 3 Feb 2020 13:48:48 +0000 (14:48 +0100)]
media: smiapp: Add macros for accessing CCS registers

Add two helper macros for reading and writing the CCS registers as defined
in ccs-regs.h.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: smiapp: Remove macros for defining registers, merge definitions
Sakari Ailus [Thu, 28 May 2020 09:39:00 +0000 (11:39 +0200)]
media: smiapp: Remove macros for defining registers, merge definitions

Remove macros for defining new SMIA registers, instead put the register
flags to the register definition itself. Also move the register flags to
the same file.

This is not expected to be updated but rather left there as a reference.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>