summaryrefslogtreecommitdiff
path: root/drivers/media/video/mt9t031.c
AgeCommit message (Collapse)Author
2011-07-27[media] V4L: soc-camera: remove soc-camera bus and devices on itGuennadi Liakhovetski
Now that v4l2 subdevices have got their own device objects, having one more device in soc-camera clients became redundant and confusing. This patch removes those devices and the soc-camera bus, they used to reside on. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Acked-by: Paul Mundt <lethal@linux-sh.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29[media] media: video: do not clear 'driver' from an i2c_clientWolfram Sang
The i2c-core does this already. Reported-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21V4L/DVB: v4l: Use v4l2_get_subdevdata instead of accessing v4l2_subdev::privLaurent Pinchart
Replace direct access to the v4l2_subdev priv field with the inline v4l2_get_subdevdata method. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-06-04Merge branch 'v4l_for_2.6.35' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6 * 'v4l_for_2.6.35' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (87 commits) V4L/DVB: ivtv: Timing tweaks and code re-order to try and improve stability V4L/DVB: ivtv: Avoid accidental video standard change V4L/DVB: ivtvfb : Module load / unload fixes V4L/DVB: cx2341x: Report correct temporal setting for log-status V4L/DVB: cx18, cx23885, v4l2 doc, MAINTAINERS: Update Andy Walls' email address V4L/DVB: drivers/media: Eliminate a NULL pointer dereference V4L/DVB: dvb-core: Fix ULE decapsulation bug V4L/DVB: Bug fix: make IR work again for dm1105 V4L/DVB: media/IR: nec-decoder needs to select BITREV V4L/DVB: video/saa7134: change dprintk() to i2cdprintk() V4L/DVB: video/saa7134: remove duplicate break V4L/DVB: IR/imon: add auto-config for 0xffdc rf device V4L/DVB: IR/imon: clean up usage of bools V4L/DVB: em28xx: remove unneeded null checks V4L/DVB: ngene: remove unused #include <linux/version.h> V4L/DVB: ak881x needs slab.h V4L/DVB: FusionHDTV: Use quick reads for I2C IR device probing V4L/DVB: Technotrend S2-3200 ships with a TT 1500 remote V4L/DVB: drivers/media: Use kzalloc V4L/DVB: m920x: Select simple tuner ...
2010-06-03i2c: Remove all i2c_set_clientdata(client, NULL) in driversWolfram Sang
I2C drivers can use the clientdata-pointer to point to private data. As I2C devices are not really unregistered, but merely detached from their driver, it used to be the drivers obligation to clear this pointer during remove() or a failed probe(). As a couple of drivers forgot to do this, it was agreed that it was cleaner if the i2c-core does this clearance when appropriate, as there is no guarantee for the lifetime of the clientdata-pointer after remove() anyhow. This feature was added to the core with commit e4a7b9b04de15f6b63da5ccdd373ffa3057a3681 to fix the faulty drivers. As there is no need anymore to clear the clientdata-pointer, remove all current occurrences in the drivers to simplify the code and prevent confusion. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Acked-by: Richard Purdie <rpurdie@linux.intel.com> Acked-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-06-01V4L/DVB: v4l2-subdev.h: fix enum_mbus_fmt prototypeHans Verkuil
enum_mbus_fmt received an index argument that was defined as an int instead of an unsigned int. This is now fixed. This had the knock-on effect that the index argument in the callback get_formats in soc_camera.h also had to be changed to unsigned int. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18V4L/DVB: mt9t031: use runtime pm support to restore ADDRESS_MODE registersValentin Longchamp
If the platform hooks are provided, soc_camera powers off the device on close and powers it on on open. This resets the ADDRESS_MODE registers which then can be different to the value the driver has computed for them. This patch setups runtime pm usage for mt9t031 and uses the resume function to write the ADDRESS_MODE registers in order to fix the above described problem. Signed-off-by: Valentin Longchamp <valentin.longchamp@epfl.ch> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-16V4L/DVB (13662): mt9t031: make the use of the soc-camera client API optionalGuennadi Liakhovetski
Now that we have moved most of the functions over to the v4l2-subdev API, only quering and setting bus parameters are still performed using the legacy soc-camera client API. Make the use of this API optional for mt9t031. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-16V4L/DVB (13659): soc-camera: convert to the new mediabus APIGuennadi Liakhovetski
Convert soc-camera core and all soc-camera drivers to the new mediabus API. This also takes soc-camera client drivers one step closer to also be usable with generic v4l2-subdev host drivers. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Acked-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-16V4L/DVB (13645): soc-camera: fix multi-line comment coding styleGuennadi Liakhovetski
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-16V4L/DVB (13644): v4l: add new v4l2-subdev sensor operations, use ↵Guennadi Liakhovetski
g_skip_top_lines in soc-camera Introduce new v4l2-subdev sensor operations, move .enum_framesizes() and .enum_frameintervals() methods to it, add a new .g_skip_top_lines() method and switch soc-camera to use it instead of .y_skip_top soc_camera_device member, which can now be removed. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl> Reviewed-by: Sergio Aguirre <saaguirre@ti.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-09-19V4L/DVB (12536): soc-camera: remove .gain and .exposure struct ↵Guennadi Liakhovetski
soc_camera_device members This makes the soc-camera interface for V4L2 subdevices thinner yet. Handle gain and exposure internally in each driver just like all other controls. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-09-19V4L/DVB (12535): soc-camera: remove .init() and .release() methods from ↵Guennadi Liakhovetski
struct soc_camera_ops Remove unneeded soc-camera operations, this also makes the soc-camera API to v4l2 subdevices thinner. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-09-19V4L/DVB (12534): soc-camera: V4L2 API compliant scaling (S_FMT) and cropping ↵Guennadi Liakhovetski
(S_CROP) The initial soc-camera scaling and cropping implementation turned out to be incompliant with the V4L2 API, e.g., it expected the user to specify cropping in output window pixels, instead of input window pixels. This patch converts the soc-camera core and all drivers to comply with the standard. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-09-19V4L/DVB (12531): soc-camera: Use I2C device for dev_{dbg,info,...} output in ↵Guennadi Liakhovetski
all clients Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-09-19V4L/DVB (12529): soc-camera: switch to s_crop v4l2-subdev video operationGuennadi Liakhovetski
Remove set_crop soc-camera device method and switch to s_crop from v4l2-subdev video operations. Also extend non-i2c drivers to also hold a pointer to their v4l2-subdev instance in control device driver-data, i.e., in dev_get_drvdata((struct device *)to_soc_camera_control(icd)) Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-09-19V4L/DVB (12517): mt9t031: improve rectangle placement in invalid S_CROPGuennadi Liakhovetski
1. soc-camera always requests a valid rectangle, when calling .s_fmt(), no need to check and adjust 2. in .s_crop(), if the rectangle exceeds sensor limits, push it to the respective border instead of centering 3. take into account left and top borders when checking Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-09-19V4L/DVB (12515): soc-camera: use struct v4l2_rect in struct soc_camera_deviceGuennadi Liakhovetski
Switch to using struct v4l2_rect in struct soc_camera_device for uniformity and simplicity. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-09-19V4L/DVB (12510): soc-camera: (partially) convert to v4l2-(sub)dev APIGuennadi Liakhovetski
Convert the soc-camera framework to use the v4l2-(sub)dev API. Start using v4l2-subdev operations. Only a part of the interface between the soc_camera core, soc_camera host drivers on one side and soc_camera device drivers on the other side is replaced so far. The rest of the interface will be replaced in incremental steps, and will require extensions and, possibly, modifications to the v4l2-subdev code. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-09-19V4L/DVB (12506): soc-camera: convert to platform deviceGuennadi Liakhovetski
Convert soc-camera core and all drivers to platform device API. We already converted platforms to register a platform device for each soc-camera client, now we remove the compatibility code and switch completely to the new scheme. This is a preparatory step for the v4l2-subdev conversion. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-23V4L/DVB (11910): mt9: Use v4l bounding/alignment functionTrent Piepho
The v4l function has a better algorithm for aligning image size. Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Trent Piepho <xyzzy@speakeasy.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16V4L/DVB (11610): soc-camera: simplify register access routines in multiple ↵Guennadi Liakhovetski
sensor drivers Register access routines only need the I2C client, not the soc-camera device context. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-04-06V4L/DVB (11347): mt9t031: use platform power hookGuennadi Liakhovetski
Use platform power hook to turn the camera on and off. Signed-off-by: Guennadi Liakhovetski <lg@denx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30V4L/DVB (11035): mt9t031 bugfixPhilippe Rétornaz
- The video device is not allocated when mt9t031_init() is called, don't use it in debug printk. - The clock polarity is inverted in mt9t031_set_bus_param(), use the correct one. Signed-off-by: Philippe Rétornaz <philippe.retornaz@epfl.ch> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30V4L/DVB (11024): soc-camera: separate S_FMT and S_CROP operationsGuennadi Liakhovetski
As host and camera drivers become more complex, differences between S_FMT and S_CROP functionality grow, this patch separates them. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30V4L/DVB (10673): mt9t031: fix gain and hflip controls, register update, and ↵Guennadi Liakhovetski
scaling Multiple fixes: 1. allow register update by setting the Output Control register to 2 and not 3 2. fix scaling factor calculations 3. recover lost HFLIP control 4. fix Global Gain calculation Signed-off-by: Guennadi Liakhovetski <lg@denx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-01-02V4L/DVB (10141): v4l2: debugging API changed to match against driver name ↵Hans Verkuil
instead of ID. Since the i2c driver ID will be removed in the near future we have to modify the v4l2 debugging API to use the driver name instead of driver ID. Note that this API is not used in applications other than v4l2-dbg.cpp as it is for debugging and testing only. Should anyone use the old VIDIOC_G_CHIP_IDENT, then this will be logged with a warning that it is deprecated and will be removed in 2.6.30. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30V4L/DVB (10099): soc-camera: add support for MT9T031 CMOS camera sensor from ↵Guennadi Liakhovetski
Micron This camera is rather similar to MT9M001, but also has a couple of enhanced features, like pixel binning. create mode 100644 drivers/media/video/mt9t031.c Signed-off-by: Guennadi Liakhovetski <lg@denx.de> Acked-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>