Commit graph

738 commits

Author SHA1 Message Date
Olli Salonen 699dcffc52 [media] rtl2832: add support for GoTView MasterHD 3 USB tuner
GoTView MasterHD 3 is a DVB-T2/C USB 2.0 tuner.

It's based on the following components:
- USB bridge: RTL2832P (contains also DVB-T demodulator)
- Demodulator: Si2168-A30
- Tuner: Si2148-A20

The demodulator and the tuner will need firmwares. The Si2148 uses Si2158
firmware. Antti has the firmwares available for download:
http://palosaari.fi/linux/v4l-dvb/firmware/

Do note that for DVB-T either of the demodulators can be used. DVB-C and
DVB-T2 are only supported by the Si2168 demodulator. The driver will
register 2 frontends for the same adapter. Frontend 0 will be the RTL2832
demodulator and frontend 1 will be the Si2168 demodulator. The same
tuner is used for both.

As a consequence of the above, it's recommended to use application that
does implement proper DVBv5 support.

For some reason, the old I2C write method sporadically fails. Thus the
need for an option to only use the new I2C write method supported by the
RTL2832.

Signed-off-by: Olli Salonen <olli.salonen@iki.fi>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-05-12 13:25:35 -03:00
Olli Salonen 7adf99d20c [media] si2168: add I2C error handling
Return error from si2168_cmd_execute in case the demodulator returns an
error.

Signed-off-by: Olli Salonen <olli.salonen@iki.fi>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-05-12 13:19:26 -03:00
Olli Salonen 8117a3121d [media] si2168: add support for gapped clock
Add a parameter in si2168_config to support gapped clock. This might be
necessary on some devices with higher bitrates.

Signed-off-by: Olli Salonen <olli.salonen@iki.fi>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-05-12 13:16:37 -03:00
Mauro Carvalho Chehab 5a13e40b28 media: replace bellow -> below
Bellow is yelling. Ok, sometimes the code is yells a lot, but
but this is not the case there ;)

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-05-08 14:48:48 -03:00
Cheolhyun Park 69bb7ab687 [media] drx-j: Misspelled comment corrected
Fix several typos inside the driver's comments.

Signed-off-by: Cheolhyun Park <pch851130@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-05-01 07:08:11 -03:00
Mauro Carvalho Chehab b674ac290e [media] tda10086: change typecast to u64 to avoid smatch warnings
drivers/media/dvb-frontends/tda10086.c:476 tda10086_get_frontend() warn: should 'tda10086_read_byte(state, 81) << 8' be a 64 bit type?

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-05-01 06:14:15 -03:00
Mauro Carvalho Chehab 05a848ecbb [media] s5h1420: use only one statement per line
drivers/media/dvb-frontends/s5h1420.c:565 s5h1420_setfec_inversion() warn: inconsistent indenting

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-05-01 06:13:50 -03:00
Mauro Carvalho Chehab 4e0b003621 [media] stv0900: fix bad indenting
drivers/media/dvb-frontends/stv0900_sw.c:1559 stv0900_search_srate_fine() warn: inconsistent indenting
drivers/media/dvb-frontends/stv0900_sw.c:2012 stv0900_algo() warn: inconsistent indenting

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-05-01 06:13:23 -03:00
Mauro Carvalho Chehab f3f8ef2274 [media] dib0070: Fix indenting
The indentation on this driver were deadly broken. On lots
of places, it was using 4 spaces instead of tab to indent.
On other parts, it were using tabs.

Also, on several places, it were not even being properly aligned,
as reported by smatch:
	drivers/media/dvb-frontends/dib0070.c:179 dib0070_set_bandwidth() warn: inconsistent indenting
	drivers/media/dvb-frontends/dib0070.c:198 dib0070_captrim() warn: inconsistent indenting
	drivers/media/dvb-frontends/dib0070.c:246 dib0070_set_ctrl_lo5() warn: inconsistent indenting
	drivers/media/dvb-frontends/dib0070.c:260 dib0070_ctrl_agc_filter() warn: inconsistent indenting
	drivers/media/dvb-frontends/dib0070.c:494 dib0070_tune_digital() warn: inconsistent indenting
	drivers/media/dvb-frontends/dib0070.c:498 dib0070_tune_digital() warn: inconsistent indenting
	drivers/media/dvb-frontends/dib0070.c:655 dib0070_reset() warn: inconsistent indenting
	drivers/media/dvb-frontends/dib0070.c:711 dib0070_reset() warn: curly braces intended?
	drivers/media/dvb-frontends/dib0070.c:713 dib0070_reset() warn: inconsistent indenting

