| .. | .. |
|---|
| 1 | | -/* SPDX-License-Identifier: GPL-2.0 */ |
|---|
| 2 | 1 | /* |
|---|
| 3 | 2 | * Definitions for API from sdio common code (bcmsdh) to individual |
|---|
| 4 | 3 | * host controller drivers. |
|---|
| 5 | 4 | * |
|---|
| 6 | | - * Copyright (C) 1999-2019, Broadcom Corporation |
|---|
| 7 | | - * |
|---|
| 5 | + * Portions of this code are copyright (c) 2022 Cypress Semiconductor Corporation |
|---|
| 6 | + * |
|---|
| 7 | + * Copyright (C) 1999-2017, Broadcom Corporation |
|---|
| 8 | + * |
|---|
| 8 | 9 | * Unless you and Broadcom execute a separate written software license |
|---|
| 9 | 10 | * agreement governing use of this software, this software is licensed to you |
|---|
| 10 | 11 | * under the terms of the GNU General Public License version 2 (the "GPL"), |
|---|
| 11 | 12 | * available at http://www.broadcom.com/licenses/GPLv2.php, with the |
|---|
| 12 | 13 | * following added to such license: |
|---|
| 13 | | - * |
|---|
| 14 | + * |
|---|
| 14 | 15 | * As a special exception, the copyright holders of this software give you |
|---|
| 15 | 16 | * permission to link this software with independent modules, and to copy and |
|---|
| 16 | 17 | * distribute the resulting executable under terms of your choice, provided that |
|---|
| .. | .. |
|---|
| 18 | 19 | * the license of that module. An independent module is a module which is not |
|---|
| 19 | 20 | * derived from this software. The special exception does not apply to any |
|---|
| 20 | 21 | * modifications of the software. |
|---|
| 21 | | - * |
|---|
| 22 | + * |
|---|
| 22 | 23 | * Notwithstanding the above, under no circumstances may you combine this |
|---|
| 23 | 24 | * software in any way with any other Broadcom software provided under a license |
|---|
| 24 | 25 | * other than the GPL, without Broadcom's express prior written consent. |
|---|
| .. | .. |
|---|
| 26 | 27 | * |
|---|
| 27 | 28 | * <<Broadcom-WL-IPTag/Open:>> |
|---|
| 28 | 29 | * |
|---|
| 29 | | - * $Id: bcmsdbus.h 514727 2014-11-12 03:02:48Z $ |
|---|
| 30 | + * $Id: bcmsdbus.h 689948 2017-03-14 05:21:03Z $ |
|---|
| 30 | 31 | */ |
|---|
| 31 | 32 | |
|---|
| 32 | 33 | #ifndef _sdio_api_h_ |
|---|
| 33 | 34 | #define _sdio_api_h_ |
|---|
| 34 | 35 | |
|---|
| 36 | +#if defined(BT_OVER_SDIO) |
|---|
| 37 | +#include <linux/mmc/sdio_func.h> |
|---|
| 38 | +#endif /* defined (BT_OVER_SDIO) */ |
|---|
| 35 | 39 | |
|---|
| 36 | 40 | #define SDIOH_API_RC_SUCCESS (0x00) |
|---|
| 37 | 41 | #define SDIOH_API_RC_FAIL (0x01) |
|---|
| .. | .. |
|---|
| 70 | 74 | #warning "SDPCM_DEFGLOM_SIZE cannot be higher than SDPCM_MAXGLOM_SIZE!!" |
|---|
| 71 | 75 | #undef SDPCM_DEFGLOM_SIZE |
|---|
| 72 | 76 | #define SDPCM_DEFGLOM_SIZE SDPCM_MAXGLOM_SIZE |
|---|
| 73 | | -#endif |
|---|
| 77 | +#endif // endif |
|---|
| 74 | 78 | |
|---|
| 75 | 79 | typedef int SDIOH_API_RC; |
|---|
| 76 | 80 | |
|---|
| .. | .. |
|---|
| 79 | 83 | |
|---|
| 80 | 84 | /* callback function, taking one arg */ |
|---|
| 81 | 85 | typedef void (*sdioh_cb_fn_t)(void *); |
|---|
| 86 | +#if defined(BT_OVER_SDIO) && defined(BCMLXSDMMC) |
|---|
| 87 | +extern |
|---|
| 88 | +void sdioh_sdmmc_card_enable_func_f3(sdioh_info_t *sd, struct sdio_func *func); |
|---|
| 89 | +#endif /* defined (BT_OVER_SDIO) */ |
|---|
| 82 | 90 | |
|---|
| 83 | 91 | extern SDIOH_API_RC sdioh_interrupt_register(sdioh_info_t *si, sdioh_cb_fn_t fn, void *argh); |
|---|
| 84 | 92 | extern SDIOH_API_RC sdioh_interrupt_deregister(sdioh_info_t *si); |
|---|
| .. | .. |
|---|
| 91 | 99 | |
|---|
| 92 | 100 | #if defined(DHD_DEBUG) |
|---|
| 93 | 101 | extern bool sdioh_interrupt_pending(sdioh_info_t *si); |
|---|
| 94 | | -#endif |
|---|
| 102 | +#endif // endif |
|---|
| 95 | 103 | |
|---|
| 96 | 104 | /* read or write one byte using cmd52 */ |
|---|
| 97 | 105 | extern SDIOH_API_RC sdioh_request_byte(sdioh_info_t *si, uint rw, uint fnc, uint addr, uint8 *byte); |
|---|
| .. | .. |
|---|
| 131 | 139 | /* Reset and re-initialize the device */ |
|---|
| 132 | 140 | extern int sdioh_sdio_reset(sdioh_info_t *si); |
|---|
| 133 | 141 | |
|---|
| 142 | +#ifdef BCMSPI |
|---|
| 143 | +/* Function to pass gSPI specific device-status bits to dhd. */ |
|---|
| 144 | +extern uint32 sdioh_get_dstatus(sdioh_info_t *si); |
|---|
| 134 | 145 | |
|---|
| 146 | +/* chipid and chiprev info for lower layers to control sw WAR's for hw bugs. */ |
|---|
| 147 | +extern void sdioh_chipinfo(sdioh_info_t *si, uint32 chip, uint32 chiprev); |
|---|
| 148 | +extern void sdioh_dwordmode(sdioh_info_t *si, bool set); |
|---|
| 149 | +#endif /* BCMSPI */ |
|---|
| 135 | 150 | |
|---|
| 136 | 151 | #if defined(BCMSDIOH_STD) |
|---|
| 137 | 152 | #define SDIOH_SLEEP_ENABLED |
|---|
| 138 | | -#endif |
|---|
| 153 | +#endif // endif |
|---|
| 139 | 154 | extern SDIOH_API_RC sdioh_sleep(sdioh_info_t *si, bool enab); |
|---|
| 140 | 155 | |
|---|
| 141 | 156 | /* GPIO support */ |
|---|