1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (C) 2014 Felix Fietkau <nbd@openwrt.org>
4 * Copyright (C) 2015 Jakub Kicinski <kubakici@wp.pl>
9 int mt7601u_wait_asic_ready(struct mt7601u_dev
*dev
)
15 if (test_bit(MT7601U_STATE_REMOVED
, &dev
->state
))
18 val
= mt7601u_rr(dev
, MT_MAC_CSR0
);
28 bool mt76_poll(struct mt7601u_dev
*dev
, u32 offset
, u32 mask
, u32 val
,
35 if (test_bit(MT7601U_STATE_REMOVED
, &dev
->state
))
38 cur
= mt7601u_rr(dev
, offset
) & mask
;
43 } while (timeout
-- > 0);
45 dev_err(dev
->dev
, "Error: Time out with reg %08x\n", offset
);
50 bool mt76_poll_msec(struct mt7601u_dev
*dev
, u32 offset
, u32 mask
, u32 val
,
57 if (test_bit(MT7601U_STATE_REMOVED
, &dev
->state
))
60 cur
= mt7601u_rr(dev
, offset
) & mask
;
65 } while (timeout
-- > 0);
67 dev_err(dev
->dev
, "Error: Time out with reg %08x\n", offset
);