My first idea were to leave it as-is or to just touch the above.

However, this won't be fixing anything. So, as painful as it
is, let's fix indentation globally on the driver, and then
address the inconsistencies.

Hopefully, this driver doesn't have much patches, so it likely
won't conflict to any other patch during this merge window.

Besides the big size of this patch, no functional changes
were done.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-05-01 06:09:10 -03:00
Mauro Carvalho Chehab f9e2e0e8ba [media] dib3000mc: fix bad indenting
drivers/media/dvb-frontends/dib3000mc.c:149 dib3000mc_setup_pwm_state() warn: inconsistent indenting

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-05-01 06:07:13 -03:00
Mauro Carvalho Chehab 5e6b681b12 [media] stv0297: change typecast to u64 to avoid smatch warnings
drivers/media/dvb-frontends/stv0297.c:140 stv0297_get_symbolrate() warn: should 'stv0297_readreg(state, 86) << 8' be a 64 bit type?
drivers/media/dvb-frontends/stv0297.c:141 stv0297_get_symbolrate() warn: should 'stv0297_readreg(state, 87) << 16' be a 64 bit type?
drivers/media/dvb-frontends/stv0297.c:142 stv0297_get_symbolrate() warn: should 'stv0297_readreg(state, 88) << 24' be a 64 bit type?

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-05-01 06:05:31 -03:00
Mauro Carvalho Chehab 2267d2d747 [media] zl10353: fix indenting
drivers/media/dvb-frontends/zl10353.c:536 zl10353_read_ucblocks() warn: inconsistent indenting

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-05-01 06:04:34 -03:00
Mauro Carvalho Chehab 2b257d18f0 [media] tda1004x: fix identation
drivers/media/dvb-frontends/tda1004x.c:653 tda10046_init() warn: inconsistent indenting

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-05-01 06:03:01 -03:00
Mauro Carvalho Chehab 82e3b88b67 [media] cx24117: fix a buffer overflow when checking userspace params
The maximum size for a DiSEqC command is 6, according to the
userspace API. However, the code allows to write up much more values:
	drivers/media/dvb-frontends/cx24116.c:983 cx24116_send_diseqc_msg() error: buffer overflow 'd->msg' 6 <= 23

Cc: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-30 14:26:42 -03:00
Mauro Carvalho Chehab d7b76c91f4 [media] af9013: Don't accept invalid bandwidth
If userspace sends an invalid bandwidth, it should either return
EINVAL or switch to auto mode.

This driver will go past an array and program the hardware on a
wrong way if this happens.

Cc: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-30 14:26:22 -03:00
Mauro Carvalho Chehab 1fa2337a31 [media] cx24116: fix a buffer overflow when checking userspace params
The maximum size for a DiSEqC command is 6, according to the
userspace API. However, the code allows to write up much more values:
	drivers/media/dvb-frontends/cx24116.c:983 cx24116_send_diseqc_msg() error: buffer overflow 'd->msg' 6 <= 23

Cc: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-30 14:26:05 -03:00
Mauro Carvalho Chehab 12f4543f5d [media] s5h1420: fix a buffer overflow when checking userspace params
The maximum size for a DiSEqC command is 6, according to the
userspace API. However, the code allows to write up to 7 values:
	drivers/media/dvb-frontends/s5h1420.c:193 s5h1420_send_master_cmd() error: buffer overflow 'cmd->msg' 6 <= 7

