xref: /openbmc/linux/drivers/net/wireless/ti/wl12xx/acx.c (revision 2b27bdcc)
12b27bdccSThomas Gleixner // SPDX-License-Identifier: GPL-2.0-only
29d68d1eeSLuciano Coelho /*
39d68d1eeSLuciano Coelho  * This file is part of wl12xx
49d68d1eeSLuciano Coelho  *
59d68d1eeSLuciano Coelho  * Copyright (C) 2008-2009 Nokia Corporation
69d68d1eeSLuciano Coelho  * Copyright (C) 2011 Texas Instruments Inc.
79d68d1eeSLuciano Coelho  */
89d68d1eeSLuciano Coelho 
99d68d1eeSLuciano Coelho #include "../wlcore/cmd.h"
109d68d1eeSLuciano Coelho #include "../wlcore/debug.h"
119d68d1eeSLuciano Coelho #include "../wlcore/acx.h"
129d68d1eeSLuciano Coelho 
139d68d1eeSLuciano Coelho #include "acx.h"
149d68d1eeSLuciano Coelho 
wl1271_acx_host_if_cfg_bitmap(struct wl1271 * wl,u32 host_cfg_bitmap)159d68d1eeSLuciano Coelho int wl1271_acx_host_if_cfg_bitmap(struct wl1271 *wl, u32 host_cfg_bitmap)
169d68d1eeSLuciano Coelho {
179d68d1eeSLuciano Coelho 	struct wl1271_acx_host_config_bitmap *bitmap_conf;
189d68d1eeSLuciano Coelho 	int ret;
199d68d1eeSLuciano Coelho 
209d68d1eeSLuciano Coelho 	bitmap_conf = kzalloc(sizeof(*bitmap_conf), GFP_KERNEL);
219d68d1eeSLuciano Coelho 	if (!bitmap_conf) {
229d68d1eeSLuciano Coelho 		ret = -ENOMEM;
239d68d1eeSLuciano Coelho 		goto out;
249d68d1eeSLuciano Coelho 	}
259d68d1eeSLuciano Coelho 
269d68d1eeSLuciano Coelho 	bitmap_conf->host_cfg_bitmap = cpu_to_le32(host_cfg_bitmap);
279d68d1eeSLuciano Coelho 
289d68d1eeSLuciano Coelho 	ret = wl1271_cmd_configure(wl, ACX_HOST_IF_CFG_BITMAP,
299d68d1eeSLuciano Coelho 				   bitmap_conf, sizeof(*bitmap_conf));
309d68d1eeSLuciano Coelho 	if (ret < 0) {
319d68d1eeSLuciano Coelho 		wl1271_warning("wl1271 bitmap config opt failed: %d", ret);
329d68d1eeSLuciano Coelho 		goto out;
339d68d1eeSLuciano Coelho 	}
349d68d1eeSLuciano Coelho 
359d68d1eeSLuciano Coelho out:
369d68d1eeSLuciano Coelho 	kfree(bitmap_conf);
379d68d1eeSLuciano Coelho 
389d68d1eeSLuciano Coelho 	return ret;
399d68d1eeSLuciano Coelho }
40