Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 300907
b: refs/heads/master
c: 4ded91c
h: refs/heads/master
i:
  300905: 8c6e3f9
  300903: bc0be3f
v: v3
  • Loading branch information
Luciano Coelho committed Apr 12, 2012
1 parent 832b6f4 commit 5c38716
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 12 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: 6f7dd16cb125468a5393861c22fbecfb52dd9653
refs/heads/master: 4ded91ced98c3d35c0d36e9ac5e69589f7aad04a
14 changes: 14 additions & 0 deletions trunk/drivers/net/wireless/ti/wl12xx/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

#include "../wlcore/wlcore.h"
#include "../wlcore/debug.h"
#include "../wlcore/io.h"

#include "reg.h"

Expand Down Expand Up @@ -180,8 +181,21 @@ static int wl12xx_identify_chip(struct wl1271 *wl)
return ret;
}

static s8 wl12xx_get_pg_ver(struct wl1271 *wl)
{
u32 die_info;

if (wl->chip.id == CHIP_ID_1283_PG20)
die_info = wl1271_top_reg_read(wl, WL128X_REG_FUSE_DATA_2_1);
else
die_info = wl1271_top_reg_read(wl, WL127X_REG_FUSE_DATA_2_1);

return (s8) (die_info & PG_VER_MASK) >> PG_VER_OFFSET;
}

static struct wlcore_ops wl12xx_ops = {
.identify_chip = wl12xx_identify_chip,
.get_pg_ver = wl12xx_get_pg_ver,
};

static int __devinit wl12xx_probe(struct platform_device *pdev)
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/wireless/ti/wlcore/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,3 +219,4 @@ u16 wl1271_top_reg_read(struct wl1271 *wl, int addr)
return 0xffff;
}
}
EXPORT_SYMBOL_GPL(wl1271_top_reg_read);
12 changes: 1 addition & 11 deletions trunk/drivers/net/wireless/ti/wlcore/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -5066,7 +5066,6 @@ static void wl12xx_get_fuse_mac(struct wl1271 *wl)
static int wl12xx_get_hw_info(struct wl1271 *wl)
{
int ret;
u32 die_info;

ret = wl12xx_set_power_on(wl);
if (ret < 0)
Expand All @@ -5077,20 +5076,11 @@ static int wl12xx_get_hw_info(struct wl1271 *wl)
wl->fuse_oui_addr = 0;
wl->fuse_nic_addr = 0;

/* TODO: properly detect PG ver and read MAC addr in other families */
if (wl->chip.id == CHIP_ID_1283_PG20)
die_info = wl1271_top_reg_read(wl, WL128X_REG_FUSE_DATA_2_1);
else if (wl->chip.id < CHIP_ID_1283_PG20)
die_info = wl1271_top_reg_read(wl, WL127X_REG_FUSE_DATA_2_1);
else
goto skip_mac;

wl->hw_pg_ver = (s8) (die_info & PG_VER_MASK) >> PG_VER_OFFSET;
wl->hw_pg_ver = wl->ops->get_pg_ver(wl);

if (wl12xx_mac_in_fuse(wl))
wl12xx_get_fuse_mac(wl);

skip_mac:
wl1271_power_off(wl);
out:
return ret;
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/wireless/ti/wlcore/wlcore.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

struct wlcore_ops {
int (*identify_chip)(struct wl1271 *wl);
s8 (*get_pg_ver)(struct wl1271 *wl);
};

enum wlcore_partitions {
Expand Down

0 comments on commit 5c38716

Please sign in to comment.