summaryrefslogtreecommitdiff
path: root/drivers/media/video/m5mols
AgeCommit message (Collapse)Author
2012-05-14[media] m5mols: Add 3A lock controlSylwester Nawrocki
Add control for locking automatic exposure, focus and white balance adjustments. While at it, tidy up the data structure documentation. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-14[media] m5mols: Add JPEG compression quality controlSylwester Nawrocki
Add JPEG compression quality control for snapshot capture. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-14[media] m5mols: Add exposure metering controlSylwester Nawrocki
This patch adds V4L2_CID_EXPOSURE_METERING control which allows to select the light metering mode for automatic exposure as one of the following modes: spot (small area at the frame center), center weighted and frame averaged. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-14[media] m5mols: Add image stabilization controlSylwester Nawrocki
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-14[media] m5mols: Add wide dynamic range controlSylwester Nawrocki
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-14[media] m5mols: Add exposure bias controlSylwester Nawrocki
Add integer menu control for exposure bias. The control value range is -2.0 EV to +2.0 EV, in 0.5 EV steps. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-14[media] m5mols: Add auto and preset white balance controlSylwester Nawrocki
Replace the V4L2_CID_AUTO_WHITE_BALANCE control with its extended version - V4L2_CID_AUTO_N_PRESET_WHITE_BALANCE so the white balance presets feature is exposed to user land. Acked-by: HeungJun Kim <riverful.kim@samsung.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-14[media] m5mols: Add ISO sensitivity controlsSylwester Nawrocki
Add controls for manual/auto ISO sensitivity. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-14[media] m5mols: Use proper sensor mode for the controlsSylwester Nawrocki
The parameters corresponding to the V4L controls can be reconfigured only in associated M-5MOLS operation mode. Use struct v4l2_ctrl priv field to assign the working mode to the controls which can be modified only in certain conditions. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-14[media] m5mols: Refactored controls handlingSylwester Nawrocki
This patch is a prerequisite for the new controls addition. It consolidates the control handling code, which is moved to m5mols_controls.c and staticized. The controls initialization is reordered to better reflect the control clusters and make the diffs smaller when new controls are added. To make the code easier to follow when more controls is added use separate set function for each control. Rewrite the image effect registers handling. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-14[media] m5mols: Convert macros to inline functionsSylwester Nawrocki
Make to_sd and to_m5mols macros static inline functions for better type safety. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08[media] convert drivers/media/* to use module_i2c_driver()Axel Lin
This patch converts the drivers in drivers/media/* to use the module_i2_driver() macro which makes the code smaller and a bit simpler. Signed-off-by: Axel Lin <axel.lin@gmail.com> Cc: Kyungmin Park <kyungmin.park@samsung.com> Cc: Heungjun Kim <riverful.kim@samsung.com> Cc: Joonyoung Shim <jy0922.shim@samsung.com> Cc: Andrew Chew <achew@nvidia.com> Cc: Paul Mundt <lethal@linux-sh.org> Cc: Michael Grzeschik <m.grzeschik@pengutronix.de> Cc: Johannes Obermaier <johannes.obermaier@gmail.com> Cc: Steven Toth <stoth@kernellabs.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Acked-by: Tomasz Stanislawski <t.stanislaws@samsung.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com> Acked-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08[media] m5mols: Make subdev name independent of the I2C slave addressSylwester Nawrocki
Initialize the subdev name properly so it doesn't have an I2C bus and slave address appended to it. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-12-30[media] m5mols: Enable v4l subdev device nodeSylwester Nawrocki
Set V4L2_SUBDEV_FL_HAS_DEVNODE flag for the host driver to create the sensor device node. Acked-by: HeungJun Kim <riverful.kim@samsung.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-12-30[media] m5mols: Change auto exposure control default value to AUTOSylwester Nawrocki
Enabling automatic exposure yields better image quality. With this setting the anti-flicker algorithm is also enabled in automatic frequency detection mode which effectively eliminates distortion from fluctuations of light intensity at power line frequency. Acked-by: HeungJun Kim <riverful.kim@samsung.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-12-30[media] m5mols: Do not reset the configured pixel format when unexpectedSylwester Nawrocki
Initialize default pixel format in driver probe() rather than in s_power handler. This also prevents resetting the configuration applied before the device was powered on. Acked-by: HeungJun Kim <riverful.kim@samsung.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-12-30[media] m5mols: Move the control handler initialization to probe()Sylwester Nawrocki
This is prerequisite for enabling the sub-device node. The control handler is now initialized in driver's probe callback in order to allow the user space access controls before the device power is enabled with s_power. This is needed due to s_power being currently called only by the host driver. It also adds the subdev internal operations, only open() for now for the TRY format initialization. Acked-by: HeungJun Kim <riverful.kim@samsung.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-12-30[media] m5mols: Don't ignore v4l2_ctrl_handler_setup() return valueSylwester Nawrocki
v4l2_ctrl_handler_setup() may fail so check its return value when restoring controls after device is powered on. While at it simplify the m5mols_restore_function() a bit. Acked-by: HeungJun Kim <riverful.kim@samsung.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-12-30[media] m5mols: Change the end of frame v4l2_subdev notification idSylwester Nawrocki
Change the v4l2_device notifications id to S5P_FIMC_TX_END_NOTIFY. Moreover, when frame capture fails, send an 'end of frame' notification with size set to 0 to let the host driver return a buffer back to the user and prevent applications waiting forever on DQBUF. The notification is needed only for the s5p-fimc driver. Acked-by: HeungJun Kim <riverful.kim@samsung.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-12-30[media] m5mols: Optimize the capture set up sequenceHeungJun Kim
Improve the single frame capture set up sequence. Since there is no need to re-enable the interrupts in each capture sequence, unmask the required interrupts once at the device initialization time. Signed-off-by: HeungJun Kim <riverful.kim@samsung.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-12-30[media] m5mols: Add support for the system initialization interruptHeungJun Kim
The M-5MOLS internal controller's initialization time depends on the hardware and firmware revision. Currently the driver just waits for worst case time period, after applying the voltage supplies, for the device to be ready. The M-5MOLS supports "System initialization" interrupt which is triggered after the controller finished booting. So use this interrupt to optimize the initialization sequence. After the voltage supplies are applied the I2C communication will fail, until the internal controller initializes to Flash Writer state. For the period when the I2C is not accessible use the isp_ready flag to suppress the error logs. Signed-off-by: HeungJun Kim <riverful.kim@samsung.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-12-30[media] m5mols: Remove mode_save field from struct m5mols_infoSylwester Nawrocki
There is no need to keep this in the drivers' private data structure, an on the stack variable is enough. Also simplify a bit the ISP state switching function. Acked-by: HeungJun Kim <riverful.kim@samsung.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-12-30[media] m5mols: Improve the interrupt handling routinesHeungJun Kim
The work struct based interrupt handling is not flexible enough as the M-5MOLS control sequence involves I2C access sequences before and after an interrupt is generated. A single waitqueue is enough for the job so remove the work struct based code. Signed-off-by: HeungJun Kim <riverful.kim@samsung.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-12-30[media] m5mols: Extend the busy wait helperHeungJun Kim
Make m5mols_busy_wait function jiffies based rather than relying on some fixed number of I2C read iterations while busy waiting for the device to execute a request. With fixed number of iterations we may be getting different wait times, depending on the I2C speed. In some conditions we have to wait even if the I2C communications fails, in those cases M5MOLS_I2C_RDY_WAIT_MASK should be passed as the mask argument to m5mols_busy_wait(). Signed-off-by: HeungJun Kim <riverful.kim@samsung.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-12-30[media] m5mols: Simplify the I2C registers definitionSylwester Nawrocki
The redundant definitions of the m5mols I2C register addresses within the pages (categories) are removed. In place of symbolic definitions plain numbers are used which simplifies the code and eases identifying the registers in the documentation. Also make the m5mols_busy() function accept I2C_REG() value as a register address, like all other functions, rather than using the category and command values. Acked-by: HeungJun Kim <riverful.kim@samsung.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-12-20Merge branch 'v4l_for_linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media * 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (31 commits) Revert "[media] af9015: limit I2C access to keep FW happy" [media] s5p-fimc: Fix camera input configuration in subdev operations [media] m5mols: Fix logic in sanity check [media] ati_remote: switch to single-byte scancodes [media] V4L: mt9m111: fix uninitialised mutex [media] V4L: omap1_camera: fix missing <linux/module.h> include [media] V4L: mt9t112: use after free in mt9t112_probe() [media] V4L: soc-camera: fix compiler warnings on 64-bit platforms [media] s5p_mfc_enc: fix s/H264/H263/ typo [media] omap_vout: Fix compile error in 3.1 [media] au0828: add missing models 72101, 72201 & 72261 to the model matrix [media] au0828: add missing USB ID 2040:7213 [media] au0828: add missing USB ID 2040:7260 [media] [trivial] omap24xxcam-dma: Fix logical test [media] omap_vout: fix crash if no driver for a display [media] media: video: s5p-tv: fix build break [media] omap3isp: fix compilation of ispvideo.c [media] m5mols: Fix set_fmt to return proper pixel format code [media] s5p-fimc: Use correct fourcc for RGB565 colour format [media] s5p-fimc: Fail driver probing when sensor configuration is wrong ...
2011-12-11[media] m5mols: Fix logic in sanity checkThomas Jarosch
Detected by "cppcheck". Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-11-24[media] m5mols: Fix set_fmt to return proper pixel format codeSylwester Nawrocki
In case pixel format is modified in set_fmt by the driver, the changes are not propagated back to the caller. Fix this by adjusting passed data for TRY and ACTIVE format. Also remove redundant pixel format code information from struct m5mols_info, it's already available in 'ffmt' array. Remove pad number validation in set/get_fmt, this is already done in the core. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Acked-by: HeungJun Kim <riverful.kim@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-11-06Merge branch 'modsplit-Oct31_2011' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux * 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux: (230 commits) Revert "tracing: Include module.h in define_trace.h" irq: don't put module.h into irq.h for tracking irqgen modules. bluetooth: macroize two small inlines to avoid module.h ip_vs.h: fix implicit use of module_get/module_put from module.h nf_conntrack.h: fix up fallout from implicit moduleparam.h presence include: replace linux/module.h with "struct module" wherever possible include: convert various register fcns to macros to avoid include chaining crypto.h: remove unused crypto_tfm_alg_modname() inline uwb.h: fix implicit use of asm/page.h for PAGE_SIZE pm_runtime.h: explicitly requires notifier.h linux/dmaengine.h: fix implicit use of bitmap.h and asm/page.h miscdevice.h: fix up implicit use of lists and types stop_machine.h: fix implicit use of smp.h for smp_processor_id of: fix implicit use of errno.h in include/linux/of.h of_platform.h: delete needless include <linux/module.h> acpi: remove module.h include from platform/aclinux.h miscdevice.h: delete unnecessary inclusion of module.h device_cgroup.h: delete needless include <linux/module.h> net: sch_generic remove redundant use of <linux/module.h> net: inet_timewait_sock doesnt need <linux/module.h> ... Fix up trivial conflicts (other header files, and removal of the ab3550 mfd driver) in - drivers/media/dvb/frontends/dibx000_common.c - drivers/media/video/{mt9m111.c,ov6650.c} - drivers/mfd/ab3550-core.c - include/linux/dmaengine.h
2011-10-31drivers/media: Add module.h to all files using it implicitlyPaul Gortmaker
A pending cleanup will mean that module.h won't be implicitly everywhere anymore. Make sure the modular drivers in clocksource are actually calling out for <module.h> explicitly in advance. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2011-09-24[media] m5mols: Remove superfluous irq field from the platform data structSylwester Nawrocki
There is no need to put the IRQ number in driver's private platform data structure as this can also be passed in struct i2c_lient.irq. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] Stop using linux/version.h on the remaining video driversMauro Carvalho Chehab
Standardize the remaining video drivers to return the API version for the VIDIOC_QUERYCAP version, instead of a per-driver version. Those drivers had the version updated more recently or are SoC drivers. Even so, it doesn't sound a good idea to keep a per-driver version control, so, let's use the per-subsystem version control instead. Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-06-11[media] m5mols: Use proper email address formatHeungJun, Kim
Signed-off-by: HeungJun, Kim <riverful.kim@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-06-11[media] m5mols: remove union in the m5mols_get_version(), and VERSION_SIZEHeungJun, Kim
Remove union version in the m5mols_get_version(), and read version information directly. Also remove VERSION_SIZE. Signed-off-by: HeungJun, Kim <riverful.kim@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Acked-by: Sakari Ailus <sakari.ailus@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-06-11[media] m5mols: add m5mols_read_u8/u16/u32() according to I2C byte widthHeungJun, Kim
For now, the m5mols_read() share in case of I2C packet 1, 2, 4 byte(s) width. So, this commit adds 3 functions - m5mols_read_u8/u16/u32() according to byte width of I2C packet. And, the u32 variables in spite of u8 or u16 for fitting to m5mols_read() having no choice, is replaced to have original byte width like u8, u16, u32 as same reason. Signed-off-by: HeungJun, Kim <riverful.kim@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-06-11[media] m5mols: Fix capture image size register definitionHeungJun, Kim
The main capture and the thumbnail image size registers were erroneously defined to have 1 byte width, resulting in wrong reported image size. Fix this by changing the registers width to correct value. Reported-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: HeungJun, Kim <riverful.kim@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-05-25[media] Add support for M-5MOLS 8 Mega Pixel camera ISPHeungJun, Kim
Add I2C/V4L2 subdev driver for M-5MOLS integrated image signal processor with 8 Mega Pixel sensor. Signed-off-by: HeungJun, Kim <riverful.kim@samsung.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>