media: pxa_camera: Use the new set_mbus_config op
authorJacopo Mondi <jacopo+renesas@jmondi.org>
Tue, 16 Jun 2020 14:12:39 +0000 (16:12 +0200)
committerpopcornmix <popcornmix@gmail.com>
Wed, 1 Jul 2020 15:34:13 +0000 (16:34 +0100)
commit127e3d7bf9ba922e67a84e217c5ed0c978d928f1
tree37c0be5af8200d917f02c15d2c5486fc3a1a93cc
parentd030be8fc776cff51de61be5177ab66a7891dd4c
media: pxa_camera: Use the new set_mbus_config op

Upstream https://patchwork.linuxtv.org/patch/64671/

Move the PXA camera driver to use the new set_mbus_config pad operation.
For this platform the change is not only cosmetic, as the pxa driver is
currently the only driver in mainline to make use of the g_mbus_config
and s_mbus_config video operations.

The existing driver semantic is the following:
- Collect all supported mbus config flags from the remote end
- Match them with the supported PXA mbus configuration flags
- If the remote subdevice allows multiple options for for VSYNC, HSYNC
  and PCLK polarity, use platform data requested settings

The semantic of the new get_mbus_config and set_mbus_config differs from
the corresponding video ops, particularly in the fact get_mbus_config
reports the current mbus configuration and not the set of supported
configuration options, with set_mbus_config always reporting the actual
mbus configuration applied to the remote subdevice.

Adapt the driver to perform the following
- Set the remote subdevice mbus configuration according to the PXA
  platform data preferences.
- If the applied configuration differs from the requested one (i.e. the
  remote subdevice does not allow changing one setting) make sure that
  - The remote end does not claim for DATA_ACTIVE_LOW, which seems not
    supported by the platform
  - The bus mastering roles match

While at there remove a few checks performed on the media bus
configuration at get_format() time as they do not belong there.

Compile-tested only.

Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
drivers/media/platform/pxa_camera.c