aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/i2c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2014-10-28[media] smiapp: Update PLL when setting formatSakari Ailus1-1/+1
The media bus format BPP does affect PLL. Recalculate PLL if the format changes. Signed-off-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>
2014-10-28[media] smiapp: Set valid link frequency rangeSakari Ailus1-2/+17
Set supported link frequencies in the menu in control initialisation and when the bpp changes. Signed-off-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>
2014-10-28[media] smiapp: Clean up smiapp_set_format()Sakari Ailus1-30/+43
smiapp_set_format() has accumulated a fair amount of changes without a needed refactoring, do the cleanup now. There's also an unlocked version of v4l2_ctrl_range_changed(), using that fixes a small serialisation issue with the user space interface. __v4l2_ctrl_modify_range() is used instead of v4l2_ctrl_modify_range() in smiapp_set_format_source() since the mutex is now held during the function call. Signed-off-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>
2014-10-28[media] smiapp: Take valid link frequencies into account in supported mbus codesSakari Ailus1-8/+16
Some media bus codes may be unavailable depending on the available media bus codes. Signed-off-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>
2014-10-28[media] smiapp: Gather information on valid link rate and BPP combinationsSakari Ailus2-17/+60
Not all link rates are possible with all BPP values. Also rearrange other initialisation a little. Obtaining possible PLL configurations earlier requires that. Signed-off-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>
2014-10-28[media] smiapp: Split calculating PLL with sensor's limits from updating itSakari Ailus1-2/+9
The first one is handy for just trying out a PLL configuration without a need to apply it. Signed-off-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>
2014-10-28[media] smiapp: Use actual pixel rate calculated by the PLL calculatorSakari Ailus1-2/+2
Signed-off-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>
2014-10-28[media] smiapp-pll: Add pixel rate in pixel array as output parametersSakari Ailus2-0/+2
The actual pixel array pixel rate may be something else than vt_pix_clk_freq on some implementations. Add a new field which contains the corrected value. Signed-off-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>
2014-10-28[media] smiapp: Remove validation of op_pix_clk_divSakari Ailus1-5/+0
op_pix_clk_div is directly assigned and not calculated. There's no need to verify it. Signed-off-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>
2014-10-28[media] smiapp: The PLL calculator handles sensors with VT clocks onlySakari Ailus1-10/+0
No need to pretend the OP limits are there anymore. Signed-off-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>
2014-10-28[media] smiapp-pll: Don't validate OP clocks if there are noneSakari Ailus1-0/+8
For profile 0 sensors (which have no OP clocks), the OP limits are in fact VT limits. Do not verify them again. Signed-off-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>
2014-10-28[media] smiapp-pll: Calculate OP clocks only for sensors that have themSakari Ailus1-30/+52
Profile 0 sensors have no OP clock branck in the clock tree. The PLL calculator still calculated them, they just weren't used for anything. Signed-off-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>
2014-10-28[media] smiapp-pll: Unify OP and VT PLL structsSakari Ailus3-46/+46
Uniform representation for VT and OP clocks. This is preparation for calculating the VT clocks using the OP clock code. Signed-off-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>
2014-10-28[media] smiapp-pll: External clock frequency isn't an output valueSakari Ailus1-1/+1
It's input. Move it elsewhere in the struct. Signed-off-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>
2014-10-28[media] smiapp-pll: Separate bounds checking into a separate functionSakari Ailus1-51/+59
Enough work for this function already. Signed-off-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>
2014-10-28[media] smiapp-pll: The clock tree values are unsigned --- fix debug printsSakari Ailus1-47/+47
These values are unsigned, so use %u instead of %d. Signed-off-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>
2014-10-28[media] smiapp-pll: Correct clock debug printsSakari Ailus1-2/+2
The PLL flags were not used correctly. Cc: stable@vger.kernel.org Signed-off-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>
2014-10-28[media] smiapp: Take mutex during PLL update in sensor initialisationSakari Ailus1-0/+2
The mutex does not serialise anything in this case but avoids a lockdep warning from the control framework. Cc: stable@vger.kernel.org Signed-off-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>
2014-10-09Merge branch 'patchwork' into v4l_for_linusMauro Carvalho Chehab16-102/+131
* patchwork: (544 commits) [media] ir-hix5hd2: fix build on c6x arch [media] pt3: fix DTV FE I2C driver load error paths Revert "[media] media: em28xx - remove reset_resume interface" [media] exynos4-is: fix some warnings when compiling on arm64 [media] usb drivers: use %zu instead of %zd [media] pci drivers: use %zu instead of %zd [media] dvb-frontends: use %zu instead of %zd [media] s5p-mfc: Fix several printk warnings [media] s5p_mfc_opr: Fix warnings [media] ti-vpe: Fix typecast [media] s3c-camif: fix dma_addr_t printks [media] s5p_mfc_opr_v6: get rid of warnings when compiled with 64 bits [media] s5p_mfc_opr_v5: Fix lots of warnings on x86_64 [media] em28xx: Fix identation [media] drxd: remove a dead code [media] saa7146: remove return after BUG() [media] cx88: remove return after BUG() [media] cx88: fix cards table CodingStyle [media] radio-sf16fmr2: declare some structs as static [media] radio-sf16fmi: declare pnp_attached as static ... Conflicts: Documentation/DocBook/media/v4l/compat.xml
2014-09-21[media] adv7604: fix inverted conditionHans Verkuil1-1/+1
The log_status function should show HDMI information, but the test checking for an HDMI input was inverted. Fix this. 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>
2014-09-21[media] adv7604/adv7842: fix il_vbackporch typo and zero the structHans Verkuil2-2/+4
Both adv7604 and adv7842 had the same typo in the code that sets the vertical backporch for the second interlaced field: it was assigned to vbackporch instead of il_vbackporch. In addition, the timings struct wasn't zeroed in the adv7842 driver, leaving several fields to undefined values causing the timing match function to fail. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-21[media] drivers: media: i2c: adv7343_regs.h: Fix typo in #ifndefRasmus Villemoes1-1/+1
Test for definedness of the macro which is actually defined, and which matches the name of the file. Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-21[media] tvp7002: Don't update device->streaming if write to register failsAxel Lin1-13/+8
This ensures device->streaming has correct status. Signed-off-by: Axel Lin <axel.lin@ingics.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-09-21Merge remote-tracking branch 'linus/master' into patchworkMauro Carvalho Chehab1-10/+3
There are some patches that depends on media-v3.16-rc6. So, merge back from upstream before applying them. * linus/master: (1123 commits) drm/nouveau: ltc/gf100-: fix cbc issues on certain boards drm/bochs: add missing drm_connector_register call drm/cirrus: add missing drm_connector_register call staging: vt6655: buffer overflow in ioctl USB: storage: Add quirks for Entrega/Xircom USB to SCSI converters USB: storage: Add quirk for Ariston Technologies iConnect USB to SCSI adapter USB: storage: Add quirk for Adaptec USBConnect 2000 USB-to-SCSI Adapter USB: EHCI: unlink QHs even after the controller has stopped [SCSI] fix for bidi use after free [SCSI] fix regression that accidentally disabled block-based tcq [SCSI] libiscsi: fix potential buffer overrun in __iscsi_conn_send_pdu drm/radeon: Fix typo 'addr' -> 'entry' in rs400_gart_set_page drm/nouveau/runpm: fix module unload drm/radeon/px: fix module unload vgaswitcheroo: add vga_switcheroo_fini_domain_pm_ops drm/radeon: don't reset dma on r6xx-evergreen init drm/radeon: don't reset sdma on CIK init drm/radeon: don't reset dma on NI/SI init drm/radeon/dpm: fix resume on mullins drm/radeon: Disable HDP flush before every CS again for < r600 ...
2014-09-03[media] lm3560: simplify boolean testsMauro Carvalho Chehab1-2/+2
Instead of using if (on == true), just use if (on). That allows a faster mental parsing when analyzing the code. Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-03[media] ov9740: use true/false for boolean varsMauro Carvalho Chehab1-2/+2
Instead of using 0 or 1 for boolean, use the true/false defines. Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-03[media] smiapp-core: use true/false for boolean varsMauro Carvalho Chehab1-4/+4
Instead of using 0 or 1 for boolean, use the true/false defines. Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-03[media] s5k5baf: remove an uneeded semicolonMauro Carvalho Chehab1-1/+1
We don't use semicolons after curly braces in the middle of the code. Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-03[media] smiapp: Set sub-device ownerSakari Ailus1-1/+1
The smiapp driver is the owner of the sub-devices exposed by the smiapp driver. This prevents unloading the module whilst it's in use. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-03[media] smiapp: Fix power count handlingSakari Ailus1-9/+2
The sensor may be powered by either one of its sub-devices being accessed from the user space (an open file handle) or by its s_power() op being called with non-zero on argument. The driver counts the users and if any reason to keep the device powered exists it will be powered. However, a faulty condition was used in recognising the need to power off the sensor, leading it to be powered off every time any of its uses went away. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-08-21[media] tda7432: Fix setting TDA7432_MUTE bit for TDA7432_RF registerAxel Lin1-1/+1
Fix a copy-paste bug when converting to the control framework. Fixes: commit 5d478e0de871 ("[media] tda7432: convert to the control framework") Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-08-21[media] soc_camera: ov772x: Include media/v4l2-image-sizes.hAxel Lin1-4/+1
So we can remove the same defines in the driver code. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-08-21[media] soc_camera: mt9t112: Include media/v4l2-image-sizes.hAxel Lin1-3/+1
So we can remove the same defines in the driver code. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-08-21[media] vs6624: Include media/v4l2-image-sizes.hAxel Lin1-13/+1
So we can remove the same defines in the driver code. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-08-21[media] ov7670: Include media/v4l2-image-sizes.hAxel Lin1-13/+1
So we can remove the same defines in the driver code. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-08-21[media] saa6752hs: Convert to devm_kzalloc()Axel Lin1-3/+3
Using the managed function the kfree() calls can be removed from the probe error path and the remove handler. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-08-21[media] cx25840: Spelling s/compuations/computations/Geert Uytterhoeven1-1/+1
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-08-21[media] smiapp: Set 64-bit integer control using v4l2_ctrl_s_ctrl_int64()Sakari Ailus1-2/+7
Don't manipulate struct v4l2_ctrl directly. Instead, use v4l2_ctrl_s_ctrl_int64() to change the values. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-08-21[media] smiapp: Use unlocked __v4l2_ctrl_modify_range()Sakari Ailus1-32/+15
Instead of modifying the control ranges directly by manipulating struct v4l2_ctrl, use __v4l2_ctrl_modify_range() for the purpose. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-08-21[media] smiapp: Implement the test pattern controlSakari Ailus2-5/+78
Add support for the V4L2_CID_TEST_PATTERN control. When the solid colour mode is selected, additional controls become available for setting the solid four solid colour components. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Acked-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>
2014-07-30[media] media: mt9m111: add device-tree suppportRobert Jarzmik1-0/+12
Add device-tree support for mt9m111 camera sensor. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-25[media] rc-core: remove protocol arraysDavid Härdeman1-2/+2
The basic API of rc-core used to be: dev = rc_allocate_device(); dev->x = a; dev->y = b; dev->z = c; rc_register_device(); which is a pretty common pattern in the kernel, after the introduction of protocol arrays the API looks something like: dev = rc_allocate_device(); dev->x = a; rc_set_allowed_protocols(dev, RC_BIT_X); dev->z = c; rc_register_device(); There's no real need for the protocols to be an array, so change it back to be consistent (and in preparation for the following patches). [m.chehab@samsung.com: added missing changes at some files] Signed-off-by: David Härdeman <david@hardeman.nu> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-23[media] rc-core: document the protocol typeDavid Härdeman1-2/+3
Right now the protocol information is not preserved, rc-core gets handed a scancode but has no idea which protocol it corresponds to. This patch (which required reading through the source/keymap for all drivers, not fun) makes the protocol information explicit which is important documentation and makes it easier to e.g. support multiple protocols with one decoder (think rc5 and rc-streamzap). The information isn't used yet so there should be no functional changes. [m.chehab@samsung.com: rebased, added cxusb and removed bad whitespacing] Signed-off-by: David Härdeman <david@hardeman.nu> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-23[media] rc-core: improve ir-kbd-i2c get_key functionsDavid Härdeman1-45/+45
The arguments used for ir-kbd-i2c's get_key() functions are not really suited for rc-core and the ir_raw/ir_key distinction is just confusing. Convert all of them to return a protocol/scancode/toggle triple instead. Signed-off-by: David Härdeman <david@hardeman.nu> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-22[media] tvp5150: Use i2c_smbus_(read|write)_byte_dataLaurent Pinchart1-20/+11
X-Patchwork-Delegate: mchehab@redhat.com Replace the custom I2C read/write implementation with SMBUS functions to simplify the driver. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-22[media] tvp5150: Fix device ID kernel log messageLaurent Pinchart1-2/+2
X-Patchwork-Delegate: mchehab@redhat.com The driver mistakenly prints the ROM version instead of the device ID to the kernel log when detecting the chip. Fix it. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-22[media] v4l: smiapp: Return V4L2_FIELD_NONE from pad-level get/set formatLaurent Pinchart1-0/+3
The SMIA++ sensors are progressive, always return the field order set to V4L2_FIELD_NONE. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-22[media] v4l: s5k6a3: Return V4L2_FIELD_NONE from pad-level set formatLaurent Pinchart1-0/+1
The sensor is progressive, always return the field order set to V4L2_FIELD_NONE. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-22[media] v4l: s5k5baf: Return V4L2_FIELD_NONE from pad-level set formatLaurent Pinchart1-0/+2
The sensor is progressive, always return the field order set to V4L2_FIELD_NONE. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-22[media] v4l: s5k4ecgx: Return V4L2_FIELD_NONE from pad-level set formatLaurent Pinchart1-0/+1
The sensor is progressive, always return the field order set to V4L2_FIELD_NONE. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>