Commit Graph

14 Commits (ad0ba85fab7da9e634c9da4f96315c8d0b9febcb)

Author SHA1 Message Date
Greg Kroah-Hartman 4c62e9764a Drivers: media: remove __dev* attributes.
CONFIG_HOTPLUG is going away as an option.  As a result, the __dev*
markings need to be removed.

This change removes the use of __devinit, __devexit_p, __devinitdata,
__devinitconst, and __devexit from these drivers.

Based on patches originally written by Bill Pemberton, but redone by me
in order to handle some of the coding style issues better, by hand.

Cc: Bill Pemberton <wfp5p@virginia.edu>
Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-03 15:57:02 -08:00
Mauro Carvalho Chehab db61371079 [media] cx88: get rid of a warning at dprintk() macro
drivers/media/pci/cx88/cx88-mpeg.c: In function 'cx8802_mpeg_irq':
drivers/media/pci/cx88/cx88-mpeg.c:419:3: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
drivers/media/pci/cx88/cx88-mpeg.c: In function 'cx8802_irq':
drivers/media/pci/cx88/cx88-mpeg.c:453:3: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
drivers/media/pci/cx88/cx88-alsa.c: In function 'snd_cx88_create':
drivers/media/pci/cx88/cx88-alsa.c:818:3: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
drivers/media/pci/cx88/cx88-alsa.c:837:3: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
drivers/media/pci/cx88/cx88-alsa.c: In function 'cx88_audio_initdev':
drivers/media/pci/cx88/cx88-alsa.c:912:2: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
drivers/media/pci/cx88/cx88-blackbird.c: In function 'blackbird_mbox_func':
drivers/media/pci/cx88/cx88-blackbird.c:327:3: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
drivers/media/pci/cx88/cx88-blackbird.c:333:3: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
drivers/media/pci/cx88/cx88-blackbird.c:360:4: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
drivers/media/pci/cx88/cx88-blackbird.c: In function 'blackbird_find_mailbox':
drivers/media/pci/cx88/cx88-blackbird.c:421:2: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
drivers/media/pci/cx88/cx88-blackbird.c: In function 'blackbird_load_firmware':
drivers/media/pci/cx88/cx88-blackbird.c:444:3: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
drivers/media/pci/cx88/cx88-blackbird.c:451:3: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
drivers/media/pci/cx88/cx88-blackbird.c:453:3: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
drivers/media/pci/cx88/cx88-blackbird.c:459:3: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
drivers/media/pci/cx88/cx88-blackbird.c:466:3: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
drivers/media/pci/cx88/cx88-blackbird.c:487:3: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
drivers/media/pci/cx88/cx88-blackbird.c:492:2: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
drivers/media/pci/cx88/cx88-blackbird.c:503:3: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
drivers/media/pci/cx88/cx88-blackbird.c: In function 'blackbird_initialize_codec':
drivers/media/pci/cx88/cx88-blackbird.c:560:4: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
drivers/media/pci/cx88/cx88-blackbird.c:566:4: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
drivers/media/pci/cx88/cx88-blackbird.c:569:3: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-10-28 07:38:41 -02:00
Mauro Carvalho Chehab 342064390c [media] cx88: reorder inline to prevent a gcc warning
drivers/media/pci/cx88/cx88.h:97:1: warning: 'inline' is not at beginning of declaration [-Wold-style-declaration]
drivers/media/pci/cx88/cx88.h:103:1: warning: 'inline' is not at beginning of declaration [-Wold-style-declaration]
drivers/media/pci/cx88/cx88-core.c:649:1: warning: 'inline' is not at beginning of declaration [-Wold-style-declaration]
drivers/media/pci/cx88/cx88-core.c:654:1: warning: 'inline' is not at beginning of declaration [-Wold-style-declaration]
drivers/media/pci/cx88/cx88-core.c:659:1: warning: 'inline' is not at beginning of declaration [-Wold-style-declaration]
drivers/media/pci/cx88/cx88-core.c:664:1: warning: 'inline' is not at beginning of declaration [-Wold-style-declaration]
drivers/media/pci/cx88/cx88-core.c:684:1: warning: 'inline' is not at beginning of declaration [-Wold-style-declaration]
drivers/media/pci/cx88/cx88-core.c:695:1: warning: 'inline' is not at beginning of declaration [-Wold-style-declaration]

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-10-28 07:38:40 -02:00
David Härdeman c003ab1bed [media] rc-core: add separate defines for protocol bitmaps and numbers
The RC_TYPE_* defines are currently used both where a single protocol is
expected and where a bitmap of protocols is expected.

Functions like rc_keydown() and functions which add/remove entries to the
keytable want a single protocol. Future userspace APIs would also
benefit from numeric protocols (rather than bitmap ones). Keytables are
smaller if they can use a small(ish) integer rather than a bitmap.

