drivers: usb: device: stm32: fix disconnect-gpios configuration.
For some reason, rather than testing for the presence of disconnect-gpios in the devicetree, the STM32 USB Device driver was relying on a hidden Kconfig flag to be set. This patch removes the Kconfig option completely and simply tests for the DT property - if it's set, you obviously know what you're doing and obviously need the pull-up GPIO behaviour. Signed-off-by: Chris Collins <chris@realsimgear.com>
This commit is contained in:
parent
2d8c45c1e0
commit
ce84c782dc
3 changed files with 2 additions and 10 deletions
|
@ -6,4 +6,3 @@
|
|||
config BOARD_OLIMEXINO_STM32
|
||||
bool "OLIMEXINO-STM32 Development Board"
|
||||
depends on SOC_STM32F103XB
|
||||
select USB_DC_STM32_DISCONN_ENABLE if USB_DEVICE_DRIVER
|
||||
|
|
|
@ -50,13 +50,6 @@ config USB_DC_STM32
|
|||
Enable USB support on the STM32 F0, F1, F2, F3, F4, F7, L0, L4, G4, U5 family of
|
||||
processors.
|
||||
|
||||
config USB_DC_STM32_DISCONN_ENABLE
|
||||
bool
|
||||
depends on USB_DC_STM32
|
||||
help
|
||||
Say Y if your board uses USB DISCONNECT pin to enable the
|
||||
pull-up resistor on USB DP.
|
||||
|
||||
config USB_DC_SAM0
|
||||
bool "SAM0 series USB Device Controller driver"
|
||||
default y
|
||||
|
|
|
@ -1099,7 +1099,7 @@ void HAL_PCD_DataInStageCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum)
|
|||
}
|
||||
}
|
||||
|
||||
#if (defined(USB) || defined(USB_DRD_FS)) && defined(CONFIG_USB_DC_STM32_DISCONN_ENABLE)
|
||||
#if (defined(USB) || defined(USB_DRD_FS)) && DT_INST_NODE_HAS_PROP(0, disconnect_gpios)
|
||||
void HAL_PCDEx_SetConnectionState(PCD_HandleTypeDef *hpcd, uint8_t state)
|
||||
{
|
||||
const struct device *usb_disconnect;
|
||||
|
@ -1112,4 +1112,4 @@ void HAL_PCDEx_SetConnectionState(PCD_HandleTypeDef *hpcd, uint8_t state)
|
|||
DT_GPIO_FLAGS(DT_INST(0, st_stm32_usb), disconnect_gpios) |
|
||||
(state ? GPIO_OUTPUT_ACTIVE : GPIO_OUTPUT_INACTIVE));
|
||||
}
|
||||
#endif /* USB && CONFIG_USB_DC_STM32_DISCONN_ENABLE */
|
||||
#endif /* USB && DT_INST_NODE_HAS_PROP(0, disconnect_gpios) */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue