Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 269344
b: refs/heads/master
c: 46b9e77
h: refs/heads/master
v: v3
  • Loading branch information
Bartlomiej Zolnierkiewicz authored and Jeff Garzik committed Oct 14, 2011
1 parent 57c7c1c commit 4b2a199
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 10 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: d912be2f3b335353ee442262e010a225c94e6ef4
refs/heads/master: 46b9e77076a609d10b2009310a1e58281f8daaf9
35 changes: 26 additions & 9 deletions trunk/drivers/ata/pata_atiixp.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,31 @@ static int atiixp_cable_detect(struct ata_port *ap)

static DEFINE_SPINLOCK(atiixp_lock);

/**
* atiixp_prereset - perform reset handling
* @link: ATA link
* @deadline: deadline jiffies for the operation
*
* Reset sequence checking enable bits to see which ports are
* active.
*/

static int atiixp_prereset(struct ata_link *link, unsigned long deadline)
{
static const struct pci_bits atiixp_enable_bits[] = {
{ 0x48, 1, 0x01, 0x00 },
{ 0x48, 1, 0x08, 0x00 }
};

struct ata_port *ap = link->ap;
struct pci_dev *pdev = to_pci_dev(ap->host->dev);

if (!pci_test_config_bits(pdev, &atiixp_enable_bits[ap->port_no]))
return -ENOENT;

return ata_sff_prereset(link, deadline);
}

/**
* atiixp_set_pio_timing - set initial PIO mode data
* @ap: ATA interface
Expand Down Expand Up @@ -221,6 +246,7 @@ static struct ata_port_operations atiixp_port_ops = {
.bmdma_start = atiixp_bmdma_start,
.bmdma_stop = atiixp_bmdma_stop,

.prereset = atiixp_prereset,
.cable_detect = atiixp_cable_detect,
.set_piomode = atiixp_set_piomode,
.set_dmamode = atiixp_set_dmamode,
Expand All @@ -235,16 +261,7 @@ static int atiixp_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
.udma_mask = ATA_UDMA5,
.port_ops = &atiixp_port_ops
};
static const struct pci_bits atiixp_enable_bits[] = {
{ 0x48, 1, 0x01, 0x00 },
{ 0x48, 1, 0x08, 0x00 }
};
const struct ata_port_info *ppi[] = { &info, &info };
int i;

for (i = 0; i < 2; i++)
if (!pci_test_config_bits(pdev, &atiixp_enable_bits[i]))
ppi[i] = &ata_dummy_port_info;

return ata_pci_bmdma_init_one(pdev, ppi, &atiixp_sht, NULL,
ATA_HOST_PARALLEL_SCAN);
Expand Down

0 comments on commit 4b2a199

Please sign in to comment.