Lines Matching refs:wl

19 	struct wl1271 *wl = dev_get_drvdata(dev);  in bt_coex_state_show()  local
22 mutex_lock(&wl->mutex); in bt_coex_state_show()
23 len = sysfs_emit(buf, "%d\n\n0 - off\n1 - on\n", wl->sg_enabled); in bt_coex_state_show()
24 mutex_unlock(&wl->mutex); in bt_coex_state_show()
34 struct wl1271 *wl = dev_get_drvdata(dev); in bt_coex_state_store() local
44 mutex_lock(&wl->mutex); in bt_coex_state_store()
48 if (res == wl->sg_enabled) in bt_coex_state_store()
51 wl->sg_enabled = res; in bt_coex_state_store()
53 if (unlikely(wl->state != WLCORE_STATE_ON)) in bt_coex_state_store()
56 ret = pm_runtime_resume_and_get(wl->dev); in bt_coex_state_store()
60 wl1271_acx_sg_enable(wl, wl->sg_enabled); in bt_coex_state_store()
61 pm_runtime_mark_last_busy(wl->dev); in bt_coex_state_store()
62 pm_runtime_put_autosuspend(wl->dev); in bt_coex_state_store()
65 mutex_unlock(&wl->mutex); in bt_coex_state_store()
75 struct wl1271 *wl = dev_get_drvdata(dev); in hw_pg_ver_show() local
78 mutex_lock(&wl->mutex); in hw_pg_ver_show()
79 if (wl->hw_pg_ver >= 0) in hw_pg_ver_show()
80 len = sysfs_emit(buf, "%d\n", wl->hw_pg_ver); in hw_pg_ver_show()
83 mutex_unlock(&wl->mutex); in hw_pg_ver_show()
95 struct wl1271 *wl = dev_get_drvdata(dev); in wl1271_sysfs_read_fwlog() local
99 ret = mutex_lock_interruptible(&wl->mutex); in wl1271_sysfs_read_fwlog()
104 if (wl->fwlog_size < 0) { in wl1271_sysfs_read_fwlog()
105 mutex_unlock(&wl->mutex); in wl1271_sysfs_read_fwlog()
110 len = min_t(size_t, count, wl->fwlog_size); in wl1271_sysfs_read_fwlog()
111 wl->fwlog_size -= len; in wl1271_sysfs_read_fwlog()
112 memcpy(buffer, wl->fwlog, len); in wl1271_sysfs_read_fwlog()
115 memmove(wl->fwlog, wl->fwlog + len, wl->fwlog_size); in wl1271_sysfs_read_fwlog()
117 mutex_unlock(&wl->mutex); in wl1271_sysfs_read_fwlog()
127 int wlcore_sysfs_init(struct wl1271 *wl) in wlcore_sysfs_init() argument
132 ret = device_create_file(wl->dev, &dev_attr_bt_coex_state); in wlcore_sysfs_init()
139 ret = device_create_file(wl->dev, &dev_attr_hw_pg_ver); in wlcore_sysfs_init()
146 ret = device_create_bin_file(wl->dev, &fwlog_attr); in wlcore_sysfs_init()
155 device_remove_file(wl->dev, &dev_attr_hw_pg_ver); in wlcore_sysfs_init()
158 device_remove_file(wl->dev, &dev_attr_bt_coex_state); in wlcore_sysfs_init()
164 void wlcore_sysfs_free(struct wl1271 *wl) in wlcore_sysfs_free() argument
166 device_remove_bin_file(wl->dev, &fwlog_attr); in wlcore_sysfs_free()
168 device_remove_file(wl->dev, &dev_attr_hw_pg_ver); in wlcore_sysfs_free()
170 device_remove_file(wl->dev, &dev_attr_bt_coex_state); in wlcore_sysfs_free()