Skip to content

Commit

Permalink
firewire: add CSR CYCLE_TIME write support
Browse files Browse the repository at this point in the history
The specification requires that CYCLE_TIME is writable so that it can be
initialized, so we better implement it.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
  • Loading branch information
Clemens Ladisch committed Jun 10, 2010
1 parent 8e4b50f commit 9ab5071
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/firewire/core-transaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -1097,6 +1097,9 @@ static void handle_registers(struct fw_card *card, struct fw_request *request,
if (TCODE_IS_READ_REQUEST(tcode) && length == 4)
*data = cpu_to_be32(card->driver->
read_csr_reg(card, CSR_CYCLE_TIME));
else if (tcode == TCODE_WRITE_QUADLET_REQUEST)
card->driver->write_csr_reg(card, CSR_CYCLE_TIME,
be32_to_cpu(*data));
else
rcode = RCODE_TYPE_ERROR;
break;
Expand Down
7 changes: 7 additions & 0 deletions drivers/firewire/ohci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1996,6 +1996,13 @@ static void ohci_write_csr_reg(struct fw_card *card, int csr_offset, u32 value)
flush_writes(ohci);
break;

case CSR_CYCLE_TIME:
reg_write(ohci, OHCI1394_IsochronousCycleTimer, value);
reg_write(ohci, OHCI1394_IntEventSet,
OHCI1394_cycleInconsistent);
flush_writes(ohci);
break;

default:
WARN_ON(1);
break;
Expand Down

0 comments on commit 9ab5071

Please sign in to comment.