- Mar 23, 2023
-
-
Pratyush Yadav authored
Firstly, there is no VC_EN bit present in the STREAM_DATA_CFG register. Bit 31 is part of the VL_SELECT field. Remove it completely. Secondly, it makes little sense to enable ith virtual channel for ith stream. Sure, there might be a use-case that demands it. But there might also be a use case that demands all streams to use the 0th virtual channel. Prefer this case over the former because it is less arbitrary and also makes it very clear what the limitations of the current driver is instead of giving a false impression that multiple virtual channels are supported. Signed-off-by:
Pratyush Yadav <p.yadav@ti.com> Signed-off-by:
Vaishnav Achath <vaishnav.a@ti.com> Reviewed-by:
Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-
Pratyush Yadav authored
The stream stop procedure says that the STOP bit should be set when the stream is to be stopped, and then the ready bit in stream status register polled to make sure the STOP operation is finished. Signed-off-by:
Pratyush Yadav <p.yadav@ti.com> Signed-off-by:
Vaishnav Achath <vaishnav.a@ti.com> Reviewed-by:
Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-
Pratyush Yadav authored
This resets the stream state machines and FIFOs, giving them a clean slate. On J721E if the streams are not reset before starting the capture, the captured frame gets wrapped around vertically on every run after the first. Signed-off-by:
Pratyush Yadav <p.yadav@ti.com> Signed-off-by:
Vaishnav Achath <vaishnav.a@ti.com> Reviewed-by:
Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-
Pratyush Yadav authored
Some platforms like TI's J721E can have the CSI2RX paired with an external DPHY. Add support to enable and configure the DPHY using the generic PHY framework. Signed-off-by:
Pratyush Yadav <p.yadav@ti.com> Signed-off-by:
Vaishnav Achath <vaishnav.a@ti.com> Reviewed-by:
Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-
Pratyush Yadav authored
The format is needed to calculate the link speed for the external DPHY configuration. It is not right to query the format from the source subdev. Add get_fmt and set_fmt pad operations so that the format can be configured and correct bpp be selected. Signed-off-by:
Pratyush Yadav <p.yadav@ti.com> Signed-off-by:
Vaishnav Achath <vaishnav.a@ti.com> Reviewed-by:
Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-
Pratyush Yadav authored
Call media_entity_cleanup() in probe error path and remove to make sure the media entity is cleaned up properly. Suggested-by:
Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by:
Pratyush Yadav <p.yadav@ti.com> Signed-off-by:
Vaishnav Achath <vaishnav.a@ti.com> Reviewed-by:
Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-
Pratyush Yadav authored
The notifier is added to the global notifier list when registered. When the module is removed, the struct csi2rx_priv in which the notifier is embedded, is destroyed. As a result the notifier list has a reference to a notifier that no longer exists. This causes invalid memory accesses when the list is iterated over. Similar for when the probe fails. Unregister and clean up the notifier to avoid this. Fixes: 1fc3b37f ("media: v4l: cadence: Add Cadence MIPI-CSI2 RX driver") Signed-off-by:
Pratyush Yadav <p.yadav@ti.com> Signed-off-by:
Vaishnav Achath <vaishnav.a@ti.com> Reviewed-by:
Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-
- Sep 30, 2021
-
-
Cai Huoqing authored
Use the devm_platform_ioremap_resource() helper instead of calling platform_get_resource() and devm_ioremap_resource() separately Signed-off-by:
Cai Huoqing <caihuoqing@baidu.com> Acked-by:
Maxime Ripard <maxime@cerno.tech> Signed-off-by:
Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by:
Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-
Sakari Ailus authored
Rename V4L2 async notifier functions, replacing "notifier" with "nf" and removing "_subdev" at the end of the function names adding subdevs as you can only add subdevs to a notifier. Also wrap and otherwise clean up long lines. Signed-off-by:
Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by:
Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Rui Miguel Silva <rmfrfs@gmail.com> (imx7) Signed-off-by:
Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-
- Jun 02, 2021
-
-
Evgeny Novikov authored
Handle errors of clk_prepare_enable() in csi2rx_get_resources(). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by:
Evgeny Novikov <novikov@ispras.ru> Signed-off-by:
Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by:
Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-
- Feb 06, 2021
-
-
Laurent Pinchart authored
The functions that add an async subdev to an async subdev notifier take as an argument the size of the container structure they need to allocate. This is error prone, as passing an invalid size will not be caught by the compiler. Wrap those functions in macros that take a container type instead of a size, and cast the returned pointer to the desired type. The compiler will catch mistakes if the incorrect type is passed to the macro, as the assignment types won't match. Signed-off-by:
Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by:
Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Reviewed-by:
Jacopo Mondi <jacopo+renesas@jmondi.org> Signed-off-by:
Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by:
Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by:
Helen Koike <helen.koike@collabora.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> (core+ti-cal) Signed-off-by:
Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-
Ezequiel Garcia authored
The use of v4l2_async_notifier_add_subdev will be discouraged. Drivers are instead encouraged to use a helper such as v4l2_async_notifier_add_fwnode_remote_subdev. This fixes a misuse of the API, as v4l2_async_notifier_add_subdev should get a kmalloc'ed struct v4l2_async_subdev, removing some boilerplate code while at it. Use the appropriate helper v4l2_async_notifier_add_fwnode_remote_subdev, which handles the needed setup, instead of open-coding it. Signed-off-by:
Ezequiel Garcia <ezequiel@collabora.com> Reviewed-by:
Jacopo Mondi <jacopo+renesas@jmondi.org> Reviewed-by:
Helen Koike <helen.koike@collabora.com> Signed-off-by:
Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by:
Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-
- Oct 10, 2019
-
-
Christophe JAILLET authored
The 2nd parameter of 'find_first_zero_bit()' is a number of bits, not of bytes. So use 'csi2rx->max_lanes' instead of 'sizeof(lanes_used)'. Fixes: 1fc3b37f ("media: v4l: cadence: Add Cadence MIPI-CSI2 RX driver") 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+samsung@kernel.org>
-
- Oct 04, 2018
-
-
Sakari Ailus authored
Initialise the V4L2 fwnode endpoints to zero in all drivers using v4l2_fwnode_endpoint_parse(). This prepares for setting default endpoint flags as well as the bus type. Setting bus type to zero will continue to guess the bus among the guessable set (parallel, Bt.656 and CSI-2 D-PHY). Signed-off-by:
Sakari Ailus <sakari.ailus@linux.intel.com> Tested-by:
Steve Longerbeam <steve_longerbeam@mentor.com> Tested-by:
Jacopo Mondi <jacopo+renesas@jmondi.org> Signed-off-by:
Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
-
Sakari Ailus authored
The CSI-2 bus may use either D-PHY or C-PHY. Make this visible in media bus enum. Signed-off-by:
Sakari Ailus <sakari.ailus@linux.intel.com> Tested-by:
Steve Longerbeam <steve_longerbeam@mentor.com> Tested-by:
Jacopo Mondi <jacopo+renesas@jmondi.org> Signed-off-by:
Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
-
Steve Longerbeam authored
Switch all media platform drivers to call v4l2_async_notifier_add_subdev() to add asd's to a notifier, in place of referencing the notifier->subdevs[] array. These drivers also must now call v4l2_async_notifier_init() before adding asd's to their notifiers. There may still be cases where a platform driver maintains a list of asd's that is a duplicate of the notifier asd_list, in which case its possible the platform driver list can be removed, and can reference the notifier asd_list instead. One example of where a duplicate list has been removed in this patch is xilinx-vipp.c. If there are such cases remaining, those drivers should be optimized to remove the duplicate platform driver asd lists. None of the changes to the platform drivers in this patch have been tested. Verify that the async subdevices needed by the platform are bound at load time, and that the driver unloads and reloads correctly with no memory leaking of asd objects. Suggested-by:
Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by:
Steve Longerbeam <slongerbeam@gmail.com> Signed-off-by:
Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by:
Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
-
- Jun 27, 2018
-
-
Arnd Bergmann authored
I ran into a randconfig build error with the new driver: drivers/media/platform/cadence/cdns-csi2tx.c: In function 'csi2tx_probe': drivers/media/platform/cadence/cdns-csi2tx.c:477:11: error: implicit declaration of function 'kzalloc'; did you mean 'd_alloc'? [-Werror=implicit-function-declaration] kzalloc() is declared in linux/slab.h, so let's include this to make it build in all configurations. Fixes: 84b477e6d4bc ("media: v4l: cadence: Add Cadence MIPI-CSI2 TX driver") Signed-off-by:
Arnd Bergmann <arnd@arndb.de> Acked-by:
Maxime Ripard <maxime.ripard@bootlin.com> Signed-off-by:
Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by:
Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
-
- May 17, 2018
-
-
Sakari Ailus authored
The clocks enabled by csi2rx_start function are intended to be disabled in an error path but there are two issues: 1) the loop condition is always true and 2) the first clock disabled is the the one enabling of which failed. Fix these two bugs by changing the loop condition as well as only disabling the clocks that were actually enabled. Reported-by:
Mauro Chehab <mchehab@kernel.org> Signed-off-by:
Sakari Ailus <sakari.ailus@linux.intel.com> Acked-by:
Maxime Ripard <maxime.ripard@bootlin.com> Signed-off-by:
Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
-
- May 16, 2018
-
-
Maxime Ripard authored
The Cadence CSI-2 RX Controller is an hardware block meant to be used as a bridge between a CSI-2 bus and pixel grabbers. It supports operating with internal or external D-PHY, with up to 4 lanes, or without any D-PHY. The current code only supports the latter case. It also support dynamic mapping of the CSI-2 virtual channels to the associated pixel grabbers, but that isn't allowed at the moment either. Acked-by:
Benoit Parrot <bparrot@ti.com> Reviewed-by:
Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Signed-off-by:
Maxime Ripard <maxime.ripard@bootlin.com> Signed-off-by:
Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by:
Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
-