xref: /wlan-dirver/qca-wifi-host-cmn/hif/src/sdio/regtable_sdio.c (revision 861af9fad3d20cded5a90c420dd1ed901be32691)
1 /*
2  * Copyright (c) 2013-2019 The Linux Foundation. All rights reserved.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for
5  * any purpose with or without fee is hereby granted, provided that the
6  * above copyright notice and this permission notice appear in all
7  * copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16  * PERFORMANCE OF THIS SOFTWARE.
17  */
18 
19 #include "bmi_msg.h"
20 #include "target_type.h"
21 #include "cepci.h"
22 
23 #define MISSING 0
24 #include "regtable_sdio.h"
25 #include "targaddrs.h"
26 #include "if_sdio.h"
27 #include "ar9888def.h"
28 #include "ar6320def.h"
29 #include "ar6320v2def.h"
30 
31 void target_register_tbl_attach(struct hif_softc *scn, u32 target_type)
32 {
33 	switch (target_type) {
34 	case TARGET_TYPE_AR9888:
35 		scn->targetdef = &ar9888_targetdef;
36 		break;
37 	case TARGET_TYPE_AR6320:
38 		scn->targetdef = &ar6320_targetdef;
39 		break;
40 	case TARGET_TYPE_AR6320V2:
41 		scn->targetdef = &ar6320v2_targetdef;
42 		break;
43 	default:
44 		break;
45 	}
46 }
47 
48 void hif_register_tbl_attach(struct hif_softc *scn, u32 hif_type)
49 {
50 	if (!scn) {
51 		QDF_TRACE(QDF_MODULE_ID_HIF, QDF_TRACE_LEVEL_ERROR,
52 			  "%s: sc is NULL", __func__);
53 		return;
54 	}
55 
56 	switch (hif_type) {
57 	case HIF_TYPE_AR9888:
58 		scn->hostdef = &ar9888_hostdef;
59 		break;
60 	case HIF_TYPE_AR6320:
61 		scn->hostdef = &ar6320_hostdef;
62 		break;
63 	case HIF_TYPE_AR6320V2:
64 		scn->hostdef = &ar6320v2_hostdef;
65 		break;
66 	default:
67 		break;
68 	}
69 }
70