1 // SPDX-License-Identifier: GPL-2.0
4 void tw5864_indir_writeb(struct tw5864_dev
*dev
, u16 addr
, u8 data
)
8 while (tw_readl(TW5864_IND_CTL
) & BIT(31) && --retries
)
11 dev_err(&dev
->pci
->dev
,
12 "tw_indir_writel() retries exhausted before writing\n");
14 tw_writel(TW5864_IND_DATA
, data
);
15 tw_writel(TW5864_IND_CTL
, addr
<< 2 | TW5864_RW
| TW5864_ENABLE
);
18 u8
tw5864_indir_readb(struct tw5864_dev
*dev
, u16 addr
)
22 while (tw_readl(TW5864_IND_CTL
) & BIT(31) && --retries
)
25 dev_err(&dev
->pci
->dev
,
26 "tw_indir_readl() retries exhausted before reading\n");
28 tw_writel(TW5864_IND_CTL
, addr
<< 2 | TW5864_ENABLE
);
31 while (tw_readl(TW5864_IND_CTL
) & BIT(31) && --retries
)
34 dev_err(&dev
->pci
->dev
,
35 "tw_indir_readl() retries exhausted at reading\n");
37 return tw_readl(TW5864_IND_DATA
);