iwlwifi: make led functions generic
Led functions are generic for all the devices except 3945, so remove the reference to 4965 Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
cc0f555d51
commit
5e215169f4
|
@ -104,7 +104,7 @@ static int iwl_send_led_cmd(struct iwl_priv *priv, struct iwl_led_cmd *led_cmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set led pattern command */
|
/* Set led pattern command */
|
||||||
static int iwl4965_led_pattern(struct iwl_priv *priv, int led_id,
|
static int iwl_led_pattern(struct iwl_priv *priv, int led_id,
|
||||||
unsigned int idx)
|
unsigned int idx)
|
||||||
{
|
{
|
||||||
struct iwl_led_cmd led_cmd = {
|
struct iwl_led_cmd led_cmd = {
|
||||||
|
@ -121,7 +121,7 @@ static int iwl4965_led_pattern(struct iwl_priv *priv, int led_id,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set led register off */
|
/* Set led register off */
|
||||||
static int iwl4965_led_on_reg(struct iwl_priv *priv, int led_id)
|
static int iwl_led_on_reg(struct iwl_priv *priv, int led_id)
|
||||||
{
|
{
|
||||||
IWL_DEBUG_LED(priv, "led on %d\n", led_id);
|
IWL_DEBUG_LED(priv, "led on %d\n", led_id);
|
||||||
iwl_write32(priv, CSR_LED_REG, CSR_LED_REG_TRUN_ON);
|
iwl_write32(priv, CSR_LED_REG, CSR_LED_REG_TRUN_ON);
|
||||||
|
@ -130,7 +130,7 @@ static int iwl4965_led_on_reg(struct iwl_priv *priv, int led_id)
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/* Set led on command */
|
/* Set led on command */
|
||||||
static int iwl4965_led_on(struct iwl_priv *priv, int led_id)
|
static int iwl_led_on(struct iwl_priv *priv, int led_id)
|
||||||
{
|
{
|
||||||
struct iwl_led_cmd led_cmd = {
|
struct iwl_led_cmd led_cmd = {
|
||||||
.id = led_id,
|
.id = led_id,
|
||||||
|
@ -142,7 +142,7 @@ static int iwl4965_led_on(struct iwl_priv *priv, int led_id)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set led off command */
|
/* Set led off command */
|
||||||
int iwl4965_led_off(struct iwl_priv *priv, int led_id)
|
int iwl_led_off(struct iwl_priv *priv, int led_id)
|
||||||
{
|
{
|
||||||
struct iwl_led_cmd led_cmd = {
|
struct iwl_led_cmd led_cmd = {
|
||||||
.id = led_id,
|
.id = led_id,
|
||||||
|
@ -157,7 +157,7 @@ int iwl4965_led_off(struct iwl_priv *priv, int led_id)
|
||||||
|
|
||||||
|
|
||||||
/* Set led register off */
|
/* Set led register off */
|
||||||
static int iwl4965_led_off_reg(struct iwl_priv *priv, int led_id)
|
static int iwl_led_off_reg(struct iwl_priv *priv, int led_id)
|
||||||
{
|
{
|
||||||
IWL_DEBUG_LED(priv, "LED Reg off\n");
|
IWL_DEBUG_LED(priv, "LED Reg off\n");
|
||||||
iwl_write32(priv, CSR_LED_REG, CSR_LED_REG_TRUN_OFF);
|
iwl_write32(priv, CSR_LED_REG, CSR_LED_REG_TRUN_OFF);
|
||||||
|
@ -171,7 +171,7 @@ static int iwl_led_associate(struct iwl_priv *priv, int led_id)
|
||||||
{
|
{
|
||||||
IWL_DEBUG_LED(priv, "Associated\n");
|
IWL_DEBUG_LED(priv, "Associated\n");
|
||||||
priv->allow_blinking = 1;
|
priv->allow_blinking = 1;
|
||||||
return iwl4965_led_on_reg(priv, led_id);
|
return iwl_led_on_reg(priv, led_id);
|
||||||
}
|
}
|
||||||
static int iwl_led_disassociate(struct iwl_priv *priv, int led_id)
|
static int iwl_led_disassociate(struct iwl_priv *priv, int led_id)
|
||||||
{
|
{
|
||||||
|
@ -314,7 +314,7 @@ void iwl_leds_background(struct iwl_priv *priv)
|
||||||
priv->last_blink_time = 0;
|
priv->last_blink_time = 0;
|
||||||
if (priv->last_blink_rate != IWL_SOLID_BLINK_IDX) {
|
if (priv->last_blink_rate != IWL_SOLID_BLINK_IDX) {
|
||||||
priv->last_blink_rate = IWL_SOLID_BLINK_IDX;
|
priv->last_blink_rate = IWL_SOLID_BLINK_IDX;
|
||||||
iwl4965_led_pattern(priv, IWL_LED_LINK,
|
iwl_led_pattern(priv, IWL_LED_LINK,
|
||||||
IWL_SOLID_BLINK_IDX);
|
IWL_SOLID_BLINK_IDX);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
@ -328,7 +328,7 @@ void iwl_leds_background(struct iwl_priv *priv)
|
||||||
|
|
||||||
/* call only if blink rate change */
|
/* call only if blink rate change */
|
||||||
if (blink_idx != priv->last_blink_rate)
|
if (blink_idx != priv->last_blink_rate)
|
||||||
iwl4965_led_pattern(priv, IWL_LED_LINK, blink_idx);
|
iwl_led_pattern(priv, IWL_LED_LINK, blink_idx);
|
||||||
|
|
||||||
priv->last_blink_time = jiffies;
|
priv->last_blink_time = jiffies;
|
||||||
priv->last_blink_rate = blink_idx;
|
priv->last_blink_rate = blink_idx;
|
||||||
|
@ -351,8 +351,8 @@ int iwl_leds_register(struct iwl_priv *priv)
|
||||||
sizeof(priv->led[IWL_LED_TRG_RADIO].name), "iwl-%s::radio",
|
sizeof(priv->led[IWL_LED_TRG_RADIO].name), "iwl-%s::radio",
|
||||||
wiphy_name(priv->hw->wiphy));
|
wiphy_name(priv->hw->wiphy));
|
||||||
|
|
||||||
priv->led[IWL_LED_TRG_RADIO].led_on = iwl4965_led_on_reg;
|
priv->led[IWL_LED_TRG_RADIO].led_on = iwl_led_on_reg;
|
||||||
priv->led[IWL_LED_TRG_RADIO].led_off = iwl4965_led_off_reg;
|
priv->led[IWL_LED_TRG_RADIO].led_off = iwl_led_off_reg;
|
||||||
priv->led[IWL_LED_TRG_RADIO].led_pattern = NULL;
|
priv->led[IWL_LED_TRG_RADIO].led_pattern = NULL;
|
||||||
|
|
||||||
ret = iwl_leds_register_led(priv, &priv->led[IWL_LED_TRG_RADIO],
|
ret = iwl_leds_register_led(priv, &priv->led[IWL_LED_TRG_RADIO],
|
||||||
|
@ -386,7 +386,7 @@ int iwl_leds_register(struct iwl_priv *priv)
|
||||||
|
|
||||||
priv->led[IWL_LED_TRG_RX].led_on = iwl_led_associated;
|
priv->led[IWL_LED_TRG_RX].led_on = iwl_led_associated;
|
||||||
priv->led[IWL_LED_TRG_RX].led_off = iwl_led_associated;
|
priv->led[IWL_LED_TRG_RX].led_off = iwl_led_associated;
|
||||||
priv->led[IWL_LED_TRG_RX].led_pattern = iwl4965_led_pattern;
|
priv->led[IWL_LED_TRG_RX].led_pattern = iwl_led_pattern;
|
||||||
|
|
||||||
if (ret)
|
if (ret)
|
||||||
goto exit_fail;
|
goto exit_fail;
|
||||||
|
@ -401,7 +401,7 @@ int iwl_leds_register(struct iwl_priv *priv)
|
||||||
|
|
||||||
priv->led[IWL_LED_TRG_TX].led_on = iwl_led_associated;
|
priv->led[IWL_LED_TRG_TX].led_on = iwl_led_associated;
|
||||||
priv->led[IWL_LED_TRG_TX].led_off = iwl_led_associated;
|
priv->led[IWL_LED_TRG_TX].led_off = iwl_led_associated;
|
||||||
priv->led[IWL_LED_TRG_TX].led_pattern = iwl4965_led_pattern;
|
priv->led[IWL_LED_TRG_TX].led_pattern = iwl_led_pattern;
|
||||||
|
|
||||||
if (ret)
|
if (ret)
|
||||||
goto exit_fail;
|
goto exit_fail;
|
||||||
|
|
Loading…
Reference in New Issue