mt76: mt7915: only use u32_get_bits with constant value

Fixes invalid unresolved symbols when built on ARM and avoids unnecessary
divisions

Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
Felix Fietkau
2022-02-23 11:33:24 +01:00
parent 378b638c70
commit 4f43095428
2 changed files with 12 additions and 3 deletions
+2 -1
View File
@@ -781,7 +781,8 @@ enum offs_rev {
/* ADIE */
#define MT_ADIE_CHIP_ID 0x02c
#define MT_ADIE_CHIP_ID_MASK GENMASK(31, 16)
#define MT_ADIE_IDX(x) ((x) ? GENMASK(31, 16) : GENMASK(15, 0))
#define MT_ADIE_IDX0 GENMASK(15, 0)
#define MT_ADIE_IDX1 GENMASK(31, 16)
#define MT_ADIE_RG_TOP_THADC_BG 0x034
#define MT_ADIE_VRPI_SEL_CR_MASK GENMASK(15, 12)
+10 -2
View File
@@ -327,14 +327,22 @@ out:
return 0;
}
static inline u16 mt7986_adie_idx(u8 adie, u32 adie_type)
{
if (adie == 0)
return u32_get_bits(adie_type, MT_ADIE_IDX0);
else
return u32_get_bits(adie_type, MT_ADIE_IDX1);
}
static inline bool is_7975(struct mt7915_dev *dev, u8 adie, u32 adie_type)
{
return u32_get_bits(adie_type, MT_ADIE_IDX(adie)) == 0x7975;
return mt7986_adie_idx(adie, adie_type) == 0x7975;
}
static inline bool is_7976(struct mt7915_dev *dev, u8 adie, u32 adie_type)
{
return u32_get_bits(adie_type, MT_ADIE_IDX(adie)) == 0x7976;
return mt7986_adie_idx(adie, adie_type) == 0x7976;
}
static int mt7986_wmac_adie_thermal_cal(struct mt7915_dev *dev, u8 adie)