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