Lines Matching +full:rfkill +full:- +full:gpio
1 // SPDX-License-Identifier: GPL-2.0-only
3 * Linux RFKILL support for RTL8187
7 * Based on the RFKILL handling in the r8187 driver, which is:
18 #include "rfkill.h"
22 u8 gpio; in rtl8187_is_radio_enabled() local
24 gpio = rtl818x_ioread8(priv, &priv->map->GPIO0); in rtl8187_is_radio_enabled()
25 rtl818x_iowrite8(priv, &priv->map->GPIO0, gpio & ~priv->rfkill_mask); in rtl8187_is_radio_enabled()
26 gpio = rtl818x_ioread8(priv, &priv->map->GPIO1); in rtl8187_is_radio_enabled()
28 return gpio & priv->rfkill_mask; in rtl8187_is_radio_enabled()
33 struct rtl8187_priv *priv = hw->priv; in rtl8187_rfkill_init()
35 priv->rfkill_off = rtl8187_is_radio_enabled(priv); in rtl8187_rfkill_init()
37 priv->rfkill_off ? "on" : "off"); in rtl8187_rfkill_init()
38 wiphy_rfkill_set_hw_state(hw->wiphy, !priv->rfkill_off); in rtl8187_rfkill_init()
39 wiphy_rfkill_start_polling(hw->wiphy); in rtl8187_rfkill_init()
45 struct rtl8187_priv *priv = hw->priv; in rtl8187_rfkill_poll()
47 mutex_lock(&priv->conf_mutex); in rtl8187_rfkill_poll()
49 if (unlikely(enabled != priv->rfkill_off)) { in rtl8187_rfkill_poll()
50 priv->rfkill_off = enabled; in rtl8187_rfkill_poll()
53 wiphy_rfkill_set_hw_state(hw->wiphy, !enabled); in rtl8187_rfkill_poll()
55 mutex_unlock(&priv->conf_mutex); in rtl8187_rfkill_poll()
60 wiphy_rfkill_stop_polling(hw->wiphy); in rtl8187_rfkill_exit()