1 /* 2 * Copyright (C) 2014-2017 Broadcom 3 * 4 * This software is licensed under the terms of the GNU General Public 5 * License version 2, as published by the Free Software Foundation, and 6 * may be copied, distributed, and modified under those terms. 7 * 8 * This program is distributed in the hope that it will be useful, 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * GNU General Public License for more details. 12 */ 13 14 #ifndef _USB_BRCM_COMMON_INIT_H 15 #define _USB_BRCM_COMMON_INIT_H 16 17 #define USB_CTLR_MODE_HOST 0 18 #define USB_CTLR_MODE_DEVICE 1 19 #define USB_CTLR_MODE_DRD 2 20 #define USB_CTLR_MODE_TYPEC_PD 3 21 22 struct brcm_usb_init_params; 23 24 struct brcm_usb_init_params { 25 void __iomem *ctrl_regs; 26 void __iomem *xhci_ec_regs; 27 int ioc; 28 int ipp; 29 int mode; 30 u32 family_id; 31 u32 product_id; 32 int selected_family; 33 const char *family_name; 34 const u32 *usb_reg_bits_map; 35 }; 36 37 void brcm_usb_set_family_map(struct brcm_usb_init_params *params); 38 int brcm_usb_init_get_dual_select(struct brcm_usb_init_params *params); 39 void brcm_usb_init_set_dual_select(struct brcm_usb_init_params *params, 40 int mode); 41 42 void brcm_usb_init_ipp(struct brcm_usb_init_params *ini); 43 void brcm_usb_init_common(struct brcm_usb_init_params *ini); 44 void brcm_usb_init_eohci(struct brcm_usb_init_params *ini); 45 void brcm_usb_init_xhci(struct brcm_usb_init_params *ini); 46 void brcm_usb_uninit_common(struct brcm_usb_init_params *ini); 47 void brcm_usb_uninit_eohci(struct brcm_usb_init_params *ini); 48 void brcm_usb_uninit_xhci(struct brcm_usb_init_params *ini); 49 50 #endif /* _USB_BRCM_COMMON_INIT_H */ 51