summaryrefslogtreecommitdiffstats
path: root/drivers/media/i2c/adv7511.c
Commit message (Collapse)AuthorAgeFilesLines
* [media] adv7511: fix error return code in adv7511_probe()Wei Yongjun2016-08-241-0/+1
| | | | | | | | Fix to return error code -ENOMEM from the i2c client register error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] adv7511: fix VIC autodetectHans Verkuil2016-07-281-4/+20
| | | | | | | | | | | The adv7511 will automatically fill in the VIC code in the AVI InfoFrame based on the timings of the incoming pixelport signals. However, to have this work correctly it needs to specify the fps value in a register. After doing this the proper VIC code is filled in. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] adv7511: the h/vsync polarities were always positiveHans Verkuil2016-07-121-0/+5
| | | | | | | | Correctly set the h/vsync polarities instead of keeping to the default (positive). Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] adv7511: fix quantization range handlingHans Verkuil2016-07-121-13/+17
| | | | | | | | | | | | | | | | | | | | Commit 1fb69bfd29e4b2e5e93922105326dd6cbd5ef6eb (adv7511: improve colorspace handling) introduced a number of bugs, specifically with regards to YCbCr output and quantization range handling: - if the output is not RGB, then disable the full-to-limited range CSC matrix since that is meant for RGB formats. YCbCr formats are always limited range, so there is nothing to convert. (OK, full range YCbCr is possible, but we don't support that right now). - the mediabus code that was passed to adv7511_set_fmt was always cleared by the memset in adv7511_fill_format. This made it effectively impossible to select YCbCr output. - adv7511_set_fmt never updated the rgb quantization range. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] adv7511: drop adv7511_set_IT_content_AVI_InfoFrameHans Verkuil2016-07-121-15/+0
| | | | | | | | | | The IT Content bit has nothing to do with CE vs IT timings. Delete this code. This will also fix a bug where this could override the 'content type' control, which is actually the correct place to set/clear the ITC bit. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] cec: adv7511: add cec supportHans Verkuil2016-06-281-8/+393
| | | | | | | | | | | Add CEC support to the adv7511 driver. Signed-off-by: Hans Verkuil <hansverk@cisco.com> [k.debski@samsung.com: Merged changes from CEC Updates commit by Hans Verkuil] Signed-off-by: Kamil Debski <kamil@wypas.org> Signed-off-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-6/+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] adv7511: TX_EDID_PRESENT is still 1 after a disconnectHans Verkuil2016-02-191-6/+15
| | | | | | | | | | | | The V4L2_CID_TX_EDID_PRESENT control reports if an EDID is present. The adv7511 however still reported the EDID present after disconnecting the HDMI cable. Fix the logic regarding this control. And when the EDID is disconnected also call ADV7511_EDID_DETECT to notify the bridge driver. This was also missing. 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] adv7511: add support to for the content type controlHans Verkuil2016-02-101-2/+20
| | | | | | | | This transmitter now supports configuring 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 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] adv7511: fix incorrect bit offsetHans Verkuil2015-11-171-1/+1
| | | | | | | | | The quantization bits are in bits 7-6, not 7-4, so shift by 6 instead of 4. This bug is caused by a typo in the adv7511 datasheet. 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/adv7511: Fix license, set to GPL v2Mike Looijmans2015-08-161-1/+1
| | | | | | | | Header claims GPL v2, so make the MODULE_LICENSE reflect that properly. Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl> 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] adv7511: log the currently set infoframesHans Verkuil2015-06-091-2/+121
| | | | | | | | | The adv7511 sets up InfoFrames that are used when transmitting video. Log the contents of those InfoFrames so it is possible to see exactly what the transmitter is sending. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] adv7511: replace uintX_t by uX for consistencyHans Verkuil2015-06-091-16/+16
| | | | | | | | Currently this driver mixes u8/u16 and uint8_t/uint16_t. Standardize on u8/u16. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] adv7511: add xfer_func supportHans Verkuil2015-06-051-0/+5
| | | | | | | Still preliminary, but the information is at least there. 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-5/+5
| | | | | | | | | | 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-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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] adv7511: improve colorspace handlingHans Verkuil2014-12-021-0/+208
| | | | | | | | Add support for YCbCr output and support setting colorspace, YCbCr encoding and quantization for the AVI InfoFrame. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] adv7511: fix G/S_EDID behaviorHans Verkuil2014-11-111-7/+14
| | | | | | | This fixes the v4l2-compliance failures. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] v4l: Validate fields in the core code for subdev EDID ioctlsLaurent Pinchart2014-05-251-2/+0
| | | | | | | | | | | | The subdev EDID ioctls receive a pad field that must reference an existing pad and an EDID field that must point to a buffer. Validate both fields in the core code instead of duplicating validation in all drivers. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] adv7511: Remove deprecated video-level DV timings operationsLaurent Pinchart2014-05-251-2/+0
| | | | | | | | | The video enum_dv_timings and dv_timings_cap operations are deprecated and unused. Remove them. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] adv7511: Add pad-level DV timings operationsLaurent Pinchart2014-05-251-28/+38
| | | | | | | | | | The video enum_dv_timings and dv_timings_cap operations are deprecated. Implement the pad-level version of those operations to prepare for the removal of the video version. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] adv*: replace the deprecated v4l2_subdev_edid by v4l2_edidHans Verkuil2014-03-111-1/+1
| | | | | | Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] adv7511: verify EDID headerMartin Bugge2014-01-071-11/+24
| | | | | | | | Ignore EDID's where the header is wrong. Signed-off-by: Martin Bugge <marbugge@cisco.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] adv7511: add VIC and audio CTS/N values to log_statusMartin Bugge2014-01-071-0/+23
| | | | | | | | Improve status logging. Signed-off-by: Martin Bugge <marbugge@cisco.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] adv7511: disable register reset by HPDMartin Bugge2014-01-071-0/+6
| | | | | | | | | | | Whenever the hotplug pin is pulled low the chip resets a whole bunch of registers. It turns out that this can be turned off on the adv7511. Do so, as this 'feature' introduces race conditions in setting up registers, particular when the hotplug pin bounces a lot. Signed-off-by: Martin Bugge <marbugge@cisco.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] adv7511: fix error return code in adv7511_probe()Wei Yongjun2013-10-141-0/+2
| | | | | | | | | Fix to return -ENOMEM in the new i2c client and create workqueue error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] adv7511: fix compilation with GCC < 4.4.6Gianluca Gennari2013-10-141-9/+7
| | | | | | Signed-off-by: Gianluca Gennari <gennarone@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] adv7511: add new video encoderHans Verkuil2013-08-261-0/+1198
This is an Analog Devices HDMI transmitter. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
OpenPOWER on IntegriCloud