Cc: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-30 13:59:54 -03:00
Mauro Carvalho Chehab 451dfbe9f1 [media] stv0288: fix indentation
drivers/media/dvb-frontends/stv0288.c:137 stv0288_set_symbolrate() warn: inconsistent indenting

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-30 13:45:32 -03:00
Mauro Carvalho Chehab 16afc67216 [media] lgdt3306a: fix indentation
drivers/media/dvb-frontends/lgdt3306a.c:2104 lgdt3306a_DumpRegs() warn: inconsistent indenting

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-30 13:45:10 -03:00
Mauro Carvalho Chehab c7a092e36e [media] dib3000mc: Fix indentation
drivers/media/dvb-frontends/dib3000mc.c:134 dib3000mc_setup_pwm_state() warn: inconsistent indenting
drivers/media/dvb-frontends/dib3000mc.c:144 dib3000mc_setup_pwm_state() warn: inconsistent indenting
drivers/media/dvb-frontends/dib3000mc.c:420 dib3000mc_sleep() warn: inconsistent indenting
drivers/media/dvb-frontends/dib3000mc.c:453 dib3000mc_set_channel_cfg() warn: inconsistent indenting

The last one is actually due to a commented code. Let's rework
it, in order to remove the sparse warning without removing the
dead code, as it may be useful in the future.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-30 13:44:50 -03:00
Mauro Carvalho Chehab 361f2e8d97 [media] bcm3510: fix indentation
drivers/media/dvb-frontends/bcm3510.c:688 bcm3510_reset() warn: inconsistent indenting
drivers/media/dvb-frontends/bcm3510.c:711 bcm3510_clear_reset() warn: inconsistent indenting

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-30 13:44:28 -03:00
Mauro Carvalho Chehab 21de82e374 [media] dib8000: fix compiler warning
In file included from include/uapi/linux/posix_types.h:4:0,
                 from include/uapi/linux/types.h:13,
                 from include/linux/types.h:5,
                 from include/uapi/linux/sysinfo.h:4,
                 from include/uapi/linux/kernel.h:4,
                 from include/linux/cache.h:4,
                 from include/linux/time.h:4,
                 from include/linux/input.h:11,
                 from drivers/media/usb/dvb-usb/dvb-usb.h:13,
                 from drivers/media/usb/dvb-usb/dib0700.h:13,
                 from drivers/media/usb/dvb-usb/dib0700_devices.c:9:
drivers/media/dvb-frontends/dib8000.h: In function 'dib8000_attach':
include/linux/stddef.h:8:14: warning: return makes integer from pointer without a cast [-Wint-conversion]
 #define NULL ((void *)0)
              ^
drivers/media/dvb-frontends/dib8000.h:72:9: note: in expansion of macro 'NULL'
  return NULL;
         ^

Reported-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-28 09:30:33 -03:00
Hans Verkuil 8b012fc9bd [media] cx24123/mb86a20s/s921: fix compiler warnings
In file included from drivers/media/common/b2c2/flexcop-fe-tuner.c:13:0:
drivers/media/dvb-frontends/cx24123.h:54:2: warning: 'cx24123_get_tuner_i2c_adapter' defined but not used [-Wunused-function]
  cx24123_get_tuner_i2c_adapter(struct dvb_frontend *fe)
  ^
In file included from drivers/media/usb/em28xx/em28xx-dvb.c:46:0:
drivers/media/dvb-frontends/s921.h:40:2: warning: 's921_get_tuner_i2c_adapter' defined but not used [-Wunused-function]
  s921_get_tuner_i2c_adapter(struct dvb_frontend *fe)
  ^
In file included from drivers/media/usb/em28xx/em28xx-dvb.c:55:0:
drivers/media/dvb-frontends/mb86a20s.h:49:2: warning: 'mb86a20s_get_tuner_i2c_adapter' defined but not used [-Wunused-function]
  mb86a20s_get_tuner_i2c_adapter(struct dvb_frontend *fe)
  ^
