mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
mt76: use mt76_dev in mt76_is_{mmio,usb}
Convert mt76_is_mmio and mt76_is_usb to rely on mt76_dev instead of mt76x02_dev since this is a property not strictly related to hw chipset and it will be more reusable Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
committed by
Felix Fietkau
parent
ea19cd7ac6
commit
a85c06cec8
+6
-6
@@ -110,7 +110,7 @@ out:
|
||||
static int
|
||||
mt76x0_rf_wr(struct mt76x02_dev *dev, u32 offset, u8 val)
|
||||
{
|
||||
if (mt76_is_usb(dev)) {
|
||||
if (mt76_is_usb(&dev->mt76)) {
|
||||
struct mt76_reg_pair pair = {
|
||||
.reg = offset,
|
||||
.value = val,
|
||||
@@ -129,7 +129,7 @@ static int mt76x0_rf_rr(struct mt76x02_dev *dev, u32 offset)
|
||||
int ret;
|
||||
u32 val;
|
||||
|
||||
if (mt76_is_usb(dev)) {
|
||||
if (mt76_is_usb(&dev->mt76)) {
|
||||
struct mt76_reg_pair pair = {
|
||||
.reg = offset,
|
||||
};
|
||||
@@ -184,7 +184,7 @@ mt76x0_phy_rf_csr_wr_rp(struct mt76x02_dev *dev,
|
||||
}
|
||||
|
||||
#define RF_RANDOM_WRITE(dev, tab) do { \
|
||||
if (mt76_is_mmio(dev)) \
|
||||
if (mt76_is_mmio(&dev->mt76)) \
|
||||
mt76x0_phy_rf_csr_wr_rp(dev, tab, ARRAY_SIZE(tab)); \
|
||||
else \
|
||||
mt76_wr_rp(dev, MT_MCU_MEMMAP_RF, tab, ARRAY_SIZE(tab));\
|
||||
@@ -752,7 +752,7 @@ mt76x0_phy_get_delta_power(struct mt76x02_dev *dev, u8 tx_mode,
|
||||
|
||||
if (!tx_mode) {
|
||||
data = mt76_rr(dev, MT_BBP(CORE, 1));
|
||||
if (is_mt7630(dev) && mt76_is_mmio(dev)) {
|
||||
if (is_mt7630(dev) && mt76_is_mmio(&dev->mt76)) {
|
||||
int offset;
|
||||
|
||||
/* 2.3 * 8192 or 1.5 * 8192 */
|
||||
@@ -974,7 +974,7 @@ void mt76x0_phy_set_channel(struct mt76x02_dev *dev,
|
||||
break;
|
||||
}
|
||||
|
||||
if (mt76_is_usb(dev)) {
|
||||
if (mt76_is_usb(&dev->mt76)) {
|
||||
mt76x0_phy_bbp_set_bw(dev, chandef->width);
|
||||
} else {
|
||||
if (chandef->width == NL80211_CHAN_WIDTH_80 ||
|
||||
@@ -1130,7 +1130,7 @@ static void mt76x0_rf_patch_reg_array(struct mt76x02_dev *dev,
|
||||
|
||||
switch (reg) {
|
||||
case MT_RF(0, 3):
|
||||
if (mt76_is_mmio(dev)) {
|
||||
if (mt76_is_mmio(&dev->mt76)) {
|
||||
if (is_mt7630(dev))
|
||||
val = 0x70;
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user