chore: replace tab with space
Signed-off-by: sakumisu <1203593632@qq.com>
This commit is contained in:
@@ -351,11 +351,11 @@ static int usbh_hub_connect(struct usbh_hubport *hport, uint8_t intf)
|
||||
}
|
||||
|
||||
/*
|
||||
* Super-Speed hubs need to know their depth to be able to
|
||||
* parse the bits of the route-string that correspond to
|
||||
* their downstream port number.
|
||||
*
|
||||
*/
|
||||
* Super-Speed hubs need to know their depth to be able to
|
||||
* parse the bits of the route-string that correspond to
|
||||
* their downstream port number.
|
||||
*
|
||||
*/
|
||||
if ((hport->depth != 0) && (hport->speed == USB_SPEED_SUPER)) {
|
||||
ret = usbh_hub_set_depth(hub, hport->depth - 1);
|
||||
if (ret < 0) {
|
||||
|
||||
@@ -91,10 +91,10 @@ static uint32_t ftdi_2232h_baud_base_to_divisor(uint32_t baud, int base)
|
||||
else if (divisor == 0x4001) /* 1.5 */
|
||||
divisor = 1;
|
||||
/*
|
||||
* Set this bit to turn off a divide by 2.5 on baud rate generator
|
||||
* This enables baud rates up to 12Mbaud but cannot reach below 1200
|
||||
* baud with this bit set
|
||||
*/
|
||||
* Set this bit to turn off a divide by 2.5 on baud rate generator
|
||||
* This enables baud rates up to 12Mbaud but cannot reach below 1200
|
||||
* baud with this bit set
|
||||
*/
|
||||
divisor |= 0x00020000;
|
||||
return divisor;
|
||||
}
|
||||
@@ -345,11 +345,11 @@ static int usbh_ftdi_get_modem_status(struct usbh_serial *serial)
|
||||
}
|
||||
|
||||
status = (serial->iobuffer[0] & FTDI_SIO_DSR_MASK ? USBH_SERIAL_TIOCM_DSR : 0) |
|
||||
(serial->iobuffer[0] & FTDI_SIO_CTS_MASK ? USBH_SERIAL_TIOCM_CTS : 0) |
|
||||
(serial->iobuffer[0] & FTDI_SIO_RI_MASK ? USBH_SERIAL_TIOCM_RI : 0) |
|
||||
(serial->iobuffer[0] & FTDI_SIO_RLSD_MASK ? USBH_SERIAL_TIOCM_CD : 0) |
|
||||
(serial->line_state & USBH_SERIAL_TIOCM_DTR ? USBH_SERIAL_TIOCM_DTR : 0) |
|
||||
(serial->line_state & USBH_SERIAL_TIOCM_RTS ? USBH_SERIAL_TIOCM_RTS : 0);
|
||||
(serial->iobuffer[0] & FTDI_SIO_CTS_MASK ? USBH_SERIAL_TIOCM_CTS : 0) |
|
||||
(serial->iobuffer[0] & FTDI_SIO_RI_MASK ? USBH_SERIAL_TIOCM_RI : 0) |
|
||||
(serial->iobuffer[0] & FTDI_SIO_RLSD_MASK ? USBH_SERIAL_TIOCM_CD : 0) |
|
||||
(serial->line_state & USBH_SERIAL_TIOCM_DTR ? USBH_SERIAL_TIOCM_DTR : 0) |
|
||||
(serial->line_state & USBH_SERIAL_TIOCM_RTS ? USBH_SERIAL_TIOCM_RTS : 0);
|
||||
|
||||
return status;
|
||||
}
|
||||
@@ -404,4 +404,4 @@ CLASS_INFO_DEFINE const struct usbh_class_info ftdi_class_info = {
|
||||
.bInterfaceProtocol = 0x00,
|
||||
.id_table = ftdi_id_table,
|
||||
.class_driver = &ftdi_class_driver
|
||||
};
|
||||
};
|
||||
|
||||
@@ -131,12 +131,12 @@ static uint32_t pl2303_encode_baud_rate_divisor_alt(unsigned char buf[4],
|
||||
unsigned int baseline, mantissa, exponent;
|
||||
|
||||
/*
|
||||
* Apparently, for the TA version the formula is:
|
||||
* baudrate = 12M * 32 / (mantissa * 2^exponent)
|
||||
* where
|
||||
* mantissa = buf[10:0]
|
||||
* exponent = buf[15:13 16]
|
||||
*/
|
||||
* Apparently, for the TA version the formula is:
|
||||
* baudrate = 12M * 32 / (mantissa * 2^exponent)
|
||||
* where
|
||||
* mantissa = buf[10:0]
|
||||
* exponent = buf[15:13 16]
|
||||
*/
|
||||
baseline = 12000000 * 32;
|
||||
mantissa = baseline / baud;
|
||||
if (mantissa == 0)
|
||||
@@ -170,12 +170,12 @@ static uint32_t pl2303_encode_baud_rate_divisor(unsigned char buf[4],
|
||||
unsigned int baseline, mantissa, exponent;
|
||||
|
||||
/*
|
||||
* Apparently the formula is:
|
||||
* baudrate = 12M * 32 / (mantissa * 4^exponent)
|
||||
* where
|
||||
* mantissa = buf[8:0]
|
||||
* exponent = buf[11:9]
|
||||
*/
|
||||
* Apparently the formula is:
|
||||
* baudrate = 12M * 32 / (mantissa * 4^exponent)
|
||||
* where
|
||||
* mantissa = buf[8:0]
|
||||
* exponent = buf[11:9]
|
||||
*/
|
||||
baseline = 12000000 * 32;
|
||||
mantissa = baseline / baud;
|
||||
if (mantissa == 0)
|
||||
@@ -347,7 +347,7 @@ static int usbh_pl2303_get_chiptype(struct usbh_serial *serial)
|
||||
case 0x300: /* GT / TA */
|
||||
if (pl2303_supports_hx_status(serial))
|
||||
return TYPE_TA;
|
||||
__attribute__((fallthrough));
|
||||
__attribute__((fallthrough));
|
||||
case 0x305:
|
||||
case 0x400: /* GL */
|
||||
case 0x405:
|
||||
@@ -355,7 +355,7 @@ static int usbh_pl2303_get_chiptype(struct usbh_serial *serial)
|
||||
case 0x500: /* GE / TB */
|
||||
if (pl2303_supports_hx_status(serial))
|
||||
return TYPE_TB;
|
||||
__attribute__((fallthrough));
|
||||
__attribute__((fallthrough));
|
||||
case 0x505:
|
||||
case 0x600: /* GS */
|
||||
case 0x605:
|
||||
@@ -525,9 +525,9 @@ static int usbh_pl2303_set_line_coding(struct usbh_serial *serial, struct cdc_li
|
||||
baud = MIN(baud, pl2303_type_data[pl2303_class->chip_type].max_baud_rate);
|
||||
}
|
||||
/*
|
||||
* Use direct method for supported baud rates, otherwise use divisors.
|
||||
* Newer chip types do not support divisor encoding.
|
||||
*/
|
||||
* Use direct method for supported baud rates, otherwise use divisors.
|
||||
* Newer chip types do not support divisor encoding.
|
||||
*/
|
||||
if (pl2303_type_data[pl2303_class->chip_type].no_divisors)
|
||||
baud_sup = baud;
|
||||
else
|
||||
|
||||
4
class/vendor/net/usbh_rtl8152.c
vendored
4
class/vendor/net/usbh_rtl8152.c
vendored
@@ -1596,8 +1596,8 @@ static void r8153_teredo_off(struct usbh_rtl8152 *tp)
|
||||
case RTL_VER_15:
|
||||
default:
|
||||
/* The bit 0 ~ 7 are relative with teredo settings. They are
|
||||
* W1C (write 1 to clear), so set all 1 to disable it.
|
||||
*/
|
||||
* W1C (write 1 to clear), so set all 1 to disable it.
|
||||
*/
|
||||
ocp_write_byte(tp, MCU_TYPE_PLA, PLA_TEREDO_CFG, 0xff);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -318,24 +318,24 @@
|
||||
/* Setup packet definition used to read raw data from USB line */
|
||||
struct usb_setup_packet {
|
||||
/** Request type. Bits 0:4 determine recipient, see
|
||||
* \ref usb_request_recipient. Bits 5:6 determine type, see
|
||||
* \ref usb_request_type. Bit 7 determines data transfer direction, see
|
||||
* \ref usb_endpoint_direction.
|
||||
*/
|
||||
* \ref usb_request_recipient. Bits 5:6 determine type, see
|
||||
* \ref usb_request_type. Bit 7 determines data transfer direction, see
|
||||
* \ref usb_endpoint_direction.
|
||||
*/
|
||||
uint8_t bmRequestType;
|
||||
|
||||
/** Request. If the type bits of bmRequestType are equal to
|
||||
* \ref usb_request_type::LIBUSB_REQUEST_TYPE_STANDARD
|
||||
* "USB_REQUEST_TYPE_STANDARD" then this field refers to
|
||||
* \ref usb_standard_request. For other cases, use of this field is
|
||||
* application-specific. */
|
||||
* \ref usb_request_type::LIBUSB_REQUEST_TYPE_STANDARD
|
||||
* "USB_REQUEST_TYPE_STANDARD" then this field refers to
|
||||
* \ref usb_standard_request. For other cases, use of this field is
|
||||
* application-specific. */
|
||||
uint8_t bRequest;
|
||||
|
||||
/** Value. Varies according to request */
|
||||
uint16_t wValue;
|
||||
|
||||
/** Index. Varies according to request, typically used to pass an index
|
||||
* or offset */
|
||||
* or offset */
|
||||
uint16_t wIndex;
|
||||
|
||||
/** Number of bytes to transfer */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright (c) 2022, Artinchip Technology Co., Ltd
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
@@ -46,37 +46,31 @@ typedef struct aic_ehci_config {
|
||||
uint32_t phy_clk_id;
|
||||
uint32_t phy_rst_id;
|
||||
uint32_t irq_num;
|
||||
}aic_ehci_config_t;
|
||||
} aic_ehci_config_t;
|
||||
|
||||
aic_ehci_config_t config[] = {
|
||||
#ifdef AIC_USING_USB0_HOST
|
||||
{
|
||||
USB_HOST0_BASE,
|
||||
CLK_USBH0,
|
||||
RESET_USBH0,
|
||||
CLK_USB_PHY0,
|
||||
RESET_USBPHY0,
|
||||
USB_HOST0_EHCI_IRQn
|
||||
},
|
||||
{ USB_HOST0_BASE,
|
||||
CLK_USBH0,
|
||||
RESET_USBH0,
|
||||
CLK_USB_PHY0,
|
||||
RESET_USBPHY0,
|
||||
USB_HOST0_EHCI_IRQn },
|
||||
#else
|
||||
{
|
||||
0xFFFFFFFF,
|
||||
0xFFFFFFFF,
|
||||
0xFFFFFFFF,
|
||||
0xFFFFFFFF,
|
||||
0xFFFFFFFF,
|
||||
0xFFFFFFFF
|
||||
},
|
||||
{ 0xFFFFFFFF,
|
||||
0xFFFFFFFF,
|
||||
0xFFFFFFFF,
|
||||
0xFFFFFFFF,
|
||||
0xFFFFFFFF,
|
||||
0xFFFFFFFF },
|
||||
#endif
|
||||
#ifdef AIC_USING_USB1_HOST
|
||||
{
|
||||
USB_HOST1_BASE,
|
||||
CLK_USBH1,
|
||||
RESET_USBH1,
|
||||
CLK_USB_PHY1,
|
||||
RESET_USBPHY1,
|
||||
USB_HOST1_EHCI_IRQn
|
||||
}
|
||||
{ USB_HOST1_BASE,
|
||||
CLK_USBH1,
|
||||
RESET_USBH1,
|
||||
CLK_USB_PHY1,
|
||||
RESET_USBPHY1,
|
||||
USB_HOST1_EHCI_IRQn }
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -85,12 +79,12 @@ void usb_hc_low_level_init(struct usbh_bus *bus)
|
||||
uint32_t val;
|
||||
int i = 0;
|
||||
|
||||
for (i=0; i<sizeof(config)/sizeof(aic_ehci_config_t); i++) {
|
||||
for (i = 0; i < sizeof(config) / sizeof(aic_ehci_config_t); i++) {
|
||||
if (bus->hcd.reg_base == config[i].base_addr)
|
||||
break;
|
||||
}
|
||||
|
||||
if (i == sizeof(config)/sizeof(aic_ehci_config_t))
|
||||
if (i == sizeof(config) / sizeof(aic_ehci_config_t))
|
||||
return;
|
||||
|
||||
/* set usb0 phy switch: Host/Device */
|
||||
@@ -109,20 +103,20 @@ void usb_hc_low_level_init(struct usbh_bus *bus)
|
||||
aicos_udelay(300);
|
||||
|
||||
/* set phy type: UTMI/ULPI */
|
||||
val = readl((volatile void *)(unsigned long)(config[i].base_addr+0x800));
|
||||
val = readl((volatile void *)(unsigned long)(config[i].base_addr + 0x800));
|
||||
#ifdef FPGA_BOARD_ARTINCHIP
|
||||
/* fpga phy type = ULPI */
|
||||
writel((val & ~0x1U), (volatile void *)(unsigned long)(config[i].base_addr+0x800));
|
||||
writel((val & ~0x1U), (volatile void *)(unsigned long)(config[i].base_addr + 0x800));
|
||||
#else
|
||||
/* board phy type = UTMI */
|
||||
writel((val | 0x1), (volatile void *)(unsigned long)(config[i].base_addr+0x800));
|
||||
writel((val | 0x1), (volatile void *)(unsigned long)(config[i].base_addr + 0x800));
|
||||
#endif
|
||||
|
||||
/* Set AHB2STBUS_INSREG01
|
||||
Set EHCI packet buffer IN/OUT threshold (in DWORDs)
|
||||
Must increase the OUT threshold to avoid underrun. (FIFO size - 4)
|
||||
*/
|
||||
writel((32 | (127 << 16)), (volatile void *)(unsigned long)(config[i].base_addr+0x94));
|
||||
writel((32 | (127 << 16)), (volatile void *)(unsigned long)(config[i].base_addr + 0x94));
|
||||
|
||||
/* register interrupt callback */
|
||||
aicos_request_irq(config[i].irq_num, (irq_handler_t)aic_ehci_isr,
|
||||
@@ -176,4 +170,4 @@ int __usbh_init(void)
|
||||
#include <rtdevice.h>
|
||||
|
||||
INIT_ENV_EXPORT(__usbh_init);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user