Lines Matching +full:led +full:- +full:mode

1 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
3 * Copyright (C) 2012-2014, 2018-2019 Intel Corporation
7 #include "iwl-io.h"
8 #include "iwl-csr.h"
30 IWL_WARN(mvm, "LED command failed: %d\n", err); in iwl_mvm_send_led_fw_cmd()
35 if (fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_led_set()
41 iwl_write32(mvm->trans, CSR_LED_REG, in iwl_mvm_led_set()
48 struct iwl_mvm *mvm = container_of(led_cdev, struct iwl_mvm, led); in iwl_led_brightness_set()
55 int mode = iwlwifi_mod_params.led_mode; in iwl_mvm_leds_init() local
58 switch (mode) { in iwl_mvm_leds_init()
60 IWL_ERR(mvm, "Blink led mode not supported, used default\n"); in iwl_mvm_leds_init()
64 mode = IWL_LED_RF_STATE; in iwl_mvm_leds_init()
67 IWL_INFO(mvm, "Led disabled\n"); in iwl_mvm_leds_init()
70 return -EINVAL; in iwl_mvm_leds_init()
73 mvm->led.name = kasprintf(GFP_KERNEL, "%s-led", in iwl_mvm_leds_init()
74 wiphy_name(mvm->hw->wiphy)); in iwl_mvm_leds_init()
75 if (!mvm->led.name) in iwl_mvm_leds_init()
76 return -ENOMEM; in iwl_mvm_leds_init()
78 mvm->led.brightness_set = iwl_led_brightness_set; in iwl_mvm_leds_init()
79 mvm->led.max_brightness = 1; in iwl_mvm_leds_init()
81 if (mode == IWL_LED_RF_STATE) in iwl_mvm_leds_init()
82 mvm->led.default_trigger = in iwl_mvm_leds_init()
83 ieee80211_get_radio_led_name(mvm->hw); in iwl_mvm_leds_init()
85 ret = led_classdev_register(mvm->trans->dev, &mvm->led); in iwl_mvm_leds_init()
87 kfree(mvm->led.name); in iwl_mvm_leds_init()
88 IWL_INFO(mvm, "Failed to enable led\n"); in iwl_mvm_leds_init()
92 mvm->init_status |= IWL_MVM_INIT_STATUS_LEDS_INIT_COMPLETE; in iwl_mvm_leds_init()
98 if (!(mvm->init_status & IWL_MVM_INIT_STATUS_LEDS_INIT_COMPLETE)) in iwl_mvm_leds_sync()
105 if (mvm->trans->trans_cfg->device_family < IWL_DEVICE_FAMILY_8000) in iwl_mvm_leds_sync()
108 iwl_mvm_led_set(mvm, mvm->led.brightness > 0); in iwl_mvm_leds_sync()
113 if (!(mvm->init_status & IWL_MVM_INIT_STATUS_LEDS_INIT_COMPLETE)) in iwl_mvm_leds_exit()
116 led_classdev_unregister(&mvm->led); in iwl_mvm_leds_exit()
117 kfree(mvm->led.name); in iwl_mvm_leds_exit()
118 mvm->init_status &= ~IWL_MVM_INIT_STATUS_LEDS_INIT_COMPLETE; in iwl_mvm_leds_exit()