In file included from drivers/media/usb/cx231xx/cx231xx-dvb.c:35:0:
drivers/media/dvb-frontends/mb86a20s.h:49:2: warning: 'mb86a20s_get_tuner_i2c_adapter' defined but not used [-Wunused-function]
  mb86a20s_get_tuner_i2c_adapter(struct dvb_frontend *fe)
  ^

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-28 09:26:02 -03:00
Mauro Carvalho Chehab 64131a87f2 Merge branch 'drm-next-merged' of git://people.freedesktop.org/~airlied/linux into v4l_for_linus
* 'drm-next-merged' of git://people.freedesktop.org/~airlied/linux: (9717 commits)
  media-bus: Fixup RGB444_1X12, RGB565_1X16, and YUV8_1X24 media bus format
  hexdump: avoid warning in test function
  fs: take i_mutex during prepare_binprm for set[ug]id executables
  smp: Fix error case handling in smp_call_function_*()
  iommu-common: Fix PARISC compile-time warnings
  sparc: Make LDC use common iommu poll management functions
  sparc: Make sparc64 use scalable lib/iommu-common.c functions
  Break up monolithic iommu table/lock into finer graularity pools and lock
  sparc: Revert generic IOMMU allocator.
  tools/power turbostat: correct dumped pkg-cstate-limit value
  tools/power turbostat: calculate TSC frequency from CPUID(0x15) on SKL
  tools/power turbostat: correct DRAM RAPL units on recent Xeon processors
  tools/power turbostat: Initial Skylake support
  tools/power turbostat: Use $(CURDIR) instead of $(PWD) and add support for O= option in Makefile
  tools/power turbostat: modprobe msr, if needed
  tools/power turbostat: dump MSR_TURBO_RATIO_LIMIT2
  tools/power turbostat: use new MSR_TURBO_RATIO_LIMIT names
  Bluetooth: hidp: Fix regression with older userspace and flags validation
  config: Enable NEED_DMA_MAP_STATE by default when SWIOTLB is selected
  perf/x86/intel/pt: Fix and clean up error handling in pt_event_add()
  ...

That solves several merge conflicts:
	Documentation/DocBook/media/v4l/subdev-formats.xml
	Documentation/devicetree/bindings/vendor-prefixes.txt
	drivers/staging/media/mn88473/mn88473.c
	include/linux/kconfig.h
	include/uapi/linux/media-bus-format.h

The ones at subdev-formats.xml and media-bus-format.h are not trivial.
That's why we opted to merge from DRM.
2015-04-21 09:44:55 -03:00
Mauro Carvalho Chehab 676ee36be0 Merge branch 'patchwork' into v4l_for_linus
* patchwork: (404 commits)
  [media] uvcvideo: add support for VIDIOC_QUERY_EXT_CTRL
  [media] uvcvideo: fix cropcap v4l2-compliance failure
  [media] media: omap3isp: remove unused clkdev
  [media] coda: Add tracing support
  [media] coda: drop dma_sync_single_for_device in coda_bitstream_queue
  [media] coda: fix fill bitstream errors in nonstreaming case
  [media] coda: call SEQ_END when the first queue is stopped
  [media] coda: fail to start streaming if userspace set invalid formats
  [media] coda: remove duplicate error messages for buffer allocations
  [media] coda: move parameter buffer in together with context buffer allocation
  [media] coda: allocate bitstream buffer from REQBUFS, size depends on the format
  [media] coda: allocate per-context buffers from REQBUFS
  [media] coda: use strlcpy instead of snprintf
  [media] coda: bitstream payload is unsigned
  [media] coda: fix double call to debugfs_remove
  [media] coda: check kasprintf return value in coda_open
  [media] coda: bitrate can only be set in kbps steps
  [media] v4l2-mem2mem: no need to initialize b in v4l2_m2m_next_buf and v4l2_m2m_buf_remove
  [media] s5p-mfc: set allow_zero_bytesused flag for vb2_queue_init
  [media] coda: set allow_zero_bytesused flag for vb2_queue_init
  ...
2015-04-21 06:12:35 -03:00
Javi Merino 512eb720c9 media: cxd2820r: use DIV_ROUND_CLOSEST_ULL()
Now that the kernel provides DIV_ROUND_CLOSEST_ULL(), drop the internal
implementation and use the kernel one.