Other functions or struct members (e.g. allowed_protos,
enabled_protocols, etc) accept multiple protocols and need a bitmap.

Using different types reduces the risk of programmer error. Using a
protocol enum whereever possible also makes for a more future-proof
user-space API as we don't need to worry about a sufficient number of
bits being available (e.g. in structs used for ioctl() calls).

The use of both a number and a corresponding bit is dalso one in e.g.
the input subsystem as well (see all the references to set/clear bit when
changing keytables for example).

This patch separate the different usages in preparation for
upcoming patches.

Where a single protocol is expected, enum rc_type is used; where one or more
protocol(s) are expected, something like u64 is used.

The patch has been rewritten so that the format of the sysfs "protocols"
file is no longer altered (at the loss of some detail). The file itself
should probably be deprecated in the future though.

Signed-off-by: David Härdeman <david@hardeman.nu>
Cc: Andy Walls <awalls@md.metrocast.net>
Cc: Maxim Levitsky <maximlevitsky@gmail.com>
Cc: Antti Palosaari <crope@iki.fi>
Cc: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-10-27 11:49:51 -02:00
Wei Yongjun 8d6b12501a [media] cx88: use list_move_tail instead of list_del/list_add_tail
Using list_move_tail() instead of list_del() + list_add_tail().
dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-10-25 16:14:27 -02:00
Mauro Carvalho Chehab bf3b202b41 Merge branch 'staging/for_v3.7' into v4l_for_linus
Applied on the top of changeset 782cd9e, as some of those patches
depend on some fixes that went via -arm tree.

* staging/for_v3.7: (109 commits)
  [media] m5mols: Add missing #include <linux/sizes.h>
  [media] stk1160: Add support for S-Video input
  Revert "[media] omap3isp: Replace cpu_is_omap3630() with ISP revision check"
  [media]  dvb: LNA implementation changes
  [media] v4l2-ioctl: fix W=1 warnings
  [media] v4l2-ioctl: add blocks check for VIDIOC_SUBDEV_G/S_EDID
  [media] omap3isp: Fix compilation error in ispreg.h
  [media] rc-msi-digivox-ii: Add full scan keycodes
  [media] cx25821: testing the wrong variable
  [media] tda18271-common: hold the I2C adapter during write transfers
  [media] ds3000: add module parameter to force firmware upload
  [media] drivers/media: Remove unnecessary semicolon
  [media] winbond: remove space from driver name
  [media] iguanair: cannot send data from the stack
  [media] omap3isp: Replace cpu_is_omap3630() with ISP revision check
  [media] dvb-usb: print small buffers via %*ph
  [media] uvc: Add return code check at vb2_queue_init()
  [media] em28xx: Replace memcpy with struct assignment
  [media] bt8xx: Add video4linux control V4L2_CID_COLOR_KILLER
  [media] mem2mem_testdev: Use devm_kzalloc() in probe
  ...
2012-10-11 15:07:19 -03:00
Peter Senna Tschudin c2c1b4156a [media] drivers/media: Remove unnecessary semicolon
A simplified version of the semantic patch that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@r1@
statement S;
position p,p1;
@@
S@p1;@p
@script:python r2@
p << r1.p;
p1 << r1.p1;
@@
if p[0].line != p1[0].line_end:
        cocci.include_match(False)
@@
position r1.p;
@@
-;@p
// </smpl>

[mchehab@redhat.com: some hunks got bitroted; applied only the
 ones that succeeds]
Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
[crope@iki.fi: For my drivers a8293, af9013, af9015, af9035]
Acked-by: Antti Palosaari <crope@iki.fi>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-10-07 09:15:18 -03:00
Linus Torvalds 0b8e74c6f4 Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
Pull media updates from Mauro Carvalho Chehab:
 "The first part of the media updates for Kernel 3.7.

  This series contain:

   - A major tree renaming patch series: now, drivers are organized
     internally by their used bus, instead of by V4L2 and/or DVB API,
     providing a cleaner driver location for hybrid drivers that
     implement both APIs, and allowing to cleanup the Kconfig items and
     make them more intuitive for the end user;

   - Media Kernel developers are typically very lazy with their duties
     of keeping the MAINTAINERS entries for their drivers updated.  As
     now the tree is more organized, we're doing an effort to add/update
     those entries for the drivers that aren't currently orphan;

   - Several DVB USB drivers got moved to a new DVB USB v2 core; the new
     core fixes several bugs (as the existing one that got bitroted).
     Now, suspend/resume finally started to work fine (at least with
     some devices - we should expect more work with regards to it);

   - added multistream support for DVB-T2, and unified the API for
     DVB-S2 and ISDB-S.  Backward binary support is preserved;

   - as usual, a few new drivers, some V4L2 core improvements and lots
     of drivers improvements and fixes.

  There are some points to notice on this series:

   1) you should expect a trivial merge conflict on your tree, with the
      removal of Documentation/feature-removal-schedule.txt: this series
      would be adding two additional entries there.  I opted to not
      rebase it due to this recent change;

   2) With regards to the PCTV 520e udev-related breakage, I opted to
      fix it in a way that the patches can be backported to 3.5 even
      without your firmware fix patch.  This way, Greg doesn't need to
      rush backporting your patch (as there are still the firmware cache
      and firmware path customization issues to be addressed there).

      I'll send later a patch (likely after the end of the merge window)
      reverting the rest of the DRX-K async firmware request, fully
      restoring its original behaviour to allow media drivers to
      initialize everything serialized as before for 3.7 and upper.

   3) I'm planning to work on this weekend to test the DMABUF patches
      for V4L2.  The patches are on my queue for several Kernel cycles,
      but, up to now, there is/was no way to test the series locally.

      I have some concerns about this particular changeset with regards
      to security issues, and with regards to the replacement of the old
      VIDIOC_OVERLAY ioctl's that is broken on modern systems, due to
      GPU drivers change.  The Overlay API allows direct PCI2PCI
      transfers from a media capture card into the GPU framebuffer, but
      its API is crappy.  Also, the only existing X11 driver that
      implements it requires a XV extension that is not available
      anymore on modern drivers.  The DMABUF can do the same thing, but
      with it is promising to be a properly-designed API.  If I can
      successfully test this series and be happy with it, I should be
      asking you to pull them next week."

* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (717 commits)
  em28xx: regression fix: use DRX-K sync firmware requests on em28xx
  drxk: allow loading firmware synchrousnously
  em28xx: Make all em28xx extensions to be initialized asynchronously
  [media] tda18271: properly report read errors in tda18271_get_id
  [media] tda18271: delay IR & RF calibration until init() if delay_cal is set
  [media] MAINTAINERS: add Michael Krufky as tda827x maintainer
  [media] MAINTAINERS: add Michael Krufky as tda8290 maintainer
  [media] MAINTAINERS: add Michael Krufky as cxusb maintainer
  [media] MAINTAINERS: add Michael Krufky as lg2160 maintainer
  [media] MAINTAINERS: add Michael Krufky as lgdt3305 maintainer
  [media] MAINTAINERS: add Michael Krufky as mxl111sf maintainer
  [media] MAINTAINERS: add Michael Krufky as mxl5007t maintainer
  [media] MAINTAINERS: add Michael Krufky as tda18271 maintainer
  [media] s5p-tv: Report only multi-plane capabilities in vidioc_querycap
  [media] s5p-mfc: Fix misplaced return statement in s5p_mfc_suspend()
  [media] exynos-gsc: Add missing static storage class specifiers
  [media] exynos-gsc: Remove <linux/version.h> header file inclusion
  [media] s5p-fimc: Fix incorrect condition in fimc_lite_reqbufs()
  [media] s5p-tv: Fix potential NULL pointer dereference error
  [media] s5k6aa: Fix possible NULL pointer dereference
  ...
2012-10-07 17:49:05 +09:00
Peter Senna Tschudin 6ec93f0193 [media] drivers/media/pci/cx88/cx88-blackbird.c: removes unnecessary semicolon
removes unnecessary semicolon
Found by Coccinelle: http://coccinelle.lip6.fr/

Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-10-06 08:22:06 -03:00
Hans Verkuil 34a6b7d093 [media] v4l2-ctrls: add a filter function to v4l2_ctrl_add_handler
With a filter function you can control more precisely which controls
are added. This is useful in particular for radio device nodes for
combined TV/Radio cards where you want to show just the radio-specific
controls and not controls like brightness.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-10-01 17:07:07 -03:00
Alan Cox 4699903e4f [media] cx88: Fix reset delays
This was reported in March 2011 by Mirek Slugen, and a simple fix posted at the time then
never got fixed and applied. The bug is still present.
Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?id=37703

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-23 13:49:52 -03:00
Mauro Carvalho Chehab fccea74ff8 [media] Kconfig: merge all customise options into just one
Instead of having 3 options to allow customizing the media
sub-drivers (tuners, I2C drivers, frontends), merge all of
them into just one.

That simplifies the life for users, as they can just keep
this untouched.

Life for developers is also simpler, as there's now just
one Kconfig item to remember, for the ancillary sub-drivers
providing supports for chips that could change from one
board design to another.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-21 08:05:06 -03:00
Mauro Carvalho Chehab cb7a01ac32 [media] move i2c files into drivers/media/i2c
Move ancillary I2C drivers into drivers/media/i2c, in order to
better organize them.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 16:42:14 -03:00
Mauro Carvalho Chehab b285192a43 [media] rename most media/video pci drivers to media/pci
Rename all PCI drivers with their own directory under
drivers/media/video into drivers/media/pci and update the
building system.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15 16:36:22 -03:00