summaryrefslogtreecommitdiffstats
path: root/drivers/media/i2c/tvp5150.c
Commit message (Collapse)AuthorAgeFilesLines
* [media] v4l: tvp5150: Don't override output pinmuxing at stream on/off timeLaurent Pinchart2016-12-211-14/+19
| | | | | | | | | | | | | | | | The s_stream() handler incorrectly writes the whole MISC_CTL register to enable or disable the outputs, overriding the output pinmuxing configuration. Fix it to only touch the output enable bits. The CONF_SHARED_PIN register is also written by the same function, resulting in muxing the INTREQ signal instead of the VBLK/GPCL signal on the INTREQ/GPCL/VBLK pin. As the driver doesn't support interrupts this is obviously incorrect, and breaks operation on other devices. Fix it by removing the write. Cc: stable@vger.kernel.org # For Kernel 4.5 and upper Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] v4l: tvp5150: Fix comment regarding output pin muxingLaurent Pinchart2016-12-211-7/+17
| | | | | | | | | | | | | | | The FID/GLCO/VLK/HVLK and INTREQ/GPCL/VBLK pins are muxed differently depending on whether the input is an S-Video or composite signal. The comment that explains the logic doesn't reflect the code. It appears that the comment is incorrect, as disabling the output data bus in composite mode makes no sense. Update the comment to match the code. While at it define macros for the MISC_CTL register bits, the code is too confusing with numerical values. Cc: stable@vger.kernel.org # For Kernel 4.5 and upper Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] v4l: tvp5150: Reset device at probe time, not in get/set format handlersLaurent Pinchart2016-12-211-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | The tvp5150 doesn't support format setting through the subdev pad API and thus implements the set format handler as a get format operation. The single handler, tvp5150_fill_fmt(), resets the device by calling tvp5150_reset(). This causes malfunction as the device can be reset at will, possibly from userspace when the subdev userspace API is enabled. The reset call was added in commit ec2c4f3f93cb ("[media] media: tvp5150: Add mbus_fmt callbacks"), probably as an attempt to set the device to a known state before detecting the current TV standard. However, the get format handler doesn't access the hardware to get the TV standard since commit 963ddc63e20d ("[media] media: tvp5150: Add cropping support"). There is thus no need to reset the device when getting the format. However, removing the tvp5150_reset() from the get/set format handlers results in the function not being called at all if the bridge driver doesn't use the .reset() operation. The operation is nowadays abused and shouldn't be used, so shouldn't expect bridge drivers to call it. To make sure the device is properly initialize, move the reset call from the format handlers to the probe function. Cc: stable@vger.kernel.org # For Kernel 4.5 and upper Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] v4l: tvp5150: Add missing break in set control handlerLaurent Pinchart2016-12-121-0/+1
| | | | | | | | | | | A break is missing resulting in the hue control enabling or disabling the decode completely. Fix it. Fixes: c43875f66140 ("[media] tvp5150: replace MEDIA_ENT_F_CONN_TEST by a control") Cc: stable@vger.kernel.org Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] v4l: tvp5150: Don't inline the tvp5150_selmux() functionLaurent Pinchart2016-12-121-1/+1
| | | | | | | | The function is large and called in several places, don't inline it. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] v4l: tvp5150: Compile tvp5150_link_setup out if !CONFIG_MEDIA_CONTROLLERLaurent Pinchart2016-12-121-2/+2
| | | | | | | | | | | The function is only referenced as a handler in the tvp5150_sd_media_ops structure, which is only used when CONFIG_MEDIA_CONTROLLER is set. Don't define the function and the structure when the configuration option is unset to avoid an unused function warning. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] tvp5150: get rid of KERN_CONTMauro Carvalho Chehab2016-11-181-11/+13
| | | | | | | | | | | | | | | | Unfortunately, KERN_CONT doesn't work with dev_foo(), producing weird messages like: tvp5150 6-005c: tvp5150: read 0xf6 = 0xff ff So, we need to get rid of it. As we're always printing read/write in hexa when dumping multiple register values, also remove the "0x" from the read/write debug messages too. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] tvp5150: Get rid of direct calls to printk()Mauro Carvalho Chehab2016-11-181-108/+110
| | | | | | | | When returning results via v4l2_subdev_core_ops.log_status, use dev_foo() call, instead of just calling printk() directly, without even specifying the log message level. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] tvp5150: convert it to use dev_foo() macrosMauro Carvalho Chehab2016-11-181-25/+24
| | | | | | | Instead of using v4l_foo(), use the dev_foo() macros, as most modern media drivers. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] tvp5150: use sd internal ops .registered instead .registered_asyncJavier Martinez Canillas2016-08-241-2/+6
| | | | | | | | | | | | | | | | | The driver is using the struct v4l2_subdev_core_ops .registered_async callback to register the connector entities and create the pad links after the subdev entity has been registered with the media device. But the .registered_async callback isn't needed since the v4l2 core already calls the struct v4l2_subdev_internal_ops .registered callback in v4l2_device_register_subdev(), after media_device_register_entity(). So, use the .registered() callback instead of the .registered_async() that is going to be removed in a following patch since isn't needed. Suggested-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] v4l2: remove g/s_crop from video opsHans Verkuil2016-08-241-42/+39
| | | | | | | | | | | | | | Replace all calls to g/s_crop by calls to the get/set_selection pad ops. Remove the old g/s_crop video ops since they are now no longer used. The cropcap video op is now only used to pass pixelaspect information, and is only needed if the pixelaspect is not 1:1. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] tvp5150: propagate I2C write error in .s_register callbackJavier Martinez Canillas2016-05-091-2/+1
| | | | | | | | | The tvp5150_write() function can fail so don't return 0 unconditionally in tvp5150_s_register() but propagate what's returned by tvp5150_write(). Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] tvp5150: return I2C write operation failure to callersJavier Martinez Canillas2016-05-091-2/+4
| | | | | | | | | | | | | | | | | | | The tvp5150_write() function calls i2c_smbus_write_byte_data() that can fail but does not propagate the error to the caller. Instead it just prints a debug, so callers can't know if the operation failed. So change the function to return the error code to the caller so it knows that the write failed and also print an error instead of just printing a debug information. While being there remove the inline keyword from tvp5150_write() to make it consistent with tvp5150_read() and also because it's called in a lot of places, so making inline is in fact counter productive since it makes the kernel image size to be much bigger (~16 KiB). Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] tvp5150: don't go past decoder->input_ent arrayMauro Carvalho Chehab2016-02-231-1/+1
| | | | | | | drivers/media/i2c/tvp5150.c:1394 tvp5150_parse_dt() warn: buffer overflow 'decoder->input_ent' 3 <= 3 Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] tvp5150: replace MEDIA_ENT_F_CONN_TEST by a controlMauro Carvalho Chehab2016-02-161-17/+28
| | | | | | | | | | | MEDIA_ENT_F_CONN_TEST is not really a connector, it is actually a signal generator. Also, as other drivers use the V4L2_CID_TEST_PATTERN control for signal generators, let's change the driver accordingly. Tested with Terratec Grabster AV350. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] tvp5150: add HW input connectors supportJavier Martinez Canillas2016-02-111-0/+150
| | | | | | | | | | | | | | | | | | | | | | | | | | The tvp5150 decoder has different input connectors. The actual list of HW inputs depends on the device version but all have at least these 3: 1) Composite0 2) Composite1 3) S-Video and some variants have a 4th possible input connector: 4) Signal generator The driver currently uses the .s_routing callback to switch the input connector but since these are separate HW blocks, it's better to use media entities to represent the input connectors and their source pads linked with the decoder's sink pad. This allows user-space to use the MEDIA_IOC_SETUP_LINK ioctl to choose the input connector. For example using the media-ctl user-space tool: $ media-ctl -r -l '"Composite0":0->"tvp5150 1-005c":0[1]' Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] tvp5150: move input definition header to dt-bindingsJavier Martinez Canillas2016-02-111-1/+1
| | | | | | | | | Add a header file for the tvp5150 input connectors constants that can be shared between the driver and Device Tree source files. [mchehab@osg.samsung.com: rename tvp5150.h also at em28xx-cards.c] Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] tvp5150: store dev id and rom versionJavier Martinez Canillas2016-02-101-9/+12
| | | | | | | | | | | | | | Not all tvp5150 variants support the same, for example some have an internal signal generator that can output a black screen. So the device id and rom version have to be stored in the driver's state to know what variant is a given device. While being there, remove some redundant comments about the device version since there is already calls to v4l2_info() with that info. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] tvp5150: put endpoint node on errorJavier Martinez Canillas2016-02-101-2/+4
| | | | | | | | If the parallel mbus configuration is not correct, the endpoint device node isn't currently put again in the error path. Fix it. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] tvp5150: identify it as a MEDIA_ENT_F_ATV_DECODERMauro Carvalho Chehab2016-02-011-0/+3
| | | | | | | | | | | The tvp5150 is an analog TV decoder. Identify as such at the media graph, or otherwise devices using it would fail. That avoids the following warning: [ 1546.669139] usb 2-3.3: Entity type for entity tvp5150 5-005c was not initialized! Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] tvp5150: create the expected number of padsMauro Carvalho Chehab2016-02-011-3/+8
| | | | | | | | | | | | The tvp5150 doesn't have just one pad. It has 3 ones: - IF input - Video output - VBI output Fix it and use the macros for the pad indexes. Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] tvp5150: Add pad-level subdev operationsLaurent Pinchart2016-01-291-11/+42
| | | | | | | | | This patch enables the tvp5150 decoder driver to be used with the media controller framework by adding pad-level subdev operations and init the media entity pad. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
* [media] tvp5150: fix tvp5150_fill_fmt()Laurent Pinchart2016-01-291-2/+2
| | | | | | | | | | The tvp5150 output video is interlaced so mark the format field as alternate and reduce the height to the half. [javier: split patch and write commit message] Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
* Revert "[media] tvp5150: Fix breakage for serial usage"Mauro Carvalho Chehab2016-01-261-4/+5
| | | | | | | | | | | | This patch were a workaround for a regression at tvp5150, but it causes troubles on devices with omap3+tvp5151 when working in non-parallel bus mode. Now that em28xx was fixed, we can get rid of that. This reverts commit 47de9bf8931e6bf9c92fdba9867925d1ce482ab1. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] tvp5150: Fix breakage for serial usageMauro Carvalho Chehab2016-01-251-5/+4
| | | | | | | | | | | | | | | | | | changeset 460b6c0831cb ("tvp5150: Add s_stream subdev operation support") broke for em28xx-based devices with uses tvp5150. On those devices, touching the TVP5150_MISC_CTL register causes em28xx to stop streaming. I suspect that it uses the 27 MHz clock provided by tvp5150 to feed em28xx. So, change the logic to do nothing on s_stream if the tvp5150 is not set up to work with V4L2_MBUS_PARALLEL. Tested with Hauppauge WinTV USB 2 model 42012 Rev. C186 (USB ID: 2040:4200). Cc: Javier Martinez Canillas <javier@osg.samsung.com> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] tvp5150: Add OF match tableEduard Gavin2016-01-251-0/+9
| | | | | | | | | | | | The Documentation/devicetree/bindings/media/i2c/tvp5150.txt DT binding doc lists "ti,tvp5150" as the device compatible string but the driver does not have an OF match table. Add the table to the driver so the I2C core can do an OF style match. Signed-off-by: Eduard Gavin <egavinc@gmail.com> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] tvp5150: Configure data interface via DTJavier Martinez Canillas2016-01-251-3/+63
| | | | | | | | | | The video decoder supports either 8-bit 4:2:2 YUV with discrete syncs or 8-bit ITU-R BT.656 with embedded syncs output format but currently BT.656 it's always reported. Allow to configure the format to use via either platform data or a device tree definition. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] tvp5150: Initialize the chip on probeJavier Martinez Canillas2016-01-251-0/+35
| | | | | | | | | | | | | | | | | | | | | | After power-up, the tvp5150 decoder is in a unknown state until the RESETB pin is driven LOW which reset all the registers and restarts the chip's internal state machine. The init sequence has some timing constraints and the RESETB signal can only be used if the PDN (Power-down) pin is first released. So, the initialization sequence is as follows: 1- PDN (active-low) is driven HIGH so the chip is power-up 2- A 20 ms delay is needed before sending a RESETB (active-low) signal. 3- The RESETB pulse duration is 500 ns. 4- A 200 us delay is needed for the I2C client to be active after reset. This patch used as a reference the logic in the IGEPv2 board file from the ISEE 2.6.37 vendor tree. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] tvp5150: Add g_mbus_config subdev operation supportLaurent Pinchart2016-01-251-0/+11
| | | | | | | | This patch adds the .g_mbus_config subdev operation to the driver. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] tvp5150: Add s_stream subdev operation supportLaurent Pinchart2016-01-251-0/+16
| | | | | | | | This patch adds the .s_stream subdev operation to the driver. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] tvp5150: Add pixel rate control supportLaurent Pinchart2016-01-251-1/+4
| | | | | | | | This patch adds support for the V4L2_CID_PIXEL_RATE control. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] tvp5150: Add tvp5151 supportLaurent Pinchart2016-01-251-0/+2
| | | | | | | | Expand the version detection code to identity the tvp5151. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] tvp5150: Restructure version detectionLaurent Pinchart2016-01-251-34/+45
| | | | | | | | | Move the version detection code to a separate function and restructure it to prepare for TVP5151 support. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] include/media: split I2C headers from V4L2 coreMauro Carvalho Chehab2015-11-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, include/media is messy, as it contains both the V4L2 core headers and some driver-specific headers on the same place. That makes harder to identify what core headers should be documented and what headers belong to I2C drivers that are included only by bridge/main drivers that would require the functions provided by them. Let's move those i2c specific files to its own subdirectory. The files to move were produced via the following script: mkdir include/media/i2c (cd include/media; for i in *.h; do n=`echo $i|sed s/.h$/.c/`; if [ -e ../../drivers/media/i2c/$n ]; then echo $i; git mv $i i2c/; fi; done) (cd include/media; for i in *.h; do n=`echo $i|sed s/.h$/.c/`; if [ -e ../../drivers/media/*/i2c/$n ]; then echo $i; git mv $i i2c/; fi; done) for i in include/media/*.h; do n=`basename $i`; (for j in $(git grep -l $n); do dirname $j; done)|sort|uniq|grep -ve '^.$' > list; num=$(wc -l list|cut -d' ' -f1); if [ $num == 1 ]; then if [ "`grep i2c list`" != "" ]; then git mv $i include/media/i2c; fi; fi; done And the references corrected via this script: MAIN_DIR="media/" PREV_DIR="media/" DIRS="i2c/" echo "Checking affected files" >&2 for i in $DIRS; do for j in $(find include/$MAIN_DIR/$i -type f -name '*.h'); do n=`basename $j` git grep -l $n done done|sort|uniq >files && ( echo "Handling files..." >&2; echo "for i in \$(cat files|grep -v Documentation); do cat \$i | \\"; ( cd include/$MAIN_DIR; for j in $DIRS; do for i in $(ls $j); do echo "perl -ne 's,(include [\\\"\\<])$PREV_DIR($i)([\\\"\\>]),\1$MAIN_DIR$j\2\3,; print \$_' |\\"; done; done; echo "cat > a && mv a \$i; done"; ); echo "Handling documentation..." >&2; echo "for i in MAINTAINERS \$(cat files); do cat \$i | \\"; ( cd include/$MAIN_DIR; for j in $DIRS; do for i in $(ls $j); do echo " perl -ne 's,include/$PREV_DIR($i)\b,include/$MAIN_DIR$j\1,; print \$_' |\\"; done; done; echo "cat > a && mv a \$i; done" ); ) >script && . ./script Merged Sakari Ailus patch that moves smiapp.h to include/media/i2c. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Acked-by: Arnd Bergmann <arnd@arndb.de>
* [media] tvp5150: add support for asynchronous probingJavier Martinez Canillas2015-10-011-3/+11
| | | | | | | | | Allow the subdevice to be probed asynchronously. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] i2c: Drop owner assignment from i2c_driverKrzysztof Kozlowski2015-08-111-1/+0
| | | | | | | | i2c_driver does not need to set an owner because i2c_register_driver() will set it. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] v4l2: replace video op g_mbus_fmt by pad op get_fmtHans Verkuil2015-05-011-6/+9
| | | | | | | | | | | The g_mbus_fmt video op is a duplicate of the pad op. Replace all uses by the get_fmt pad op and remove the video op. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Acked-by: Prabhakar Lad <prabhakar.csengg@gmail.com> Cc: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] v4l2: replace enum_mbus_fmt by enum_mbus_codeHans Verkuil2015-05-011-5/+10
| | | | | | | | | | | | | Replace all calls to the enum_mbus_fmt video op by the pad enum_mbus_code op and remove the duplicate video op. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Acked-by: Scott Jiang <scott.jiang.linux@gmail.com> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Kamil Debski <k.debski@samsung.com> Acked-by: Prabhakar Lad <prabhakar.csengg@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] i2c: Make use of media_bus_format enumBoris BREZILLON2014-11-141-3/+3
| | | | | | | | | | | | | | | In order to have subsytem agnostic media bus format definitions we've moved media bus definitions to include/uapi/linux/media-bus-format.h and prefixed values with MEDIA_BUS_FMT instead of V4L2_MBUS_FMT. Replace all references to the old definitions in i2c drivers. Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> 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>
* [media] tvp5150: Use i2c_smbus_(read|write)_byte_dataLaurent Pinchart2014-07-221-20/+11
| | | | | | | | | X-Patchwork-Delegate: mchehab@redhat.com Replace the custom I2C read/write implementation with SMBUS functions to simplify the driver. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] tvp5150: Fix device ID kernel log messageLaurent Pinchart2014-07-221-2/+2
| | | | | | | | | X-Patchwork-Delegate: mchehab@redhat.com The driver mistakenly prints the ROM version instead of the device ID to the kernel log when detecting the chip. Fix it. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] v4l: subdev: Move [gs]_std operation to video opsLaurent Pinchart2014-05-241-1/+1
| | | | | | | | | | | | The g_std and s_std operations are video-related, move them to the video ops where they belong. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] tvp5150: Replace container_of() with to_tvp5150()Laurent Pinchart2014-05-231-2/+2
| | | | | | | | | Use the driver-specific inline function to cast from a subdev pointer to a tvp5150 pointer instead of the generic container_of(). Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] tvp5150: Make debug module parameter visible in sysfsPhilipp Zabel2014-03-111-1/+1
| | | | | | | | | Set permissions on the debug module parameter to make it appear in sysfs. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] tvp5150: Fix type mismatch warning in clamp macroPhilipp Zabel2014-03-111-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes the following warning: drivers/media/i2c/tvp5150.c: In function '__tvp5150_try_crop': include/linux/kernel.h:762:17: warning: comparison of distinct pointer types lacks a cast [enabled by default] (void) (&__val == &__min); \ ^ drivers/media/i2c/tvp5150.c:886:16: note: in expansion of macro 'clamp' rect->width = clamp(rect->width, ^ include/linux/kernel.h:763:17: warning: comparison of distinct pointer types lacks a cast [enabled by default] (void) (&__val == &__max); \ ^ drivers/media/i2c/tvp5150.c:886:16: note: in expansion of macro 'clamp' rect->width = clamp(rect->width, ^ include/linux/kernel.h:762:17: warning: comparison of distinct pointer types lacks a cast [enabled by default] (void) (&__val == &__min); \ ^ drivers/media/i2c/tvp5150.c:904:17: note: in expansion of macro 'clamp' rect->height = clamp(rect->height, ^ include/linux/kernel.h:763:17: warning: comparison of distinct pointer types lacks a cast [enabled by default] (void) (&__val == &__max); \ ^ drivers/media/i2c/tvp5150.c:904:17: note: in expansion of macro 'clamp' rect->height = clamp(rect->height, ^ Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] videodev2: Set vb2_rect's width and height as unsignedRicardo Ribalda2014-01-071-7/+7
| | | | | | | | | | | | | | As discussed on the media summit 2013, there is no reason for the width and height to be signed. Therefore this patch is an attempt to convert those fields from __s32 to __u32. Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Acked-by: Sakari Ailus <sakari.ailus@iki.fi> (documentation and smiapp) Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] tvp5150: make read operations atomicMauro Carvalho Chehab2014-01-051-15/+11
| | | | | | | | | | Instead of using two I2C operations between write and read, use just one i2c_transfer. That allows I2C mutexes to not let any other I2C transfer between the two. Reviewed-by: Frank Schäfer <fschaefer.oss@googlemail.com> Tested-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] tvp5150: fix s_std supportHans Verkuil2013-06-171-5/+3
| | | | | | | | | | - do exact matching for special formats like PAL-M - drop autodetect support: it's non-standard, and it is bogus as well since there is no way to get back the detected standard since neither g_std nor querystd are implemented. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] media/i2c: remove g_chip_ident opHans Verkuil2013-06-171-24/+0
| | | | | | | | | This is no longer needed since the core now handles this through DBG_G_CHIP_INFO. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] media: i2c: remove duplicate checks for EPERM in dbg_g/s_registerLad, Prabhakar2013-05-271-4/+0
| | | | | | | | | This patch removes check for EPERM in dbg_g/s_register of subdevice drivers as this check is already performed by core. 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@redhat.com>