Skip to content
Permalink
Mansur-Alisha-…
Switch branches/tags

Commits on Jul 13, 2021

  1. venus: vdec: decoded picture buffer handling during reconfig sequence

    In existing implementation, driver is freeing and un-mapping all the
    decoded picture buffers(DPB) as part of dynamic resolution change(DRC)
    handling. As a result, when firmware try to access the DPB buffer, from
    previous sequence, SMMU context fault is seen due to the buffer being
    already unmapped.
    
    With this change, driver defines ownership of each DPB buffer. If a buffer
    is owned by firmware, driver would skip from un-mapping the same.
    
    Signed-off-by: Mansur Alisha Shaik <mansur@codeaurora.org>
    Mansur Alisha Shaik authored and intel-lab-lkp committed Jul 13, 2021

Commits on Jun 24, 2021

  1. media: Fix Media Controller API config checks

    Smatch static checker warns that "mdev" can be null:
    
    sound/usb/media.c:287 snd_media_device_create()
        warn: 'mdev' can also be NULL
    
    If CONFIG_MEDIA_CONTROLLER is disabled, this file should not be included
    in the build.
    
    The below conditions in the sound/usb/Makefile are in place to ensure that
    media.c isn't included in the build.
    
    sound/usb/Makefile:
    snd-usb-audio-$(CONFIG_SND_USB_AUDIO_USE_MEDIA_CONTROLLER) += media.o
    
    select SND_USB_AUDIO_USE_MEDIA_CONTROLLER if MEDIA_CONTROLLER &&
           (MEDIA_SUPPORT=y || MEDIA_SUPPORT=SND_USB_AUDIO)
    
    The following config check in include/media/media-dev-allocator.h is
    in place to enable the API only when CONFIG_MEDIA_CONTROLLER and
    CONFIG_USB are enabled.
    
     #if defined(CONFIG_MEDIA_CONTROLLER) && defined(CONFIG_USB)
    
    This check doesn't work as intended when CONFIG_USB=m. When CONFIG_USB=m,
    CONFIG_USB_MODULE is defined and CONFIG_USB is not. The above config check
    doesn't catch that CONFIG_USB is defined as a module and disables the API.
    This results in sound/usb enabling Media Controller specific ALSA driver
    code, while Media disables the Media Controller API.
    
    Fix the problem requires two changes:
    
    1. Change the check to use IS_ENABLED to detect when CONFIG_USB is enabled
       as a module or static. Since CONFIG_MEDIA_CONTROLLER is a bool, leave
       the check unchanged to be consistent with drivers/media/Makefile.
    
    2. Change the drivers/media/mc/Makefile to include mc-dev-allocator.o
       in mc-objs when CONFIG_USB is enabled.
    
    Link: https://lore.kernel.org/alsa-devel/YLeAvT+R22FQ%2FEyw@mwanda/
    
    Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
    Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
    Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
    Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
    shuahkh authored and mchehab committed Jun 24, 2021

