mt76x2: move mt76x2_write_reg_pairs to mt76x2_init.c

Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
Felix Fietkau
2016-02-03 15:57:25 +01:00
parent a6d7949f67
commit ebb8d3a74b
3 changed files with 18 additions and 20 deletions
-8
View File
@@ -150,14 +150,6 @@ struct mt76x2_sta {
int n_frames;
};
struct mt76x2_reg_pair {
u32 reg;
u32 value;
};
void mt76_write_reg_pairs(struct mt76x2_dev *dev,
const struct mt76x2_reg_pair *data, int len);
static inline bool is_mt7612(struct mt76x2_dev *dev)
{
return (dev->rev >> 16) == 0x7612;
-10
View File
@@ -15,16 +15,6 @@
#include "mt76x2.h"
#include "mt76x2_trace.h"
void mt76_write_reg_pairs(struct mt76x2_dev *dev,
const struct mt76x2_reg_pair *data, int len)
{
while (len > 0) {
mt76_wr(dev, data->reg, data->value);
len--;
data++;
}
}
void mt76x2_set_irq_mask(struct mt76x2_dev *dev, u32 clear, u32 set)
{
unsigned long flags;
+18 -2
View File
@@ -16,6 +16,11 @@
#include "mt76x2_eeprom.h"
#include "mt76x2_mcu.h"
struct mt76x2_reg_pair {
u32 reg;
u32 value;
};
static bool
mt76x2_wait_for_mac(struct mt76x2_dev *dev)
{
@@ -62,6 +67,17 @@ mt76x2_mac_pbf_init(struct mt76x2_dev *dev)
mt76_wr(dev, MT_PBF_RX_MAX_PCNT, 0xfebf);
}
static void
mt76x2_write_reg_pairs(struct mt76x2_dev *dev,
const struct mt76x2_reg_pair *data, int len)
{
while (len > 0) {
mt76_wr(dev, data->reg, data->value);
len--;
data++;
}
}
static void
mt76_write_mac_initvals(struct mt76x2_dev *dev)
{
@@ -148,8 +164,8 @@ mt76_write_mac_initvals(struct mt76x2_dev *dev)
{ MT_GF40_PROT_CFG, DEFAULT_PROT_CFG_40 },
};
mt76_write_reg_pairs(dev, vals, ARRAY_SIZE(vals));
mt76_write_reg_pairs(dev, prot_vals, ARRAY_SIZE(prot_vals));
mt76x2_write_reg_pairs(dev, vals, ARRAY_SIZE(vals));
mt76x2_write_reg_pairs(dev, prot_vals, ARRAY_SIZE(prot_vals));
}
static void