commit 5331aec1bf upstream.
This change resolves a new compile-time warning
when built as a loadable module:
WARNING: modpost: missing MODULE_LICENSE() in drivers/media/platform/soc_camera/soc_scale_crop.o
see include/linux/module.h for more information
This adds the license as "GPL", which matches the header of the file.
MODULE_DESCRIPTION and MODULE_AUTHOR are also added.
Signed-off-by: Jesse Chan <jc@linux.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch adds the function of mipi-dphy TX1RX1 for RK3288, the
mipi-dphy TX1RX1 is matched when "txrx_base_addr" is valid.
Change-Id: I01640925157a7082e942188b29f6bbf1318cf3d5
Signed-off-by: Wen Nuan <leo.wen@rock-chips.com>
Rockchip 4.4 kernel don't support of_iommu,
so we have to manage it manualy
Change-Id: I38e784e97f1df336837c5ded2b47932f6add180f
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
Fixup for differences of the previous FROMLIST patches for
rockchip isp1 driver as following,
- regression of UPSTREAM commits
+ d6dd645eae: ("[media] media: videobuf2: Move timestamp to vb2_buffer")
+ 36c0f8b32c: ("[media] vb2: replace void *alloc_ctxs by struct device *alloc_devs")
+ df9ecb0cad: ("[media] vb2: drop v4l2_format argument from queue_setup")
- API changes of (4.4 v.s. UPSTREAM)
+ media_entity_pipeline_start/stop() v.s. media_pipeline_start/stop()
+ media_entity_init() v.s. media_entity_pads_init()
+ media_entity_create_link() v.s. media_create_pad_link()
+ media_device_init()
+ entity function flags: MEDIA_ENT_F_IO_V4L and MEDIA_ENT_F_V4L2_SUBDEV_UNKNOWN
BUG=b:36227021
TEST=Camera works on Scarlet with the whole series
Change-Id: I4d9c9f784210fda2165ac5372baea09a9c01a30d
Signed-off-by: Shunqian Zheng <zhengsq@rock-chips.com>
* linux-linaro-lsk-v4.4-android: (510 commits)
Linux 4.4.103
Revert "sctp: do not peel off an assoc from one netns to another one"
xen: xenbus driver must not accept invalid transaction ids
s390/kbuild: enable modversions for symbols exported from asm
ASoC: wm_adsp: Don't overrun firmware file buffer when reading region data
btrfs: return the actual error value from from btrfs_uuid_tree_iterate
ASoC: rsnd: don't double free kctrl
netfilter: nf_tables: fix oob access
netfilter: nft_queue: use raw_smp_processor_id()
spi: SPI_FSL_DSPI should depend on HAS_DMA
staging: iio: cdc: fix improper return value
iio: light: fix improper return value
mac80211: Suppress NEW_PEER_CANDIDATE event if no room
mac80211: Remove invalid flag operations in mesh TSF synchronization
drm: Apply range restriction after color adjustment when allocation
ALSA: hda - Apply ALC269_FIXUP_NO_SHUTUP on HDA_FIXUP_ACT_PROBE
ath10k: set CTS protection VDEV param only if VDEV is up
ath10k: fix potential memory leak in ath10k_wmi_tlv_op_pull_fw_stats()
ath10k: ignore configuring the incorrect board_id
ath10k: fix incorrect txpower set by P2P_DEVICE interface
...
Conflicts:
drivers/media/v4l2-core/v4l2-ctrls.c
kernel/sched/fair.c
Change-Id: I48152b2a0ab1f9f07e1da7823119b94f9b9e1751
1. support isp0 and isp1 run at the same time;
2. support VIDIOC_G_INPUT command;
3. support VIDIOC_G_PARM command;
4. support VIDIOC_G_PARM command;
5. add pix.bytesperline and pix.sizeimage in VIDIOC_G_FMT command;
Change-Id: I6d0347350a0bef372ee2e01c508b2fb581ea7cfc
Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
The async subdev notifier .bound(), .unbind() and .complete() operations
are function pointers stored directly in the v4l2_async_subdev
structure. As the structure isn't immutable, this creates a potential
security risk as the function pointers are mutable.
To fix this, move the function pointers to a new
v4l2_async_subdev_operations structure that can be made const in
drivers.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
(cherry picked from commit ef44d7cb0c00968dc62987a6d0438ec30ca8c06c)
https://git.linuxtv.org/sailus/media_tree.git/log/?h=010f7f4393fdhttp://www.spinics.net/lists/linux-media/msg122688.html
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Conflicts:
drivers/media/pci/intel/ipu3/ipu3-cio2.c
(implement change in non-upstream driver)
drivers/media/platform/davinci/vpif_capture.c
(Change vpif_probe() instead of newer vpif_capture_get_pdata() UNTESTED)
drivers/media/platform/omap3isp/isp.c
(Add .bound = isp_subdev_notifier_bound which we still have UNTESTED)
drivers/media/platform/atmel/atmel-isc.c
drivers/media/platform/atmel/atmel-isi.c
drivers/media/platform/pxa_camera.c
drivers/media/platform/qcom/camss-8x16/camss.c
drivers/media/platform/rcar-vin/rcar-core.c
drivers/media/platform/rcar_drif.c
drivers/media/platform/stm32/stm32-dcmi.c
drivers/media/platform/ti-vpe/cal.c
drivers/staging/media/imx/imx-media-dev.c
(Ignore drivers we don't have)
BUG=b:64133998
TEST=media device topology shows subdevs registered successfully
TEST=no camera regression
Change-Id: Ic3c4a327763507c8b4fa242ae4642a633e3c7dbc
Reviewed-on: https://chromium-review.googlesource.com/693689
Commit-Ready: Tomasz Figa <tfiga@chromium.org>
Tested-by: Hyungwoo Yang <hyungwoo.yang@intel.com>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
Add deinit gpiod for camera sensor when probe failed.
The video_device->ctrl_handler = NULL in soc_camera, in order to
VIDIOC_CTRL call v4l2_ioctl_ops.
Change-Id: Idf2d8bf2c8d56ec921084dcd74220ed3c5541427
Signed-off-by: Peng Zhou <benjo.zhou@rock-chips.com>
Also:
- correct the default quantization for RGB input, it should be full range.
Change-Id: I786799a3532b5c3a18e67c9195ec24ea811d1144
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
Initialize default format for current stream and set stream state
to 'READY' in case of streaming on by user without passing format
to driver. Default format will be overridden by VIDIOC_S_FMT.
Implement VIDIOC_G_FMT and application can get the format info
of current stream now. This will become necessary when enable
'--set-fmt-video' option of v4l2-ctl test suite,
Set bytesused of each plane to its real size to prevent confusing.
The IO mode of vb2 queue 'VB2_DMABUF' is now supported.
Change-Id: Id52da502df8aea796b3405ebf472541a394afd80
Signed-off-by: Jacob Chen <cc@rock-chips.com>
rk-isp10: version 0.1.a
1. To optimize the readability of the code, based on v0.1.9
2. Optimize CIF_MI_CTRL_BURST_LEN param.
3. Add check for cam_itf.type(PLTFRM_CAM_ITF_BT656_8I) on
cif_isp10_s_fmt_mp.
4. get field_flag value from cif_isp10_isp_isr.
Change-Id: I334595c01e8b418b47e0a54e6fdfcf624445ff9f
Signed-off-by: zhoupeng <benjo.zhou@rock-chips.com>
odd and even field interlace generating a frame image.
fix cif_isp10_img_src_v4l2_subdev_enum_strm_fmts defrect info get error.
fix cif_isp10_rk3399 cif_clk_pll info doesn't match with dts config.
Change-Id: I44159c0dd4e676334221b5d5682e29d3280aa9fd
Signed-off-by: zhoupeng <benjo.zhou@rock-chips.com>
LSK 17.08 v4.4-android
* tag 'lsk-v4.4-17.08-android': (451 commits)
Linux 4.4.83
pinctrl: samsung: Remove bogus irq_[un]mask from resource management
pinctrl: sunxi: add a missing function of A10/A20 pinctrl driver
pnfs/blocklayout: require 64-bit sector_t
iio: adc: vf610_adc: Fix VALT selection value for REFSEL bits
usb:xhci:Add quirk for Certain failing HP keyboard on reset after resume
usb: quirks: Add no-lpm quirk for Moshi USB to Ethernet Adapter
usb: core: unlink urbs from the tail of the endpoint's urb_list
USB: Check for dropped connection before switching to full speed
uag: Add US_FL_IGNORE_RESIDUE for Initio Corporation INIC-3069
iio: light: tsl2563: use correct event code
iio: accel: bmc150: Always restore device to normal mode after suspend-resume
staging:iio:resolver:ad2s1210 fix negative IIO_ANGL_VEL read
USB: hcd: Mark secondary HCD as dead if the primary one died
usb: musb: fix tx fifo flush handling again
USB: serial: pl2303: add new ATEN device id
USB: serial: cp210x: add support for Qivicon USB ZigBee dongle
USB: serial: option: add D-Link DWM-222 device ID
nfs/flexfiles: fix leak of nfs4_ff_ds_version arrays
fuse: initialize the flock flag in fuse_file on allocation
...
The running of isp0 or isp1 is ok,
but running of isp0 and isp1 at the same time has not been tested.
Change-Id: I430aafb6060eb5aea464ddce05614604ee015e78
Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
Switch users of the v4l2_of_ APIs to the more generic v4l2_fwnode_ APIs.
Async OF matching is replaced by fwnode matching and OF matching support
is removed.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Benoit Parrot <bparrot@ti.com> # i2c/ov2569.c, am437x/am437x-vpfe.c and ti-vpe/cal.c
Tested-by: Hans Verkuil <hans.verkuil@cisco.com> # Atmel sama5d3 board + ov2640 sensor
Tested-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
(cherry picked from commit 859969b38e)
Signed-off-by: Nathan Ciobanu <nathan.d.ciobanu@intel.com>
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
Conflicts:
Nathan: context, comment and include deltas, as well as deleting files
that don't apply to ChromeOS-4.4 yet
drivers/media/i2c/Kconfig
drivers/media/i2c/mt9v032.c
drivers/media/i2c/ov5645.c
drivers/media/i2c/ov5647.c
drivers/media/i2c/s5c73m3/s5c73m3-core.c
drivers/media/i2c/smiapp/smiapp-core.c
drivers/media/i2c/tc358743.c
drivers/media/i2c/tvp514x.c
drivers/media/i2c/tvp5150.c
drivers/media/i2c/tvp7002.c
drivers/media/platform/Kconfig
drivers/media/platform/atmel/Kconfig
drivers/media/platform/atmel/atmel-isc.c
drivers/media/platform/atmel/atmel-isi.c
drivers/media/platform/exynos4-is/mipi-csis.c
drivers/media/platform/omap3isp/isp.c
drivers/media/platform/pxa_camera.c
drivers/media/platform/rcar-vin/Kconfig
drivers/media/platform/rcar-vin/rcar-core.c
drivers/media/platform/soc_camera/soc_camera.c
drivers/media/platform/stm32/stm32-dcmi.c
drivers/media/platform/ti-vpe/cal.c
include/media/v4l2-subdev.h
BUG=b:62359918
TEST=No regression in camera functionality
TEST=Kernel builds and boots
Change-Id: If338e2ab0c68c72f242988f34202e0449642734c
Signed-off-by: Nathan Ciobanu <nathan.d.ciobanu@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/528621
Commit-Ready: Nathan D Ciobanu <nathan.d.ciobanu@intel.com>
Tested-by: Yong Zhi <yong.zhi@intel.com>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
commit da05d52d2f upstream.
this patch makes sure VPFE_CMD_S_CCDC_RAW_PARAMS ioctl no longer works
for vpfe_capture driver with a minimal patch suitable for backporting.
- This ioctl was never in public api and was only defined in kernel header.
- The function set_params constantly mixes up pointers and phys_addr_t
numbers.
- This is part of a 'VPFE_CMD_S_CCDC_RAW_PARAMS' ioctl command that is
described as an 'experimental ioctl that will change in future kernels'.
- The code to allocate the table never gets called after we copy_from_user
the user input over the kernel settings, and then compare them
for inequality.
- We then go on to use an address provided by user space as both the
__user pointer for input and pass it through phys_to_virt to come up
with a kernel pointer to copy the data to. This looks like a trivially
exploitable root hole.
Due to these reasons we make sure this ioctl now returns -EINVAL and backport
this patch as far as possible.
Fixes: 5f15fbb68f ("V4L/DVB (12251): v4l: dm644x ccdc module for vpfe capture driver")
Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Rockchip RGA is a separate 2D raster graphic acceleration unit. It
accelerates 2D graphics operations, such as point/line drawing, image
scaling, rotation, BitBLT, alpha blending and image blur/sharpness
The drvier is mostly based on s5p-g2d v4l2 m2m driver
And supports various operations from the rendering pipeline.
- copy
- fast solid color fill
- rotation
- flip
- alpha blending
The code in rga-hw.c is used to configure regs accroding to operations
The code in rga-buf.c is used to create (1-Level)mmu table for RGA
The tables is stored in a list, and be removed when buffer is cleanup
(am form https://patchwork.linuxtv.org/patch/42846/)
Change-Id: I3ddd885beb2388be2ef23fe75806719d1fda8695
Signed-off-by: Jacob Chen <jacob-chen@iotwrt.com>
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
commit a16e37726c upstream.
Gcc 7.1 complains about:
drivers/media/platform/s5p-jpeg/jpeg-core.c: In function 's5p_jpeg_parse_hdr.isra.9':
drivers/media/platform/s5p-jpeg/jpeg-core.c:1207:12: warning: 'width' may be used uninitialized in this function [-Wmaybe-uninitialized]
result->w = width;
~~~~~~~~~~^~~~~~~
drivers/media/platform/s5p-jpeg/jpeg-core.c:1208:12: warning: 'height' may be used uninitialized in this function [-Wmaybe-uninitialized]
result->h = height;
~~~~~~~~~~^~~~~~~~
Indeed the code would allow it to return a random value (although
it shouldn't happen, in practice). So, explicitly set both to zero,
just in case.
Acked-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Verify the functionality of isp driver with
sensor ov7750.
V4l2n or gstreamer is suitable for test.
Change-Id: I4f0cf68b84f4909dd1c132ec3506777f39d487ee
Signed-off-by: Jacob Chen <cc@rock-chips.com>
commit a5cb00eb42 upstream.
Clock should be turned off after calling s5p_mfc_init_hw() from the
watchdog worker, like it is already done in the s5p_mfc_open() which also
calls this function.
Fixes: af93574678 ("[media] MFC: Add MFC 5.1 V4L2 driver")
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
LSK 17.03 v4.4-android
* tag 'lsk-v4.4-17.03-android': (166 commits)
Linux 4.4.55
ext4: don't BUG when truncating encrypted inodes on the orphan list
dm: flush queued bios when process blocks to avoid deadlock
nfit, libnvdimm: fix interleave set cookie calculation
s390/kdump: Use "LINUX" ELF note name instead of "CORE"
KVM: s390: Fix guest migration for huge guests resulting in panic
mvsas: fix misleading indentation
serial: samsung: Continue to work if DMA request fails
USB: serial: io_ti: fix information leak in completion handler
USB: serial: io_ti: fix NULL-deref in interrupt callback
USB: iowarrior: fix NULL-deref in write
USB: iowarrior: fix NULL-deref at probe
USB: serial: omninet: fix reference leaks at open
USB: serial: safe_serial: fix information leak in completion handler
usb: host: xhci-plat: Fix timeout on removal of hot pluggable xhci controllers
usb: host: xhci-dbg: HCIVERSION should be a binary number
usb: gadget: function: f_fs: pass companion descriptor along
usb: dwc3: gadget: make Set Endpoint Configuration macros safe
usb: gadget: dummy_hcd: clear usb_gadget region before registration
powerpc: Emulation support for load/store instructions on LE
...
Change-Id: I4db95bbe5b2523e19ddf22b3f65863f7f6d46632
commit 6ebf75774f upstream.
In vpfe_s_fmt(), when the sensor format and the requested format were
the same, bpp was assigned to vpfe->bpp without being initialized first.
Grab the bpp value that is currently used by using __vpfe_get_format()
instead of its wrapper, vpfe_try_fmt().
This use of uninitialized variable has been found by compiling the
kernel with clang.
Fixes: 417d2e507e ("[media] media: platform: add VPFE capture driver
support for AM437X")
Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit c9205e18b4 upstream.
devm_pinctrl_get() can fail so we should check for that.
Fixes: 0a6824bc10 ('[media] v4l2: blackfin: select proper pinctrl state in ppi_set_params if CONFIG_PINCTRL is enabled')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* linux-linaro-lsk-v4.4-android: (1362 commits)
Linux 4.4.30
Revert "fix minor infoleak in get_user_ex()"
Revert "x86/mm: Expand the exception table logic to allow new handling options"
Linux 4.4.29
ARM: pxa: pxa_cplds: fix interrupt handling
powerpc/nvram: Fix an incorrect partition merge
mpt3sas: Don't spam logs if logging level is 0
perf symbols: Fixup symbol sizes before picking best ones
perf symbols: Check symbol_conf.allow_aliases for kallsyms loading too
perf hists browser: Fix event group display
clk: divider: Fix clk_divider_round_rate() to use clk_readl()
clk: qoriq: fix a register offset error
s390/con3270: fix insufficient space padding
s390/con3270: fix use of uninitialised data
s390/cio: fix accidental interrupt enabling during resume
x86/mm: Expand the exception table logic to allow new handling options
dmaengine: ipu: remove bogus NO_IRQ reference
power: bq24257: Fix use of uninitialized pointer bq->charger
staging: r8188eu: Fix scheduling while atomic splat
ASoC: dapm: Fix kcontrol creation for output driver widget
...
commit 0fb5040011 upstream.
gcc-6 points out an obviously silly comparison in vpfe_get_app_input_index():
drivers/media/platform/am437x/am437x-vpfe.c: In function 'vpfe_get_app_input_index':
drivers/media/platform/am437x/am437x-vpfe.c:1709:27: warning: self-comparison always evaluats to true [-Wtautological-compare]
client->adapter->nr == client->adapter->nr) {
^~
This was introduced in a slighly incorrect conversion, and it's
clear that the comparison was meant to compare the iterator
to the current subdev instead, as we do in the line above.
Fixes: d37232390f ("[media] media: am437x-vpfe: match the OF node/i2c addr instead of name")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit 6311f1261f upstream.
When s5p_mfc_remove() calls put_device() for the reserved memory region
devs, the driver core warns that the dev doesn't have a release callback:
WARNING: CPU: 0 PID: 591 at drivers/base/core.c:251 device_release+0x8c/0x90
Device 's5p-mfc-l' does not have a release() function, it is broken and must be fixed.
Also, the declared DMA memory using dma_declare_coherent_memory() isn't
relased so add a dev .release that calls dma_release_declared_memory().
Fixes: 6e83e6e25e ("[media] s5p-mfc: Fix kernel warning on memory init")
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit 29debab0a9 upstream.
The devices don't have a name set, so makes dev_name() returns NULL which
makes harder to identify the devices that are causing issues, for example:
WARNING: CPU: 2 PID: 616 at drivers/base/core.c:251 device_release+0x8c/0x90
Device '(null)' does not have a release() function, it is broken and must be fixed.
And after setting the device name:
WARNING: CPU: 0 PID: 591 at drivers/base/core.c:251 device_release+0x8c/0x90
Device 's5p-mfc-l' does not have a release() function, it is broken and must be fixed.
Fixes: 6e83e6e25e ("[media] s5p-mfc: Fix kernel warning on memory init")
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
rockchip_vpu_hw.c:251:5: warning: 'ret' may be used uninitialized in this function [-Wuninitialized]
Change-Id: Ia5564c2da345c5922341b818961b18d2b1419013
Signed-off-by: Yakir Yang <ykk@rock-chips.com>