Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 265781
b: refs/heads/master
c: 6f07b72
h: refs/heads/master
i:
  265779: 1c7ed57
v: v3
  • Loading branch information
Gery Kahn authored and Luciano Coelho committed Aug 12, 2011
1 parent 42fe4fd commit 9888edc
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0a1d3abcc43231e341b6890b873dc27cba848218
refs/heads/master: 6f07b72adaeddc9a90306ab4f2237b90967fd3ce
13 changes: 8 additions & 5 deletions trunk/drivers/net/wireless/wl12xx/boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -549,13 +549,13 @@ static void wl1271_boot_hw_version(struct wl1271 *wl)
{
u32 fuse;

fuse = wl1271_top_reg_read(wl, REG_FUSE_DATA_2_1);
if (wl->chip.id == CHIP_ID_1283_PG20)
fuse = wl1271_top_reg_read(wl, WL128X_REG_FUSE_DATA_2_1);
else
fuse = wl1271_top_reg_read(wl, WL127X_REG_FUSE_DATA_2_1);
fuse = (fuse & PG_VER_MASK) >> PG_VER_OFFSET;

wl->hw_pg_ver = (s8)fuse;

if (((wl->hw_pg_ver & PG_MAJOR_VER_MASK) >> PG_MAJOR_VER_OFFSET) < 3)
wl->quirks |= WL12XX_QUIRK_END_OF_TRANSACTION;
}

static int wl128x_switch_tcxo_to_fref(struct wl1271 *wl)
Expand Down Expand Up @@ -696,7 +696,8 @@ static int wl127x_boot_clk(struct wl1271 *wl)
u32 pause;
u32 clk;

wl1271_boot_hw_version(wl);
if (((wl->hw_pg_ver & PG_MAJOR_VER_MASK) >> PG_MAJOR_VER_OFFSET) < 3)
wl->quirks |= WL12XX_QUIRK_END_OF_TRANSACTION;

if (wl->ref_clock == CONF_REF_CLK_19_2_E ||
wl->ref_clock == CONF_REF_CLK_38_4_E ||
Expand Down Expand Up @@ -750,6 +751,8 @@ int wl1271_load_firmware(struct wl1271 *wl)
u32 tmp, clk;
int selected_clock = -1;

wl1271_boot_hw_version(wl);

if (wl->chip.id == CHIP_ID_1283_PG20) {
ret = wl128x_boot_clk(wl, &selected_clock);
if (ret < 0)
Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/net/wireless/wl12xx/boot.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ struct wl1271_static_data {
#define OCP_REG_CLK_POLARITY 0x0cb2
#define OCP_REG_CLK_PULL 0x0cb4

#define REG_FUSE_DATA_2_1 0x050a
#define WL127X_REG_FUSE_DATA_2_1 0x050a
#define WL128X_REG_FUSE_DATA_2_1 0x2152
#define PG_VER_MASK 0x3c
#define PG_VER_OFFSET 2

Expand Down
12 changes: 11 additions & 1 deletion trunk/drivers/net/wireless/wl12xx/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1395,6 +1395,7 @@ static int wl1271_chip_wakeup(struct wl1271 *wl)
int wl1271_plt_start(struct wl1271 *wl)
{
int retries = WL1271_BOOT_RETRIES;
struct wiphy *wiphy = wl->hw->wiphy;
int ret;

mutex_lock(&wl->mutex);
Expand Down Expand Up @@ -1428,6 +1429,11 @@ int wl1271_plt_start(struct wl1271 *wl)
wl1271_notice("firmware booted in PLT mode (%s)",
wl->chip.fw_ver_str);

/* update hw/fw version info in wiphy struct */
wiphy->hw_version = wl->chip.id;
strncpy(wiphy->fw_version, wl->chip.fw_ver_str,
sizeof(wiphy->fw_version));

goto out;

irq_disable:
Expand Down Expand Up @@ -4126,7 +4132,7 @@ static ssize_t wl1271_sysfs_show_hw_pg_ver(struct device *dev,
return len;
}

static DEVICE_ATTR(hw_pg_ver, S_IRUGO | S_IWUSR,
static DEVICE_ATTR(hw_pg_ver, S_IRUGO,
wl1271_sysfs_show_hw_pg_ver, NULL);

static ssize_t wl1271_sysfs_read_fwlog(struct file *filp, struct kobject *kobj,
Expand Down Expand Up @@ -4522,6 +4528,10 @@ int wl1271_free_hw(struct wl1271 *wl)
mutex_unlock(&wl->mutex);

device_remove_bin_file(&wl->plat_dev->dev, &fwlog_attr);

device_remove_file(&wl->plat_dev->dev, &dev_attr_hw_pg_ver);

device_remove_file(&wl->plat_dev->dev, &dev_attr_bt_coex_state);
platform_device_unregister(wl->plat_dev);
free_page((unsigned long)wl->fwlog);
dev_kfree_skb(wl->dummy_packet);
Expand Down

0 comments on commit 9888edc

Please sign in to comment.