Signed-off-by: Javi Merino <javi.merino@arm.com>
Cc: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Acked-by: Antti Palosaari <crope@iki.fi>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-04-17 09:03:56 -04:00
Linus Torvalds d0bbe0dd35 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial
Pull trivial tree from Jiri Kosina:
 "Usual trivial tree updates.  Nothing outstanding -- mostly printk()
  and comment fixes and unused identifier removals"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial:
  goldfish: goldfish_tty_probe() is not using 'i' any more
  powerpc: Fix comment in smu.h
  qla2xxx: Fix printks in ql_log message
  lib: correct link to the original source for div64_u64
  si2168, tda10071, m88ds3103: Fix firmware wording
  usb: storage: Fix printk in isd200_log_config()
  qla2xxx: Fix printk in qla25xx_setup_mode
  init/main: fix reset_device comment
  ipwireless: missing assignment
  goldfish: remove unreachable line of code
  coredump: Fix do_coredump() comment
  stacktrace.h: remove duplicate declaration task_struct
  smpboot.h: Remove unused function prototype
  treewide: Fix typo in printk messages
  treewide: Fix typo in printk messages
  mod_devicetable: fix comment for match_flags
2015-04-14 09:50:27 -07:00
Mauro Carvalho Chehab 00c78a3728 dvb-frontends: use IS_REACHABLE() instead of IS_ENABLED()
Changeset 9b174527e7 added this new macro, ensuring that it
is true only if the function is actually reachable.

However, newer drivers were added since when it was written.
So, change those drivers to also use it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-08 15:05:12 -03:00
Arnd Bergmann 9b174527e7 [media] Add and use IS_REACHABLE macro
In the media drivers, the v4l2 core knows about all submodules
and calls into them from a common function. However this cannot
work if the modules that get called are loadable and the
core is built-in. In that case we get

