aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firewire/ohci.c
diff options
context:
space:
mode:
authorStefan Richter <stefanr@s5r6.in-berlin.de>2010-06-12 14:30:21 -0400
committerStefan Richter <stefanr@s5r6.in-berlin.de>2010-06-19 07:01:41 -0400
commitdb3c9cc105ee844f6cd7a1beb9926fb8e9a093ae (patch)
tree5fe981b7be4ffb97a506e23836d6c81a61dc8c91 /drivers/firewire/ohci.c
parente847cc832bab50aad939a0c30414cd986637564d (diff)
firewire: replace get_features card driver hook
by feature variables in the fw_card struct. The hook appeared to be an unnecessary abstraction in the card driver interface. Cleaner would be to pass those feature flags as arguments to fw_card_initialize() or fw_card_add(), but the FairnessControl register is in the SCLK domain and may therefore not be accessible while Link Power Status is off, i.e. before the card->driver->enable call from fw_card_add(). Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/firewire/ohci.c')
-rw-r--r--drivers/firewire/ohci.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c
index 2abdb3268a10..09bba9315de9 100644
--- a/drivers/firewire/ohci.c
+++ b/drivers/firewire/ohci.c
@@ -172,7 +172,6 @@ struct fw_ohci {
172 int request_generation; /* for timestamping incoming requests */ 172 int request_generation; /* for timestamping incoming requests */
173 unsigned quirks; 173 unsigned quirks;
174 unsigned int pri_req_max; 174 unsigned int pri_req_max;
175 unsigned int features;
176 u32 bus_time; 175 u32 bus_time;
177 bool is_root; 176 bool is_root;
178 177
@@ -1753,15 +1752,14 @@ static int ohci_enable(struct fw_card *card,
1753 if (version >= OHCI_VERSION_1_1) { 1752 if (version >= OHCI_VERSION_1_1) {
1754 reg_write(ohci, OHCI1394_InitialChannelsAvailableHi, 1753 reg_write(ohci, OHCI1394_InitialChannelsAvailableHi,
1755 0xfffffffe); 1754 0xfffffffe);
1756 ohci->features |= FEATURE_CHANNEL_31_ALLOCATED; 1755 card->broadcast_channel_auto_allocated = true;
1757 } 1756 }
1758 1757
1759 /* Get implemented bits of the priority arbitration request counter. */ 1758 /* Get implemented bits of the priority arbitration request counter. */
1760 reg_write(ohci, OHCI1394_FairnessControl, 0x3f); 1759 reg_write(ohci, OHCI1394_FairnessControl, 0x3f);
1761 ohci->pri_req_max = reg_read(ohci, OHCI1394_FairnessControl) & 0x3f; 1760 ohci->pri_req_max = reg_read(ohci, OHCI1394_FairnessControl) & 0x3f;
1762 reg_write(ohci, OHCI1394_FairnessControl, 0); 1761 reg_write(ohci, OHCI1394_FairnessControl, 0);
1763 if (ohci->pri_req_max != 0) 1762 card->priority_budget_implemented = ohci->pri_req_max != 0;
1764 ohci->features |= FEATURE_PRIORITY_BUDGET;
1765 1763
1766 ar_context_run(&ohci->ar_request_ctx); 1764 ar_context_run(&ohci->ar_request_ctx);
1767 ar_context_run(&ohci->ar_response_ctx); 1765 ar_context_run(&ohci->ar_response_ctx);
@@ -2132,13 +2130,6 @@ static void ohci_write_csr_reg(struct fw_card *card, int csr_offset, u32 value)
2132 } 2130 }
2133} 2131}
2134 2132
2135static unsigned int ohci_get_features(struct fw_card *card)
2136{
2137 struct fw_ohci *ohci = fw_ohci(card);
2138
2139 return ohci->features;
2140}
2141
2142static void copy_iso_headers(struct iso_context *ctx, void *p) 2133static void copy_iso_headers(struct iso_context *ctx, void *p)
2143{ 2134{
2144 int i = ctx->header_length; 2135 int i = ctx->header_length;
@@ -2578,7 +2569,6 @@ static const struct fw_card_driver ohci_driver = {
2578 .enable_phys_dma = ohci_enable_phys_dma, 2569 .enable_phys_dma = ohci_enable_phys_dma,
2579 .read_csr_reg = ohci_read_csr_reg, 2570 .read_csr_reg = ohci_read_csr_reg,
2580 .write_csr_reg = ohci_write_csr_reg, 2571 .write_csr_reg = ohci_write_csr_reg,
2581 .get_features = ohci_get_features,
2582 2572
2583 .allocate_iso_context = ohci_allocate_iso_context, 2573 .allocate_iso_context = ohci_allocate_iso_context,
2584 .free_iso_context = ohci_free_iso_context, 2574 .free_iso_context = ohci_free_iso_context,