Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (c) 2013-2015 The Linux Foundation. All rights reserved. |
| 3 | * |
| 4 | * Previously licensed under the ISC license by Qualcomm Atheros, Inc. |
| 5 | * |
| 6 | * |
| 7 | * Permission to use, copy, modify, and/or distribute this software for |
| 8 | * any purpose with or without fee is hereby granted, provided that the |
| 9 | * above copyright notice and this permission notice appear in all |
| 10 | * copies. |
| 11 | * |
| 12 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 13 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 14 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 15 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 16 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 17 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 18 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 19 | * PERFORMANCE OF THIS SOFTWARE. |
| 20 | */ |
| 21 | |
| 22 | /* |
| 23 | * This file was originally distributed by Qualcomm Atheros, Inc. |
| 24 | * under proprietary terms before Copyright ownership was assigned |
| 25 | * to the Linux Foundation. |
| 26 | */ |
| 27 | |
| 28 | #include "bmi_msg.h" |
| 29 | #include "targaddrs.h" |
| 30 | #include "cepci.h" |
| 31 | #include "regtable.h" |
| 32 | #include "ar9888def.h" |
| 33 | #include "ar6320def.h" |
| 34 | #include "ar6320v2def.h" |
| 35 | #include "qca6180def.h" |
| 36 | #include "ol_if_athvar.h" |
| 37 | #include "hif.h" |
| 38 | #include "adrastea_reg_def.h" |
| 39 | |
| 40 | void target_register_tbl_attach(struct ol_softc *scn, u32 target_type) |
| 41 | { |
| 42 | switch (target_type) { |
| 43 | case TARGET_TYPE_AR9888: |
| 44 | scn->targetdef = &ar9888_targetdef; |
| 45 | scn->target_ce_def = &ar9888_ce_targetdef; |
| 46 | break; |
| 47 | case TARGET_TYPE_AR6320: |
| 48 | scn->targetdef = &ar6320_targetdef; |
| 49 | scn->target_ce_def = &ar6320_ce_targetdef; |
| 50 | break; |
| 51 | case TARGET_TYPE_AR6320V2: |
| 52 | scn->targetdef = &ar6320v2_targetdef; |
| 53 | scn->target_ce_def = &ar6320v2_ce_targetdef; |
| 54 | break; |
| 55 | case TARGET_TYPE_QCA6180: |
| 56 | scn->targetdef = &qca6180_targetdef; |
| 57 | scn->target_ce_def = &qca6180_ce_targetdef; |
| 58 | break; |
| 59 | case TARGET_TYPE_ADRASTEA: |
| 60 | scn->targetdef = &adrastea_targetdef; |
| 61 | scn->target_ce_def = &adrastea_ce_targetdef; |
| 62 | break; |
| 63 | default: |
| 64 | break; |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | void hif_register_tbl_attach(struct ol_softc *scn, u32 hif_type) |
| 69 | { |
| 70 | switch (hif_type) { |
| 71 | case HIF_TYPE_AR9888: |
| 72 | scn->hostdef = &ar9888_hostdef; |
| 73 | break; |
| 74 | case HIF_TYPE_AR6320: |
| 75 | scn->hostdef = &ar6320_hostdef; |
| 76 | break; |
| 77 | case HIF_TYPE_AR6320V2: |
| 78 | scn->hostdef = &ar6320v2_hostdef; |
| 79 | break; |
| 80 | case HIF_TYPE_QCA6180: |
| 81 | scn->hostdef = &qca6180_hostdef; |
| 82 | scn->host_shadow_regs = &qca6180_host_shadow_regs; |
| 83 | break; |
| 84 | case HIF_TYPE_ADRASTEA: |
| 85 | scn->hostdef = &adrastea_hostdef; |
| 86 | scn->host_shadow_regs = &adrastea_host_shadow_regs; |
| 87 | break; |
| 88 | default: |
| 89 | break; |
| 90 | } |
| 91 | } |