dect
/
linux-2.6
Archived
13
0
Fork 0
Commit Graph

67802 Commits

Author SHA1 Message Date
Andre Noll ac5e7113e7 md: Push down data integrity code to personalities.
This patch replaces md_integrity_check() by two new public functions:
md_integrity_register() and md_integrity_add_rdev() which are both
personality-independent.

md_integrity_register() is called from the ->run and ->hot_remove
methods of all personalities that support data integrity.  The
function iterates over the component devices of the array and
determines if all active devices are integrity capable and if their
profiles match. If this is the case, the common profile is registered
for the mddev via blk_integrity_register().

The second new function, md_integrity_add_rdev() is called from the
->hot_add_disk methods, i.e. whenever a new device is being added
to a raid array. If the new device does not support data integrity,
or has a profile different from the one already registered, data
integrity for the mddev is disabled.

For raid0 and linear, only the call to md_integrity_register() from
the ->run method is necessary.

Signed-off-by: Andre Noll <maan@systemlinux.org>
Signed-off-by: NeilBrown <neilb@suse.de>
2009-08-03 10:59:47 +10:00
Dan Williams 95fc17aac4 md/raid6: release spare page at ->stop()
Add missing call to safe_put_page from stop() by unifying open coded
raid5_conf_t de-allocation under free_conf().

Cc: <stable@kernel.org>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2009-07-31 12:39:15 +10:00
Linus Torvalds 7d3e91b8a1 Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging
* 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
  hwmon: (asus_atk0110) Fix upper limit readings
  hwmon: (smsc47m1) Differentiate between LPC47M233 and LPC47M292
2009-07-28 14:31:13 -07:00
Linus Torvalds ddb1d4ede9 Merge branch 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging
* 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
  i2c/tsl2550: Fix lux value in dark environment
2009-07-28 14:31:02 -07:00
Andreas Eversberg ce4adcc6e5 mISDN: Fix handling of receive buffer size in L1oIP
The size of receive buffer pointer was used to get size of
receive buffer instead of recvbuf_size itself, so only 4/8
bytes could be transfered.

