summaryrefslogtreecommitdiff
path: root/drivers/media/i2c/saa7115.c
AgeCommit message (Collapse)Author
2017-01-27[media] media: Drop FSF's postal address from the source code filesSakari Ailus
Drop the FSF's postal address from the source code files that typically contain mostly the license text. Of the 628 removed instances, 578 are outdated. The patch has been created with the following command without manual edits: git grep -l "675 Mass Ave\|59 Temple Place\|51 Franklin St" -- \ drivers/media/ include/media|while read i; do i=$i perl -e ' open(F,"< $ENV{i}"); $a=join("", <F>); $a =~ s/[ \t]*\*\n.*You should.*\n.*along with.*\n.*(\n.*USA.*$)?\n//m && $a =~ s/(^.*)Or, (point your browser to) /$1To obtain the license, $2\n$1/m; close(F); open(F, "> $ENV{i}"); print F $a; close(F);'; done Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
2016-07-12[media] media/i2c: drop the last users of the ctrl core opsHans Verkuil
Nobody is using these ops anymore, so remove these callbacks from the subdev drivers that still have them. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Cc: Andy Walls <awalls@md.metrocast.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-05-06[media] i2c: saa7115: Support CJC7113 detectionKevin Fitch
It's been reported that CJC7113 devices are returning all 1s when reading register 0: "1111111111111111" found @ 0x4a (stk1160) This new device is apparently compatible with SA7113, so let's add a quirk to allow its autodetection. Given there isn't any known differences with SAA7113, this commit does not introduces a new saa711x_model value. Reported-by: Philippe Desrochers <desrochers.philippe@gmail.com> Signed-off-by: Kevin Fitch <kfitch42@gmail.com> Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-01[media] saa7115: initialize demod type and add the needed padsMauro Carvalho Chehab
The saa7115 driver is used on several em28xx-based devices. Now that we're about to add MC support to em28xx, we need to be sure that the saa711x demod will be properly mapped at MC. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-11-17[media] include/media: split I2C headers from V4L2 coreMauro Carvalho Chehab
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>
2015-08-11[media] i2c: Drop owner assignment from i2c_driverKrzysztof Kozlowski
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>
2015-05-01[media] v4l2: replace s_mbus_fmt by set_fmtHans Verkuil
The s_mbus_fmt video op is a duplicate of the pad op. Replace all uses in sub-devices by the set_fmt() pad op. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-14[media] i2c: Make use of media_bus_format enumBoris BREZILLON
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>
2014-05-24[media] v4l: subdev: Move [gs]_std operation to video opsLaurent Pinchart
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>
2013-11-29[media] media_tree: Fix spelling errorsJonathan McCrohan
Fix various spelling errors in strings and comments throughout the media tree. The majority of these were found using Lucas De Marchi's codespell tool. [m.chehab@samsung.com: discard hunks with conflicts] Signed-off-by: Jonathan McCrohan <jmccrohan@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-08-18[media] saa7115: make multi-line comments compliant with CodingStyleMauro Carvalho Chehab
changeset 2ccf12a did a crappy job when added multi-line comment lines, violating CodingStyle. Change the comments added there to fulfill CodingStyle, and document the platform_data using Documentation/kernel-doc-nano-HOWTO.txt. Cc: Jon Arne Jørgensen <jonarne@jonarne.no> Cc: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-08-18[media] saa7115: Implement i2c_board_info.platform_dataJon Arne Jørgensen
This patch implements i2c_board_info.platform_data, and some options to override the default initialization table for the GM7113C and SAA7113 chips. Signed-off-by: Jon Arne Jørgensen <jonarne@jonarne.no> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-08-18[media] saa7115: Do not load saa7115_init_misc for gm7113cJon Arne Jørgensen
Most of the registers changed in saa7115_init_misc table are out of range for the gm7113c chip. The only register that's within range, don't need to be changed here. Signed-off-by: Jon Arne Jørgensen <jonarne@jonarne.no> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-08-18[media] saa7115: Fix saa711x_set_v4lstd for gm7113cJon Arne Jørgensen
saa711x_set_v4lstd would toggle several bits that should not be touched when changing std. This patch fixes this. Signed-off-by: Jon Arne Jørgensen <jonarne@jonarne.no> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-06-17[media] saa7115: fix querystdHans Verkuil
Return V4L2_STD_UNKNOWN if no signal is detected. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-06-17[media] media/i2c: remove g_chip_ident opHans Verkuil
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>
2013-06-17[media] saa7115: add back the dropped 'found' messageHans Verkuil
The saa7115 driver used to show a 'chip found' message during probe. This was accidentally dropped during recent commits. Add it back as it is quite useful. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-05-27[media] media: i2c: remove duplicate checks for EPERM in dbg_g/s_registerLad, Prabhakar
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>
2013-05-21[media] saa7115: Don't use a dynamic arrayMauro Carvalho Chehab
At least on s390, gcc complains about that: drivers/media/i2c/saa7115.c: In function 'saa711x_detect_chip.constprop.2': drivers/media/i2c/saa7115.c:1647:1: warning: 'saa711x_detect_chip.constprop.2' uses dynamic stack allocation [enabled by default] While for me the above report seems utterly bogus, as the compiler should be optimizing saa711x_detect_chip, merging it with saa711x_detect_chip and changing: char chip_ver[size - 1]; to char chip_ver[16]; because this function is only called on this code snippet: char name[17]; ... ident = saa711x_detect_chip(client, id, name, sizeof(name)); It seems that gcc is not optimizing it, at least on s390. As getting rid of it is easy, let's do it. Reported-by: kbuild test robot <fengguang.wu@intel.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-05-21[media] saa7115: Add register setup and config for gm7113cJon Arne Jørgensen
The gm7113c chip is similar to the original saa7113 chip, so I try to re-use most of the saa7113 specific setup-/configuration registers. According to the datasheet, the gm7113c chip has not implemented any register-addresses after 0x1f, so I add a new entry to for the chip to the saa711x_has_reg function. The devices I've seen using this chip will fail to get stable video-sync if these registers are not zeroed: R_14_ANAL_ADC_COMPAT_CNTL R_15_VGATE_START_FID_CHG R_16_VGATE_STOP R_17_MISC_VGATE_CONF_AND_MSB The saa711x_set_v4lstd is updated to send a simpler configuration-table to avoid setting these registers. Signed-off-by: Jon Arne Jørgensen <jonarne@jonarne.no> Tested-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-05-21[media] saa7115: add detection code for gm7113cMauro Carvalho Chehab
Adds a code that (auto)detects gm7113c clones. The auto-detection here is not perfect, as, on contrary to what it would be expected by looking into its datasheets some devices would return, instead: saa7115 0-0025: chip 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 @ 0x4a is unknown (found on a device labeled as GM7113C 1145 by Ezequiel Garcia) Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> Tested-by: Jon Arne Jørgensen <jonarne@jonarne.no> Tested-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-05-21[media] saa7115: move the autodetection code out of the probe functionMauro Carvalho Chehab
As we're now seeing other variants from chinese clones, like gm1113c, we'll need to add more bits at the detection code. So, move it into a separate function. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> Tested-by: Jon Arne Jørgensen <jonarne@jonarne.no> Tested-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-05-21[media] media: i2c: Convert to devm_kzalloc()Laurent Pinchart
Using the managed function the kfree() calls can be removed from the probe error path and the remove handler. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24[media] saa7115: add support for double-rate ASCLKHans Verkuil
Some devices expect a double rate ASCLK. Add a flag to let the driver know through the s_crystal_freq call. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24[media] saa7115: improve querystd handling for the saa7115Hans Verkuil
The saa7115 has better PAL/NTSC detection, so it can detect PAL even though the chip is currently set up for NTSC. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24[media] saa7115: add config flag to change the IDQ polarityHans Verkuil
Needed by the go7007 driver: it assumes a different polarity of the IDQ signal, so we need to be able to tell the saa7115 about this. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24[media] v4l2: add const to argument of write-only s_register ioctlHans Verkuil
This ioctl is defined as IOW, so pass the argument as const. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-10-01[media] sliced vbi: subdevs shouldn't clear the full v4l2_sliced_vbi_format ↵Hans Verkuil
struct Various subdevs cleared the full v4l2_sliced_vbi_format struct, when only the service_set/lines fields should have been cleared. Due to this the io_size field was wrongly cleared to 0, causing a v4l2-compliance error. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15[media] move i2c files into drivers/media/i2cMauro Carvalho Chehab
Move ancillary I2C drivers into drivers/media/i2c, in order to better organize them. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>