aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-led.c
diff options
context:
space:
mode:
authorWey-Yi Guy <wey-yi.w.guy@intel.com>2011-04-05 11:30:43 -0400
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2011-04-18 11:47:43 -0400
commite79b1ca75bb48111e8d93fc576f50e24671f5f9d (patch)
tree41f07ec5de343a4bd65c38e508fcc9fd1229b428 /drivers/net/wireless/iwlwifi/iwl-led.c
parent6fc3ba999994b675c4e6af77ac4e1a6bfd8e6128 (diff)
iwlagn: use direct call for led functions
After driver split, no need to call led functions through callback Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-led.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-led.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-led.c b/drivers/net/wireless/iwlwifi/iwl-led.c
index 0d90004e8b1b..d798c2a152d3 100644
--- a/drivers/net/wireless/iwlwifi/iwl-led.c
+++ b/drivers/net/wireless/iwlwifi/iwl-led.c
@@ -61,6 +61,12 @@ static const struct ieee80211_tpt_blink iwl_blink[] = {
61 { .throughput = 300 * 1024 - 1, .blink_time = 50 }, 61 { .throughput = 300 * 1024 - 1, .blink_time = 50 },
62}; 62};
63 63
64/* Set led register off */
65void iwlagn_led_enable(struct iwl_priv *priv)
66{
67 iwl_write32(priv, CSR_LED_REG, CSR_LED_REG_TRUN_ON);
68}
69
64/* 70/*
65 * Adjust led blink rate to compensate on a MAC Clock difference on every HW 71 * Adjust led blink rate to compensate on a MAC Clock difference on every HW
66 * Led blink rate analysis showed an average deviation of 20% on 5000 series 72 * Led blink rate analysis showed an average deviation of 20% on 5000 series
@@ -84,6 +90,24 @@ static inline u8 iwl_blink_compensation(struct iwl_priv *priv,
84 return (u8)((time * compensation) >> 6); 90 return (u8)((time * compensation) >> 6);
85} 91}
86 92
93static int iwl_send_led_cmd(struct iwl_priv *priv, struct iwl_led_cmd *led_cmd)
94{
95 struct iwl_host_cmd cmd = {
96 .id = REPLY_LEDS_CMD,
97 .len = sizeof(struct iwl_led_cmd),
98 .data = led_cmd,
99 .flags = CMD_ASYNC,
100 .callback = NULL,
101 };
102 u32 reg;
103
104 reg = iwl_read32(priv, CSR_LED_REG);
105 if (reg != (reg & CSR_LED_BSM_CTRL_MSK))
106 iwl_write32(priv, CSR_LED_REG, reg & CSR_LED_BSM_CTRL_MSK);
107
108 return iwl_send_cmd(priv, &cmd);
109}
110
87/* Set led pattern command */ 111/* Set led pattern command */
88static int iwl_led_cmd(struct iwl_priv *priv, 112static int iwl_led_cmd(struct iwl_priv *priv,
89 unsigned long on, 113 unsigned long on,
@@ -108,7 +132,7 @@ static int iwl_led_cmd(struct iwl_priv *priv,
108 led_cmd.off = iwl_blink_compensation(priv, off, 132 led_cmd.off = iwl_blink_compensation(priv, off,
109 priv->cfg->base_params->led_compensation); 133 priv->cfg->base_params->led_compensation);
110 134
111 ret = priv->cfg->ops->led->cmd(priv, &led_cmd); 135 ret = iwl_send_led_cmd(priv, &led_cmd);
112 if (!ret) { 136 if (!ret) {
113 priv->blink_on = on; 137 priv->blink_on = on;
114 priv->blink_off = off; 138 priv->blink_off = off;