Daniel Scheller [Wed, 7 Mar 2018 20:07:56 +0000 (15:07 -0500)]
media: ngene: use common DVB I2C client handling helpers
Like in ddbridge, get rid of all duplicated I2C client handling constructs
and rather make use of the newly added dvb_module_*() helpers. Makes
things more clean and removes the (cosmetic) need for some variables.
The check on a valid ptr on ci->en isn't really needed since the cxd2099
driver will set it at a time where it is going to return successfully
from probing.
Signed-off-by: Daniel Scheller <d.scheller@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Daniel Scheller [Wed, 7 Mar 2018 20:07:55 +0000 (15:07 -0500)]
media: ddbridge: use common DVB I2C client handling helpers
Instead of keeping duplicated I2C client handling construct, make use of
the newly introduced dvb_module_*() helpers. This not only keeps things
way cleaner and removes the need for duplicated I2C client attach code,
but even allows to get rid of some variables that won't help in making
things look cleaner anymore.
The check on a valid ptr on port->en isn't really needed since the cxd2099
driver will set it at a time where it is going to return successfully
from probing.
Signed-off-by: Daniel Scheller <d.scheller@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Daniel Scheller [Wed, 7 Mar 2018 19:23:48 +0000 (14:23 -0500)]
media: dvb-frontends/Kconfig: move the SP2 driver to the CI section
The CIMaX SP2 driver is a EN50221 CI controller I2C driver similar to the
cxd2099 driver. Move it's Kconfig block into the newly introduced CI
subsection.
Cc: Olli Salonen <olli.salonen@iki.fi> Cc: Antti Palosaari <crope@iki.fi> Signed-off-by: Daniel Scheller <d.scheller@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Daniel Scheller [Wed, 7 Mar 2018 19:23:47 +0000 (14:23 -0500)]
media: dvb-frontends/cxd2099: Kconfig additions
The cxd2099 driver makes use of the Regmap I2C kernel API, thus add
"select REGMAP_I2C" to it's Kconfig block. Also, make it default "m" if
!MEDIA_SUBDRV_AUTOSELECT, just like every other dvb-frontend driver.
And, while at it, remove the hyphens around the help tag.
If I2C is present and it is module, the DVB core should also
be a module, otherwise build will now fail with:
drivers/media/dvb-core/dvbdev.o: In function `dvb_module_probe':
drivers/media/dvb-core/dvbdev.c:965: undefined reference to `i2c_new_device'
drivers/media/dvb-core/dvbdev.c:972: undefined reference to `i2c_unregister_device'
Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
media: v4l2-subdev: get rid of __V4L2_SUBDEV_MK_GET_TRY() macro
X-Virus-Scanned: Debian amavisd-new at dev.s-opensource.com
media: v4l2-subdev: get rid of __V4L2_SUBDEV_MK_GET_TRY() macro
The __V4L2_SUBDEV_MK_GET_TRY() macro is used to define
3 functions that have the same arguments. The code of those
functions is simple enough to just declare them, de-obfuscating
the code.
While here, replace BUG_ON() by WARN_ON() as there's no reason
why to panic the Kernel if this fails.
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
media: s5c73m3-core: fix logic on a timeout condition
As warned by smatch:
drivers/media/i2c/s5c73m3/s5c73m3-core.c:268 s5c73m3_check_status() error: uninitialized symbol 'status'.
if s5c73m3_check_status() is called too late, time_is_after_jiffies(end)
will return 0, causing the while to abort before reading status.
The current code will do the wrong thing here, as it will still
check if status != value. The right fix here is to change
the logic to ensure that it will always read the status.
Suggested-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/dvb-frontends/cxd2880/cxd2880_top.c: In function ‘cxd2880_set_ber_per_period_t’:
drivers/media/dvb-frontends/cxd2880/cxd2880_top.c:677:34: warning: variable ‘c’ set but not used [-Wunused-but-set-variable]
struct dtv_frontend_properties *c;
^
drivers/media/dvb-frontends/cxd2880/cxd2880_top.c: In function ‘cxd2880_set_ber_per_period_t2’:
drivers/media/dvb-frontends/cxd2880/cxd2880_top.c:790:34: warning: variable ‘c’ set but not used [-Wunused-but-set-variable]
struct dtv_frontend_properties *c;
^
drivers/media/dvb-frontends/cxd2880/cxd2880_top.c: In function ‘cxd2880_get_frontend’:
drivers/media/dvb-frontends/cxd2880/cxd2880_top.c:1799:23: warning: variable ‘priv’ set but not used [-Wunused-but-set-variable]
struct cxd2880_priv *priv = NULL;
^~~~
This part of the driver has the main routines to handle
the tuner and demodulator functionality. The tnrdmd_mon.* files
have monitor functions for the driver.
This is part of the Sony CXD2880 DVB-T2/T tuner + demodulator driver.
Brad Love [Tue, 6 Mar 2018 19:15:37 +0000 (14:15 -0500)]
media: cx23885: Override 888 ImpactVCBe crystal frequency
Hauppauge produced a revision of ImpactVCBe using an 888,
with a 25MHz crystal, instead of using the default third
overtone 50Mhz crystal. This overrides that frequency so
that the cx25840 is properly configured. Without the proper
crystal setup the cx25840 cannot load the firmware or
decode video.
Signed-off-by: Brad Love <brad@nextdimension.cc> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Brad Love [Tue, 6 Mar 2018 19:15:36 +0000 (14:15 -0500)]
media: cx23885: Set subdev host data to clk_freq pointer
Currently clk_freq is ignored entirely, because the cx235840 driver
configures the xtal at the chip defaults. This is an issue if a
board is produced with a non-default frequency crystal. If clk_freq
is not zero the cx25840 will attempt to use the setting provided,
or fall back to defaults otherwise.
Signed-off-by: Brad Love <brad@nextdimension.cc> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Brad Love [Tue, 6 Mar 2018 19:15:35 +0000 (14:15 -0500)]
media: cx23885: change 887/888 default to 888
Proper cx2388x chip type is detected in cx25840 probe, the clock
rate is untouched however in probe. The cx25840 only checks for
non default clock values for 888 and provides custom settings for
25MHz 888. This change ensures that cx23888 chips with default 50MHz
crystals will not get configured as if they have 25MHz crystals. A
cx23887 board will continue to be configured for 25MHz crystal as
there is no custom clock support included for it.
Signed-off-by: Brad Love <brad@nextdimension.cc> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Brad Love [Tue, 6 Mar 2018 19:15:34 +0000 (14:15 -0500)]
media: cx25840: Use subdev host data for PLL override
The cx25840 driver currently configures 885, 887, and 888 using
default divisors for each chip. This check to see if the cx23885
driver has passed the cx25840 a non-default clock rate for a
specific chip. If a cx23885 board has left clk_freq at 0, the
clock default values will be used to configure the PLLs.
This patch only has effect on 888 boards who set clk_freq to 25M.
Signed-off-by: Brad Love <brad@nextdimension.cc> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Brad Love [Tue, 6 Mar 2018 19:15:01 +0000 (14:15 -0500)]
media: cx231xx: Add second i2c demod to Hauppauge 975
Hauppauge HVR-975 is a hybrid, dual frontend, single tuner USB device.
It contains lgdt3306a and si2168 frontends and one si2157 tuner. The
lgdt3306a frontend is currently enabled. This creates the second
demodulator and attaches it to the tuner.
Enables lgdt3306a|si2168 + si2157
Signed-off-by: Brad Love <brad@nextdimension.cc> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Daniel Scheller [Tue, 6 Mar 2018 17:46:37 +0000 (12:46 -0500)]
media: ngene: compensate for TS buffer offset shifts
A possible hardware bug was discovered when using CA addon hardware
attached to the ngene hardware, in that the TS input buffer much likely
will shift and thus become unaligned to 188 byte blocks (a full TS frame)
when things like CA module initialisation (which happens via differing
communication paths) take place. This causes the TS NULL removal in
tsin_exchange() to fail to detect this previously inserted data and thus
causes userspace applications to receive data they didn't sent beforehand
and ultimately cause troubles.
On driver load with an inserted CAM, buffers are fine at first (note that
the driver has to keep the communication running from/to the card by
inserting TS NULL frames, this is done in tsout_exchange() via
FillTSBuffer() - that data is simply sent back by the hardware):
Next, VDR, TVHeadend or any other CI aware application is started, buffers
will shift by even more bytes. It is believed this is due to the hardware
not handling control and data bytes properly distinct, and control data
having an influence on the actual data stream, which we cannot properly
detect at the driver level.
Workaround this hardware quirk by adding a detection for the TS sync byte
0x47 before each TS frame copy, scan for a new SYNC byte and a TS NULL
packet if buffers become unaligned, take note of that offset and apply
that when copying data to the DVB ring buffers. The last <188 bytes from
the hardware buffers are stored in a temp buffer (tsin_buffer), for which
the remainder will be in the beginning of the next hardware buffer (next
iteration of tsin_exchange()). That remainder will be appended to the
temp buffer and finally sent to the DVB ring buffer. The resulting TS
stream is perfectly fine, and the TS NULL packets inserted by the driver
which are sent back are properly removed. The resulting offset is being
clamped to 188 byte segments (one TS packet). Though this can result in
a repeated TS packet if the overall offset grows beyond this (and it
will grow only on CA initialisation), this is still way better than
unaligned TS frames and data sent to userspace that just isn't supposed
to be there.
This compensation can be toggled by the ci_tsfix modparam, which defaults
to 1 (enabled). In the case of problems, this can be turned off by setting
the parameter to 0 to restore the old behaviour.
Signed-off-by: Daniel Scheller <d.scheller@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Daniel Scheller [Tue, 6 Mar 2018 17:46:36 +0000 (12:46 -0500)]
media: ngene: move the tsin_exchange() stripcopy block into a function
Move the copy logic that will skip previously inserted TS NULL frames when
moving data to the DVB ring buffers into an own function. This is done to
not duplicate code all over the place with the following TS offset shift
fixup patch.
While we're touching this part of the code, get rid of the DEBUG_CI_XFER
debug-ifdeffery. This could be toggleable either by a Kconfig or a module
param, but in the end this will accidentally be enabled and cause lots
of kernel log messages, and such devel debug shouldn't be there anyway.
Signed-off-by: Daniel Scheller <d.scheller@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Tomoki Sekiyama [Sat, 3 Mar 2018 18:20:56 +0000 (13:20 -0500)]
media: siano: Fix coherent memory allocation failure on arm64
On some architectures such as arm64, siano chip based TV-tuner
USB devices are not recognized correctly due to coherent memory
allocation failure with the following error:
Luca Ceresoli [Fri, 2 Mar 2018 09:37:20 +0000 (04:37 -0500)]
media: doc: poll: fix links to dual-ioctl sections
Links like :ref:`VIDIOC_STREAMON` expand to "ioctl VIDIOC_STREAMON,
VIDIOC_STREAMOFF". Thus our reader will think we are talking about
STREAMON _and_ STREAMOFF, but only one of the two actually applies
in some cases.
Fix by adding a link title, so the reader will read only the correct
ioctl name.
Arnd Bergmann [Wed, 28 Feb 2018 23:19:37 +0000 (18:19 -0500)]
media: renesas-ceu: mark PM functions as __maybe_unused
The PM runtime operations are unused when CONFIG_PM is disabled,
leading to a harmless warning:
drivers/media/platform/renesas-ceu.c:1003:12: error: 'ceu_runtime_suspend' defined but not used [-Werror=unused-function]
static int ceu_runtime_suspend(struct device *dev)
^~~~~~~~~~~~~~~~~~~
drivers/media/platform/renesas-ceu.c:987:12: error: 'ceu_runtime_resume' defined but not used [-Werror=unused-function]
static int ceu_runtime_resume(struct device *dev)
^~~~~~~~~~~~~~~~~~
This adds a __maybe_unused annotation to shut up the warning.
Daniel Scheller [Tue, 6 Mar 2018 16:39:12 +0000 (11:39 -0500)]
media: dvb-frontends/cxd2099: remove remainders from old attach way
As all drivers using the cxd2099 are converted to handle attach/detach
the generic I2C client way, the static inline cxd2099_attach isn't
required anymore. Thus cleanup cxd2099.h from the remainders, the adr
struct member also isn't used anymore.
Daniel Scheller [Tue, 6 Mar 2018 16:39:11 +0000 (11:39 -0500)]
media: ngene: add I2C_FUNC_I2C to the I2C interface functionality
Report I2C_FUNC_I2C in .functionality() as well. The I2C interface can
handle this fine and even is required for all I2C client drivers that
utilise the regmap API which are used from within the ngene driver.
Joe Perches [Thu, 1 Mar 2018 12:01:22 +0000 (07:01 -0500)]
media: tw9910: Miscellaneous neatening
Yet more whitespace and style neatening
o Add blank lines before returns
o Reverse a logic test and return early on error
o Move formats to same line as dev_<level> calls
o Remove an unnecessary period from a logging message
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Daniel Scheller [Sun, 25 Feb 2018 17:06:56 +0000 (12:06 -0500)]
media: ngene: add proper polling to the dvbdev_ci file ops
Implement the poll callback for the dvbdev_ci file ops. The ts_poll()
function queries the DVB ring buffers for available data and space, and
reports this as appropriate. Also, set the dvb_device readers, writers
and users to proper values (one reader, one writer, two users).
This fixes the raw CI TS transport in conjunction with TVheadend's
DDCI functionality.
Signed-off-by: Daniel Scheller <d.scheller@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Daniel Scheller [Sun, 25 Feb 2018 12:31:38 +0000 (07:31 -0500)]
media: ngene: don't treat non-existing demods as error
When probing the I2C busses in cineS2_probe(), it's no error when there's
no hardware connected to the probed expansion connector, so print this
informal message with info severity.
Signed-off-by: Daniel Scheller <d.scheller@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Daniel Scheller [Sun, 25 Feb 2018 12:31:37 +0000 (07:31 -0500)]
media: ngene: check for CXD2099AR presence before attaching
Currently, if there's no CXD2099AR attached to any expansion connector of
the ngene hardware, it will complain with this on every module load:
cxd2099 1-0040: No CXD2099AR detected at 0x40
cxd2099: probe of 1-0040 failed with error -5
ngene 0000:02:00.0: CXD2099AR attach failed
This happens due to the logic assuming such hardware is always there and
blindly tries to attach the cxd2099 I2C driver. Rather add a probe
function (in ngene-cards.c with a prototype in ngene.h) to check for
the existence of such hardware before probing, and don't try further if
no CXD2099 was found.
Signed-off-by: Daniel Scheller <d.scheller@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Daniel Scheller [Sun, 25 Feb 2018 12:31:36 +0000 (07:31 -0500)]
media: ngene: deduplicate I2C adapter evaluation
The I2C adapter evaluation (based on chan->number) is duplicated at
several places (tuner_attach_() functions, demod_attach_stv0900() and
cineS2_probe()). Clean this up by wrapping that construct in a separate
function which all users of that can pass the ngene_channel pointer and
get the correct I2C adapter from.
Signed-off-by: Daniel Scheller <d.scheller@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Daniel Scheller [Sun, 25 Feb 2018 12:31:35 +0000 (07:31 -0500)]
media: ngene: add support for DuoFlex S2 V4 addon modules
Add support for the STV0910/STV6111/LNBH25 based DuoFlex S2 V4 DVB-S2
addon modules by recognizing them from their XO2 type value and using
the auxiliary stv0910, stv6111 and lnbh25 driver to form a complete
DVB frontend.
This also adds autoselection (if MEDIA_SUBDRV_AUTOSELECT) of the STV0910,
STV6111 and LNBH25 demod/tuner/LNB-IC drivers to Kconfig.
Signed-off-by: Daniel Scheller <d.scheller@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Daniel Scheller [Sun, 25 Feb 2018 12:31:34 +0000 (07:31 -0500)]
media: ngene: add support for Sony CXD28xx-based DuoFlex modules
Recognize (probe) and support (attach) all Sony CXD28xx based DuoFlex
addon modules/cards, namely the DuoFlex CT2 (CXD2837), ISDB-T (CXD2838),
C2T2 (CXD2843) and C2T2I (CXD2854). Since all these modules are equipped
with a MachXO2 interface, that support is required for the hardware to
work. This functionality utilises the auxiliary cxd2841er and tda18212
drivers.
This also adds autoselection (if MEDIA_SUBDRV_AUTOSELECT) of the CXD2841ER
demod driver to Kconfig. The __maybe_unused annotation can now be removed
from the xo2names array.
Signed-off-by: Daniel Scheller <d.scheller@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Daniel Scheller [Sun, 25 Feb 2018 12:31:33 +0000 (07:31 -0500)]
media: ngene: add XO2 module support
Detect and initialise modules equipped with XO2 interfaces (Lattice
MachXO2). This requires a few more I2C transfer functions which this adds
as well. Defines for the different possible (available) module types are
added to ngene.h. The support for the actual tuners contained on these
addon modules is kept separate from this commit and is being added with
the next commits.
The xo2names array is temporarily marked __maybe_unused to silence a
corresponding compiler warning at this stage.
Signed-off-by: Daniel Scheller <d.scheller@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Daniel Scheller [Sun, 25 Feb 2018 12:31:32 +0000 (07:31 -0500)]
media: ngene: support STV0367 DVB-C/T DuoFlex addons
Add support for STV0367+TDA18212 based DuoFlex CT addon modules. For this,
add a demod probe function and all necessary demod/tuner attach functions
which use existing auxiliary drivers (stv0367 and tda18212) to support
this hardware. As tda18212 is an I2C client driver, proper cleanup code
is added to the deregistration sequence in ngene-core. To not cause use-
after-free situations when there's a CXD2099 I2C client connected, which
is rather freed in ngene-core.c:cxd_detach(), add i2c_client_fe to struct
ngene_channel to keep track if the i2c_client was allocated by a frontend
driver, rather than the CI code paths. Also move the I2C access functions
to the top of the file and add the required read_regs() function for the
tda18212 ping to work.
This adds autoselection (if MEDIA_SUBDRV_AUTOSELECT) of the STV0367 demod
driver and TDA18212 tuner driver to Kconfig aswell.
Signed-off-by: Daniel Scheller <d.scheller@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Daniel Scheller [Sun, 25 Feb 2018 12:31:31 +0000 (07:31 -0500)]
media: ngene: use defines to identify the demod_type
Make it more clear which demod_type is used for which hardware by having
defines for the possible demod_type values. With that, change the
demod_type evaluation in tuner_attach_probe() to a switch-case instead
of an if() for each possible value.
Signed-off-by: Daniel Scheller <d.scheller@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Daniel Scheller [Sun, 25 Feb 2018 12:31:30 +0000 (07:31 -0500)]
media: ngene: convert kernellog printing from printk() to dev_*() macros
Convert all printk() and pr_*() kernel log printing to rather use the
dev_*() macros. Not only is it discouraged to use printk() (checkpatch
even complains about that), but also this helps identifying the exact PCI
device for any printed event, and it makes almost all printing shorter
in terms of code style since there's no need to use KERN_* DEVICE_NAME
any more (dev_*() will take care of this).
Since the dprintk macro define isn't used anymore, remove it.
Signed-off-by: Daniel Scheller <d.scheller@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Brad Love [Mon, 12 Feb 2018 20:19:04 +0000 (15:19 -0500)]
media: si2168: change ts bus control logic
Move the ts bus control function moved higher, enabling it
after configuring frontend and removeing ts_bus_ctrl callback.
While here, also add an error checking and re-add a comment
that were removed by commit 445877742ce3 ("media: si2168:
Add ts bus coontrol, turn off bus on sleep").
[mchehab@s-opensource.com: I ended by applying the first version,
instead of the right one. So, this patch contains the diff and
the v2 changelog instead]
Fixes: 445877742ce3 ("media: si2168: Add ts bus coontrol, turn off bus on sleep") Signed-off-by: Brad Love <brad@nextdimension.cc> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Daniel Scheller [Fri, 9 Feb 2018 18:22:49 +0000 (13:22 -0500)]
media: dvb-frontends/stv0910: rework and fix DiSEqC send
Rework both DiSEqC send functions (send_master_cmd() and send_burst()) to
utilise the new SET_REG() and SET_FIELD() macros. Esp. due to SET_FIELD(),
this makes sure that not all bits (with unrelated purposes) are always
rewritten, but only those needed for sending DiSEqC commands. In
send_burst(), this makes sure that DISEQC_MODE isn't changed from 3 to 2
inbetween when sending SEC_MINI_A. Also, change both functions to write
DISEQC_MODE first before setting DIS_PRECHARGE. This makes diseqc control
work more reliable for "fullblown" DiSEqC strings in VDR's diseqc.conf in
combination with certain multiswitches.
Fixes: 448461af0e19 ("media: dvb-frontends/stv0910: implement diseqc_send_burst") Reported-by: Helmut Auer <post@helmutauer.de> Cc: Ralph Metzler <rjkm@metzlerbros.de> Signed-off-by: Daniel Scheller <d.scheller@gmx.net> Tested-by: Helmut Auer <post@helmutauer.de> Tested-by: Richard Scobie <rascobie@slingshot.co.nz> Tested-by: Dietmar Spingler <d_spingler@freenet.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Daniel Scheller [Thu, 8 Feb 2018 19:53:17 +0000 (14:53 -0500)]
media: cxd2099: move driver out of staging into dvb-frontends
According to the TODO file, this driver only landed in staging because of
the way device nodes and data transfers are handled. Besides that this way
(use of secX devices) has become sort of standard to date (ie. VDR
supports this literally since ages via the ddci plugin, TVHeadend received
this functionality lately, and minisatip being currently worked on
regarding this), most importantly this I2C client only driver isn't even
responsible for setting up device nodes, not for handling data
transfer and so on, but only serves as interface for the dvb_ca_en50221
subsystem, just like every other DVB card out in the wild, with hard-wired
or such flexible CA interfaces. And, it would even work with cards having
the cxd2099 controller hard-wired.
Also, this driver received quite some love and even is a proper I2C client
driver by now. So, as this driver acts as a EN50221 frontend device, move
it to dvb-frontends. There is no need to keep it buried in staging.
This commit also updates all affected Kconfig and Makefile's, and adds
MEDIA_AUTOSELECT depends to ddbridge and ngene.
Daniel Scheller [Sat, 17 Feb 2018 15:03:23 +0000 (10:03 -0500)]
media: staging/cxd2099: convert to regmap API
Convert the cxd2099 driver to use regmap for I2C accesses, removing all
own i2c_*() functions. With that, make the driver a proper I2C client
driver. This also adds the benefit of having a proper cleanup function
(cxd2099_remove() in this case) that takes care of resource cleanup
upon I2C client deregistration.
At this point, keep the static inline declared cxd2099_attach()
function so that drivers using the legacy/proprietary style attach way
still compile, albeit lacking the cxd2099 driver functionality. This
is taken care of in the next two patches.
Thoses files are unused since commit b3b961448f70 ("V4L/DVB (13795): [Mantis/Hopper] Code overhaul, add Hopper devices into the PCI ID list")
8 year after, we could remove it.
Brad Love [Wed, 17 Jan 2018 21:32:36 +0000 (16:32 -0500)]
media: em28xx: Enable inversion for Solo/Dual HD DVB models
Hauppauge Solo/Dual HD DVB models use a si2157 tuner, which is set to
produce inverted spectrum. This configures the si2168 DVB demod for
inverted spectrum on both affected models.
[mchehab@s-opensource.com: rebased on the top of upstream] Signed-off-by: Brad Love <brad@nextdimension.cc> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Brad Love [Wed, 17 Jan 2018 22:31:58 +0000 (17:31 -0500)]
media: si2168: Add spectrum inversion property
Some tuners produce inverted spectrum, but the si2168 is not
currently set up to accept it. This adds an optional parameter
to set the frontend up to receive inverted spectrum.
Parameter is optional and only boards who enable inversion
will utilize this.
Signed-off-by: Brad Love <brad@nextdimension.cc> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Arnd Bergmann [Tue, 16 Jan 2018 21:52:15 +0000 (16:52 -0500)]
media: s3c-camif: fix out-of-bounds array access
While experimenting with older compiler versions, I ran
into a warning that no longer shows up on gcc-4.8 or newer:
drivers/media/platform/s3c-camif/camif-capture.c: In function '__camif_subdev_try_format':
drivers/media/platform/s3c-camif/camif-capture.c:1265:25: error: array subscript is below array bounds
This is an off-by-one bug, leading to an access before the start of the
array, while newer compilers silently assume this undefined behavior
cannot happen and leave the loop at index 0 if no other entry matches.
As Sylvester explains, we actually need to ensure that the
value is within the range, so this reworks the loop to be
easier to parse correctly, and an additional check to fall
back on the first format value for any unexpected input.
I found an existing gcc bug for it and added a reduced version
of the function there.
Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69249#c3 Fixes: babde1c243b2 ("[media] V4L: Add driver for S3C24XX/S3C64XX SoC series camera interface") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Brad Love [Fri, 12 Jan 2018 16:19:41 +0000 (11:19 -0500)]
media: lgdt3306a: Announce successful creation
The driver is near silent, this adds a simple announcement at the
end of probe after the chip has been detected and upgrades a debug
message to error if probe has failed.
Signed-off-by: Brad Love <brad@nextdimension.cc> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Brad Love [Fri, 12 Jan 2018 16:19:37 +0000 (11:19 -0500)]
media: cx231xx: Add second i2c demod client
Include ability to add a i2c device style frontend to cx231xx USB
bridge. All current boards set to use frontend[0]. Changes are
backwards compatible with current behaviour.
Signed-off-by: Brad Love <brad@nextdimension.cc> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Brad Love [Fri, 12 Jan 2018 16:19:36 +0000 (11:19 -0500)]
media: cx231xx: Add second frontend option
Include ability to add a second dvb attach style frontend to cx231xx
USB bridge. All current boards set to use frontend[0]. Changes are
backwards compatible with current behaviour.
[mchehab@s-opensource.com: fix some coding style issues] Signed-off-by: Brad Love <brad@nextdimension.cc> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>