summaryrefslogtreecommitdiffstats
path: root/drivers/media/i2c/adv7604.c
Commit message (Collapse)AuthorAgeFilesLines
* [media] adv7604/adv7842: fix quantization range handlingHans Verkuil2016-07-121-11/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | Fix a number of bugs that appeared when support for mediabus formats was added: - Support for V4L2_DV_RGB_RANGE_FULL/LIMITED should only be enabled for HDMI RGB formats, not for YCbCr formats. Since, as the name says, this setting is for RGB only. So read the InfoFrame to check the format. - the quantization range for the pixelport depends on whether the mediabus code is RGB or not: if it is RGB, then produce full range RGB values, otherwise produce limited range YCbCr values. This means that the op_656_range and alt_data_sat fields of the platform data are no longer used and these will be removed in a following patch. - when setting up a new format the RGB quantization range settings were never updated. Do so, since this depends on the format. - fix the log_status output which was confusing and incorrect. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* Merge branch 'topic/cec' into patchworkMauro Carvalho Chehab2016-07-081-36/+296
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * topic/cec: [media] DocBook/media: add CEC documentation [media] s5p_cec: get rid of an unused var [media] move s5p-cec to staging [media] vivid: add CEC emulation [media] cec: s5p-cec: Add s5p-cec driver [media] cec: adv7511: add cec support [media] cec: adv7842: add cec support [media] cec: adv7604: add cec support [media] cec: add compat32 ioctl support [media] cec/TODO: add TODO file so we know why this is still in staging [media] cec: add HDMI CEC framework (api) [media] cec: add HDMI CEC framework (adapter) [media] cec: add HDMI CEC framework (core) [media] cec-funcs.h: static inlines to pack/unpack CEC messages [media] cec.h: add cec header [media] cec-edid: add module for EDID CEC helper functions [media] cec.txt: add CEC framework documentation [media] rc: Add HDMI CEC protocol handling
| * [media] cec: adv7604: add cec supportHans Verkuil2016-06-281-36/+296
| | | | | | | | | | | | | | | | | | | | | | | | Add CEC support to the adv7604 driver. Signed-off-by: Hans Verkuil <hansverk@cisco.com> [k.debski@samsung.com: Merged changes from CEC Updates commit by Hans Verkuil] [k.debski@samsung.com: add missing methods cec/io_write_and_or] [k.debski@samsung.com: change adv7604 to adv76xx in added functions] [hansverk@cisco.com: use _clr_set instead of _and_or] Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* | [media] adv7604: Add support for hardware resetDragos Bogdan2016-07-081-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The part can be reset by a low pulse on the RESET pin (i.e. a hardware reset) with a minimum width of 5 ms. It is recommended to wait 5 ms after the low pulse before an I2C write is performed to the part. For safety reasons, the delays will be between 5 and 10 ms. The RESET pin can be tied high, so the GPIO is optional. Signed-off-by: Dragos Bogdan <dragos.bogdan@analog.com> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* | [media] adv7604: Remove deprecated create_singlethread_workqueueBhaktipriya Shridhar2016-07-081-13/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The workqueue "work_queues" enables hotplugging. It has a single work item(&state->delayed_work_enable_hotplug) and hence doesn't require ordering. Also, it is not being used on a memory reclaim path. Hence, the singlethreaded workqueue has been replaced with the use of system_wq. System workqueues have been able to handle high level of concurrency for a long time now and hence it's not required to have a singlethreaded workqueue just to gain concurrency. Unlike a dedicated per-cpu workqueue created with create_singlethread_workqueue(), system_wq allows multiple work items to overlap executions even on the same CPU; however, a per-cpu workqueue doesn't have any CPU locality or global ordering guarantee unless the target CPU is explicitly specified and thus the increase of local concurrency shouldn't make any difference. Work item has been sync cancelled in adv76xx_remove() to ensure that there are no pending tasks while disconnecting the driver. Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* | [media] adv7604: Don't ignore pad number in subdev DV timings pad operationsLaurent Pinchart2016-06-281-11/+35
|/ | | | | | | | | | | | | | | | | The dv_timings_cap() and enum_dv_timings() pad operations take a pad number as an input argument and return the DV timings capabilities and list of supported DV timings for that pad. Commit bd3e275f3ec0 ("[media] media: i2c: adv7604: Use v4l2-dv-timings helpers") broke this as it started ignoring the pad number, always returning the information associated with the currently selected input. Fix it. Fixes: bd3e275f3ec0 ("[media] media: i2c: adv7604: Use v4l2-dv-timings helpers") Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] media/i2c/adv*: make controls inheritable instead of privateHans Verkuil2016-04-251-8/+0
| | | | | | | | Marking these controls as private seemed a good idea at one time, but in practice it makes no sense. So drop this. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] adv7604: fix SPA register location for ADV7612Ulrich Hecht2016-03-031-1/+2
| | | | | | | | SPA location LSB register is at 0x70. Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* Merge branch 'v4l_for_linus' into patchworkMauro Carvalho Chehab2016-03-031-2/+1
|\ | | | | | | | | | | | | | | | | We need to import the changes at media.h, as we have a followup patch that depends on it. * v4l_for_linus: [media] media.h: use hex values for range offsets, move connectors base up. [media] adv7604: fix tx 5v detect regression
| * [media] adv7604: fix tx 5v detect regressionHans Verkuil2016-02-161-2/+1
| | | | | | | | | | | | | | | | | | | | | | The 5 volt detect functionality broke in 3.14: the code reads IO register 0x70 again after it has already been cleared. Instead it should use the cached irq_reg_0x70 value and the io_write to 0x71 to clear 0x70 can be dropped since this has already been done. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Cc: <stable@vger.kernel.org> # for v3.14 and up Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* | [media] adv7604: add support to for the content type controlHans Verkuil2016-02-101-0/+21
| | | | | | | | | | | | | | | | This receiver now supports reading the IT content type of the incoming video. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* | [media] media: i2c: adv7604: Use v4l2-dv-timings helpersJean-Michel Hautbois2016-02-101-113/+65
| | | | | | | | | | | | | | | | | | Use the helper to enumerate and set DV timings instead of a custom code. This will ease debugging too, as it is consistent with other drivers. Signed-off-by: Jean-Michel Hautbois <jean-michel.hautbois@veo-labs.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* | [media] adv7604: Check v4l2_of_parse_endpoint() return valueJavier Martinez Canillas2016-02-011-1/+6
| | | | | | | | | | | | | | | | The v4l2_of_parse_endpoint() function can fail so check the return value. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* | [media] media: adv7604: implement get_selectionUlrich Hecht2016-02-011-0/+21
|/ | | | | | | | | The rcar_vin driver relies on this. Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media framework: rename pads init function to media_entity_pads_init()Mauro Carvalho Chehab2016-01-111-1/+1
| | | | | | | | | | | | | | | | | With the MC next gen rework, what's left for media_entity_init() is to just initialize the PADs. However, certain devices, like a FLASH led/light doesn't have any input or output PAD. So, there's no reason why calling media_entity_init() would be mandatory. Also, despite its name, what this function actually does is to initialize the PADs data. So, rename it to media_entity_pads_init() in order to reflect that. The media entity actual init happens during entity register, at media_device_register_entity(). We should move init of num_links and num_backlinks to it. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: get rid of unused "extra_links" param on media_entity_init()Mauro Carvalho Chehab2016-01-111-1/+1
| | | | | | | | | | | | | | | | | | Currently, media_entity_init() creates an array with the links, allocated at init time. It provides a parameter (extra_links) that would allocate more links than the current needs, but this is not used by any driver. As we want to be able to do dynamic link allocation/removal, we'll need to change the implementation of the links. So, before doing that, let's first remove that extra unused parameter, in order to cleanup the interface first. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] v4l2-dv-timings: add new arg to v4l2_match_dv_timingsHans Verkuil2015-12-031-3/+3
| | | | | | | | | | Add the new match_reduced_fps argument to v4l2_match_dv_timings(). Depending on the situation you may or may not desire to match the reduced_fps flag. Typically only HDMI transmitters will need to check for this flag. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.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] 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] media: adv7604: reduce support to first (digital) inputWilliam Towle2015-08-111-3/+14
| | | | | | | | | | | | | | | | | Using adv7611_read_cable_det() for ADV7612 means that full support for '.max_port = ADV7604_PAD_HDMI_PORT_B,' isn't available due to the need for multiple port reads to determine cable detection, and an agreed mechanism for communicating the separate statuses. This patch replaces adv7611_read_cable_det() with a functionally identical copy, commented appropriately. Earlier submissions [leading to commit 8331d30b] also set .cp_csc, which is used in a cp_read() call within adv76xx_log_status(). Signed-off-by: William Towle <william.towle@codethink.co.uk> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: adv7604: fix probe of ADV7611/7612William Towle2015-08-111-1/+1
| | | | | | | | | | | Prior to commit f862f57d ("[media] media: i2c: ADV7604: Migrate to regmap"), the local variable 'val' contained the combined register reads used in the chipset version ID test. Restore this expectation so that the comparison works as it used to. Signed-off-by: William Towle <william.towle@codethink.co.uk> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] adv7604: Deliver resolution change events to userspaceLars-Peter Clausen2015-07-171-5/+18
| | | | | | | | | | | | | | | | | | Use the new v4l2_subdev_notify_event() helper function to deliver the resolution change event to userspace via the v4l2 subdev event queue as well as to the bridge driver using the callback notify mechanism. This allows userspace applications to react to changes in resolution. This is useful and often necessary for video pipelines where there is no direct 1-to-1 relationship between the subdevice converter and the video capture device and hence it does not make sense to directly forward the event to the video capture device node. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> [hans.verkuil@cisco.com: fix obvious mistake: v4l2_event_subdev_unsubscribe -> v4l2_ctrl_subdev_subscribe_event] Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] adv7604: Add support for control event notificationsLars-Peter Clausen2015-07-171-1/+4
| | | | | | | | | | Allow userspace applications to subscribe to control change events. This can e.g. be used to monitor the 5V detect control to be notified when a source is connected or disconnected. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: adv7604: ability to read default input port from DTIan Molton2015-07-061-1/+7
| | | | | | | | | | | Adds support to the adv7604 driver for specifying the default input port in the Device tree. If no value is provided, the driver will be unable to select an input without help from userspace. Tested-by: William Towle <william.towle@codethink.co.uk> Signed-off-by: Ian Molton <ian.molton@codethink.co.uk> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: adv7604: chip info and formats for ADV7612William Towle2015-07-061-4/+87
| | | | | | | | | | | | Add support for the ADV7612 chip as implemented on Renesas' Lager board to adv7604.c, including lists for formats/colourspace/timing selection and an IRQ handler. Signed-off-by: William Towle <william.towle@codethink.co.uk> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> [hans.verkuil@cisco.com: fix merge conflicts due to regmap patch] Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: i2c: ADV7604: Migrate to regmapPablo Anton2015-07-061-95/+256
| | | | | | | | | | This is a preliminary patch in order to add support for ALSA. It replaces all current i2c access with regmap. Signed-off-by: Pablo Anton <pablo.anton@veo-labs.com> Signed-off-by: Jean-Michel Hautbois <jean-michel.hautbois@veo-labs.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] v4l2-dv-timings: add support for reduced blanking v2Prashant Laddha2015-07-061-1/+1
| | | | | | | | | | | | | | | | | | | | Added support for reduced blanking version 2 (RB v2) in cvt timings. Standard specifies a fixed vsync pulse of 8 lines to indicate RB v2 timings. Vertical back porch is fixed at 6 lines and vertical front porch is remainder of vertical blanking time. For RB v2, horizontal blanking is fixed at 80 pixels. Horizontal sync is fixed at 32. All horizontal timing counts (active pixels, front, back porches) can be specified upto a precision of 1. RB v2 allows for non standard aspect ratios. In RB v2 vsync does not indicate aspect ratio. In absence of aspect ratio v4l2_detect_cvt() cannot calculate image width from image height. Hence extending the v4l2_detect_cvt() to pass image width in case of RB v2. Signed-off-by: Prashant Laddha <prladdha@cisco.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] v4l2-dv-timings: add interlace support in detect cvt/gtfPrashant Laddha2015-06-091-2/+2
| | | | | | | | | | | | | | | | | | | | Extend detect_cvt/gtf API to indicate the format type (interlaced or progressive). In case of interlaced, the vertical front and back porch and vsync values for both (odd,even) fields are considered to derive image height. Populated vsync, vertical front, back porch values in bt timing structure for even and odd fields and updated the flags appropriately. Also modified the functions calling the detect_cvt/gtf(). As of now these functions are calling detect_cvt/gtf() with interlaced flag set to false. Cc: Martin Bugge <marbugge@cisco.com> Cc: Mats Randgaard <matrandg@cisco.com> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Prashant Laddha <prladdha@cisco.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] adv7604: log alt-gamma and HDMI colorspaceHans Verkuil2015-06-091-2/+12
| | | | | | | | Log the alternate gamma state and the HDMI colorspace that the adv device detected. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] adv7604: fix broken saturator checkHans Verkuil2015-06-091-1/+1
| | | | | | | | The logging of the saturator status was wrong due to an incorrect condition. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] adv7604: log infoframesHans Verkuil2015-06-091-29/+58
| | | | | | | | Add support for logging the detected InfoFrames for the adv76xx. Helps in debugging what is actually received on the HDMI link. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] adv7604/adv7842: replace FMT_CHANGED by V4L2_DEVICE_NOTIFY_EVENTHans Verkuil2015-05-201-3/+9
| | | | | | | | This makes it easier for the bridge driver to just passthrough such events to the corresponding device node. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] constify of_device_id arrayFabian Frederick2015-05-121-2/+2
| | | | | | | | | | of_device_id is always used as const. (See driver.of_match_table and open firmware functions) [mchehab@osg.samsung.com: fix a merge conflict at adv7604.c] Signed-off-by: Fabian Frederick <fabf@skynet.be> Acked-by: Patrice Chotard <patrice.chotard@st.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: adv7604: Fix masks used for querying timings in ADV7611jean-michel.hautbois@vodalys.com2015-05-011-13/+56
| | | | | | | | | | All masks for timings are different between ADV7604 and ADV7611. Most of the values have 1 precision bit more in the latter. Fix this by adding new fields to the chip_info structure. Signed-off-by: Jean-Michel Hautbois <jean-michel.hautbois@vodalys.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] adv: use V4L2_DV_FL_IS_CE_VIDEO instead of V4L2_DV_BT_STD_CEA861Hans Verkuil2015-04-081-2/+3
| | | | | | | | | | Don't rely on V4L2_DV_BT_STD_CEA861 since that include the 640x480p format, which is an IT format, not CE. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Cc: Martin Bugge <marbugge@cisco.com> Cc: Mats Randgaard <mats.randgaard@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] v4l2-subdev: replace v4l2_subdev_fh by v4l2_subdev_pad_configHans Verkuil2015-03-231-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a subdevice pad op is called from a bridge driver, then there is no v4l2_subdev_fh struct that can be passed to the subdevice. This made it hard to use such subdevs from a bridge driver. This patch replaces the v4l2_subdev_fh pointer by a v4l2_subdev_pad_config pointer in the pad ops. This allows bridge drivers to use the various try_ pad ops by creating a v4l2_subdev_pad_config struct and passing it along to the pad op. The v4l2_subdev_get_try_* macros had to be changed because of this, so I also took the opportunity to use the full name of the v4l2_subdev_get_try_* functions in the __V4L2_SUBDEV_MK_GET_TRY macro arguments: if you now do 'git grep v4l2_subdev_get_try_format' you will actually find the header where it is defined. One remark regarding the drivers/staging/media/davinci_vpfe patches: the *_init_formats() functions assumed that fh could be NULL. However, that's not true for this driver, it's always set. This is almost certainly a copy and paste from the omap3isp driver. I've updated the code to reflect the fact that fh is never NULL. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Tested-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: adv7604: improve usage of gpiod APIUwe Kleine-König2015-03-031-10/+6
| | | | | | | | | | | | | | Since 39b2bbe3d715 (gpio: add flags argument to gpiod_get*() functions) which appeared in v3.17-rc1, the gpiod_get* functions take an additional parameter that allows to specify direction and initial value for output. Simplify accordingly. Moreover use devm_gpiod_get_index_optional instead of devm_gpiod_get_index with ignoring all errors. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: drop call to v4l2_device_unregister_subdev()Lad, Prabhakar2015-03-031-1/+0
| | | | | | | | | | These drivers are moved to support asynchronous probing, v4l2_async_unregister_subdev() unregisters the subdev so there isn't a need to explicitly call v4l2_device_unregister_subdev(). 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@osg.samsung.com>
* [media] media: i2c: ADV7604: Rename adv7604 prefixesPablo Anton2015-03-021-449/+449
| | | | | | | | | | | | | | It is confusing which parts of the driver are adv7604 specific, adv7611 specific or common for both. This patch renames any adv7604 prefixes (both for functions and defines) to adv76xx whenever they are common. Signed-off-by: Pablo Anton <pablo.anton@vodalys-labs.com> Signed-off-by: Jean-Michel Hautbois <jean-michel.hautbois@vodalys.com> [hans.verkuil@cisco.com: rebased and renamed ADV76xx_fsc to ADV76XX_FSC] [hans.verkuil@cisco.com: kept the existing adv7604 driver name] Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: adv7604: CP CSC uses a different register on adv7604 and adv7611jean-michel.hautbois@vodalys.com2015-03-021-1/+4
| | | | | | | | | The bits are the same, but register is 0xf4 on ADV7611 instead of 0xfc. When reading back the value in log_status, differentiate both. Signed-off-by: Jean-Michel Hautbois <jean-michel.hautbois@vodalys.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: i2c: ADV7604: In free run mode, signal is lockedjean-michel.hautbois@vodalys.com2015-03-021-3/+9
| | | | | | | | | | | The CP_NON_STD_VIDEO bit indicates an input not aligned with DV timings. If there is no input, and chip is in free run mode, consider we are locked. Signed-off-by: Jean-Michel Hautbois <jean-michel.hautbois@vodalys.com> [hans.verkuil@cisco.com: put both conditions in one 'if'] Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: i2c: adv7604: Remove some unused functionsRickard Strandqvist2015-01-271-66/+0
| | | | | | | | | | | | Removes some functions that are not used anywhere: test_read() edid_read_block() dpp_write() dpp_read() esdp_write() esdp_read() cec_write_clr_set() This was partially found by using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: i2c: adv7604.c: Remove some unused functionsRickard Strandqvist2015-01-271-10/+0
| | | | | | | | | | | Removes some functions that are not used anywhere: vblanking() hblanking() This was partially found by using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] i2c: Make use of media_bus_format enumBoris BREZILLON2014-11-141-36/+36
| | | | | | | | | | | | | | | 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] adv7604: Correct G/S_EDID behaviourHans Verkuil2014-11-111-19/+18
| | | | | | | | | | | | | In order to have v4l2-compliance tool pass the G/S_EDID some modifications where needed in the driver. In particular, the edid.reserved zone must be blanked. Based on a patch from Jean-Michel Hautbois <jean-michel.hautbois@vodalys.com>, but reworked it a bit. It should use 'data' (which depends on edid.present) instead of edid.blocks as the check whether edid data is present. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* Merge branch 'patchwork' into v4l_for_linusMauro Carvalho Chehab2014-10-091-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * patchwork: (544 commits) [media] ir-hix5hd2: fix build on c6x arch [media] pt3: fix DTV FE I2C driver load error paths Revert "[media] media: em28xx - remove reset_resume interface" [media] exynos4-is: fix some warnings when compiling on arm64 [media] usb drivers: use %zu instead of %zd [media] pci drivers: use %zu instead of %zd [media] dvb-frontends: use %zu instead of %zd [media] s5p-mfc: Fix several printk warnings [media] s5p_mfc_opr: Fix warnings [media] ti-vpe: Fix typecast [media] s3c-camif: fix dma_addr_t printks [media] s5p_mfc_opr_v6: get rid of warnings when compiled with 64 bits [media] s5p_mfc_opr_v5: Fix lots of warnings on x86_64 [media] em28xx: Fix identation [media] drxd: remove a dead code [media] saa7146: remove return after BUG() [media] cx88: remove return after BUG() [media] cx88: fix cards table CodingStyle [media] radio-sf16fmr2: declare some structs as static [media] radio-sf16fmi: declare pnp_attached as static ... Conflicts: Documentation/DocBook/media/v4l/compat.xml
| * [media] adv7604/adv7842: fix il_vbackporch typo and zero the structHans Verkuil2014-09-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Both adv7604 and adv7842 had the same typo in the code that sets the vertical backporch for the second interlaced field: it was assigned to vbackporch instead of il_vbackporch. In addition, the timings struct wasn't zeroed in the adv7842 driver, leaving several fields to undefined values causing the timing match function to fail. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* | [media] adv7604: fix inverted conditionHans Verkuil2014-09-211-1/+1
|/ | | | | | | | | The log_status function should show HDMI information, but the test checking for an HDMI input was inverted. Fix this. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Cc: stable@vger.kernel.org # for v3.12 and up Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] adv7604: Update recommended writes for the adv7611Lars-Peter Clausen2014-07-041-1/+4
| | | | | | | | | | | | | Update the recommended writes to those mentioned in the Rev 1.5 version of the ADV7611 Register Settings Recommendations document released by Analog Devices. The document does not mention why the recommended settings have been updated, but presumably those are more fine tuned settings that can enhance performance in some cases. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-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] adv7604: Add LLC polarity configurationLaurent Pinchart2014-05-251-1/+2
| | | | | | | | | Add an inv_llc_pol field to platform data to control the clock polarity. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com> Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
OpenPOWER on IntegriCloud