Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 256218
b: refs/heads/master
c: 0c00504
h: refs/heads/master
v: v3
  • Loading branch information
Shahar Levi authored and Luciano Coelho committed Jun 27, 2011
1 parent c137efc commit ab98540
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 3 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: 86046da4afe068991b77e0a4c4b79b99ad961bda
refs/heads/master: 0c005048aa3cd3ac7bfdd3c6fcc20ea4f0ab667d
3 changes: 3 additions & 0 deletions trunk/drivers/net/wireless/wl12xx/boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -749,6 +749,9 @@ int wl1271_load_firmware(struct wl1271 *wl)
clk |= (wl->ref_clock << 1) << 4;
}

if (wl->quirks & WL12XX_QUIRK_LPD_MODE)
clk |= SCRATCH_ENABLE_LPD;

wl1271_write32(wl, DRPW_SCRATCH_START, clk);

wl1271_set_partition(wl, &part_table[PART_WORK]);
Expand Down
5 changes: 5 additions & 0 deletions trunk/drivers/net/wireless/wl12xx/cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@ int wl1271_cmd_general_parms(struct wl1271 *wl)
/* Override the REF CLK from the NVS with the one from platform data */
gen_parms->general_params.ref_clock = wl->ref_clock;

/* LPD mode enable (bits 6-7) in WL1271 AP mode only */
if (wl->quirks & WL12XX_QUIRK_LPD_MODE)
gen_parms->general_params.general_settings |=
GENERAL_SETTINGS_DRPW_LPD;

ret = wl1271_cmd_test(wl, gen_parms, sizeof(*gen_parms), answer);
if (ret < 0) {
wl1271_warning("CMD_INI_FILE_GENERAL_PARAM failed");
Expand Down
3 changes: 3 additions & 0 deletions trunk/drivers/net/wireless/wl12xx/ini.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
#ifndef __INI_H__
#define __INI_H__

#define GENERAL_SETTINGS_DRPW_LPD 0xc0
#define SCRATCH_ENABLE_LPD BIT(25)

#define WL1271_INI_MAX_SMART_REFLEX_PARAM 16

struct wl1271_ini_general_params {
Expand Down
9 changes: 7 additions & 2 deletions trunk/drivers/net/wireless/wl12xx/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1191,9 +1191,13 @@ static int wl1271_chip_wakeup(struct wl1271 *wl)
wl1271_debug(DEBUG_BOOT, "chip id 0x%x (1271 PG20)",
wl->chip.id);

/* end-of-transaction flag should be set in wl127x AP mode */
/*
* 'end-of-transaction flag' and 'LPD mode flag'
* should be set in wl127x AP mode only
*/
if (wl->bss_type == BSS_TYPE_AP_BSS)
wl->quirks |= WL12XX_QUIRK_END_OF_TRANSACTION;
wl->quirks |= (WL12XX_QUIRK_END_OF_TRANSACTION |
WL12XX_QUIRK_LPD_MODE);

ret = wl1271_setup(wl);
if (ret < 0)
Expand All @@ -1206,6 +1210,7 @@ static int wl1271_chip_wakeup(struct wl1271 *wl)
ret = wl1271_setup(wl);
if (ret < 0)
goto out;

if (wl1271_set_block_size(wl))
wl->quirks |= WL12XX_QUIRK_BLOCKSIZE_ALIGNMENT;
break;
Expand Down
6 changes: 6 additions & 0 deletions trunk/drivers/net/wireless/wl12xx/wl12xx.h
Original file line number Diff line number Diff line change
Expand Up @@ -645,4 +645,10 @@ int wl1271_recalc_rx_streaming(struct wl1271 *wl);
/* WL128X requires aggregated packets to be aligned to the SDIO block size */
#define WL12XX_QUIRK_BLOCKSIZE_ALIGNMENT BIT(2)

/*
* WL127X AP mode requires Low Power DRPw (LPD) enable to reduce power
* consumption
*/
#define WL12XX_QUIRK_LPD_MODE BIT(3)

#endif

0 comments on commit ab98540

Please sign in to comment.