xref: /wlan-dirver/qca-wifi-host-cmn/hif/src/dispatcher/multibus_sdio.c (revision bac753d968f39c1fab8507a7e5afb8e84db947ea)
1 /*
2  * Copyright (c) 2016-2017 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 "hif.h"
20 #include "hif_main.h"
21 #include "multibus.h"
22 #include "sdio_api.h"
23 #include "hif_io32.h"
24 #include "dummy.h"
25 #include "if_sdio.h"
26 
27 /**
28  * hif_initialize_sdio_ops() - initialize the pci ops
29  * @bus_ops: hif_bus_ops table pointer to initialize
30  *
31  * Return: QDF_STATUS_SUCCESS
32  */
33 QDF_STATUS hif_initialize_sdio_ops(struct hif_softc *hif_sc)
34 {
35 	struct hif_bus_ops *bus_ops = &hif_sc->bus_ops;
36 
37 	bus_ops->hif_bus_open = &hif_sdio_open;
38 	bus_ops->hif_bus_close = &hif_sdio_close;
39 	bus_ops->hif_bus_prevent_linkdown = &hif_dummy_bus_prevent_linkdown;
40 	bus_ops->hif_reset_soc = &hif_dummy_reset_soc;
41 	bus_ops->hif_bus_suspend = &hif_sdio_bus_suspend;
42 	bus_ops->hif_bus_resume = &hif_sdio_bus_resume;
43 	bus_ops->hif_target_sleep_state_adjust =
44 			&hif_dummy_target_sleep_state_adjust;
45 	bus_ops->hif_disable_isr = &hif_dummy_disable_isr;
46 	bus_ops->hif_nointrs = &hif_dummy_nointrs;
47 	bus_ops->hif_enable_bus = &hif_sdio_enable_bus;
48 	bus_ops->hif_disable_bus = &hif_sdio_disable_bus;
49 	bus_ops->hif_bus_configure = &hif_dummy_bus_configure;
50 	bus_ops->hif_get_config_item = &hif_sdio_get_config_item;
51 	bus_ops->hif_set_mailbox_swap = &hif_sdio_set_mailbox_swap;
52 	bus_ops->hif_claim_device = &hif_sdio_claim_device;
53 	bus_ops->hif_shutdown_device = &hif_sdio_shutdown;
54 	bus_ops->hif_stop = &hif_sdio_stop;
55 	bus_ops->hif_cancel_deferred_target_sleep =
56 				&hif_dummy_cancel_deferred_target_sleep;
57 	bus_ops->hif_irq_disable = &hif_dummy_irq_disable;
58 	bus_ops->hif_irq_enable = &hif_dummy_irq_enable;
59 	bus_ops->hif_dump_registers = &hif_dummy_dump_registers;
60 	bus_ops->hif_dump_target_memory = &hif_dummy_dump_target_memory;
61 	bus_ops->hif_ipa_get_ce_resource = &hif_dummy_ipa_get_ce_resource;
62 	bus_ops->hif_mask_interrupt_call = &hif_sdio_mask_interrupt_call;
63 	bus_ops->hif_enable_power_management =
64 		&hif_dummy_enable_power_management;
65 	bus_ops->hif_disable_power_management =
66 		&hif_dummy_disable_power_management;
67 
68 	return QDF_STATUS_SUCCESS;
69 }
70 
71 /**
72  * hif_sdio_get_context_size() - return the size of the sdio context
73  *
74  * Return the size of the context.  (0 for invalid bus)
75  */
76 int hif_sdio_get_context_size(void)
77 {
78 	return sizeof(struct hif_sdio_softc);
79 }
80