This is a regression to 2.6.30 introduced by commit
8c90e11e35 ("mISDN: Use
kernel_{send,recv}msg instead of open coding")

Signed-off-by: Andreas Eversberg <andreas@eversberg.eu>
Signed-off-by: Karsten Keil <keil@b1-systems.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-07-28 14:26:51 -07:00
Michele Jr De Candia 96f699ad09 i2c/tsl2550: Fix lux value in dark environment
I've tested TSL2550 driver and I've found a bug: when light is off, 
returned value from tsl2550_calculate_lux function is -1 when it should 
be 0 (sensor correctly read that light was off).

I think the bug is that a zero c0 value (approximated value of ch0) is 
misinterpreted as an error. 

Signed-off-by: Michele Jr De Candia <michele.decandia@valueteam.com>
Acked-by: Rodolfo Giometti <giometti@linux.it>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-07-28 16:33:03 +02:00
Luca Tettamanti 8d282497cb hwmon: (asus_atk0110) Fix upper limit readings
On newer Asus boards the "upper" limit of a sensor is encoded as
delta from the "lower" limit. Fix the driver to correctly handle
this case.

Signed-off-by: Luca Tettamanti <kronos.it@gmail.com>
Tested-by: Alex Macfarlane Smith <nospam@archifishal.co.uk>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-07-28 16:31:39 +02:00
Jean Delvare 1b54ab450b hwmon: (smsc47m1) Differentiate between LPC47M233 and LPC47M292
The SMSC LPC47M233 and LPC47M292 chips have the same device ID but
are not compatible.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Juerg Haefliger <juergh@gmail.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
2009-07-28 16:31:39 +02:00
Alan Cox c56d300086 usb_serial: Fix remaining ref count/lock bugs
This fixes
- locking bug that was hidden by ecc2e05e73
- Regression #13821
- Spurious warning when closing and blocking for data write out

With these changes my PL2303 always ends up as ttyUSB0 when it should and
the module refcounts stay correct.

I'll do a more wholesale split & tidy of _open in the next release or two
as we get a standard tty_port_open and port->ops->init port->ops->shutdown
call backs.

Copy sent to Alan Stern and Carlos Mafra just to confirm it fixes all the
reports but it passes local testing with the same hardware as Alan Stern.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-07-27 17:26:23 -07:00
Alan Cox 3a54297478 pty: quickfix for the pty ENXIO timing problems
This also makes close stall in the normal case which is apparently
needed to fix emacs

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-07-27 15:53:29 -07:00
Linus Torvalds f1462147f1 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (45 commits)
  cnic: Fix ISCSI_KEVENT_IF_DOWN message handling.
  net: irda: init spinlock after memcpy
  ixgbe: fix for 82599 errata marking UDP checksum errors
  r8169: WakeOnLan fix for the 8168
  netxen: reset ring consumer during cleanup
  net/bridge: use kobject_put to release kobject in br_add_if error path
  smc91x.h: add config for Nomadik evaluation kit
  NET: ROSE: Don't use static buffer.
  eepro: Read buffer overflow
  tokenring: Read buffer overflow
  at1700: Read buffer overflow
  fealnx: Write outside array bounds
  ixgbe: remove unnecessary call to device_init_wakeup
  ixgbe: Don't priority tag control frames in DCB mode
  ixgbe: Enable FCoE offload when DCB is enabled for 82599
  net: Rework mdio-ofgpio driver to use of_mdio infrastructure
  register at91_ether using platform_driver_probe
  skge: Enable WoL by default if supported
  net: KS8851 needs to depend on MII
  be2net: Bug fix in the non-lro path. Size of received packet was not updated in statistics properly.
  ...
2009-07-27 13:42:47 -07:00
Linus Torvalds e00b95debb Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp:
  amd64_edac: read the right F2 maskoffset reg
2009-07-27 12:23:47 -07:00
Alan Cox b68f2fb9e7 tty: Fix a USB serial crash/scribble
The port lock is used to protect the port state. However the port structure
is freed on a hangup, then the lock taken on a close. The right fix is to
drop the port on tty->shutdown() but we can't yet do that due to sleep v
non-sleeping rules. Instead do the next best thing and fix it up when we are
not in -rc season.

Reported-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Tested-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-07-27 12:23:22 -07:00
Linus Torvalds 04fc0a4097 Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (34 commits)
  V4L/DVB (12303): cx23885: check pointers before dereferencing in dprintk macro
  V4L/DVB (12302): cx23885-417: fix broken IOCTL handling
  V4L/DVB (12300): bttv: fix regression: tvaudio must be loaded before tuner
  V4L/DVB (12291): b2c2: fix frontends compiled into kernel
  V4L/DVB (12286): sn9c20x: reorder includes to be like other drivers
  V4L/DVB (12284): gspca - jpeg subdrivers: Check the result of kmalloc(jpeg header).
  V4L/DVB (12283): gspca - sn9c20x: New subdriver for sn9c201 and sn9c202 bridges.
  V4L/DVB (12282): gspca - main: Support for vidioc_g_chip_ident and vidioc_g/s_register.
  V4L/DVB (12269): af9013: auto-detect parameters in case of garbage given by app
  V4L/DVB (12267): gspca - sonixj: Bad sensor init of non ov76xx sensors.
  V4L/DVB (12265): em28xx: fix tuning problem in HVR-900 (R1)
  V4L/DVB (12263): em28xx: set demod profile for Pinnacle Hybrid Pro 320e
  V4L/DVB (12262): em28xx: Make sure the tuner is initialized if generic empia USB id was used
  V4L/DVB (12261): em28xx: set GPIO properly for Pinnacle Hybrid Pro analog support
  V4L/DVB (12260): em28xx: make support work for the Pinnacle Hybrid Pro (eb1a:2881)
  V4L/DVB (12258): em28xx: fix typo in mt352 init sequence for Terratec Cinergy T XS USB
  V4L/DVB (12257): em28xx: make tuning work for Terratec Cinergy T XS USB (mt352 variant)
  V4L/DVB (12245): em28xx: add support for mt9m001 webcams
  V4L/DVB (12244): em28xx: adjust vinmode/vinctl based on the stream input format
  V4L/DVB (12243): em28xx: allow specifying sensor xtal frequency
  ...
2009-07-27 12:16:57 -07:00
Linus Torvalds 760dcc6e18 Merge branch 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6
* 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6:
  [S390] zcrypt: fix scheduling of hrtimer ap_poll_timer
  [S390] vdso: clock_gettime of CLOCK_THREAD_CPUTIME_ID with noexec=on
  [S390] vdso: fix per cpu area allocation
  [S390] hibernation: fix register corruption on machine checks
  [S390] hibernation: fix lowcore handling
2009-07-27 12:16:38 -07:00
Michael Chan 6d7760a88c cnic: Fix ISCSI_KEVENT_IF_DOWN message handling.
When a net device goes down or when the bnx2i driver is unloaded,
the code was not generating the ISCSI_KEVENT_IF_DOWN message
properly and this could cause the userspace driver to crash.

This is fixed by sending the message properly in the shutdown path.
cnic_uio_stop() is also added to send the message when bnx2i is
unregistering.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-07-27 11:25:58 -07:00
Wan Wei 4afcd2dcc6 amd64_edac: read the right F2 maskoffset reg
Signed-off-by: Wan Wei <onewayforever@gmail.com>
Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
2009-07-27 14:42:24 +02:00
Don Skidmore 8bae1b2b13 ixgbe: fix for 82599 errata marking UDP checksum errors
There is an 82599 errata that UDP frames with a zero checksum are
incorrectly marked as checksum invalid by the hardware.  This was
leading to misleading hw_csum_rx_error counts. This patch adds a
test around this counter increase for this condition.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-07-26 20:20:47 -07:00
françois romieu ca52efd549 r8169: WakeOnLan fix for the 8168
More stuff for http://bugzilla.kernel.org/show_bug.cgi?id=9512

Some 8168 are unable to WoL when receiving is not enabled (plain
old 8169 do not seem to care).

It is not exactly pretty to leave the receiver enabled but we
should now enable DMA late enough for it to be safe. Some late
stage boot failure due to pxe and friends may benefit from the
delayed enabling of bus-mastering as well.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Tested-by: Jaromír Cápík <tavvva@volny.cz>
Cc: Edward Hsu <edward_hsu@realtek.com.tw>
2009-07-26 20:18:52 -07:00
Dhananjay Phadke c8a5a658b8 netxen: reset ring consumer during cleanup
Reset consumer of status rings to 0 when cleaning
up sw resources. Status rings are not deleted
during suspend since they have napi objects.

This ensures correct rx processing across suspen-resume.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-07-26 20:17:21 -07:00
Alessandro Rubini 4a29f39642 smc91x.h: add config for Nomadik evaluation kit
Signed-off-by: Alessandro Rubini <rubini@unipv.it>
Acked-by: Andrea Gallo <andrea.gallo@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-07-26 19:15:07 -07:00
Roel Kluin d513d018e2 eepro: Read buffer overflow
io[i] is read before the bounds check on i, order should be reversed

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-07-26 18:53:17 -07:00
roel kluin c65d3198ad tokenring: Read buffer overflow
io[i] is read before the bounds check on i, order should be reversed

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-07-26 18:50:39 -07:00
roel kluin 3b73e79b0d at1700: Read buffer overflow
loop bound looks to be wrong, for an array of length 8

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-07-26 18:50:38 -07:00
roel kluin f83284fe20 fealnx: Write outside array bounds
phy_idx is checked to be < 4, but np->phys[] is 2 elements long

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-07-26 18:50:37 -07:00
Michael Krufky ca4e771f7b V4L/DVB (12303): cx23885: check pointers before dereferencing in dprintk macro
When enabling debug with v4l_debug set to 2 or greater, the driver
OOPS's on startup.  Checks dev pointer before dereferencing, in
order to prevent this OOPS.

Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-07-24 14:03:32 -03:00
Michael Krufky 12a34cc8a9 V4L/DVB (12302): cx23885-417: fix broken IOCTL handling
IOCTLS will never get handled if we dont connect
video_ioctl2 to mpeg_fops.ioctl

Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-07-24 14:03:32 -03:00
Hans Verkuil 2c90577841 V4L/DVB (12300): bttv: fix regression: tvaudio must be loaded before tuner
Both tvaudio and the tuner share i2c address 0x42. The tvaudio module can
check whether it really is a tda9840, but the tuner can't. So the tvaudio
module must be loaded before the tuner module. This was also the case for
2.6.29, but the order was swapped in 2.6.30.

Thanks to Krzysztof Grygiencz for reporting and testing this.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-07-24 14:03:31 -03:00
Trent Piepho 68b7f7616a V4L/DVB (12291): b2c2: fix frontends compiled into kernel
A recent patch didn't take into account that frontends can be compiled into
the kernel.  Or that frontends compiled as modules can't be used by the
b2c2 driver if it is not a module itself.

Some frontends require multiple drivers, e.g. a demod driver and a tuner
driver.  The code for the frontend support was getting added if the demod
driver was available.  Change this to also require any needed tuner or SEC
drivers as well.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-07-24 14:03:31 -03:00
Mauro Carvalho Chehab c15b95edb9 V4L/DVB (12286): sn9c20x: reorder includes to be like other drivers
This is not just pure cosmetic, since the order affects the out-of-tree
module build at the -hg development tree.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-07-24 14:03:31 -03:00
Julia Lawall 3eb0237d44 V4L/DVB (12284): gspca - jpeg subdrivers: Check the result of kmalloc(jpeg header).
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-07-24 14:03:30 -03:00
Brian Johnson 26e744b6b6 V4L/DVB (12283): gspca - sn9c20x: New subdriver for sn9c201 and sn9c202 bridges.
Signed-off-by: Brian Johnson <brijohn@gmail.com>
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-07-24 14:03:30 -03:00
Brian Johnson af1d9afa75 V4L/DVB (12282): gspca - main: Support for vidioc_g_chip_ident and vidioc_g/s_register.
Signed-off-by: Brian Johnson <brijohn@gmail.com>
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-07-24 14:03:30 -03:00
Antti Palosaari a2f5a8117c V4L/DVB (12269): af9013: auto-detect parameters in case of garbage given by app
Request demodulator auto-detect transmission parameters in case of
garbage parameters provided by application for compatibility.
That's needed at least for MPlayer compatibility currently.

Thanks to Jelle de Jong for reporting issue and providing SSH access to
Devin for debugging.

Thanks to Devin Heitmueller for hard debug work he did to find that bug.

Cc: Devin Heitmueller <dheitmueller@kernellabs.com>
Cc: Jelle de Jong <jelledejong@powercraft.nl>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-07-24 14:03:29 -03:00
Jean-Francois Moine 27954930f0 V4L/DVB (12267): gspca - sonixj: Bad sensor init of non ov76xx sensors.
The bug was introduced when adding the light frequency control

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-07-24 14:03:29 -03:00
Devin Heitmueller a84f79aed6 V4L/DVB (12265): em28xx: fix tuning problem in HVR-900 (R1)
When the change was introduced in the zl10353 for the i2c gate behavior, this
broke the HVR-900 which was not behind a gate.  Use a version of the zl10353
config profile that indicates the tuner is not behind such a gate.

Without this patch the first tune succeeds, but subsequent tuning attempts
will fail.

The change also renames the terratec zl10353 profile I wrote to be more
generic, since it is shared by the non-terratec device.

Thanks to Michael Krufky for providing a HVR-900 and DVB-T environment to test
with.

Cc: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-07-24 14:03:28 -03:00
Devin Heitmueller e16e5a3739 V4L/DVB (12263): em28xx: set demod profile for Pinnacle Hybrid Pro 320e
The Pinnacle Hybrid Pro 320e was missing a demod config for the xc3028, which
is required for digital tuning to work properly.  Add the missing profile.

Thanks to Andreas Lunderhage for testing patches and providing a remote debug
environment.

Cc: Andreas Lunderhage <lunderhage@home.se>
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-07-24 14:03:28 -03:00
Devin Heitmueller 5343e44601 V4L/DVB (12262): em28xx: Make sure the tuner is initialized if generic empia USB id was used
In cases where the device has a generic Empia USB ID, the call in the
precard setup phase did not set the tuner GPIO.  As a result, the tuner may
not be taken out of reset before attempting initialization in the analog
driver.

This problem was not seen before with the EVGA inDtube, since that particular
board has the analog GPIO setup to include taking the tuner out of reset.

Thanks to Andreas Lunderhage for testing patches and providing a remote debug
environment for the Pinnacle 320e.

Cc: Andreas Lunderhage <lunderhage@home.se>
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-07-24 14:03:28 -03:00
Devin Heitmueller 44010440ca V4L/DVB (12261): em28xx: set GPIO properly for Pinnacle Hybrid Pro analog support
Set the GPIO properly for the analog side of the Pinnacle Hybrid Pro, or else
the emp202 doesn't get detected properly.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-07-24 14:03:28 -03:00
Devin Heitmueller d5b3ba9cb3 V4L/DVB (12260): em28xx: make support work for the Pinnacle Hybrid Pro (eb1a:2881)
Setup the GPIOs properly and enable support for the DVB side of the Pinnacle
Hybrid Pro USB stick.

Thanks to Andreas Lunderhage for testing patches and providing a remote debug
environment.

Cc: Andreas Lunderhage <lunderhage@home.se>
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-07-24 14:03:27 -03:00
Devin Heitmueller ff69786b4c V4L/DVB (12258): em28xx: fix typo in mt352 init sequence for Terratec Cinergy T XS USB
Andy walls pointed out that we were passing 0x5d to the TUNER_GO register,
instead of 0x01.  Set the register properly (note the code did still work with
the incorrect value, so this does not address a regression).

Thanks to Andy Walls for noticing the issue.

Cc: Andy Walls <awalls@radix.net>
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-07-24 14:03:27 -03:00
Devin Heitmueller 4fb202a8d9 V4L/DVB (12257): em28xx: make tuning work for Terratec Cinergy T XS USB (mt352 variant)
The Terratec Cinergy T XS USB can have either a zl10353 or an mt352.  Add
support for the MT352 variant.

Thanks to Jelle de Jong for providing a unit to test/debug with.

Cc: Jelle de Jong <jelledejong@powercraft.nl>
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-07-24 14:03:27 -03:00
Mauro Carvalho Chehab b80fd2d811 V4L/DVB (12245): em28xx: add support for mt9m001 webcams
Thanks to Wally <wally@voosen.eu> for bringing the issue and helping
with the tests.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-07-24 14:03:26 -03:00
Mauro Carvalho Chehab 579d315218 V4L/DVB (12244): em28xx: adjust vinmode/vinctl based on the stream input format
Depending on the video input format, vinmode/vinctl needs adjustments.
For TV, this is not relevant, since the supported decoders output data
at the same format. However, webcam sensors may have different formats,
so, this needs to be adjusted based on the device.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-07-24 14:03:26 -03:00
Mauro Carvalho Chehab d36bb4e772 V4L/DVB (12243): em28xx: allow specifying sensor xtal frequency
In order to properly estimate fps, mt9v011 sensor driver needs to know
what is the used frequency on the sensor cristal. Adds the proper fields
and initialization code for specifying the cristal frequency.

Also, based on experimentation, it was noticed that the Silvercrest is
outputing data at 7 fps. This means that it should be using a 6.3 MHz
cristal. This information needs to be double checked later, by opening
the device. Anyway, by using this value for xtal, at least now we have
the correct fps report.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-07-24 14:03:26 -03:00
Mauro Carvalho Chehab 2ea472ff70 V4L/DVB (12242): mt9v011: implement core->s_config to allow adjusting xtal frequency
Since frames per second is a function of cristal frequency, and this is
device-specific, add a function that allows adjusting it, via
subdev->core->s_config callback.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-07-24 14:03:25 -03:00
Mauro Carvalho Chehab c180604a87 V4L/DVB (12241): mt9v011: Fix vstart
vstart calculus were wrong. Fix it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-07-24 14:03:25 -03:00
Mauro Carvalho Chehab e11206e67f V4L/DVB (12240): mt9v011: add a function to calculate frames per second rate
It is possible to adjust the fps rate by changing some register values.
This is function of the connected Xtal at the camera sensor, being a 27
MHz cristal needed, in order to support 640x480 at 30 fps.

For now, it will only calculate the values for fps. Later patches may
introduce V4L2 ioctls, to allow frequency rate adjustments.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-07-24 14:03:25 -03:00
Mauro Carvalho Chehab 5569996421 V4L/DVB (12239): em28xx: fix webcam scaling
While trying to fix an mt9v001 webcam, I noticed that HSCALE/VSCALE do
work with em28xx + webcam. The issue is that the scaling setup depends
on the number of visible rows/cols of the input image.

With mt9v011 (Silvercrest), the resolution is 640x480. So, the scaling
is different from a normal TV image (720x480 on NTSC). This were causing
a wrong scaling and a previous patch disabled scaling.

As each sensor have their different resolution setting, the xres/yres
should be adjusted accordingly with the input sensor.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-07-24 14:03:24 -03:00
Mauro Carvalho Chehab b04fb66152 V4L/DVB (12238): em28xx: call sensor detection code for all webcam entries
With the previous approach, autodetection were working only for the two
generic entries (em275x and em2820 unknown ones). So, if someone would
try to force probing an specific device, the code would not properly run
the autodetection code.

With the new approach, the sensor autodetection will be run not only for
the two generic entries, but also do webcam specific ones.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-07-24 14:03:24 -03:00