diff options
| -rw-r--r-- | drivers/firewire/ohci.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c index c788dbdaf3bc..834e71d2324d 100644 --- a/drivers/firewire/ohci.c +++ b/drivers/firewire/ohci.c | |||
| @@ -1777,11 +1777,35 @@ static int get_self_id_pos(struct fw_ohci *ohci, u32 self_id, | |||
| 1777 | return i; | 1777 | return i; |
| 1778 | } | 1778 | } |
| 1779 | 1779 | ||
| 1780 | static int initiated_reset(struct fw_ohci *ohci) | ||
| 1781 | { | ||
| 1782 | int reg; | ||
| 1783 | int ret = 0; | ||
| 1784 | |||
| 1785 | mutex_lock(&ohci->phy_reg_mutex); | ||
| 1786 | reg = write_phy_reg(ohci, 7, 0xe0); /* Select page 7 */ | ||
| 1787 | if (reg >= 0) { | ||
| 1788 | reg = read_phy_reg(ohci, 8); | ||
| 1789 | reg |= 0x40; | ||
| 1790 | reg = write_phy_reg(ohci, 8, reg); /* set PMODE bit */ | ||
| 1791 | if (reg >= 0) { | ||
| 1792 | reg = read_phy_reg(ohci, 12); /* read register 12 */ | ||
| 1793 | if (reg >= 0) { | ||
| 1794 | if ((reg & 0x08) == 0x08) { | ||
| 1795 | /* bit 3 indicates "initiated reset" */ | ||
| 1796 | ret = 0x2; | ||
| 1797 | } | ||
| 1798 | } | ||
| 1799 | } | ||
| 1800 | } | ||
| 1801 | mutex_unlock(&ohci->phy_reg_mutex); | ||
| 1802 | return ret; | ||
| 1803 | } | ||
| 1804 | |||
| 1780 | /* | 1805 | /* |
| 1781 | * TI TSB82AA2B and TSB12LV26 do not receive the selfID of a locally | 1806 | * TI TSB82AA2B and TSB12LV26 do not receive the selfID of a locally |
| 1782 | * attached TSB41BA3D phy; see http://www.ti.com/litv/pdf/sllz059. | 1807 | * attached TSB41BA3D phy; see http://www.ti.com/litv/pdf/sllz059. |
| 1783 | * Construct the selfID from phy register contents. | 1808 | * Construct the selfID from phy register contents. |
| 1784 | * FIXME: How to determine the selfID.i flag? | ||
| 1785 | */ | 1809 | */ |
| 1786 | static int find_and_insert_self_id(struct fw_ohci *ohci, int self_id_count) | 1810 | static int find_and_insert_self_id(struct fw_ohci *ohci, int self_id_count) |
| 1787 | { | 1811 | { |
| @@ -1814,6 +1838,8 @@ static int find_and_insert_self_id(struct fw_ohci *ohci, int self_id_count) | |||
| 1814 | self_id |= ((status & 0x3) << (6 - (i * 2))); | 1838 | self_id |= ((status & 0x3) << (6 - (i * 2))); |
| 1815 | } | 1839 | } |
| 1816 | 1840 | ||
| 1841 | self_id |= initiated_reset(ohci); | ||
| 1842 | |||
| 1817 | pos = get_self_id_pos(ohci, self_id, self_id_count); | 1843 | pos = get_self_id_pos(ohci, self_id, self_id_count); |
| 1818 | if (pos >= 0) { | 1844 | if (pos >= 0) { |
| 1819 | memmove(&(ohci->self_id_buffer[pos+1]), | 1845 | memmove(&(ohci->self_id_buffer[pos+1]), |
