David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame^] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2014-2017 Broadcom |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | #ifndef _USB_BRCM_COMMON_INIT_H |
| 7 | #define _USB_BRCM_COMMON_INIT_H |
| 8 | |
| 9 | #define USB_CTLR_MODE_HOST 0 |
| 10 | #define USB_CTLR_MODE_DEVICE 1 |
| 11 | #define USB_CTLR_MODE_DRD 2 |
| 12 | #define USB_CTLR_MODE_TYPEC_PD 3 |
| 13 | |
| 14 | struct brcm_usb_init_params; |
| 15 | |
| 16 | struct brcm_usb_init_params { |
| 17 | void __iomem *ctrl_regs; |
| 18 | void __iomem *xhci_ec_regs; |
| 19 | int ioc; |
| 20 | int ipp; |
| 21 | int mode; |
| 22 | u32 family_id; |
| 23 | u32 product_id; |
| 24 | int selected_family; |
| 25 | const char *family_name; |
| 26 | const u32 *usb_reg_bits_map; |
| 27 | }; |
| 28 | |
| 29 | void brcm_usb_set_family_map(struct brcm_usb_init_params *params); |
| 30 | int brcm_usb_init_get_dual_select(struct brcm_usb_init_params *params); |
| 31 | void brcm_usb_init_set_dual_select(struct brcm_usb_init_params *params, |
| 32 | int mode); |
| 33 | |
| 34 | void brcm_usb_init_ipp(struct brcm_usb_init_params *ini); |
| 35 | void brcm_usb_init_common(struct brcm_usb_init_params *ini); |
| 36 | void brcm_usb_init_eohci(struct brcm_usb_init_params *ini); |
| 37 | void brcm_usb_init_xhci(struct brcm_usb_init_params *ini); |
| 38 | void brcm_usb_uninit_common(struct brcm_usb_init_params *ini); |
| 39 | void brcm_usb_uninit_eohci(struct brcm_usb_init_params *ini); |
| 40 | void brcm_usb_uninit_xhci(struct brcm_usb_init_params *ini); |
| 41 | |
| 42 | #endif /* _USB_BRCM_COMMON_INIT_H */ |