drivers/built-in.o: In function `set_type':
drivers/media/v4l2-core/tuner-core.c:301: undefined reference to `tea5767_attach'
drivers/media/v4l2-core/tuner-core.c:307: undefined reference to `tea5761_attach'
drivers/media/v4l2-core/tuner-core.c:349: undefined reference to `tda9887_attach'
drivers/media/v4l2-core/tuner-core.c:405: undefined reference to `xc4000_attach'

This was working previously, until the IS_ENABLED() macro was used
to replace the construct like

 #if defined(CONFIG_DVB_CX24110) || (defined(CONFIG_DVB_CX24110_MODULE) && defined(MODULE))

with the difference that the new code no longer checks whether it is being
built as a loadable module itself.

To fix this, this new patch adds an 'IS_REACHABLE' macro, which evaluates
true in exactly the condition that was used previously. The downside
of this is that this trades an obvious link error for a more subtle
runtime failure, but it is clear that the change that introduced the
link error was unintentional and it seems better to revert it for
now. Also, a similar change was originally created by Trent Piepho
and then reverted by teh change to the IS_ENABLED macro.

Ideally Kconfig would be used to avoid the case of a broken dependency,
or the code restructured in a way to turn around the dependency, but either
way would require much larger changes here.

Fixes: 7b34be71db ("[media] use IS_ENABLED() macro")
See-also: c5dec9fb24 ("V4L/DVB (4751): Fix DBV_FE_CUSTOMISE for card drivers compiled into kernel")

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-08 15:02:07 -03:00
Yannick Guerrini a87a4d3428 [media] si2168: tda10071: m88ds3103: Fix trivial typos
Change 'firmare' to 'firmware'

Signed-off-by: Yannick Guerrini <yguerrini@tomshardware.fr>
Acked-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-08 14:57:15 -03:00
Luis de Bethencourt 2035775624 [media] rtl2832: remove compiler warning
Cleaning up the following compiler warning:
rtl2832.c:703:12: warning: 'tmp' may be used uninitialized in this function

Even though it could never happen since if rtl2832_rd_demod_reg () doesn't set
tmp, this line would never run because we go to err. It is still nice to avoid
compiler warnings.

[mchehab@osg.samsung.com: fix a merge conflict with another patch meant
 to fix the same bug, but doing it at the wrong way]
Signed-off-by: Luis de Bethencourt <luis.bg@samsung.com>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-08 13:13:36 -03:00
Christian Engelmayer ec73b9fdc7 [media] si2165: Fix possible leak in si2165_upload_firmware()
In case of an error function si2165_upload_firmware() releases the already
requested firmware in the exit path. However, there is one deviation where
the function directly returns. Use the correct cleanup so that the firmware
memory gets freed correctly. Detected by Coverity CID 1269120.

Signed-off-by: Christian Engelmayer <cengelma@gmx.at>
Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
Reviewed-by: Luis de Bethencourt <luis.bg@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-08 08:12:00 -03:00
Markus Elfring 0ea4bce7c0 [media] sp2: Delete an unnecessary check before the function call "kfree"
The kfree() function tests whether its argument is NULL and then
returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-08 07:36:00 -03:00
Benjamin Larsson 021cd2d21b [media] mn88472: add ts mode and ts clock to driver
Signed-off-by: Benjamin Larsson <benjamin@southpole.se>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-08 06:54:41 -03:00
Antti Palosaari b3226f961a [media] ts2020: do not use i2c_transfer() on sleep()
There is no need to use bulk i2c_transfer() to write single register.
Use write register function instead.

Tested-by: David Howells <dhowells@redhat.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 22:27:32 -03:00
Antti Palosaari dc245a5f9b [media] ts2020: implement I2C client bindings
Implement I2C binding model.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 22:24:03 -03:00
Antti Palosaari abd9025b95 [media] ts2020: add support for TS2022
TS2022 is slightly newer and different version of same tuner, which
could be supported with rather small changes. Tuner type is
auto-detected.

Tested-by: David Howells <dhowells@redhat.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 22:24:03 -03:00
Antti Palosaari b3b2bf820e [media] rtl2832: disable regmap register cache
Caching register reads causes some random I/O errors on channel
change. Disable caching now in order to avoid those errors.

Reverts partly commit dcadb82

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 18:26:45 -03:00
Hans Verkuil f2e37b9b73 [media] rtl2832: fix compiler warning
>From the daily build:

rtl2832.c: In function 'rtl2832_read_status':
rtl2832.c:703:12: warning: 'tmp' may be used uninitialized in this function [-Wmaybe-uninitialized]
  } else if (tmp == 10) {
            ^

The code is OK, it's just the compiler that cannot figure out what's
going on. So just init 'tmp' to 0.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 18:22:54 -03:00
Yannick Guerrini 2701e84f8b si2168, tda10071, m88ds3103: Fix firmware wording
Change 'firmare' to 'firmware'

Signed-off-by: Yannick Guerrini <yguerrini@tomshardware.fr>
Acked-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2015-03-06 23:18:12 +01:00
Benjamin Larsson 3b786f1316 [media] mn88473: calculate the IF register values
Add xtal as a configuration parameter so it can be used
in the IF register value calculation. If not set in the
configuration then use a default value.

Signed-off-by: Benjamin Larsson <benjamin@southpole.se>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-03-03 13:07:55 -03:00
Mauro Carvalho Chehab 95f22c5aae [media] lgdt3306a: Minor source code cleanups
Fix a few minor CodingStyle issues at the source code:
	- Use proper multi-line comments;
	- Align the log tables;
	- Remove the .type from dvb_frontend_ops, since this is not
	  needed anymore (since the drivers conversion to DVBv5);
	- Remove emacs format macro.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-03-03 10:34:15 -03:00
Mauro Carvalho Chehab 534f4364f9 [media] lgdt3306a: Break long lines
Fix most of checkpatch warnings like:
	WARNING: line over 80 characters

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-03-03 10:34:15 -03:00
Mauro Carvalho Chehab 9369fe012d [media] lgdt3306a: constify log tables
Ideally, we should be replacing this function by intlog10().

While we don't do that, let's at least constify the tables,
in order to remove its code footfrint, and get rid of nelems.

This also fixes a few 80-cols CodingStyle warnings.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-03-03 10:34:14 -03:00
Mauro Carvalho Chehab c9897649db [media] lbdt3306a: remove uneeded braces
WARNING: braces {} are not necessary for any arm of this statement
+		if (ret == 0) {
[...]
+		} else {
[...]

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-03-03 10:34:14 -03:00
Mauro Carvalho Chehab b4e43e959b [media] lgdt3306a: Don't use else were not needed
Get rid of the remaining checkpatch.pl warnings:
	WARNING: braces {} are not necessary for any arm of this statement

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-03-03 10:34:14 -03:00
Mauro Carvalho Chehab b1a88c713a [media] lbdt3306a: simplify the lock status check
The logic there is too complex and it looks like an inifite
loop.

So, simplify the logic and implement it as a for loop.

This gets rid of the following checkpatch.pl warnings:

WARNING: else is not generally useful after a break or return
+			return LG3306_UNLOCK;
+		} else {

WARNING: else is not generally useful after a break or return
+			return LG3306_UNLOCK;
+		} else {

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-03-03 10:34:13 -03:00
Mauro Carvalho Chehab 097117cab5 [media] lbdt3306a: rework at printk macros
Use pr_foo() where there's a direct replacement. For debug, use
custom-made macros, for now, as there are 3 different debug levels.

We should get rid of those some day, specially since several such
macros can be just removed, as Kernel trace would provide about
the same output.

This gets rid of some checkpatch errors:

WARNING: Prefer [subsystem eg: netdev]_info([subsystem]dev, ... then dev_info(dev, ... then pr_info(...  to printk(KERN_INFO ...
+#define lg_info(fmt, arg...)	printk(KERN_INFO "lgdt3306a: " fmt, ##arg)

ERROR: Macros with complex values should be enclosed in parentheses
+#define lg_dbg(fmt, arg...) if (debug & DBG_INFO)			\
+				lg_printk(KERN_DEBUG,         fmt, ##arg)

ERROR: Macros with complex values should be enclosed in parentheses
+#define lg_reg(fmt, arg...) if (debug & DBG_REG)			\
+				lg_printk(KERN_DEBUG,         fmt, ##arg)

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-03-03 10:34:13 -03:00
Mauro Carvalho Chehab e2c47fa7dd [media] lgdt3306a: Remove FSF address
Fix this CodingStyle error:

	ERROR: Do not include the paragraph about writing to the Free Software Foundation's mailing address from the sample GPL notice. The FSF has changed addresses in the past, and may do so ag$
	#56: FILE: drivers/media/dvb-frontends/lgdt3306a.c:19:
	+ *    along with this program; if not, write to the Free Software$

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-03-03 10:34:13 -03:00
Mauro Carvalho Chehab ee0133eea0 [media] lgdt3306a: properly handle I/O errors
Fixes the following smatch errors:

drivers/media/dvb-frontends/lgdt3306a.c: In function 'lgdt3306a_set_if':
drivers/media/dvb-frontends/lgdt3306a.c:695:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
  int ret;
      ^
drivers/media/dvb-frontends/lgdt3306a.c: In function 'lgdt3306a_monitor_vsb':
drivers/media/dvb-frontends/lgdt3306a.c:1033:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
  int ret;
      ^
drivers/media/dvb-frontends/lgdt3306a.c: In function 'lgdt3306a_check_oper_mode':
drivers/media/dvb-frontends/lgdt3306a.c:1082:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
  int ret;
      ^
drivers/media/dvb-frontends/lgdt3306a.c: In function 'lgdt3306a_check_lock_status':
drivers/media/dvb-frontends/lgdt3306a.c:1109:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
  int ret;
      ^
drivers/media/dvb-frontends/lgdt3306a.c: In function 'lgdt3306a_check_neverlock_status':
drivers/media/dvb-frontends/lgdt3306a.c:1185:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
  int ret;
      ^
drivers/media/dvb-frontends/lgdt3306a.c: In function 'lgdt3306a_pre_monitoring':
drivers/media/dvb-frontends/lgdt3306a.c:1199:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
  int ret;
      ^
drivers/media/dvb-frontends/lgdt3306a.c: In function 'lgdt3306a_get_packet_error':
drivers/media/dvb-frontends/lgdt3306a.c:1310:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
  int ret;
      ^

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-03-03 10:34:12 -03:00