Lines Matching +full:led +full:- +full:3
2 * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
3 * Copyright (c) 2004-2005 Atheros Communications, Inc.
19 * 3. Neither the names of the above-listed copyright holders nor the names
55 /* Devices we match on for LED config info (typically laptops) */
62 { ATH_SDEVICE(PCI_VENDOR_ID_FOXCONN, 0xe008), ATH_LED(3, 0) },
63 /* Acer Aspire One AO531h AO751h (keng-yu.lin@canonical.com) */
64 { ATH_SDEVICE(PCI_VENDOR_ID_FOXCONN, 0xe00d), ATH_LED(3, 0) },
67 /* E-machines E510 (tuliom@gmail.com) */
68 { ATH_SDEVICE(PCI_VENDOR_ID_AMBIT, 0x0428), ATH_LED(3, 0) },
72 { ATH_SDEVICE(PCI_VENDOR_ID_QMI, 0x0105), ATH_LED(3, 0) },
74 { ATH_SDEVICE(PCI_VENDOR_ID_AZWAVE, 0x1026), ATH_LED(3, 0) },
77 /* HP Compaq CQ60-206US (ddreggors@jumptv.com) */
78 { ATH_SDEVICE(PCI_VENDOR_ID_HP, 0x0137a), ATH_LED(3, 1) },
80 { ATH_SDEVICE(PCI_VENDOR_ID_HP, 0x0137b), ATH_LED(3, 0) },
82 { ATH_SDEVICE(PCI_VENDOR_ID_ATHEROS, 0x3067), ATH_LED(3, 0) },
83 /* IBM-specific AR5212 (all others) */
85 /* Dell Vostro A860 (shahar@shahar-or.co.il) */
86 { ATH_SDEVICE(PCI_VENDOR_ID_QMI, 0x0112), ATH_LED(3, 0) },
93 test_bit(ATH_STAT_LEDSOFT, ah->status)) { in ath5k_led_enable()
94 ath5k_hw_set_gpio_output(ah, ah->led_pin); in ath5k_led_enable()
101 if (!test_bit(ATH_STAT_LEDSOFT, ah->status)) in ath5k_led_on()
103 ath5k_hw_set_gpio(ah, ah->led_pin, ah->led_on); in ath5k_led_on()
109 !test_bit(ATH_STAT_LEDSOFT, ah->status)) in ath5k_led_off()
111 ath5k_hw_set_gpio(ah, ah->led_pin, !ah->led_on); in ath5k_led_off()
118 struct ath5k_led *led = container_of(led_dev, struct ath5k_led, in ath5k_led_brightness_set() local
122 ath5k_led_off(led->ah); in ath5k_led_brightness_set()
124 ath5k_led_on(led->ah); in ath5k_led_brightness_set()
128 ath5k_register_led(struct ath5k_hw *ah, struct ath5k_led *led, in ath5k_register_led() argument
133 led->ah = ah; in ath5k_register_led()
134 strscpy(led->name, name, sizeof(led->name)); in ath5k_register_led()
135 led->led_dev.name = led->name; in ath5k_register_led()
136 led->led_dev.default_trigger = trigger; in ath5k_register_led()
137 led->led_dev.brightness_set = ath5k_led_brightness_set; in ath5k_register_led()
139 err = led_classdev_register(ah->dev, &led->led_dev); in ath5k_register_led()
141 ATH5K_WARN(ah, "could not register LED %s\n", name); in ath5k_register_led()
142 led->ah = NULL; in ath5k_register_led()
148 ath5k_unregister_led(struct ath5k_led *led) in ath5k_unregister_led() argument
150 if (!IS_ENABLED(CONFIG_MAC80211_LEDS) || !led->ah) in ath5k_unregister_led()
152 led_classdev_unregister(&led->led_dev); in ath5k_unregister_led()
153 ath5k_led_off(led->ah); in ath5k_unregister_led()
154 led->ah = NULL; in ath5k_unregister_led()
159 ath5k_unregister_led(&ah->rx_led); in ath5k_unregister_leds()
160 ath5k_unregister_led(&ah->tx_led); in ath5k_unregister_leds()
166 struct ieee80211_hw *hw = ah->hw; in ath5k_init_leds()
168 struct pci_dev *pdev = ah->pdev; in ath5k_init_leds()
173 if (!IS_ENABLED(CONFIG_MAC80211_LEDS) || !ah->pdev) in ath5k_init_leds()
182 __set_bit(ATH_STAT_LEDSOFT, ah->status); in ath5k_init_leds()
183 ah->led_pin = ATH_PIN(match->driver_data); in ath5k_init_leds()
184 ah->led_on = ATH_POLARITY(match->driver_data); in ath5k_init_leds()
187 if (!test_bit(ATH_STAT_LEDSOFT, ah->status)) in ath5k_init_leds()
192 snprintf(name, sizeof(name), "ath5k-%s::rx", wiphy_name(hw->wiphy)); in ath5k_init_leds()
193 ret = ath5k_register_led(ah, &ah->rx_led, name, in ath5k_init_leds()
198 snprintf(name, sizeof(name), "ath5k-%s::tx", wiphy_name(hw->wiphy)); in ath5k_init_leds()
199 ret = ath5k_register_led(ah, &ah->tx_led, name, in ath5k_init_leds()