x86, IA64, powerpc: add phys_to_dma() and dma_to_phys()
This adds two functions, phys_to_dma() and dma_to_phys() to x86, IA64
and powerpc. swiotlb uses them. phys_to_dma() converts a physical
address to a dma address. dma_to_phys() does the opposite.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Acked-by: Becky Bruce <beckyb@kernel.crashing.org>
swiotlb doesn't use swiotlb_arch_address_needs_mapping(); it uses
dma_capalbe(). We can remove unnecessary
swiotlb_arch_address_needs_mapping().
We can remove swiotlb_addr_needs_map() and is_buffer_dma_capable() in
swiotlb_pci_addr_needs_map() too; dma_capable() handles the features
that both provide.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Acked-by: Becky Bruce <beckyb@kernel.crashing.org>
powerpc: add dma_capable() to replace is_buffer_dma_capable()
dma_capable() eventually replaces is_buffer_dma_capable(), which tells
if a memory area is dma-capable or not. The problem of
is_buffer_dma_capable() is that it doesn't take a pointer to struct
device so it doesn't work for POWERPC.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Acked-by: Becky Bruce <beckyb@kernel.crashing.org>
ia64: add dma_capable() to replace is_buffer_dma_capable()
dma_capable() eventually replaces is_buffer_dma_capable(), which tells
if a memory area is dma-capable or not. The problem of
is_buffer_dma_capable() is that it doesn't take a pointer to struct
device so it doesn't work for POWERPC.
x86: add dma_capable() to replace is_buffer_dma_capable()
dma_capable() eventually replaces is_buffer_dma_capable(), which tells
if a memory area is dma-capable or not. The problem of
is_buffer_dma_capable() is that it doesn't take a pointer to struct
device so it doesn't work for POWERPC.
Alan Cox [Mon, 27 Jul 2009 23:34:58 +0000 (00:34 +0100)]
usb_serial: Fix remaining ref count/lock bugs
This fixes
- locking bug that was hidden by ecc2e05e739c30870c8e4f252b63a0c4041f2724
- 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>
Merge branch 'for-linus' of git://git.infradead.org/users/eparis/notify
* 'for-linus' of git://git.infradead.org/users/eparis/notify:
inotify: use GFP_NOFS under potential memory pressure
fsnotify: fix inotify tail drop check with path entries
inotify: check filename before dropping repeat events
fsnotify: use def_bool in kconfig instead of letting the user choose
inotify: fix error paths in inotify_update_watch
inotify: do not leak inode marks in inotify_add_watch
inotify: drop user watch count when a watch is removed
* 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.
...
Alan Cox [Mon, 27 Jul 2009 09:58:08 +0000 (10:58 +0100)]
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>
Merge branch 'fixes-for-linus' of git://git.monstr.eu/linux-2.6-microblaze
* 'fixes-for-linus' of git://git.monstr.eu/linux-2.6-microblaze:
microblaze: Makefile cleanup
microblaze: Typo fix for cpu param inconsistency
microblaze: Add support for R_MICROBLAZE_64_NONE
microblaze: Get module loading working
microblaze: remove sys_ipc
microblaze: Support unaligned address for put/get_user macros
microblaze: Detect new Microblaze 7.20 versions
microblaze: Fix do_page_fault for no context
microblaze: Add _PAGE_FILE macros to pgtable.h
microblaze: Fix put_user macro for 64bits arguments
microblaze: Clear print messages for DTB passing via r7
microblaze: Not to clear r7 after copying DTB to kernel
microblaze: Add messages about FDT blob
microblaze: Final support for statically linked DTB
microblaze: remove duplicated #include
microblaze: Define tlb_flush macro
Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
x86: geode: Mark mfgpt irq IRQF_TIMER to prevent resume failure
x86, amd: Don't probe for extended APIC ID if APICs are disabled
x86, mce: Rename incorrect macro name "CONFIG_X86_THRESHOLD"
x86-64: Fix bad_srat() to clear all state
x86, mce: Fix set_trigger() accessor
x86: Fix movq immediate operand constraints in uaccess.h
x86: Fix movq immediate operand constraints in uaccess_64.h
x86: Add reboot fixup for SBC-fitPC2
x86: Include all of .data.* sections in _edata on 64-bit
x86: Add quirk for Intel DG45ID board to avoid low memory corruption
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
ALSA: hda - Fix mute control with some ALC262 models
ALSA: snd_usb_caiaq: add support for Audio2DJ
ALSA: pcm - Fix hwptr buffer-size overlap bug
ALSA: pcm - Fix warnings in debug loggings
ALSA: pcm - Add logging of hwptr updates and interrupt updates
ASoC: tlv320aic3x: Enable PLL when not bypassed
ALSA: hda - Restore GPIO1 properly at resume with AD1984A
ALSA: ctxfi - Fix uninitialized error checks
ALSA: hda - Use snprintf() to be safer
ALSA: usb-audio - Volume control quirk for QuickCam E 3500
ALSA: pcm - Fix regressions with VMware
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
...
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
* git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-2.6-dm:
dm table: pass correct dev area size to device_area_is_valid
dm: remove queue next_ordered workaround for barriers
dm raid1: wake kmirrord when requeueing delayed bios after remote recovery
Oleg Nesterov [Fri, 19 Jun 2009 00:51:13 +0000 (02:51 +0200)]
update the comment in kthread_stop()
Commit 63706172f332fd3f6e7458ebfb35fa6de9c21dc5 ("kthreads: rework
kthread_stop()") removed the limitation that the thread function mysr
not call do_exit() itself, but forgot to update the comment.
Since that commit it is OK to use kthread_stop() even if kthread can
exit itself.
Mike Frysinger [Thu, 23 Jul 2009 14:12:08 +0000 (23:42 +0930)]
module: use MODULE_SYMBOL_PREFIX with module_layout
The check_modstruct_version() needs to look up the symbol "module_layout"
in the kernel, but it does so literally and not by a C identifier. The
trouble is that it does not include a symbol prefix for those ports that
need it (like the Blackfin and H8300 port). So make sure we tack on the
MODULE_SYMBOL_PREFIX define to the front of it.
Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6:
jbd: fix race between write_metadata_buffer and get_write_access
ext3: Get rid of extenddisksize parameter of ext3_get_blocks_handle()
jbd: Fix a race between checkpointing code and journal_get_write_access()
ext3: Fix truncation of symlinks after failed write
jbd: Fail to load a journal if it is too short
* git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
[CIFS] fix sparse warning
cifs: fix sb->s_maxbytes so that it casts properly to a signed value
cifs: disable serverino if server doesn't support it
mm: Pass virtual address to [__]p{te,ud,md}_free_tlb()
mm: Pass virtual address to [__]p{te,ud,md}_free_tlb()
Upcoming paches to support the new 64-bit "BookE" powerpc architecture
will need to have the virtual address corresponding to PTE page when
freeing it, due to the way the HW table walker works.
Basically, the TLB can be loaded with "large" pages that cover the whole
virtual space (well, sort-of, half of it actually) represented by a PTE
page, and which contain an "indirect" bit indicating that this TLB entry
RPN points to an array of PTEs from which the TLB can then create direct
entries. Thus, in order to invalidate those when PTE pages are deleted,
we need the virtual address to pass to tlbilx or tlbivax instructions.
The old trick of sticking it somewhere in the PTE page struct page sucks
too much, the address is almost readily available in all call sites and
almost everybody implemets these as macros, so we may as well add the
argument everywhere. I added it to the pmd and pud variants for consistency.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Acked-by: David Howells <dhowells@redhat.com> [MN10300 & FRV] Acked-by: Nick Piggin <npiggin@suse.de> Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com> [s390] Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Michael Chan [Mon, 27 Jul 2009 18:25:58 +0000 (11:25 -0700)]
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>
irttp_dup() copies a tsap_cb struct, but does not initialize the
spinlock in the new structure, which confuses lockdep.
Signed-off-by: Deepak Saxena <dsaxena@mvista.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Sam Ravnborg [Fri, 24 Jul 2009 07:04:49 +0000 (09:04 +0200)]
microblaze: Makefile cleanup
Reviewed the Makefile on request by Michal and this is the resulting changes.
o Use ':=' for assignmnet so we do not re-evaluate for each use
o Use $(shell echo xxx) to remove ""
o Replaced CFLAGS_KERNEL with KBUILD_CFLAGS
The settings are equally relevant for modules and the linked kernel
o Dropped LDFLAGS_BLOB - it is no longer used
o Refactored assignmnets to libs-y and core-y
o Use MMU for the MMU specific extension. "MMUEXT" was hurting my eyes
and I did not wanted it spread to m68k
Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Michal Simek <monstr@monstr.eu>
John Williams [Thu, 23 Jul 2009 04:56:49 +0000 (14:56 +1000)]
microblaze: Get module loading working
New reloc type R_MICROBLAZE_32_PCREL_LO requires a null handler (no work to do).
Remove legacy hack for broken linker pre gcc-4.1.1, that required us to extract
an offset from the code, add it to the addend, then rewrite the instruction.
Fixup the invalid reloc type error output.
Boot tested with the xilinx_emaclite ethernet driver.
Signed-off-by: John Williams <john.williams@petalogix.com> Signed-off-by: Michal Simek <monstr@monstr.eu>
Michal Simek [Tue, 21 Jul 2009 10:48:01 +0000 (12:48 +0200)]
microblaze: Support unaligned address for put/get_user macros
This patch add support for cases where load/store instruction
in put/get_user macro gets unaligned pointer to data and this
address is not valid. I prevent all cases which can failed.
I had to disable first stage of unaligned handler which is used
only for noMMU kernel and the whole work is done when interrupt
is enabled.
You have enable HW support for detect unaligned access in Microblaze.
This patch fixed three LTP tests:
getpeername01, getsockname01, socketpair01
Michal Simek [Wed, 15 Jul 2009 11:39:35 +0000 (13:39 +0200)]
microblaze: Add _PAGE_FILE macros to pgtable.h
We need to define _PAGE_FILE macro and change pte
functions. Microblaze use the same MMU as PowerPC
that's why we define _PAGE_FILE in the same style.
This change fixed remap_file_pages01 LTP test.
Michal Simek [Mon, 13 Jul 2009 14:46:54 +0000 (16:46 +0200)]
microblaze: Fix put_user macro for 64bits arguments
For 64bits arguments gcc caused that put_user macro
works with wrong value because of optimalization.
Adding volatile caused that gcc not optimized it.
It is possible to use (as Blackfin do) two put_user
macros with 32bits arguments but there is one more
instruction which is due to duplication zero return
value which is called put_user_asm macro.
John Williams [Mon, 22 Jun 2009 04:02:09 +0000 (14:02 +1000)]
microblaze: Final support for statically linked DTB
If r7 is zero at kernel boot, or does not point to a valid DTB, then
we fall back to a DTB (assumed to be) linked statically in the kernel, instead
of blindly copying bogus cruft into the kernel DTB memory region
Signed-off-by: John Williams <john.williams@petalogix.com> Signed-off-by: Michal Simek <monstr@monstr.eu>
Michal Simek [Thu, 9 Jul 2009 09:33:39 +0000 (11:33 +0200)]
microblaze: Define tlb_flush macro
This fix remove bug which we had till now in all
Microblaze MMU code. Primary tested on mmap01 LTP test.
We forget to flush invalid tlb which were changed - we
used them and there were wrong old data which wasn't correct.
Don Skidmore [Thu, 23 Jul 2009 18:00:39 +0000 (18:00 +0000)]
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>
françois romieu [Fri, 24 Jul 2009 12:34:19 +0000 (12:34 +0000)]
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.
net/bridge: use kobject_put to release kobject in br_add_if error path
kobject_init_and_add will alloc memory for kobj->name, so in br_add_if
error path, simply use kobject_del will not free memory for kobj->name.
Fix by using kobject_put instead, kobject_put will internally calls
kobject_del and frees memory for kobj->name.
Signed-off-by: Xiaotian Feng <dfeng@redhat.com> Acked-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
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>
The use of a static buffer in rose2asc() to return its result is not
threadproof and can result in corruption if multiple threads are trying
to use one of the procfs files based on rose2asc().
Signed-off-by: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* fix/hda:
ALSA: hda - Fix mute control with some ALC262 models
ALSA: hda - Restore GPIO1 properly at resume with AD1984A
ALSA: hda - Use snprintf() to be safer
Michael Krufky [Sun, 19 Jul 2009 20:55:35 +0000 (17:55 -0300)]
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>
Hans Verkuil [Mon, 20 Jul 2009 11:14:17 +0000 (08:14 -0300)]
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>
Trent Piepho [Thu, 11 Jun 2009 22:31:22 +0000 (19:31 -0300)]
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.
Antti Palosaari [Fri, 10 Jul 2009 23:03:43 +0000 (20:03 -0300)]
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>
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.
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.
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.
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).
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.
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.
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.
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.
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.
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.
All hdcs registers use bit 0 as a read/write flag and needs to be shifted one bit to the left. This wasn't accounted for when doing a sequence of writes.
Signed-off-by: Erik Andrén <erik.andren@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>