Fix __ide_do_rw_disk() to use ->OUTBSYNC instead of ->OUTB
(needed for pmac and scc_pata host drivers).
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Save PCI regs values for both IDE ports in one buffer, in order to eliminate
a needless and ugly loop across all hwifs, searching for our PCI device.
Partially based on the previous patch by Jeff Garzik.
Cc: Jeff Garzik <jeff@garzik.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* Add IDE_TFLAG_IN_DATA taskfile flag to indicate the need of reading
IDE_DATA_REG in ide_end_drive_cmd().
Set the new flag in ide_taskfile_ioctl() if ->in_flags.b.data is set.
* Add IDE_TFLAG_FLAGGED_SET_IN_FLAGS taskfile flag to indicate the
need of modifying ->in_flags in ide_taskfile_ioctl().
Set the new flag in flagged_taskfile() and move the code modifying
->tf_in_flags to ide_taskfile_ioctl().
While at it remove the bogus comment: ->tf_in_flags (except .b.data)
have no effect on selection of registers to read.
* Remove no longer needed 'tf_in_flags' field from ide_task_t.
As the result we finally have the internals of HDIO_DRIVE_TASKFILE ioctl
separated from the core IDE code.
There should be no functionality changes caused by this patch.
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* Add 'data_buf' and 'nsect' variables in ide_taskfile_ioctl()
to cache data buffer pointer and number of sectors to transfer
(this allows us to have only one ide_diag_taskfile() call).
* Add IDE_TFLAG_WRITE taskfile flag and use it to check whether
the REQ_RW request flag should be set.
* Move ->command_type handling from ide_diag_taskfile() to
ide_taskfile_ioctl() and use ->req_cmd instead of ->command_type.
* Add 'nsect' parameter to ide_raw_taskfile().
* Merge ide_diag_taskfile() into ide_raw_taskfile().
* Initialize ->data_phase explicitly in idedisk_prepare_flush(),
ide_start_power_step() and ide_disk_special().
* Remove no longer needed 'command_type' field from ide_task_t.
* Add #ifndef/#endif __KERNEL__ to <linux/hdreg.h> around no
longer used by kernel IDE_DRIVE_TASK_* and TASKFILE_* defines.
There should be no functionality changes caused by this patch.
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Given that:
* hpt366.c::hpt3xx_intrproc() is the only user of hwif->intrproc
* hpt366.c::hpt3xx_quirkproc() sets drive->quirk_list to 1 for quirky drives
which is a value unique to hpt366 host driver
we can remove hwif->intproc and just check for drive->quirk_list == 1
in ide_do_request().
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Add ide_pktcmd_tf_load() helper and convert ATAPI device drivers to use it.
There should be no functionality changes caused by this patch.
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Load IDE_BCOUNTL_REG before IDE_BCOUNTH_REG when issuing packet command.
It shouldn't affect anything (just a usual paranoia to separate changes
which change the way in which hardware is accessed from code cleanups).
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Load IDE_CONTROL_REG before other registers in cdrom_start_packet_command().
It shouldn't affect anything (just a usual paranoia to separate changes
which change the way in which hardware is accessed from code cleanups).
While at it move misplaced FIXME comment in the right place.
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Remove atapi_ireason_t.
While at it:
* replace 'HWIF(drive)' by 'drive->hwif' (or just 'hwif' where possible)
v2:
* v1 had CD and IO bits reversed in many places.
* Use CD and IO defines from <linux/hdreg.h>.
v3:
* Fix incorrect "(ireason & IO) == test_bit()". (Noticed by Sergei)
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Remove ata_nsector_t, ata_data_t (unused) and atapi_bcount_t.
While at it:
* replace 'HWIF(drive)' by 'hwif'
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Remove atapi_feature_t.
While at it:
* replace 'HWIF(drive)' by 'hwif'
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Remove atapi_error_t.
While at it:
* replace 'HWIF(drive)' by 'drive->hwif'
v2:
* Add {ILI,EOM,LFS}_ERR defines to <linux/hdreg.h>.
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Remove ata_status_t (unused) and atapi_status_t.
While at it:
* replace 'HWIF(drive)' by 'drive->hwif' (or just 'hwif' where possible)
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Based on the earlier work by Tejun Heo.
All users are gone so we can finally remove it.
Cc: Tejun Heo <htejun@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Based on the earlier work by Tejun Heo.
There should be no functionality changes caused by this patch.
Cc: Tejun Heo <htejun@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Based on the earlier work by Tejun Heo.
There should be no functionality changes caused by this patch.
Cc: Tejun Heo <htejun@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Extend timeout for REQ_TYPE_ATA_{CMD,TASK} requests from WAIT_CMD (10sec)
to WAIT_WORSTCASE (30sec, already used for REQ_TYPE_ATA_TASKFILE).
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* Set taskfile flags for REQ_TYPE_ATA_TASKFILE requests before
adding the request to the queue.
* Cleanup execute_drive_cmd().
* Remove unnecessary writes to HOB taskfile registers when using
LBA48 disk for the following cases:
- Power Management requests
(WIN_FLUSH_CACHE[_EXT], WIN_STANDBYNOW1, WIN_IDLEIMMEDIATE commands)
- special commands (WIN_SPECIFY, WIN_RESTORE, WIN_SETMULT)
- Host Protected Area support (WIN_READ_NATIVE_MAX, WIN_SET_MAX)
- /proc/ide/ SMART support (WIN_SMART with SMART_ENABLE,
SMART_READ_VALUES and SMART_READ_THRESHOLDS subcommands)
- write cache enabling/disabling in ide-disk
(WIN_SETFEATURES with SETFEATURES_{EN,DIS}_WCACHE)
- write cache flushing in ide-disk (WIN_FLUSH_CACHE[_EXT])
- acoustic management in ide-disk
(WIN_SETFEATURES with SETFEATURES_{EN,DIS}_AAM)
- door (un)locking in ide-disk (WIN_DOORLOCK, WIN_DOORUNLOCK)
- /proc/ide/hd?/identify support (WIN_IDENTIFY)
- ACPI _GTF taskfiles
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* Use IDE_TFLAG_LBA48 for REQ_TYPE_ATA_TASKFILE requests in ide_end_drive_cmd()
to decide whether we need to read HOB taskfile registers.
* Update execute_drive_cmd() accordingly.
This is a preparation for the next patch which removes unnecessary writes to
HOB taskfile registers for some ATA commands.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* Add IDE_TFLAG_OUT_DEVICE taskfile flag to indicate the need of writing
the Device register and handle it in ide_tf_load().
Update ide_tf_load() and {do_rw,flagged}_taskfile() users accordingly.
* Use struct ide_taskfile and ide_tf_load() in execute_drive_cmd().
* Make the debugging code dump all taskfile registers for both
REQ_ATA_TYPE_{CMD,TASK} requests and move it to ide_tf_load()
so it also covers REQ_ATA_TYPE_TASKFILE requests.
There should be no functionality changes caused by this patch
(unless DEBUG is defined).
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* Rename 'args' variable in 'if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE)'
block to 'task'.
* execute_drive_cmd() is used only for REQ_TYPE_ATA_{CMD,TASK,TASKFILE} so
we can move the common code out from 'if (rq->cmd_type == REQ_TYPE_ATA_CMD)'
and 'if (rq->cmd_type == REQ_TYPE_ATA_TASK)' blocks.
There should be no functionality changes caused by this patch.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Move loading of IDE_NSECTOR_REG from ide_cmd() to execute_drive_cmd()
(load the IDE_NSECTOR_REG just after IDE_FEATURE_REG).
This also allows us to drop 'nsect' argument from ide_cmd() and simplify
execute_drive_cmd() code for REQ_TYPE_ATA_CMD case a bit.
It shouldn't affect anything (just a usual paranoia to separate changes
which change the way in which hardware is accessed from code cleanups).
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Fix registers loading order for REQ_TYPE_ATA_CMD request with WIN_SMART
command in execute_drive_cmd() (load IDE_FEATURE_REG and IDE_SECTOR_REG
before loading IDE_LCYL_REG and IDE_HCYL_REG).
It shouldn't affect anything (just a usual paranoia to separate changes
which change the way in which hardware is accessed from code cleanups).
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Remove stale ide.h "configuration options":
* INITIAL_MULT_COUNT - always defined to 0
* SUPPORT_SLOW_DATA_PORTS - unused
* OK_TO_RESET_CONTROLLER - always defined to 1
* DISABLE_IRQ_NOSYNC - always defined to 0
Leave SUPPORT_VLB_SYNC (defined to 0 for CRIS and FRV, otherwise to 1)
for now but disallow overriding it by <asm/ide.h>.
There should be no functionality changes caused by this patch.
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
IRQF_DISABLED is not needed because the first thing that ide_intr()
(IDE IRQ handler) does is calling spin_lock_irqsave() which disables
local IRQs (IRQ unmasking is later handled by drive->unmask).
kernel/irq/handle.c:
irqreturn_t handle_IRQ_event(unsigned int irq, struct irqaction *action)
...
if (!(action->flags & IRQF_DISABLED))
local_irq_enable_in_hardirq();
do {
ret = action->handler(irq, action->dev_id);
if (ret == IRQ_HANDLED)
status |= action->flags;
retval |= ret;
action = action->next;
} while (action);
...
drivers/ide/ide-io.c:
irqreturn_t ide_intr (int irq, void *dev_id)
...
spin_lock_irqsave(&ide_lock, flags);
...
spin_unlock(&ide_lock);
...
if (drive->unmask)
local_irq_enable_in_hardirq();
...
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* pmac_ide_init_hwif_ports() can be called by ide_init_hwif_ports()
(through ppc_ide_md.ide_init_hwif hook) for non IDE PMAC interfaces.
If this is the case the hw->io_ports[] should be already setup by
ide_init_hwif_ports()->ide_std_init_ports() so remove redundant code
from pmac_ide_init_hwif_ports().
As side-effect this change fixes ctl_addr == 0 special handling in
ide_init_hwif_ports().
* Fix misleading comment while at it.
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Based on the earlier work by Tejun Heo.
* Move setting IDE_TFLAG_LBA48 taskfile flag from do_rw_taskfile()
function to the callers.
* Add IDE_TFLAG_FLAGGED taskfile flag for flagged taskfiles coming
from ide_taskfile_ioctl(). Check it instead of ->tf_out_flags.all.
* Add IDE_TFLAG_OUT_DATA taskfile flag to indicate the need to load
IDE data register in ide_tf_load().
* Add IDE_TFLAG_OUT_* taskfile flags to indicate the need to load
particular IDE taskfile registers in ide_tf_load().
* Update do_rw_taskfile() and ide_tf_load() users to set respective
IDE_TFLAG_OUT_* taksfile flags.
* Add task_dma_ok() helper.
* Use IDE_TFLAG_FLAGGED taskfile flag to select HIHI mask in ide_tf_load().
* Use do_rw_taskfile() in flagged_taskfile().
* Remove no longer needed 'tf_out_flags' field from ide_task_t.
There should be no functionality changes caused by this patch.
Cc: Tejun Heo <htejun@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* Add ide_no_data_taskfile() helper and convert ide_raw_taskfile() w/ NO DATA
protocol users to use it instead.
* Set ->data_phase explicitly in ide_no_data_taskfile()
(TASKFILE_NO_DATA is defined as 0x0000).
* Unexport task_no_data_intr().
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Based on the earlier work by Tejun Heo.
* Add 'tf_flags' field (for taskfile flags) to ide_task_t.
* Add IDE_TFLAG_LBA48 taskfile flag for LBA48 taskfiles.
* Add IDE_TFLAG_NO_SELECT_MASK taskfile flag for __ide_do_rw_disk()
which doesn't use SELECT_MASK() (looks like a bug but it requires
some more investigation).
* Split off ide_tf_load() helper from do_rw_taskfile().
* Convert __ide_do_rw_disk() to use ide_tf_load().
There should be no functionality changes caused by this patch.
Cc: Tejun Heo <htejun@gmail.com>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Based on the earlier work by Tejun Heo.
There should be no functionality changes caused by this patch.
Cc: Tejun Heo <htejun@gmail.com>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Load IDE_SECTOR_REG after IDE_FEATURE_REG and IDE_NSECTOR_REG when using CHS.
This patch is basically a preparation for the next one which converts
__ide_do_rw_disk() to use struct ide_taskfile.
It shouldn't affect anything (just a usual paranoia to separate changes
which change the way in which hardware is accessed from code cleanups).
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* Merge idedisk_{read_native,set}_max_address_ext() into
idedisk_{read_native,set}_max_address().
v2:
* Remove LBA48 code leftover from idedisk_read_native_max_address()
('high' variable initialization). (Noticed by Sergei).
There should be no functionality changes caused by this patch.
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* Don't set write-only ide_task_t.hobRegister[6] and ide_task_t.hobRegister[7]
in idedisk_set_max_address_ext().
* Add struct ide_taskfile and use it in ide_task_t instead of tfRegister[]
and hobRegister[].
* Remove no longer needed IDE_CONTROL_OFFSET_HOB define.
* Add #ifndef/#endif __KERNEL__ around definitions of {task,hob}_struct_t.
While at it:
* Use ATA_LBA define for LBA bit (0x40) as suggested by Tejun Heo.
v2:
* Add missing newlines. (Noticed by Sergei)
* Use ~ATA_LBA instead of 0xBF. (Noticed by Sergei)
* Use unnamed unions for error/feature and status/command.
(Suggested by Sergei).
There should be no functionality changes caused by this patch.
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Tejun Heo <htejun@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Remove task_ioreg_t typedef from the kernel code (but leave it
in <linux/hdreg.h> for #ifndef/#endif __KERNEL__ case).
While at it also move sata_ioreg_t typedef under #ifndef/#endif __KERNEL__.
v2:
Remove name of the second parameter from ide_execute_command() declaration.
(Noticed by Sergei).
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* Convert cmd64x, hpt366 and pdc202xx_old host drivers to use
pci_resource_start(hwif->pci_dev, 4) instead of hwif->dma_master.
* Remove no longer needed ->dma_master field from ide_hwif_t.
v2:
* Use the more readable 'hwif->dma_base - (hwif->channel * 8)' instead of
pci_resource_start(hwif->pci_dev, 4).
v3:
* Use hwif->extra_base in hpt366/pdc20xx_old + some cosmetic fixups over v2
(suggested by Sergei).
v4:
* Correct offsets in hpt3xxn_set_clock().
v5:
* Use hwif->extra_base in hpt366 for _real_ this time. (Noticed by Sergei)
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Group the array of pointers to the timing tables with the timing register masks
which allows us to merge HPT36x/HPT37x set_dma_mode() methods into one.
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
There's no reason to keep the set_dma_mode() method wrapper for two different
chip families, so get rid of it...
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Since PIO autotuning is now done always, there's no need anymore to program
the taskfile timings also on DMA modes, so change the IDE timing register
masks accordingly, "inverting the polarity" of the masks while at it...
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Currently it's possible to ide-cd to set an incorrect blocksize by
reading garbage if the drive is dead:
ide_cd_probe()
-> cdrom_read_toc()
-> cdrom_read_capacity()
-> cdrom_queue_packet_command()
-> ide_do_drive_cmd()
-> ide_do_request()
-> start_request()
on start_request():
/* bail early if we've exceeded max_failures */
if (drive->max_failures && (drive->failures > drive->max_failures)) {
goto kill_rq;
}
(...)
kill_rq:
ide_kill_rq(drive, rq);
return ide_stopped;
ide_kill_rq() and the next calls won't set REQ_FAILED on rq->cmd_flags and thus
cdrom_queue_packet_command() won't return an error. then:
stat = cdrom_queue_packet_command(drive, &req);
if (stat == 0) {
*capacity = 1 + be32_to_cpu(capbuf.lba);
*sectors_per_frame =
be32_to_cpu(capbuf.blocklen) >> SECTOR_BITS;
}
cdrom_read_capacity() ends believing capbuf is valid but in fact it's just
uninitialized data. back to cdrom_read_toc():
/* Try to get the total cdrom capacity and sector size. */
stat = cdrom_read_capacity(drive, &toc->capacity, §ors_per_frame,
sense);
if (stat)
toc->capacity = 0x1fffff;
set_capacity(info->disk, toc->capacity * sectors_per_frame);
/* Save a private copy of te TOC capacity for error handling */
drive->probed_capacity = toc->capacity * sectors_per_frame;
blk_queue_hardsect_size(drive->queue,
sectors_per_frame << SECTOR_BITS);
that will set drive->queue->hardsect_size to be the random value.
hardsect_size is used to calculate inode->i_blkbits. later on, on a read
path:
void create_empty_buffers(struct page *page,
unsigned long blocksize, unsigned long b_state)
{
struct buffer_head *bh, *head, *tail;
head = alloc_page_buffers(page, blocksize, 1);
bh = head;
do {
bh->b_state |= b_state;
tail = bh;
bh = bh->b_this_page;
} while (bh);
tail->b_this_page = head;
alloc_page_buffers() will return NULL if blocksize > 4096. blocksize is
calculed based on inode->i_blkbits. that will trigger a null
dereference on create_empty_buffers().
Signed-off-by: Aristeu Rozanski <arozansk@redhat.com>
Cc: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
isapnp_fmi_probe() is only called by fmi_init(), which is __init,
so isapnp_fmi_probe() can also be __init.
media/radio/radio-sf16fmi.c:
WARNING: vmlinux.o(.text+0x994e19): Section mismatch: reference to .init.data: (between 'isapnp_fmi_probe' and 'vidioc_s_tuner')
WARNING: vmlinux.o(.text+0x994e22): Section mismatch: reference to .init.data: (between 'isapnp_fmi_probe' and 'vidioc_s_tuner')
WARNING: vmlinux.o(.text+0x994e3a): Section mismatch: reference to .init.data:id_table (between 'isapnp_fmi_probe' and 'vidioc_s_tuner')
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This patch moves the subsystem ID and subsystem vendor ID check from probing
function to the PCI generic function by describing subsystem IDs in
pci_device_id table. This enables to add new PCI IDs to a device driver pci_ids
table at runtime by new_id file in sysfs pci driver tree.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Removing two bugs to improve sensitivity for DiB7070 and Dib7000P with MT2266.
Signed-off-by: Patrick Boettcher <pb@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Here is a patch for Hauppage Nova-T-Stick and Nova-T-500 users. It
sets the MT2060 IF1 frequency according to the calibration values
stored in the EEPROM.
It is supposed to enhance the signal quality, but, hey, there is no
guarantee. Feedbacks would be much appreciated, to know whether it
deserves being applied.
Signed-off-by: Olivier DANET <odanet at caramail.com>
Signed-off-by: Patrick Boettcher <pb@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
There was a mistake in the way how to start the streaming in the dib0700. This patch fixes that.
Signed-off-by: Patrick Boettcher <pb@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
The attached patch solves all my vdr tuning problems on a dib7000p
nova-t stick as far as I could check within the last weekend.
It disables streaming while tuning, like that the number of faulty TS
packets is reduced.
Signed-off-by: Soeren Moch <Soeren.Moch@stud.uni-hannover.de>
Signed-off-by: Patrick Boettcher <pb@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Here's a roll-up which provides support for both this and the myTV.t.
Signed-off-by: Darren Salt <linux@youmustbejoking.demon.co.uk>
Signed-off-by: Patrick Boettcher <pb@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Add support for WinTV Nova-T-CE driver
Signed-off-by: Tim Taubert <ttmails@gmx.de>
Signed-off-by: Patrick Boettcher <pb@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This patch fix autoserach in the Hauppauge NOVA-T 500.
Signed-off-by: Jose Alberto Reguero <jareguero@telefonica.net>
Signed-off-by: Patrick Boettcher <pb@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Adding support for ASUS My Cinema U3000 Mini DVBT Tuner
Signed-off-by: Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>
Signed-off-by: Patrick Boettcher <pb@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
- avoid poss. locking when doing copy_to_user which may sleep
- RDS is automatically activated on read now
- code cleaned of unnecessary rds_commands
- USB Vendor/Product ID for ADS/Tech FM Radio Receiver verified
(thanks to Guillaume RAMOUSSE)
Signed-off-by: Tobias Lorenz <tobias.lorenz@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
- code reordered to avoid function prototypes
- switch/case defaults are now more user-friendly
- unified comment style
- applied all checkpatch.pl v1.12 suggestions
except the warning about the too long lines with bit comments
- renamed FMRADIO to RADIO to cut line length (checkpatch.pl)
Signed-off-by: Tobias Lorenz <tobias.lorenz@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
has_tuner flag doesn't make much sense, since tuner_type=TUNER_ABSENT
means the same thing.
Having two ways to say that a tuner is not present is
not nice, since it may lead to bad setups. In fact, with the previous
code, if a device were using has_tuner=0, but the user forces a tuner,
with modprobe option tuner=type, the modprobe option won't work.
Also, tveeprom returns TUNER_ABSENT, when tuner is unknown or absent.
So, with the previous logic, in this case, the driver should set
has_tuner=0, or has_tuner=1 otherwise.
Instead of adding several additional tests and setups, better just to
remove .has_tuner.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Previous patches assume the tuner was on a different gpio. This patch
corrects this.
Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Chaogui Zhang <czhang1974@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
IR corrections for the Pinnacle 800i
Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Chaogui Zhang <czhang1974@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
We already know that the XC5000 tuner can only be located at
i2c address 0x61, 0x62, 0x63 or 0x64
We shouldn't display this warning if the XC5000 tuner is present.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Change TDA9887 to tda9887.
TDA8290 shall reflect the actual hardware present in its name,
ie:
tda8295+18271
tda8290+8275a
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Marcos Melero (marcosmelero at gmail.com) reported he could make
his dvb-t usb stick work with the af9005 driver by changing the device
ids (10b9:6000).
The stick is branded "Ansonic" (one of the brands of a spanish chain of
supermarkets) with no other identification of the model.
Since neither Marcos nor me know the OEM for the stick, in the attached
patch I used Ansonic for the ids/description.
Signed-off-by: Luca Olivetti <luca@ventoso.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Call analog_ops.standby during tda18271_set_params, to put the tda8295
in tri-state when tuning digital channels. Otherwise the tda8295 will
interfere with the signal coming from the tda18271 into the digital
demodulator.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Correctly set the atatch structures, enable IR, configure the
xc5000 tuner includes.
Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
xc5000: Small amount of cleanup and commenting, just for clarification.
Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
From Zhang: This patch fixes support for the HVR1500Q which was broken
when the xc5000 analog patch was added.
Patch committed as-is, cleanups to follows .... Steve
Signed-off-by: Chaogui Zhang <czhang1974@gmail.com>
Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
From Zhang: This patch continues the support for the Pinnacle HD 800i.
Patch committed as-is, cleanups to follow ... Steve
Signed-off-by: Chaogui Zhang <czhang1974@gmail.com>
Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
From Zhang: This an updated patch that adds analog support for
the xc5000 tuner driver. it was tested on a Pinnacle PCTV HD 800i
card (patches to follow).
Patch commited as-is, cleanup to follow ... Steve.
Signed-off-by: Chaogui Zhang <czhang1974@gmail.com>
Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Parallel support was not working with the s5h1409 and the Pinnacle HD800i.
This patch fixes the demodulator driver and ensures that all existing
s5h1409 based products configure the demodulator correctly.
Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
this patch adds a new driver for the Silicon Labs Si470x FM Radio Receiver. It
should also work for the identical ADS/Tech FM Radio Receiver (formerly
Instant FM Music) as soon as I find out the USB Vendor and Product ID.
The driver is inspired by several other USB and radio drivers, but mainly from
the D-Link DSB-R100 USB radio (dsbr100.c).
The USB stick currently has an Si4701 FM RDS radio receiver. But the other
Si470x devices are pin and register compatible, so that in the future the
driver can easily be patched to support these too. Therefore I named the
driver radio-si470x and the configuration option usb-si470x.
The driver itself just provides the control function over the radio. For
getting audio back, the device support the USB audio class, which is
implemented in the already existing driver.
I tested the driver in the last days, until it now satisfies all my
functionality and robustness requirements. The application I used for testing
was kradio.
Signed-off-by: Tobias Lorenz <tobias.lorenz@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
The file drivers/media/video/videodev.c defines both video_device_alloc and
video_device_release. These are essentially just kzmalloc and kfree,
respectively, but it seems better to use video_device_release, as done in
the other media files, rather than kfree, in case the implementation some
day changes.
The problem was found using the following semantic match.
(http://www.emn.fr/x-info/coccinelle/)
// <smpl>
@@
type T,T1,T2;
identifier E;
statement S;
expression x1,x2,x3;
int ret;
@@
T E;
...
* E = video_device_alloc(...);
if (E == NULL) S
... when != video_device_release(...,(T1)E,...)
when != if (E != NULL) { ... video_device_release(...,(T1)E,...); ...}
when != x1 = (T1)E
when != E = x3;
when any
if (...) {
... when != video_device_release(...,(T2)E,...)
when != if (E != NULL) { ... video_device_release(...,(T2)E,...); ...}
when != x2 = (T2)E
(
* return;
|
* return ret;
)
}
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Video_device_alloc returns the result of a kzalloc. In this case, the
value is stored in a local variable which is not copied elsewhere before
the point of the error return (video_register_device does not save its
first argument anywhere if it returns a negative value). Thus, a
video_device_release it needed before the error return.
The problem was found using the following semantic match.
(http://www.emn.fr/x-info/coccinelle/)
// <smpl>
@@
type T,T1,T2;
identifier E;
statement S;
expression x1,x2,x3;
int ret;
@@
T E;
...
* E = video_device_alloc(...);
if (E == NULL) S
... when != video_device_release(...,(T1)E,...)
when != if (E != NULL) { ... video_device_release(...,(T1)E,...); ...}
when != x1 = (T1)E
when != E = x3;
when any
if (...) {
... when != video_device_release(...,(T2)E,...)
when != if (E != NULL) { ... video_device_release(...,(T2)E,...); ...}
when != x2 = (T2)E
(
* return;
|
* return ret;
)
}
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
CC: Oliver Endriss <o.endriss@gmx.de>
CC: Michael Hunold <michael@mihu.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This module option variable is only handled within the file tda18271-fe.c -
Declare this variable as static.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
If module option "cal" is set to 1, the ~22 sec rf tracking filter calibration
sequence will be invoked on startup. Otherwise, the calibration will take
place during the first tune.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Test RF_CAL_OK to see if we need to perform the RF tracking filter
calibration after returning from standby.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Add function, tda18271_set_standby_mode.
During sleep, enter standby mode with slave tuner output enabled,
loop through on and xtal oscillator on.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
All YUV to RGB conversions in usbvision were reverted
(conversion to BGR but saying RGB to the application)
Signed-off-by: Thierry MERLE <thierry.merle@free.fr>
Acked-by: Dwaine Garden <DwaineGarden@rogers.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Changeset 7e65d6e8f6df removed a very bad hack on mmap(). However, the fixes
weren't considering usermap and overlay memory models. This were breaking
direct reading from /dev/video?, used mostly by mpeg aware drivers.
Thanks to Steven Toth <stoth@linuxtv.org> for reporting the issue and
bissecting it.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This driver supports cameras with USB ID 174f:a311 or 05e1:0501,
and the ov965x sensors. These devices are found in some Asus laptops
and probably somewhere else.
It is based on the stk11xx driver written by Nicolas Vivien
Signed-off-by: Jaime Velasco Juan <jsagarribay@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Thanks go to Mark Schultz for the initial contribution and to
Dean Hilkewich for testing it again.
Signed-off-by: Hermann Pitton <hermann-pitton@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
saa7134: remove the Avermedia Super 007 from eeprom detection
The card made it into the Philips' Tigers eeprom detection and falls through.
Since it has attracted already others to follow, which are wrongly identified
as TIGER_S then, move it to the usual analog initialization.
Signed-off-by: Hermann Pitton <hermann-pitton@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Setting force_init=1 bypasses the friendly auto-detection by polling the
status register, and instead attempts to initialize the qcam directly. Not
friendly to other parallel devices, but much more reliable than the
auto-detection.
Signed-off-by: Brett T. Warden <brett.warden@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
If not it impacts on analog tuner quality.
Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This enabled basic preview NTSC and PAL support for the HVR1800.
Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
The cx23885/6/8 all have different clock rates, this patch allows
the core to compensate, and developers to allow vendor specific
overrides. This patches will be used by future analog video
and encoder patches.
Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
We need to clear space large enough for the video and encoder fifos.
Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Failure to do this means that a full system reboot is required if the
part hangs.
Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Each version of the cx23885/7/8 silicon has different build revs.
We'll use this internal revision to work around bugs and known
issues in the video and encoder related patches.
Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
The cx23885/7/8 PCIe bridge has an internal AVCore modelled on
the cx2584x family. Many of the registers positions are identical
but some moved. The register values are also different because
the different bridges run at different clock rates.
Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
In order to videobuf_iolock to work, mmap_mapper should be called first.
Otherwise, an OOPS is generated.
On some cases, .mmap file handler used to took some time to be called. On those
situations, mmap_mmapper() were called after iolock.
This patch properly waits for mmap_mapper to be called, otherwise generating an
error.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Add adjust_X_Offset/adjust_Y_Offset module parameters to allow users
to tune X and Y picture offsets for their almost-working tuners without
repetitive recompilation.
Signed-off-by: Thierry MERLE <thierry.merle@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Add the "Pinnacle Studio PCTV USB (NTSC) FM" device.
This is the third occurrence of the same device designation...
Signed-off-by: Thierry MERLE <thierry.merle@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
As in the past, we should not allow to auto detect like this,
since all saa7130 and saa7134 cards without eeprom will be detected
as such Beholder cards then.
Signed-off-by: Hermann Pitton <hermann-pitton@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
We don't usually want to see the calibration debug messages, but sometimes
it is useful. Assign it to a separate debug mask.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
IR were not working for Winfast XP 2000 TV.
Gabor Nyekhelyi <n0gabor@vipmail.hu> wrote a hack some time ago:
http://marc.info/?l=linux-video&m=116362609323281&w=2
This patch fixes CodingStyle and commits the hack. I suspect that the proper
solution would be to find the proper mask_keydown for this IR. Anyway, better
to have this patch as a workaround.
Thanks to Stafan Talpalaru <stefantalpalaru@yahoo.com> for pointing the issue.
CC: Gabor Nyekhelyi <n0gabor@vipmail.hu>
CC: Stafan Talpalaru <stefantalpalaru@yahoo.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Store last tuned frequency & bandwidth after successful tune.
Clean up tune functions -- remove pointer to tune function in
state structure, instead call tune function based on priv->id.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Always initialize registers during attach.
Perform IR Calibration during init if needed.
Perform RF Calibration during init if needed for C2, only.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This patch updates cardlist for Beholder TV tuners:
old models (with GPIO ir) 401, 403, 405, 407, 409, 505, 507
and add support for 607, 609, M6 cards with new i2c-ir.
Signed-off-by: Igor Kuznetsov <igk72@yandex.ru>
Signed-off-by: Andrey J. Melnikov <temnota@kmv.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Before this patch, only Vendor Class audio support were loaded. This means that
older em28xx devices won't have digital audio support loaded.
This patch changes the logic to auto load eighter snd-usb-audio, for devices
with USB Audio Class or em28xx-alsa, for devices with USB Vendor Class.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Only HVR950 has analog_gpio configured. It makes no sense to set gpio to 0 for
other boards. Better to add a test, while this var is not set for all xc3028
devices.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Create a device description and enable autodetection for
Hauppauge WinTV PVR-USB2 Model 75xxx
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
An earlier patch, "tda18271: fail table lookups if frequency is out of range"
broke analog support on certain hardware. This patch fixes that problem, by
allowing the RF_CAL byte to be set to the maximum value, in cases of the
frequency being out of range.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Store IF Frequency in a u16 instead of a u32. Multiply by 1000 before use.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Allow drivers to pass device-specific configuration parameters during attach.
If these parameters are omitted, default values will be used.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Move some common code to a new file to make this easier to look at.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Tested successfully with QAM256 digital cable.
Analog television is limping, needs more work.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
make set_analog_params function look consistent with set_params function
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Older em28xx devices does implement standard Audio Class.
However, on newer devices, this were replaced by a Vendor Class. This
patch autodetects that an em28xx lacks Audio Class and auto-loads
em28xx-alsa, for the devices that implements only a Vendor Class.
For devices with Audio Class, snd-usb-audio module will provide an ALSA
interface.
This patch uses the request_module_async function as defined on cx88-mpeg.c,
originally wrote by Markus Rechberger.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
em28xx-audio module exports em28xx Vendor Class audio as an -alsa
driver. This module were written based on usbaudio driver by Markus
Rechberger. Recently, he acked to allow us to merge it on kernel:
http://lists-archives.org/video4linux/20408-supporting-prolink-pixelview-405-dvd-maker.html
Thanks to Markus Rechberger <mrechberger@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Thanks to Markus Rechberger <mrechberger@gmail.com> for retriving those
commands.
Also, MTS firmware is required for audio to work on HVR950.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
It is possible to select audio inputs via em28xx or via ac97 functions.
This patch allows configuring a board to use either one way.
It also do some cleanups at audio setup configurations.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Break out the following new functions from tda18271_tune:
tda18271_calc_bp_filter
tda18271_calc_km
tda18271_calc_rf_band
tda18271_calc_gain_taper
tda18271_calc_ir_measure
tda18271_calc_rf_cal
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
We don't need to do a dbg_info during tda18271_attach anymore, since
the tda18271_get_id function will call dbg_info with the same information
and more.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
tuner-core was checking if analog_ops->set_config is set. If set, it would
complain that it isn't. Fix this backwards logic to the proper behavior.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Everybody forgets to add the Kconfig stuff after they add new card support :-/
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
bttv driver is working as previously. An additional gain of about 1,5Kb were
obtained with the driver conversion to vidioc_ioctl2:
text data bss dec hex filename
89208 40244 57556 187008 2da80 old/bttv.ko
88960 38740 57556 185256 2d3a8 new/bttv.ko
(measured on a x86_64)
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Since there are a few vidioc_ functions that were exported, rename those
functions to bttv_ in order to avoid poluting namespace.
The other functions were also renamed, to standardize inside the driver.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Don't allow the tda8290 module to probe and attach the tuner module,
causing incorrect use counts when using dvb_attach.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Prevent the tda8290 module from probing for tuners during tda829x_attach,
by passing:
.probe_tuner = TDA829X_DONT_PROBE,
...in struct tda829x_config
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Identify the silicon during attach, return NULL if unsupported device.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Bit 7 of both Main Divider byte 1 and Cal Divider byte 1 is always zero.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Fixes all occurences of assignment in if
checkpatch marks them as ERROR.
Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
Reviewed-by: Andreas Oberritter <obi@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Add module option 'alt_tuner' disabled by default.
When set to one, the dvb_frontend of HVR1800 will consist of:
s5h1409 demod + tda18271 tuner
When set zero (default), the dvb_frontend of HVR1800 will consist of:
s5h1409 demod + mt2131 tuner
If the tda18271 is used in digital mode, you will not be able to
tune an analog channel at the same time.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
If we are selecting the S-Code firmware to load by name, then we must mask
off the HAS_IF bit during the search.
Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Fix the following build warning:
xc5000.c:560: warning: format '%d' expects type 'int',
but argument 2 has type 'size_t'
On many architectrues size_t is unsigned long, and may not be printed with %d.
Use %Zu instead.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
xc2028_attach was returning an integer when disabled from the build, where it
should instead be returning NULL. Declare xc2028_attach as type dvb_frontend *
instead of void *.
The prototype declaration must be marked as extern in the header.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
We want to set bits 1 & 2 on easy programming byte 4, not extended byte 4.
Thanks to David Wong for pointing this out.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Cc: David Wong <davidtlwong@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This translates much of the xceive coding style, adds
some result codes and generally cleans up whitespace
and function arguments.
Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This is an all formats tuner, QAM, ATSC, DVB-T and others.
Only ATSC and QAM have been tested.
Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Rather than using a pointer, include struct analog_demod_ops directly
inside struct dvb_frontend. This will allow us to use dvb_attach in
the future, along with removing the need to check the ops structure
before having to check the pointer to the method being called.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
struct analog_tuner_ops no longer has any dependencies specific
to v4l2, so we can move this into dvb_frontend.h with the rest
of the tuning structures.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
tuner_count is already declared as "extern unsigned const int"
in <media/tuner-types.h> -- Remove it from tuner-driver.h
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
In my testing yesterday, I was using a scan file tailored specifically
for a unique test situation -- As it turns out, this scan file was bad,
and I will use the one included inside dvb-apps for testing for now on.
I've tested with other ATSC tuners just to confirm, using:
us-ATSC-center-frequencies-8VSB
Anyhow, as it turns out, the tuner-xc2028 *does* require a tuning offset
for ATSC. Even though the linux-dvb api passes in center frequencies
from userspace, apparantly the xceive firmware is already factoring in
the tuning offset to center.
In order to make the device function using the same scan files /
channels.conf configurations as other atsc devices, we must offset by
1.75 MHz.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
do { \
if (debug) printk(KERN_DEBUG "mt312: " args); \
} while (0)
So no caller need to specify KERN_DEBUG.
Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
For some reason the include header wasn't changed from v4l2-i2c-drv-legacy.h
to v4l2-i2c-drv.h in the previous patch. This is now corrected.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Thanks to Steve Toth from Hauppauge with providing me with the information
needed to add support for these models.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
When an I2C message specifies a write then a read from the same I2C address,
we need to tell the chip to not release the bus between the message parts.
Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Some more I2C traces and a experimentation with register values on
both the ZL10353 and MT352 mean that I can now guess at what more
of the ZL10353 registers do.
Guess at the registers' names (based on the equivalent names in MT352)
and update set_parameters/get_parameters with the new knowledge.
Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
It seems that the DTV78 firmware is intended for use in locations where
VHF channels have 7MHz bandwidth and UHF channels have 8MHz bandwidth.
If we switch to DTV78 firmware when we detect this condition, we can
avoid firmware reloads when switching between VHF and UHF transponders.
Place the state for this in the control structure so that card drivers
can hint to us to use DTV78 firmware from the first tuning attempt.
Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
We have been inserting a mystery 500kHz offset for tuning 7MHz channels,
however some experimentation reveals it is only needed under certain
conditions with specific firmware combinations. Document these and only
apply the offset when we know it is required.
Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
When searching for the right S-Code table to load, check the HAS_IF flag
against the firmware we are checking instead of against the the "type"
requested. We already ignore the scode type requested if the caller passed
an int_freq; this makes the search by frequency consistent with that behaviour.
Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Don't modify the control structure that was provided at attach when applying
an offset to the S-Code, otherwise it will be incorrect on subsequent tunes.
Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Add "int_freq" to the debugging output when selecting firmware and the
HAS_IF flag when dumping firmware during load.
Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
The patch below adds the "Pinnacle Dazzle DVC 100" to the list of
cards supported by the em28xx driver. As the configuration is the same
as the DVC 90 one, it simply adds a new USB ID to the list of devices
supported by the DVC 90 configuration.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Ensure that the audio is muted at attach-time
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
struct tuner holds state for tuner-core, only -- move it into tuner-core.c
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
replace tda9887_info and tda9887_dbg printk macros with
tuner_info and tuner_dbg, defined in tuner-i2c.h
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Use TUNER_SET_CONFIG to set configuration in tda9887's private state
structure, rather than storing tda9887-specific configuration within
struct tuner.
Update handling of TUNER_SET_CONFIG by tuner-core, to call
&t->fe.ops.analog_demod_ops rather than &t->fe.ops.tuner_ops
analog_demod_ops.set_config passes the request to tuner_ops.set_config,
so this does not break other drivers.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Prevent us from wasting some extra bytes of memory
Thanks to Trent Piepho, for pointing this out.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
The auto selection of pertinent helper chips (VIDEO_HELPER_CHIPS_AUTO)
should select the wm8775 driver, which is used by at least one
Conexant 2388x based card (Hauppauge HVR-1300), if VIDEO_CX88 is
selected.
Signed-off-by: Frej Drejhammar <frej.drejhammar@gmail.com>
Signed-off-by: Ricardo Cerqueira <v4l@cerqueira.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
All cx2388 boards need the line-in audio to be routed from an external ADC
(refered to as "ADC mode" in the spec sheet), since the chip is uncapable
of dealing with baseband audio directly.
So... this patch enables normal mode when using the tuner (TV or Radio), and
enables ADC mode with any other source. It'll probably only work with boards
that have supported ADCs (such as the Wolfson wm9775)
Signed-off-by: Ricardo Cerqueira <v4l@cerqueira.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
We should not mute the audio input when we stop the codec,
because it will interfere with the live uncompressed stream.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Reviewed-by: Jelle Foks <jelle@foks.8m.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Fix lack of audio on the MPEG-2 stream of wm8775 based blackbirds.
The wm8775 module initializes the audio input at "route 2", which doesn't
hold true for all boards. The HVR-1300, for example, uses route 1 for
tuner audio, and route 2 for baseband. So we must route the audio to the
proper input depending on what video input is being used.
Signed-off-by: Ricardo Cerqueira <v4l@cerqueira.org>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Remove the unnecessary BLACKBIRD_UNMUTE calls to the mpeg encoder in
cx88-blackbird.c
The encoder is never muted, hence unmuting should then only be necessary
once after hardware initialization.
I tested this from warm boots and cold boots (with long power down time
to ensure the sram in the chip is emptied), and found that after the
firmware upload the encoder is apparently not muted, making the unmutes
unnecessary.
Signed-off-by: Jelle Foks <jelle@foks.8m.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This patch should fix the 'muted audio' and 'raspy audio' problem for
mpeg2 streams out of cx88-blackbird devices.
Especially mythtv users would find that the audio would often sound bad
(aliased, or 'raspy'), mainly related to channel changes, many (all?)
other users would find that there was no audio at all in the mpeg data
from the encoder chip, unless the audio was manually unmuted.
The patch includes the following modifications:
Don't actually start the mpeg2 encoder until the device is read from
by the application.
Wait until the audio is stable for at least 400ms before starting the
mpeg encoder.
Mute/Unmute the audio when starting/stopping the mpeg encoder.
Stop the mpeg encoder when changing parameters and when changing tuner
frequency.
Add a variable 'mpeg_active' to struct cx8802_dev to allow tracking of
whether or not the mpeg2 encoder is active.
Load the firmware on cx88-blackbird driver load.
Signed-off-by: Jelle Foks <jelle@foks.8m.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
ATSC standard-specific firmware is D2633 on both v2.5 and v2.7. Better to
auto-select this firmware, overriding ctrl.d2633.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
use VSB IF frequency ( 44 / 5.38 MHz ) if qam_if is invalid or unspecified
Acked-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
On the s5h1409 demod, the IF frequency for VSB is limited to 44 / 5.38 MHz.
Hardcode VSB IF frequency within the driver to 44 / 5.38 MHz.
QAM IF frequency remains configurable via attach-time configuration.
Acked-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
The ctrlUrbLock has all it's users commented out, and so it's unused. This
patch removes it.
Signed-off-by: Daniel Walker <dwalker@mvista.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Thierry MERLE <thierry.merle@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
There are a few error paths which don't unlock the usbvision->lock.
So I've added mutex_unlock() calls to fix those paths.
Signed-off-by: Daniel Walker <dwalker@mvista.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Thierry MERLE <thierry.merle@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/et61x251/et61x251_core.c:390: warning: 'et61x251_i2c_read' defined but not used
drivers/media/video/et61x251/et61x251_core.c:397: warning: 'et61x251_i2c_write' defined but not used
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
If we pass TDA18271_GATE_DIGITAL into tda18271_attach(), it will always try to
use the digital demodulator's i2c gate.
If we pass TDA18271_GATE_ANALOG into tda18271_attach(), it will always try to
use the analog demodulator's i2c gate.
If we pass TDA18271_GATE_AUTO into tda18271_attach(), it will try to use the
analog demodulator's i2c gate when tuning in analog mode, and it will try to
use the digital demodulator's i2c gate when tuning in digital mode.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Use an enum rather than an integer #define to store analog / digital state.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Those newer functions are used by saa7134-empress. Adds export for them:
+EXPORT_SYMBOL_GPL(saa7134_g_ctrl);
+EXPORT_SYMBOL_GPL(saa7134_s_ctrl);
+EXPORT_SYMBOL_GPL(saa7134_queryctrl);
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
saa7134 were converted to video_ioctl2, but saa7134_empress weren't. This broke
saa7134-empress, since it were dependent of saa7134_common_ioctl.
With the conversion, the module had a size decrease of 436 bytes on x86_64:
text data bss dec hex filename
5196 4912 4 10112 2780 old/saa7134-empress.ko
4760 4912 4 9676 25cc new/saa7134-empress.ko
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
VBI were broken, since there weren't any function handlers for it. This patch
fixes it, by removing the vbi_template, using, instead video_template.
This also saves some space at the data segment.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Some functions are used also by saa7134-empress, and need to be exported. To
avoid namespace confusion, rename all of them to saa7134_
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Don't waste 128 bytes of memory for a name that might not actually need it.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Fix codingstyle issue discovered after using new checkpatch.pl
ERROR: open brace '{' following struct go on the same line
396: FILE: linux/drivers/media/video/tda8290.h:24:
+struct tda829x_config
+{
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Store the analog demodulator name in fe.ops.analog_demod_ops.info.name
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
- remove dependency of tda8290 module on struct tuner
- move tuner_foo printk macros from tuner-driver.h into tuner-core.c
- clean up #includes of tuner-i2c.h / tuner-driver.h
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Always call tda829x_release if tda829x_attach fails for a reason
other than failure to allocate memory for private structure.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
We can tell whether we are tuning television or radio by testing for
struct analog_parameters *params->mode == V4L2_TUNER_RADIO
There is no longer any need for separate set_tv_freq and
set_radio_freq functions in the analog tuner demodulator modules.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Fix "warning: Using plain integer as NULL pointer".
Convert 'x < y ? x : y' to use min() instead.
Signed-off-by: Richard Knutsson <ricknu-0@student.ltu.se>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
The pvrusb2 driver tries to keep all device specific attributes in a
single data structure in one source file. This change further cleans
up how that table is set up. We now try to group everything together
for each specific device, and the number of symbols exported from this
module has now been reduced to a single global.
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Add support for the AVerMedia EZMaker PCI Deluxe and update the ivtv cardlist.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Manually fixed all pertinent checkpatch.pl errors inside the source code.
Also removed some unused code at the driver and a few minor cleanups.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
mv_count is a counter used to move the vertical bars. Before this patch, it
where a static var. This works fine for just one device. However, when using
multiple devices, every device would increment it.
This patch moves it to its correct place: struct vivi_dev. So, now, each device
has its own data.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Now, it is possible to open multiple vivi devices, by using n_devs parameter.
This makes vivi driver closer to a real one.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
There were a trouble at vivi driver when using non-zero inodes. This where due
to not properly preserving the minor inode after calling video_register. Since
this driver is a reference for newer drivers, and it is possible to have more
than one video device inside the machine, this patch makes vivi to dynamically
allocate video_device struct.
Thanks to Gregor Jasny <jasny@vidsoft.de> for pointing the issue.
Also, this patch removes a very anoying (but useless) message of not having a
proper release call.
CC: Gregor Jasny <jasny@vidsoft.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This patch enabled the IR remote control for the Avermedia M102 (card=110),
which appears to be the same IR as the already supported device on the
Avermedia AVerTV GO 007 FM (card=57) model, the code is two one liners which
enable the IR for this device (subsystem: 1461:f31e)
Signed-off-by: Albert Graham <agraham@g-b.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
dont just copy-and-paste stuff.
(compile-tested this time)
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Convert v4l from nopage to fault.
Remove redundant vma range checks.
Signed-off-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
The tuning request coming in from userspace is already center adjusted,
so we should not adjust to center (+1.75mhz) within the driver.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
cx25840_read4 reads a little-endian 32-bit value whereas cx25840_write4 writes
the 32-bit value as big-endian. Convert write4 to use little-endian as well
(that's the correct endianness).
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
After this patch, the order of the functions will be the same as before the
patch converting the driver to user video_ioctl2. This makes easier to diff
between the previous version and the newer one.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Remove the shadowing 'struct v4l2_chip_ident *chip', since it already exists
and makes the if-statement useless.
Signed-off-by: Richard Knutsson <ricknu-0@student.ltu.se>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>