summaryrefslogtreecommitdiffstats
path: root/drivers/media/i2c
Commit message (Collapse)AuthorAgeFilesLines
* media: tvp5150: make debug output more readablemfe/media/i2c/tvp5150.8Marco Felsch2019-08-191-3/+6
| | | | | | | | | | | | | The debug output for tvp5150_selmux() isn't really intuitive. Register values are printed decimal formatted and the input/output driver states are printed as enum. Even more the "normal" output enum mapps to zero so a active output will printing output=0 and a inactive output=1. Change this by brinting the register values hex formatted and the states as more readable string. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
* media: tvp5150: add support to limit sdtv standardsMarco Felsch2019-08-191-2/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The tvp5150 accepts NTSC(M,J,4.43), PAL (B,D,G,H,I,M,N) and SECAM video data and is able to auto-detect the input signal. The auto-detection does not work if the connector does not receive an input signal and the tvp5150 might not be configured correctly. This misconfiguration leads into wrong decoded video streams if the tvp5150 gets powered on before the video signal is present. Limit the supported sdtv standards according to the actual selected connector to avoid a misconfiguration. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> --- [1] https://patchwork.kernel.org/cover/10794703/ v8: - adapt commit message - fix rebasing issue - apdapt to new v4l2_fwnode_connector_analog naming - fix cur_connector update during tvp5150_link_setup() -> Only update if we have of-connectors. - fix supported_stds detection during tvp5150_s_std() -> use connectors_num to detect of-connectors presence v5: - probe() initialize supported tv-norms according the given connectors if they are available. - check if media-controller is used. Don't limit the norm if it isn't used. - add more logic to be smarter during connector changing so it is intuitiver for the user space. v2-v4: - nothing since the patch was squashed from series [1] into this series.
* media: tvp5150: add s_power callbackMarco Felsch2019-08-191-6/+17
| | | | | | | | | Don't en-/disable the interrupts during s_stream because someone can disable the stream but wants to get informed if the stream is locked again. So keep the interrupts enabled the whole time the pipeline is opened. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
* media: tvp5150: initialize subdev before parsing device treeMichael Tretter2019-08-191-4/+3
| | | | | | | | | | | There are several debug prints in the tvp5150_parse_dt() function, which do not print the prefix, because the v4l2_subdev is not initialized, yet. Initialize the v4l2_subdev before parsing the device tree to fix the debug messages. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
* media: tvp5150: add FORMAT_TRY support for get/set selection handlersMarco Felsch2019-08-191-32/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit 10d5509c8d50 ("[media] v4l2: remove g/s_crop from video ops") the 'which' field for set/get_selection must be FORMAT_ACTIVE. There is no way to try different selections. The patch adds a helper function to select the correct selection memory space (sub-device file handle or driver state) which will be set/returned. The selection rectangle is updated if the format is FORMAT_ACTIVE and the rectangle position and/or size differs from the current set rectangle. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> --- Changelog: v8: - adapt commit message - remove wrong FORMAT_TRY handling for tvp5150_fill_fmt() handling - return 0 during set_selection if FORMAT_TRY was requested and CONFIG_VIDEO_V4L2_SUBDEV_API is disabled - return -EINVAL during get_selection if FORMAT_TRY was requested and CONFIG_VIDEO_V4L2_SUBDEV_API is disabled v7: - __tvp5150_get_pad_crop(): return error on default case - simplify __tvp5150_get_pad_crop() error handling - tvp5150_set_selection() squash __tvp5150_set_selection() execution conditions v6: nothing v5: - handle stub for v4l2_subdev_get_try_crop() internal since commit ("media: v4l2-subdev: add stubs for v4l2_subdev_get_try_*") isn't anymore part of this series. - add error handling of __tvp5150_get_pad_crop() v4: - fix merge conflict due to rebase on top of media-tree/master - __tvp5150_get_pad_crop(): cosmetic alignment fixes
* media: tvp5150: add input source selection of_graph supportMarco Felsch2019-08-191-28/+344
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds the of_graph support to describe the tvp input connections. Physical the TVP5150 has three ports: AIP1A, AIP1B and YOUT. As result of discussion [1],[2] the device-tree maps these ports 1:1. Look at the Documentation for more information. Since the TVP5150 is a converter/bridge the device-tree must contain at least 1-input and 1-output port. The mc-connectors and mc-links are only created if the device-tree contains the corresponding connector nodes. If more than one connector is available the media_entity_operations.link_setup() callback ensures that only one connector is active. [1] https://www.spinics.net/lists/linux-media/msg138545.html [2] https://www.spinics.net/lists/linux-media/msg138546.html Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> --- Changelog: [1] https://patchwork.kernel.org/cover/10794703/ [2] https://patchwork.kernel.org/cover/10786553/ v8: - fix rebasing issue - fix error handling during tvp5150_registered() - adapt to new v4l2_connector_type enum v7: - don't init enum tvp5150_pads with TVP5150_COMPOSITE0 functionality - break some 80 character limitation to improve readability - fix comment style -> always start with capital letters and end with dot - fix some minor style issues - fix tvp5150_registered error handling - simplify tvp5150_mc_init - make connectors static -> since now only three connectors are possible (as described in DT) -> drop tvp5150.endpoints storage -> squash tvp5150_parse_dt and tvp5150_add_of_connectors - improve tvp5150_parse_dt: -> make parsing stricter and fix not detected missconfigured dt-data -> svideo must be connected now to port@[0,1]/endpoint@1 v6: - fix misspelled comments - use 'unsigned int' where it's possible - cleanup ifdef part-2: * tvp5150_mc_init, tvp5150_add_of_connectors: add surrounding CONFIG_MEDIA_CONTROLLER if def and stubs to improve quality - tvp5150_mc_init: uniform interface, use 'struct tvp5150' since all internal function do this. - tvp5150_add_of_connectors: call within probe() to make it cleaner - tvp5150_parse_dt: move local loop vars within the loop. v5: - Fixing build deps: - tvp5150_mc_init: fix CONFIG_MEDIA_CONTROLLER deps - struct tvp5150: drop CONFIG_MEDIA_CONTROLLER conditional property includes. This leads into to complex deps for futher development. - tvp5150_dt_cleanup: enable function only if CONFIG_OF is enabled - tvp5150_parse_dt: enable function only if CONFIG_OF is enabled - tvp5150_probe: call tvp5150_dt_cleanup only if CONFIG_OF is enabled - Simplify link_setup routine: - use generic connector parsing since both series [1,2] are squashed into one - struct tvp5150: drop pads_state and modify_second_link property due to link_setup() rework. - tvp5150_link_setup: add more comments - tvp5150_link_setup: simply the link setup routine a lot. Edit the 2nd link directly within the driver instead of a recursive media-framework call (__media_entity_setup_link). This improves the readability and shrinks the driver code. - tvp5150_link_setup: disable all active links in case user switches connectors without disable it first. - tvp5150_registered: simplify default link enable path due to link_setup() rework. - General cleanups - tvp5150_parse_dt: drop unecessary test - tvp5150_parse_dt: add err message due to misconfiguration - tvp5150_parse_dt: make use of V4L2_MBUS_UNKNOWN definition - s/dev_dbg/dev_dbg_lvl v4: - rebase on top of media_tree/master, fix merge conflict due to commit 60359a28d592 ("media: v4l: fwnode: Initialise the V4L2 fwnode endpoints to zero") v3: - probe(): s/err/err_free_v4l2_ctrls - drop MC dependency for tvp5150_pads v2: - adapt commit message - unify ifdef switches - rename tvp5150_valid_input -> tvp5150_of_valid_input, to be more precise - mc: use 2-input and 1-output pad - mc: link svideo connector to both input pads - mc: enable/disable svideo links in one go - mc: change link_setup() behaviour, switch the input src don't require a explicite disable before. - mc: rename 'local' media_pad param to tvp5150_pad to avoid confusion - mc: enable link to the first available connector and set the corresponding tvp5150 input src per default during registered() - mc/of: factor out oftree connector allocation - of: drop svideo dt port - of: move svideo connector to port@0/endpoint@1 - of: require at least 1-in and 1-out endpoint
* partial revert of "[media] tvp5150: add HW input connectors support"Javier Martinez Canillas2019-08-191-145/+0
| | | | | | | | | | | | | | | | | | | | | | | Commit f7b4b54e6364 ("[media] tvp5150: add HW input connectors support") added input signals support for the tvp5150, but the approach was found to be incorrect so the corresponding DT binding commit 82c2ffeb217a ("[media] tvp5150: document input connectors DT bindings") was reverted. This left the driver with an undocumented (and wrong) DT parsing logic, so lets get rid of this code as well until the input connectors support is implemented properly. It's a partial revert due other patches added on top of mentioned commit not allowing the commit to be reverted cleanly anymore. But all the code related to the DT parsing logic and input entities creation are removed. Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> [m.felsch@pengutronix.de: rm TVP5150_INPUT_NUM define] Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Acked-by: Rob Herring <robh@kernel.org>
* media: i2c: ov5645: Fix power sequenceEzequiel Garcia2019-08-151-8/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is mostly a port of Jacopo's fix: commit aa4bb8b8838ffcc776a79f49a4d7476b82405349 Author: Jacopo Mondi <jacopo@jmondi.org> Date: Fri Jul 6 05:51:52 2018 -0400 media: ov5640: Re-work MIPI startup sequence In the OV5645 case, the changes are: - At set_power(1) time power up MIPI Tx/Rx and set data and clock lanes in LP11 during 'sleep' and 'idle' with MIPI clock in non-continuous mode. - At set_power(0) time power down MIPI Tx/Rx (in addition to the current power down of regulators and clock gating). - At s_stream time enable/disable the MIPI interface output. With this commit the sensor is able to enter LP-11 mode during power up, as expected by some CSI-2 controllers. Many thanks to Fabio Estevam for his help debugging this issue. Tested-by: Fabio Estevam <festevam@gmail.com> Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: ov5640: Add support for flash and lens devicesLuca Weiss2019-08-151-1/+1
| | | | | | | | | Parse async sub-devices related to the sensor by switching the async sub-device registration function. Signed-off-by: Luca Weiss <luca@z3ntu.xyz> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: ov8856: Check reading clock frequency succeededSakari Ailus2019-08-151-1/+4
| | | | | | | | | | Instead of blindly trusting getting the clock frequency succeeded end then testing it against a pre-defined value, verify reading the value succeeded. Fixes: 879347f0c258 ("media: ov8856: Add support for OV8856 sensor") Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: ov5675: Add support for OV5675 sensorShawn Tu2019-08-153-0/+1197
| | | | | | | | | | | | | | | | | | | | | | | Add a V4L2 sub-device driver for Omnivision ov5675 image sensor. This is a camera sensor using the I2C bus for control and the CSI-2 bus for data. This driver supports following features: - manual exposure and analog/digital gain control support - vblank/hblank control support - test pattern support - media controller support - runtime PM support - support following resolutions: + 2592x1944 at 30FPS + 1296x972 at 30FPS [Sakari Ailus: Wrapped a few long lines.] [mchehab+samsung@kernel.org: fix a checkpatch warning] Signed-off-by: Shawn Tu <shawnx.tu@intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: ir-kbd-i2c: convert to i2c_new_dummy_device()Wolfram Sang2019-08-141-5/+6
| | | | | | | | | | Convert this driver to use the new i2c_new_dummy_device() call and bail out if the dummy device cannot be registered to make failure more visible to the user. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: i2c: Convert to new i2c device probe()Kieran Bingham2019-08-1319-56/+38
| | | | | | | | | | | | | | | The I2C core framework provides a simplified probe framework from commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"). These drivers do not utilise the i2c_device_id table in the probe, so we can easily convert them to utilise the simplified i2c driver registration. Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Acked-by: Andrzej Hajda <a.hajda@samsung.com> Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: i2c: et8ek8: Convert to new i2c device probe()Kieran Bingham2019-08-131-3/+2
| | | | | | | | | | | | | The I2C core framework provides a simplified probe framework from commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"). This driver does not utilise the i2c_device_id table in the probe, so we can easily convert it to utilise the simplified i2c driver registration. Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: i2c: s5c73m3: Convert to new i2c device probe()Kieran Bingham2019-08-131-3/+2
| | | | | | | | | | | | | | The I2C core framework provides a simplified probe framework from commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"). This driver does not utilise the i2c_device_id table in the probe, so we can easily convert it to utilise the simplified i2c driver registration. Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Acked-by: Andrzej Hajda <a.hajda@samsung.com> Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: i2c: smiapp: Convert to new i2c device probe()Kieran Bingham2019-08-131-3/+2
| | | | | | | | | | | | | The I2C core framework provides a simplified probe framework from commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"). This driver does not utilise the i2c_device_id table in the probe, so we can easily convert it to utilise the simplified i2c driver registration. Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: i2c: adv748x: Convert to new i2c device probe()Kieran Bingham2019-08-131-11/+2
| | | | | | | | | | | | | The I2C core framework provides a simplified probe framework from commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"). Convert the ADV748x to utilise this simplified i2c driver registration. Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Acked-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: i2c: tvp5150: Add of_node_put() before gotoNishka Dasgupta2019-08-131-0/+4
| | | | | | | | | | | | Each iteration of for_each_available_child_of_node puts the previous node, but in the case of a goto from the middle of the loop, there is no put, thus causing a memory leak. Hence add an of_node_put before the goto in four places. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: i2c: adv7842: convert to i2c_new_dummy_deviceWolfram Sang2019-08-131-3/+6
| | | | | | | | | | | Move away from the to-be-removed i2c_new_dummy() to i2c_new_dummy_device(). So, we now get an ERRPTR which we use in error handling by printing the error code. To keep the rest of the driver logic as is, internally a NULL ptr is still kept. 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+samsung@kernel.org>
* media: i2c: tda1997x: prevent potential NULL pointer accessWolfram Sang2019-08-131-2/+7
| | | | | | | | | | | | i2c_new_dummy() can fail returning a NULL pointer. This is not checked and the returned pointer is blindly used. Convert to devm_i2c_new_dummy_client() which returns an ERR_PTR and also add a validity check. Using devm_* here also fixes a leak because the dummy client was not released in the probe error path. 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+samsung@kernel.org>
* media: i2c: adv7511-v4l2: convert to i2c_new_dummy_deviceWolfram Sang2019-08-131-9/+9
| | | | | | | | | Move from i2c_new_dummy() to i2c_new_dummy_device(), so we now get an ERRPTR which we use in error handling. 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+samsung@kernel.org>
* media: i2c: adv7180: convert to i2c_new_dummy_deviceWolfram Sang2019-08-131-6/+6
| | | | | | | | | Move from i2c_new_dummy() to i2c_new_dummy_device(), so we now get an ERRPTR which we use in error handling. 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+samsung@kernel.org>
* media: i2c: ad9389b: convert to i2c_new_dummy_deviceWolfram Sang2019-08-131-3/+3
| | | | | | | | | Move from i2c_new_dummy() to i2c_new_dummy_device(), so we now get an ERRPTR which we use in error handling. 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+samsung@kernel.org>
* media: adv7511/cobalt: rename driver name to adv7511-v4l2Hans Verkuil2019-08-071-2/+2
| | | | | | | | | | | | | | Commit b2ce5617dad2 ("media: i2c: fix warning same module names") renamed the adv7511 module in the media tree to adv7511-v4l2. This patch does the same rename for the driver name and device id to keep the naming consistent. Since the cobalt driver loads this module, it had to be renamed there as well. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: ir-kbd-i2c: remove outdated commentsWolfram Sang2019-08-041-3/+0
| | | | | | | | | The "free memory" comment is obsolete since 2013 and the other ones explain the obvious. Just remove the comments. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: ov2680: fix a typo in a function nameChristophe JAILLET2019-07-251-2/+2
| | | | | | | | | | | All functions in this file starts with 'ov2680_', except ov2860_parse_dt(). This is likely a typo. rename it to 'ov2680_parse_dt()' (6 and 8) Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: i2c: ov5640: Fix the order for enabling regulatorsFabio Estevam2019-07-251-1/+1
| | | | | | | | | | | | | | | | | According to the OV5640 datasheet the following sequence needs to be followed when powering the OV5640 supplies: - DOVDD - AVDD - DVDD So follow this order inside the ov5640_supply_name[] array, so that the regulator_bulk() functions can enable the regulator in the correct sequence. Signed-off-by: Fabio Estevam <festevam@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: i2c: ov5640: Check for devm_gpiod_get_optional() errorFabio Estevam2019-07-251-0/+5
| | | | | | | | | | The power down and reset GPIO are optional, but the return value from devm_gpiod_get_optional() needs to be checked and propagated in the case of error, so that probe deferral can work. Signed-off-by: Fabio Estevam <festevam@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: ov5645: Use regulator_bulk() functionsFabio Estevam2019-07-251-73/+21
| | | | | | | | | The code can be simplified by using the regulator_bulk() functions, so switch to it. Signed-off-by: Fabio Estevam <festevam@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: ov5645: Remove unneeded regulator_set_voltage()Fabio Estevam2019-07-251-28/+0
| | | | | | | | | | | | There is no need to call regulator_set_voltage() for each regulator that powers the camera. The voltage value for each regulator should be retrieved from the device tree, so remove the unneeded regulator_set_voltage(). Signed-off-by: Fabio Estevam <festevam@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: media/i2c: don't return ENOTTY if SUBDEV_API is not setHans Verkuil2019-07-236-19/+7
| | | | | | | | | | | | | | | If CONFIG_VIDEO_V4L2_SUBDEV_API is not set, then it is still possible to call set_fmt for V4L2_SUBDEV_FORMAT_TRY, the result is just not stored. So return 0 instead of -ENOTTY. Calling get_fmt with V4L2_SUBDEV_FORMAT_TRY should return -EINVAL instead of -ENOTTY, after all the get_fmt functionality is still present, just not supported for TRY. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Acked-by: Rui Miguel Silva <rmfrfs@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: ov7670: don't return ENOTTY if SUBDEV_API is not setHans Verkuil2019-07-231-4/+2
| | | | | | | | | | | | | If CONFIG_VIDEO_V4L2_SUBDEV_API is not set, then it is still possible to call set_fmt for V4L2_SUBDEV_FORMAT_TRY, the result is just not stored. So return 0 instead of -ENOTTY. Calling get_fmt with V4L2_SUBDEV_FORMAT_TRY should return -EINVAL instead of -ENOTTY, after all the get_fmt functionality is still present, just not supported for TRY. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* Merge tag 'media/v5.3-1' of ↵Linus Torvalds2019-07-0924-423/+1207
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media Pull media updates from Mauro Carvalho Chehab: - new Atmel microship ISC driver - coda has gained support for mpeg2 and mpeg4 - cxusb gained support for analog TV - rockchip staging driver was split into two separate staging drivers - added a new staging driver for Allegro DVT video IP core - added a new staging driver for Amlogic Meson video decoder - lots of improvements and cleanups * tag 'media/v5.3-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (398 commits) media: allegro: use new v4l2_m2m_ioctl_try_encoder_cmd funcs media: doc-rst: Fix typos media: radio-raremono: change devm_k*alloc to k*alloc media: stv0297: fix frequency range limit media: rc: Prefer KEY_NUMERIC_* for number buttons on remotes media: dvb_frontend: split dvb_frontend_handle_ioctl function media: mceusb: disable "nonsensical irdata" messages media: rc: remove redundant dev_err message media: cec-notifier: add new notifier functions media: cec: add struct cec_connector_info support media: cec-notifier: rename variables, check kstrdup and n->conn_name media: MAINTAINERS: Add maintainers for Media Controller media: staging: media: tegra-vde: Defer dmabuf's unmapping media: staging: media: tegra-vde: Add IOMMU support media: hdpvr: fix locking and a missing msleep media: v4l2: Test type instead of cfg->type in v4l2_ctrl_new_custom() media: atmel: atmel-isc: fix i386 build error media: v4l2-ctrl: Move compound control initialization media: hantro: Use vb2_get_buffer media: pci: cx88: Change the type of 'missed' to u64 ...
| * media: st-mipid02: add support of JPEGHugues Fruchet2019-06-241-5/+13
| | | | | | | | | | | | | | | | | | Add support of JPEG pixel format. This requires auto detection of data type from CSI-2 stream. Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: st-mipid02: add support of YUYV8 and UYVY8Hugues Fruchet2019-06-241-0/+5
| | | | | | | | | | | | | | | | Add support of YUYV8 and UYVY8 pixel formats. Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: st-mipid02: add support of RGB565Hugues Fruchet2019-06-241-1/+7
| | | | | | | | | | | | | | | | Add support of RGB565 pixel format. Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: st-mipid02: add support of V4L2_CID_LINK_FREQHugues Fruchet2019-06-241-3/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Ask device connected on sink pad for link frequency in order to configure CLK_LANE_REG1 (ui_x4). If not available, ask for pixel rate information to compute it. This is needed to deal with compressed format such as JPEG where number of bits per pixel is unknown: computation of link frequency from pixel rate is not possible. Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: mt9m111: fix fw-node refactoringRobert Jarzmik2019-06-241-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the patch refactoring the fw-node, the mt9m111 was broken for all platform_data based platforms, which were the first aim of this driver. Only the devicetree platform are still functional, probably because the testing was done on these. The result is that -EINVAL is systematically return for such platforms, what this patch fixes. [Sakari Ailus: Rework this to resolve a merge conflict and use dev_fwnode] Fixes: 98480d65c48c ("media: mt9m111: allow to setup pixclk polarity") Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: i2c: tw9910: simplify getting the adapter of a clientWolfram Sang2019-06-241-2/+1
| | | | | | | | | | | | | | | | | | | | We have a dedicated pointer for that, so use it. Much easier to read and less computation involved. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: Simon Horman <horms+renesas@verge.net.au> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: i2c: ov2640: simplify getting the adapter of a clientWolfram Sang2019-06-241-1/+1
| | | | | | | | | | | | | | | | | | | | We have a dedicated pointer for that, so use it. Much easier to read and less computation involved. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: Simon Horman <horms+renesas@verge.net.au> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: i2c: mt9m111: simplify getting the adapter of a clientWolfram Sang2019-06-241-1/+1
| | | | | | | | | | | | | | | | | | | | We have a dedicated pointer for that, so use it. Much easier to read and less computation involved. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: Simon Horman <horms+renesas@verge.net.au> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: i2c: mt9m001: simplify getting the adapter of a clientWolfram Sang2019-06-241-1/+1
| | | | | | | | | | | | | | | | | | | | We have a dedicated pointer for that, so use it. Much easier to read and less computation involved. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: Simon Horman <horms+renesas@verge.net.au> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: i2c: ak881x: simplify getting the adapter of a clientWolfram Sang2019-06-241-1/+1
| | | | | | | | | | | | | | | | | | | | We have a dedicated pointer for that, so use it. Much easier to read and less computation involved. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: Simon Horman <horms+renesas@verge.net.au> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: mt9m111: Fix error handling in mt9m111_power_onSakari Ailus2019-06-241-5/+13
| | | | | | | | | | | | | | | | | | The mt9m111_power_on function did not properly clean up whenever it encountered an error. Do that now. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: mt9m111: No need to check for the regulatorSakari Ailus2019-06-241-7/+4
| | | | | | | | | | | | | | | | | | The regulator_get() function returns a regulator when it succeeds. There's no need to check whether the regulator is NULL later on. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: mt9m111: add regulator supportRobert Jarzmik2019-06-211-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the soc_camera removal, the board specific power callback was dropped. This at least will remove the power optimization from ezx and em-x270 pxa based boards. As to recreate the same level of functionality, make the mt9m111 have a regulator providing it its power, so that board designers can plug in a gpio based or ldo regulator, mimicking their former soc_camera power hook. [sakari.ailus@linux.intel.com: fix a build warning] Fixes: 5c10113cc668 ("media: mt9m111: make a standalone v4l2 subdevice") Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Tested-by: Akinobu Mita <akinobu.mita@gmail.com> Tested-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: ov9640: Don't check for NULL on devm_gpiod_get return valuesSakari Ailus2019-06-211-2/+2
| | | | | | | | | | | | | | | | | | devm_gpiod_get never returns NULL; therefore it's not necessary to check for that. PTR_ERR(NULL) also yields zero, which is confusing to smatch. Reported-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: ov6650: Fix device node exposed without proper lockingJanusz Krzysztofik2019-06-211-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit c62b96050bee ("media: ov6650: Register with asynchronous subdevice framework") carelessly requested creation of a video device node by setting a V4L2_SUBDEV_FL_HAS_DEVNODE flag. The driver is not ready for that as it doesn't implement proper locking required for serialization of IOCTLs. Fix it by dropping the flag assignment. Fixes: c62b96050bee ("media: ov6650: Register with asynchronous subdevice framework") Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: i2c: Fix Unnecessary Semicolon Warning Reported by coccicheckShobhit Kukreti2019-06-213-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | Removed the warning from the following files: drivers/media/i2c/ov13858.c drivers/media/i2c/ov2685.c drivers/media/i2c/ov5695.c Signed-off-by: Shobhit Kukreti <shobhitkukreti@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: video-i2c: use V4L2_FRACT_COMPAREAkinobu Mita2019-06-211-6/+2
| | | | | | | | | | | | | | | | | | | | | | Use V4L2_FRACT_COMPARE to check whether two v4l2_fract structs are equal. Cc: Matt Ranostay <matt.ranostay@konsulko.com> Cc: Sakari Ailus <sakari.ailus@linux.intel.com> Cc: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>