16 #ifdef CONFIG_RTL8187_LEDS
33 struct rtl8187_led *
led = &priv->led_tx;
43 switch (led->ledpin) {
45 rtl818x_iowrite8(priv, &priv->
map->GPIO0, 0x01);
46 rtl818x_iowrite8(priv, &priv->
map->GP_ENABLE, 0x00);
49 reg = rtl818x_ioread8(priv, &priv->
map->PGSELECT) & ~(1 << 4);
50 rtl818x_iowrite8(priv, &priv->
map->PGSELECT, reg);
53 reg = rtl818x_ioread8(priv, &priv->
map->PGSELECT) & ~(1 << 5);
54 rtl818x_iowrite8(priv, &priv->
map->PGSELECT, reg);
71 struct rtl8187_led *led = &priv->led_tx;
81 switch (led->ledpin) {
83 rtl818x_iowrite8(priv, &priv->
map->GPIO0, 0x01);
84 rtl818x_iowrite8(priv, &priv->
map->GP_ENABLE, 0x01);
87 reg = rtl818x_ioread8(priv, &priv->
map->PGSELECT) | (1 << 4);
88 rtl818x_iowrite8(priv, &priv->
map->PGSELECT, reg);
91 reg = rtl818x_ioread8(priv, &priv->
map->PGSELECT) | (1 << 5);
92 rtl818x_iowrite8(priv, &priv->
map->PGSELECT, reg);
102 static void rtl8187_led_brightness_set(
struct led_classdev *led_dev,
105 struct rtl8187_led *led =
container_of(led_dev,
struct rtl8187_led,
109 static bool radio_on;
118 }
else if (radio_on) {
123 }
else if (radio_on) {
135 struct rtl8187_led *led,
const char *
name,
136 const char *default_trigger,
u8 ledpin,
144 if (!default_trigger)
147 led->ledpin = ledpin;
148 led->is_radio = is_radio;
149 strncpy(led->name, name,
sizeof(led->name));
151 led->led_dev.name = led->name;
152 led->led_dev.default_trigger = default_trigger;
153 led->led_dev.brightness_set = rtl8187_led_brightness_set;
164 static void rtl8187_unregister_led(
struct rtl8187_led *led)
177 char name[RTL8187_LED_MAX_NAME_LEN + 1];
186 case EEPROM_CID_RSVD0:
187 case EEPROM_CID_RSVD1:
188 case EEPROM_CID_SERCOMM_PS:
190 case EEPROM_CID_DELL:
194 case EEPROM_CID_ALPHA0:
208 "rtl8187-%s::radio", wiphy_name(dev->
wiphy));
209 err = rtl8187_register_led(dev, &priv->led_radio, name,
210 ieee80211_get_radio_led_name(dev), ledpin,
true);
215 "rtl8187-%s::tx", wiphy_name(dev->
wiphy));
216 err = rtl8187_register_led(dev, &priv->led_tx, name,
217 ieee80211_get_tx_led_name(dev), ledpin,
false);
222 "rtl8187-%s::rx", wiphy_name(dev->
wiphy));
223 err = rtl8187_register_led(dev, &priv->led_rx, name,
224 ieee80211_get_rx_led_name(dev), ledpin,
false);
229 rtl8187_unregister_led(&priv->led_tx);
231 rtl8187_unregister_led(&priv->led_radio);
238 rtl8187_unregister_led(&priv->led_radio);
239 rtl8187_unregister_led(&priv->led_rx);
240 rtl8187_unregister_led(&priv->led_tx);