Commits on Jun 17, 2021

  1. media: i2c: rdacm20: Re-work ov10635 reset

    The OV10635 image sensor embedded in the camera module is currently
    reset after the MAX9271 initialization with two long delays that were
    most probably not correctly characterized.
    
    Re-work the image sensor reset procedure by holding the chip in reset
    during the MAX9271 configuration, removing the long sleep delays and
    only wait after the chip exits from reset for 350-500 microseconds
    interval, which is larger than the minimum (2048 * (1 / XVCLK)) timeout
    characterized in the chip manual.
    
    Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
    Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
    Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
    Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
    Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
    Jacopo Mondi authored and mchehab committed Jun 17, 2021
  2. media: i2c: rdacm20: Check return values

    The camera module initialization routine does not check the return
    value of a few functions. Fix that.
    
    Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
    Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
    Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
    Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
    Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
    Jacopo Mondi authored and mchehab committed Jun 17, 2021
  3. media: i2c: rdacm20: Report camera module name

    When the device is identified the driver currently reports the
    names of the chips embedded in the camera module.
    
    Report the name of the camera module itself instead.
    Cosmetic change only.
    
    Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
    Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
    Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
    Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
    Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
    Jacopo Mondi authored and mchehab committed Jun 17, 2021
  4. media: i2c: rdacm20: Enable noise immunity

    Enable the noise immunity threshold at the end of the rdacm20
    initialization routine.
    
    The rdacm20 camera module has been so far tested with a startup
    delay that allowed the embedded MCU to program the serializer. If
    the initialization routine is run before the MCU programs the
    serializer and the image sensor and their addresses gets changed
    by the rdacm20 driver it is required to manually enable the noise
    immunity threshold to make the communication on the control channel
    more reliable.
    
    Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
    Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
    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>
    Jacopo Mondi authored and mchehab committed Jun 17, 2021
  5. media: i2c: rdacm20: Embed 'serializer' field

    There's no reason to allocate dynamically the 'serializer' field in
    the driver structure.
    
    Embed the field and adjust all its users in the driver.
    
    Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
    Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
    Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
    Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
    Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
    Jacopo Mondi authored and mchehab committed Jun 17, 2021
  6. media: i2c: rdacm21: Power up OV10640 before OV490

    The current RDACM21 initialization routine powers up the OV10640 image
    sensor after the OV490 ISP. The ISP is programmed with a firmware loaded
    from an embedded serial flash that (most probably) tries to interact and
    program also the image sensor connected to the ISP.
    
    As described in commit "media: i2c: rdacm21: Fix OV10640 powerup" the
    image sensor powerdown signal is kept high by an internal pull up
    resistor and occasionally fails to startup correctly if the powerdown
    line is not asserted explicitly. Failures in the OV10640 startup causes
    the OV490 firmware to fail to boot correctly resulting in the camera
    module initialization to fail consequentially.
    
    Fix this by powering up the OV10640 image sensor before testing the
    OV490 firmware boot completion, by splitting the ov10640_initialize()
    function in an ov10640_power_up() one and an ov10640_check_id() one.
    
    Also make sure the OV10640 identification procedure gives enough time to
    the image sensor to resume after the programming phase performed by the
    OV490 firmware by repeating the ID read procedure.
    
    This commit fixes a sporadic start-up error triggered by a failure to
    detect the OV490 firmware boot completion:
    rdacm21 8-0054: Timeout waiting for firmware boot
    
    [hverkuil: fixed two typos in commit log]
    
    Fixes: a59f853 ("media: i2c: Add driver for RDACM21 camera module")
    Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
    Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
    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>
    Jacopo Mondi authored and mchehab committed Jun 17, 2021
  7. media: i2c: rdacm21: Fix OV10640 powerup

    The OV10640 image sensor powerdown signal is controlled by the first
    line of the OV490 GPIO pad #1, but the pad #0 identifier
    OV490_GPIO_OUTPUT_VALUE0 was erroneously used. As a result the image
    sensor powerdown signal was never asserted but was left floating and
    kept high by an internal pull-up resistor, causing sporadic failures
    during the image sensor startup phase.
    
    Fix this by using the correct GPIO pad identifier and wait the mandatory
    1.5 millisecond delay after the powerup lane is asserted. The reset
    delay is not characterized in the chip manual if not as "255 XVCLK +
    initialization". Wait for at least 3 milliseconds to guarantee the SCCB
    bus is available.
    
    While at it also fix the reset sequence, as the reset line was released
    before the powerdown one, and the line was not cycled.
    
    This commit fixes a sporadic start-up error triggered by a failure to
    read the OV10640 chip ID:
    rdacm21 8-0054: OV10640 ID mismatch: (0x01)
    
    Fixes: a59f853 ("media: i2c: Add driver for RDACM21 camera module")
    Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
    Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
    Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
    Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
    Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
    Jacopo Mondi authored and mchehab committed Jun 17, 2021
  8. media: i2c: rdacm21: Add delay after OV490 reset

    Add a delay after the OV490 chip is put in reset state. The reset
    signal shall be held low for at least 250 useconds.
    
    Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
    Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
    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>
    Jacopo Mondi authored and mchehab committed Jun 17, 2021
  9. media: i2c: max9271: Introduce wake_up() function

    The MAX9271 chip manual prescribes a delay of 5 milliseconds
    after the chip exits from low power state.
    
    Add a new function to the max9271 library driver that wakes up the chip
    with a dummy i2c transaction and implements the correct delay of 5
    milliseconds after the chip exits from low power state.
    
    Use the newly introduced function in the rdacm20 and rdacm21 camera
    drivers. The former was not respecting the required delay while the
    latter was waiting for a too-short timeout.
    
    Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
    Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
    Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
    Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
    Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
    Jacopo Mondi authored and mchehab committed Jun 17, 2021
  10. media: i2c: max9271: Check max9271_write() return

    Check the return value of the max9271_write() function in the
    max9271 library driver.
    
    While at it, modify an existing condition to be made identical
    to other checks.
    
    Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
    Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
    Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
    Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
    Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
    Jacopo Mondi authored and mchehab committed Jun 17, 2021
  11. media: i2c: max9286: Rework comments in .bound()

    Rephrase a comment in .bound() callback to make it clear we register
    a subdev notifier and remove a redundant comment about disabling i2c
    auto-ack.
    
    No functional changes intended.
    
    Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
    Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
    Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
    Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
    Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
    Jacopo Mondi authored and mchehab committed Jun 17, 2021
  12. media: i2c: max9286: Define high channel amplitude

    Provide a macro to define the reverse channel amplitude to
    be used to compensate the remote serializer noise immunity.
    
    While at it, update a comment.
    
    Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
    Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
    Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
    Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
    Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
    Jacopo Mondi authored and mchehab committed Jun 17, 2021
  13. media: i2c: max9286: Cache channel amplitude

    Cache the current channel amplitude in a driver variable
    to skip updating it if the newly requested value is the same
    as the currently configured one.
    
    Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
    Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
    Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
    Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
    Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
    Jacopo Mondi authored and mchehab committed Jun 17, 2021
  14. media: i2c: max9286: Rename reverse_channel_mv

    Rename the reverse_channel_mv variable to init_rev_chan_mv as
    the next patch will cache the reverse channel amplitude in
    a new driver variable.
    
    Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
    Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
    Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
    Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
    Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
    Jacopo Mondi authored and mchehab committed Jun 17, 2021
  15. media: i2c: max9286: Adjust parameters indent

    The parameters to max9286_i2c_mux_configure() fits on the previous
    line. Adjust it.
    
    Cosmetic change only.
    
    Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
    Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
    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>
    Jacopo Mondi authored and mchehab committed Jun 17, 2021
  16. media: hantro: add support for Rockchip RK3036

    RK3036's VPU IP block is the same as RK3288 has, except that it doesn't
    have an encoder, decoding is supported up to 1920x1088 only and the axi
    clock can be set to 300 MHz max.
    
    Add a new RK3036 variant which reflects these differences.
    
    Signed-off-by: Alex Bee <knaerzche@gmail.com>
    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>
    knaerzche authored and mchehab committed Jun 17, 2021
  17. media: hantro: add support for Rockchip RK3066

    RK3066's VPU IP block is the predecessor from what RK3288 has.
    The hardware differences are:
      - supports decoding frame sizes up to 1920x1088 only
      - doesn't have the 'G1_REG_SOFT_RESET' register
        (requires another .reset callback for hantro_codec_ops,
         since writing this register will result in non-working
         IP block)
      - has one ACLK/HCLK per vdpu/vepu
      - ACLKs can be clocked up to 300 MHz only
      - no MMU
        (no changes required: CMA will be transparently used)
    
    Add a new RK3066 variant which reflect this differences. This variant
    can be used for RK3188 as well.
    
    Signed-off-by: Alex Bee <knaerzche@gmail.com>
    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>
    knaerzche authored and mchehab committed Jun 17, 2021
  18. media: hantro: merge Rockchip platform drivers

    Merge the two Rockchip platform drivers into one as it was suggested at
    [1] and [2].
    This will hopefully make it easier to add new variants (which are surely
    to come for Rockchip).
    Also rename from "rk3288" to "v(d/e)pu1" and "rk3399" to "v(d/e)pu2"
    where applicable, as this is the dicition the vendor uses and will
    also refelect the variants that get added later in this series. Rename
    from "rk3288" to "rockchip" if applicable to both hardware versions.
    
    [1] https://patchwork.kernel.org/project/linux-rockchip/patch/20210107134101.195426-6-paul.kocialkowski@bootlin.com/
    [2] https://patchwork.kernel.org/project/linux-rockchip/patch/20210525152225.154302-5-knaerzche@gmail.com/
    
    Signed-off-by: Alex Bee <knaerzche@gmail.com>
    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>
    knaerzche authored and mchehab committed Jun 17, 2021
  19. media: hantro: reorder variants

    Reorder variants in hantro driver alphanumeric.
    
    Signed-off-by: Alex Bee <knaerzche@gmail.com>
    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>
    knaerzche authored and mchehab committed Jun 17, 2021
  20. media: dt-bindings: media: rockchip-vdec: add RK3228 compatible

    Document the RK3228 compatible for rockchip-vdec.
    Also add the optional assigned-clocks and assigned-clock-rates
    properties.
    
    Signed-off-by: Alex Bee <knaerzche@gmail.com>
    Reviewed-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>
    knaerzche authored and mchehab committed Jun 17, 2021
  21. media: dt-bindings: media: rockchip-vpu: add new compatibles

    Add compatibles for RK3036, RK3066, RK3188 and RK3228. Also reflect the
    changes to the additional clocks for RK3066/RK3188.
    
    Signed-off-by: Alex Bee <knaerzche@gmail.com>
    Reviewed-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>
    knaerzche authored and mchehab committed Jun 17, 2021
  22. media: mtk-vcodec: fix kerneldoc warnings

    Fix the following kerneldoc warnings:
    
    drivers/media/platform/mtk-vcodec/venc_ipi_msg.h:31: warning: Enum value 'AP_IPIMSG_ENC_INIT' not described in enum 'venc_ipi_msg_id'
    drivers/media/platform/mtk-vcodec/venc_ipi_msg.h:31: warning: Enum value 'AP_IPIMSG_ENC_SET_PARAM' not described in enum 'venc_ipi_msg_id'
    drivers/media/platform/mtk-vcodec/venc_ipi_msg.h:31: warning: Enum value 'AP_IPIMSG_ENC_ENCODE' not described in enum 'venc_ipi_msg_id'
    drivers/media/platform/mtk-vcodec/venc_ipi_msg.h:31: warning: Enum value 'AP_IPIMSG_ENC_DEINIT' not described in enum 'venc_ipi_msg_id'
    drivers/media/platform/mtk-vcodec/venc_ipi_msg.h:31: warning: Enum value 'VPU_IPIMSG_ENC_INIT_DONE' not described in enum 'venc_ipi_msg_id'
    drivers/media/platform/mtk-vcodec/venc_ipi_msg.h:31: warning: Enum value 'VPU_IPIMSG_ENC_SET_PARAM_DONE' not described in enum 'venc_ipi_msg_id'
    drivers/media/platform/mtk-vcodec/venc_ipi_msg.h:31: warning: Enum value 'VPU_IPIMSG_ENC_ENCODE_DONE' not described in enum 'venc_ipi_msg_id'
    drivers/media/platform/mtk-vcodec/venc_ipi_msg.h:31: warning: Enum value 'VPU_IPIMSG_ENC_DEINIT_DONE' not described in enum 'venc_ipi_msg_id'
    drivers/media/platform/mtk-vcodec/venc_ipi_msg.h:31: warning: Excess enum value 'VPU_IPIMSG_ENC_XXX_DONE' description in 'venc_ipi_msg_id'
    drivers/media/platform/mtk-vcodec/venc_ipi_msg.h:31: warning: Excess enum value 'AP_IPIMSG_ENC_XXX' description in 'venc_ipi_msg_id'
    drivers/media/platform/mtk-vcodec/venc_ipi_msg.h:120: warning: Enum value 'VENC_IPI_MSG_STATUS_OK' not described in enum 'venc_ipi_msg_status'
    drivers/media/platform/mtk-vcodec/venc_ipi_msg.h:120: warning: Enum value 'VENC_IPI_MSG_STATUS_FAIL' not described in enum 'venc_ipi_msg_status'
    drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h:50: warning: Enum value 'VDEC_SYS' not described in enum 'mtk_hw_reg_idx'
    drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h:50: warning: Enum value 'VDEC_MISC' not described in enum 'mtk_hw_reg_idx'
    drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h:50: warning: Enum value 'VDEC_LD' not described in enum 'mtk_hw_reg_idx'
    drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h:50: warning: Enum value 'VDEC_TOP' not described in enum 'mtk_hw_reg_idx'
    drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h:50: warning: Enum value 'VDEC_CM' not described in enum 'mtk_hw_reg_idx'
    drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h:50: warning: Enum value 'VDEC_AD' not described in enum 'mtk_hw_reg_idx'
    drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h:50: warning: Enum value 'VDEC_AV' not described in enum 'mtk_hw_reg_idx'
    drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h:50: warning: Enum value 'VDEC_PP' not described in enum 'mtk_hw_reg_idx'
    drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h:50: warning: Enum value 'VDEC_HWD' not described in enum 'mtk_hw_reg_idx'
    drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h:50: warning: Enum value 'VDEC_HWQ' not described in enum 'mtk_hw_reg_idx'
    drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h:50: warning: Enum value 'VDEC_HWB' not described in enum 'mtk_hw_reg_idx'
    drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h:50: warning: Enum value 'VDEC_HWG' not described in enum 'mtk_hw_reg_idx'
    drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h:50: warning: Enum value 'NUM_MAX_VDEC_REG_BASE' not described in enum 'mtk_hw_reg_idx'
    drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h:50: warning: Enum value 'VENC_SYS' not described in enum 'mtk_hw_reg_idx'
    drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h:50: warning: Enum value 'VENC_LT_SYS' not described in enum 'mtk_hw_reg_idx'
    drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h:50: warning: Enum value 'NUM_MAX_VCODEC_REG_BASE' not described in enum 'mtk_hw_reg_idx'
    drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h:58: warning: Enum value 'MTK_INST_DECODER' not described in enum 'mtk_instance_type'
    drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h:58: warning: Enum value 'MTK_INST_ENCODER' not described in enum 'mtk_instance_type'
    drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h:87: warning: Enum value 'MTK_ENCODE_PARAM_NONE' not described in enum 'mtk_encode_param'
    drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h:87: warning: Enum value 'MTK_ENCODE_PARAM_BITRATE' not described in enum 'mtk_encode_param'
    drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h:87: warning: Enum value 'MTK_ENCODE_PARAM_FRAMERATE' not described in enum 'mtk_encode_param'
    drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h:87: warning: Enum value 'MTK_ENCODE_PARAM_INTRA_PERIOD' not described in enum
    'mtk_encode_param'
    drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h:87: warning: Enum value 'MTK_ENCODE_PARAM_FORCE_INTRA' not described in enum
    'mtk_encode_param'
    drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h:87: warning: Enum value 'MTK_ENCODE_PARAM_GOP_SIZE' not described in enum 'mtk_encode_param'
    drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h:103: warning: Function parameter or member 'fourcc' not described in 'mtk_video_fmt'
    drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h:103: warning: Function parameter or member 'type' not described in 'mtk_video_fmt'
    drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h:103: warning: Function parameter or member 'num_planes' not described in 'mtk_video_fmt'
    drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h:103: warning: Function parameter or member 'flags' not described in 'mtk_video_fmt'
    drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h:112: warning: Function parameter or member 'fourcc' not described in 'mtk_codec_framesizes'
    drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h:112: warning: Function parameter or member 'stepwise' not described in 'mtk_codec_framesizes'
    drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h:120: warning: Enum value 'MTK_Q_DATA_SRC' not described in enum 'mtk_q_type'
    drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h:120: warning: Enum value 'MTK_Q_DATA_DST' not described in enum 'mtk_q_type'
    drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h:134: warning: Function parameter or member 'visible_width' not described in 'mtk_q_data'
    drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h:134: warning: Function parameter or member 'visible_height' not described in 'mtk_q_data'
    drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h:134: warning: Function parameter or member 'coded_width' not described in 'mtk_q_data'
    drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h:134: warning: Function parameter or member 'coded_height' not described in 'mtk_q_data'
    drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h:134: warning: Function parameter or member 'field' not described in 'mtk_q_data'
    drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h:134: warning: Function parameter or member 'bytesperline' not described in 'mtk_q_data'
    drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h:134: warning: Function parameter or member 'sizeimage' not described in 'mtk_q_data'
    drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h:134: warning: Function parameter or member 'fmt' not described in 'mtk_q_data'
    drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h:177: warning: Function parameter or member 'clk_name' not described in 'mtk_vcodec_clk_info'
    drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h:177: warning: Function parameter or member 'vcodec_clk' not described in
    'mtk_vcodec_clk_info'
    drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h:185: warning: Function parameter or member 'clk_info' not described in 'mtk_vcodec_clk'
    drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h:185: warning: Function parameter or member 'clk_num' not described in 'mtk_vcodec_clk'
    drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h:198: warning: Function parameter or member 'vdec_clk' not described in 'mtk_vcodec_pm'
    drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h:198: warning: Function parameter or member 'larbvdec' not described in 'mtk_vcodec_pm'
    drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h:198: warning: Function parameter or member 'venc_clk' not described in 'mtk_vcodec_pm'
    drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h:198: warning: Function parameter or member 'larbvenc' not described in 'mtk_vcodec_pm'
    drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h:198: warning: Function parameter or member 'dev' not described in 'mtk_vcodec_pm'
    drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h:198: warning: Function parameter or member 'mtkdev' not described in 'mtk_vcodec_pm'
    drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h:300: warning: Function parameter or member 'decoded_frame_cnt' not described in
    'mtk_vcodec_ctx'
    drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h:332: warning: Function parameter or member 'min_bitrate' not described in
    'mtk_vcodec_enc_pdata'
    drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h:405: warning: Function parameter or member 'venc_pdata' not described in 'mtk_vcodec_dev'
    drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h:405: warning: Function parameter or member 'decode_workqueue' not described in
    'mtk_vcodec_dev'
    drivers/media/platform/mtk-vcodec/vdec_ipi_msg.h:27: warning: Enum value 'AP_IPIMSG_DEC_INIT' not described in enum 'vdec_ipi_msgid'
    drivers/media/platform/mtk-vcodec/vdec_ipi_msg.h:27: warning: Enum value 'AP_IPIMSG_DEC_START' not described in enum 'vdec_ipi_msgid'
    drivers/media/platform/mtk-vcodec/vdec_ipi_msg.h:27: warning: Enum value 'AP_IPIMSG_DEC_END' not described in enum 'vdec_ipi_msgid'
    drivers/media/platform/mtk-vcodec/vdec_ipi_msg.h:27: warning: Enum value 'AP_IPIMSG_DEC_DEINIT' not described in enum 'vdec_ipi_msgid'
    drivers/media/platform/mtk-vcodec/vdec_ipi_msg.h:27: warning: Enum value 'AP_IPIMSG_DEC_RESET' not described in enum 'vdec_ipi_msgid'
    drivers/media/platform/mtk-vcodec/vdec_ipi_msg.h:27: warning: Enum value 'VPU_IPIMSG_DEC_INIT_ACK' not described in enum 'vdec_ipi_msgid'
    drivers/media/platform/mtk-vcodec/vdec_ipi_msg.h:27: warning: Enum value 'VPU_IPIMSG_DEC_START_ACK' not described in enum 'vdec_ipi_msgid'
    drivers/media/platform/mtk-vcodec/vdec_ipi_msg.h:27: warning: Enum value 'VPU_IPIMSG_DEC_END_ACK' not described in enum 'vdec_ipi_msgid'
    drivers/media/platform/mtk-vcodec/vdec_ipi_msg.h:27: warning: Enum value 'VPU_IPIMSG_DEC_DEINIT_ACK' not described in enum 'vdec_ipi_msgid'
    drivers/media/platform/mtk-vcodec/vdec_ipi_msg.h:27: warning: Enum value 'VPU_IPIMSG_DEC_RESET_ACK' not described in enum 'vdec_ipi_msgid'
    drivers/media/platform/mtk-vcodec/vdec_ipi_msg.h:27: warning: Excess enum value 'AP_IPIMSG_XXX' description in 'vdec_ipi_msgid'
    drivers/media/platform/mtk-vcodec/vdec_ipi_msg.h:27: warning: Excess enum value 'VPU_IPIMSG_XXX_ACK' description in 'vdec_ipi_msgid'
    
    In some cases I just changed /** to /*, in other cases the missing
    field descriptions were added.
    
    Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
    Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
    Hans Verkuil authored and mchehab committed Jun 17, 2021
  23. media: adv7842: remove spurious & and fix vga_edid size

    No need to use & to get the start address of an array.
    
    Fix the size of vga_edid.edid to a single block (128 bytes) to fix
    this smatch error:
    
    adv7842.c:2538 adv7842_set_edid() error: memcpy() '&state->vga_edid.edid' too small (128 vs 512)
    
    Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
    Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
    Hans Verkuil authored and mchehab committed Jun 17, 2021
  24. media: pci: cx88: 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.
    
    Only 2 functions allocate some memory. They are both in cx88-core.c
    
    When memory is allocated in 'cx88_risc_buffer()', GFP_KERNEL can be
    used because its 2 callers end up to '.buf_prepare' functions in 'vb2_ops'
    structures.
    The call chains are:
    
      .buf_prepare                   (cx88-vbi.c)
        --> buffer_prepare           (cx88-vbi.c)
          --> cx88_risc_buffer
    
      .buf_prepare                   (cx88-video.c)
        --> buffer_prepare           (cx88-video.c)
          --> cx88_risc_buffer
    
    When memory is allocated in 'cx88_risc_databuffer()', GFP_KERNEL can be
    used because its 2 callers end up to 'snd_cx88_hw_params' which already
    uses GFP_KERNEL and '.buf_prepare' functions in 'vb2_ops' structures.
    The call chains are:
    
      snd_cx88_hw_params                   (cx88-alsa.c)
        --> cx88_risc_databuffer
    
      .buf_prepare                         (cx88-blackbird.c)
        --> buffer_prepare                 (cx88-blackbird.c)
          --> cx8802_buf_prepare           (cx88-mpeg.c)
            --> cx88_risc_databuffer
    
      .buf_prepare                         (cx88-dvb.c)
        --> buffer_prepare                 (cx88-dvb.c)
          --> cx8802_buf_prepare           (cx88-mpeg.c)
            --> cx88_risc_databuffer
    
    @@ @@
    -    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>
    tititiou36 authored and mchehab committed Jun 17, 2021
  25. media: imx-jpeg: Constify static struct mxc_jpeg_fmt

    It is only read-from, so make it const. In order to be able to do this,
    constify all places where mxc_jpeg_fmt is used, in function arguments,
    return values and pointers. On top of that, make the name a pointer to
    const char.
    
    On aarch64, this shrinks object code size with 550 bytes with gcc 11.1.0,
    and almost 2kB with clang 12.0.0.
    
    Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
    Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
    Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
    rikardfalkeborn authored and mchehab committed Jun 17, 2021
  26. media: imx-jpeg: Constify static struct v4l2_m2m_ops

    The only usage of mxc_jpeg_m2m_ops is to pass its address to
    v4l2_m2m_init() which takes a pointer to const struct v4l2_m2m_ops. Make
    it const to allow the compiler to put it in read-only memory.
    
    Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
    Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
    Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
    rikardfalkeborn authored and mchehab committed Jun 17, 2021
  27. media: rcar-csi2: Add support for Y10 and Y8

    Add support for two new media bus formats, Y10 and Y8.
    
    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>
    Niklas Söderlund authored and mchehab committed Jun 17, 2021
  28. media: v4l2-event: Modified variable type 'unsigned' to 'unsigned int'

    Prefer 'unsigned int' to bare use of 'unsigned'.
    So modified variable type 'unsigned' to 'unsigned int' in v4l2-event.c.
    
    Signed-off-by: lijian <lijian@yulong.com>
    Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
    Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
    lijian authored and mchehab committed Jun 17, 2021
  29. media: usb: cpia2: Fixed Coding Style issues

    Fixed all the Coding style issues generated by checkpatch.pl.
    The changes made considering the --strict option.
    
    Signed-off-by: Piyush Thange <pthange19@gmail.com>
    Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
    Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
    its-crypted authored and mchehab committed Jun 17, 2021
  30. media: s5p-g2d: Fix a memory leak on ctx->fh.m2m_ctx

    The m2m_ctx resources was allocated by v4l2_m2m_ctx_init() in g2d_open()
    should be freed from g2d_release() when it's not used.
    
    Fix it
    
    Fixes: 9188473 ("[media] v4l: add G2D driver for s5p device family")
    Signed-off-by: Dillon Min <dillon.minfei@gmail.com>
    Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
    Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
    dillon-min authored and mchehab committed Jun 17, 2021
  31. media: marvell-ccic: set error code in probe

    When i2c_new_client_device() fails, cafe_pci_probe() cleans up all
    resources and returns 0. The patch sets the error code on the
    corresponding path.
    
    Found by Linux Driver Verification project (linuxtesting.org).
    
    Signed-off-by: Evgeny Novikov <novikov@ispras.ru>
    Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
    Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
    Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
    eunovm authored and mchehab committed Jun 17, 2021
  32. media: imx-csi: Skip first few frames from a BT.656 source

    Some BT.656 sensors (e.g. ADV718x) transmit frames with unstable BT.656
    sync codes after initial power on. This confuses the imx CSI,resulting
    in vertical and/or horizontal sync issues. Skip the first 20 frames
    to avoid the unstable sync codes.
    
    [fabio: fixed checkpatch warning and increased the frame skipping to 20]
    
    Signed-off-by: Steve Longerbeam <slongerbeam@gmail.com>
    Signed-off-by: Fabio Estevam <festevam@gmail.com>
    Reviewed-by: Tim Harvey <tharvey@gateworks.com>
    Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
    Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
    slongerbeam authored and mchehab committed Jun 17, 2021
  33. media: coda: set debugfs blobs to read only

    Those blobs can only be read. So, don't confuse users with 'writable'
    flags.
    
    Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
    Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
    Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
    Wolfram Sang authored and mchehab committed Jun 17, 2021
Older