Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 17270
b: refs/heads/master
c: 2d0235d
h: refs/heads/master
v: v3
  • Loading branch information
Andrew de Quincey authored and Mauro Carvalho Chehab committed Jan 9, 2006
1 parent e66da12 commit 5664b74
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8a8e9c281de5dd63cdcbbafc0252fe0d8c758294
refs/heads/master: 2d0235df0e62cb9f07232bf9cf8009fabf13d304
28 changes: 23 additions & 5 deletions trunk/drivers/media/dvb/ttpci/budget-av.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ static int ciintf_read_attribute_mem(struct dvb_ca_en50221 *ca, int slot, int ad
saa7146_setgpio(budget_av->budget.dev, 1, SAA7146_GPIO_OUTHI);
udelay(1);

result = ttpci_budget_debiread(&budget_av->budget, DEBICICAM, address & 0xfff, 1, 0, 0);
result = ttpci_budget_debiread(&budget_av->budget, DEBICICAM, address & 0xfff, 1, 0, 1);

if (result == -ETIMEDOUT)
budget_av->slot_status = 0;
Expand All @@ -145,7 +145,7 @@ static int ciintf_write_attribute_mem(struct dvb_ca_en50221 *ca, int slot, int a
saa7146_setgpio(budget_av->budget.dev, 1, SAA7146_GPIO_OUTHI);
udelay(1);

result = ttpci_budget_debiwrite(&budget_av->budget, DEBICICAM, address & 0xfff, 1, value, 0, 0);
result = ttpci_budget_debiwrite(&budget_av->budget, DEBICICAM, address & 0xfff, 1, value, 0, 1);

if (result == -ETIMEDOUT)
budget_av->slot_status = 0;
Expand Down Expand Up @@ -192,7 +192,7 @@ static int ciintf_slot_reset(struct dvb_ca_en50221 *ca, int slot)
{
struct budget_av *budget_av = (struct budget_av *) ca->data;
struct saa7146_dev *saa = budget_av->budget.dev;
int timeout = 500; // 5 seconds (4.4.6 Ready)
int timeout = 50; // 5 seconds (4.4.6 Ready)

if (slot != 0)
return -EINVAL;
Expand Down Expand Up @@ -256,19 +256,37 @@ static int ciintf_poll_slot_status(struct dvb_ca_en50221 *ca, int slot, int open
{
struct budget_av *budget_av = (struct budget_av *) ca->data;
struct saa7146_dev *saa = budget_av->budget.dev;
int cam_present = 0;

if (slot != 0)
return -EINVAL;

if (!budget_av->slot_status) {
if (!budget_av->slot_status)
{
// first of all test the card detect line
saa7146_setgpio(saa, 3, SAA7146_GPIO_INPUT);
udelay(1);
if (saa7146_read(saa, PSR) & MASK_06)
{
cam_present = 1;
}
saa7146_setgpio(saa, 3, SAA7146_GPIO_OUTLO);

// that is unreliable however, so try and read from IO memory
if (!cam_present)
{
saa7146_setgpio(budget_av->budget.dev, 1, SAA7146_GPIO_OUTLO);
if (ttpci_budget_debiread(&budget_av->budget, DEBICICAM, 0, 1, 0, 1) != -ETIMEDOUT)
{
cam_present = 1;
}
}

// did we find something?
if (cam_present) {
printk(KERN_INFO "budget-av: cam inserted\n");
budget_av->slot_status = 1;
}
saa7146_setgpio(saa, 3, SAA7146_GPIO_OUTLO);
} else if (!open) {
saa7146_setgpio(budget_av->budget.dev, 1, SAA7146_GPIO_OUTLO);
if (ttpci_budget_debiread(&budget_av->budget, DEBICICAM, 0, 1, 0, 1) == -ETIMEDOUT)
Expand Down

0 comments on commit 5664b74

Please sign in to comment.