usb: usb_dc_stm32: Convert to DT instance defines to remove dts_fixup.h
Convert usb_dc_stm32 driver GPIO disconnect to use new defines so we can remove the dts_fixup.h code for it. Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
parent
e0349fb421
commit
9e4016d8dc
2 changed files with 6 additions and 10 deletions
|
@ -3,10 +3,6 @@
|
||||||
* are modified to handle the generated information, or the mapping of
|
* are modified to handle the generated information, or the mapping of
|
||||||
* generated data matches the driver definitions.
|
* generated data matches the driver definitions.
|
||||||
*/
|
*/
|
||||||
#define DT_USB_DC_STM32_DISCONN_GPIO_PORT_NAME DT_ST_STM32_USB_40005C00_DISCONNECT_GPIOS_CONTROLLER
|
|
||||||
#define DT_USB_DC_STM32_DISCONN_PIN DT_ST_STM32_USB_40005C00_DISCONNECT_GPIOS_PIN
|
|
||||||
#define DT_USB_DC_STM32_DISCONN_PIN_LEVEL DT_ST_STM32_USB_40005C00_DISCONNECT_GPIOS_FLAGS
|
|
||||||
|
|
||||||
#define DT_DISK_SDHC0_BUS_ADDRESS DT_ST_STM32_SPI_40003800_ZEPHYR_MMC_SPI_SLOT_0_BASE_ADDRESS
|
#define DT_DISK_SDHC0_BUS_ADDRESS DT_ST_STM32_SPI_40003800_ZEPHYR_MMC_SPI_SLOT_0_BASE_ADDRESS
|
||||||
#define DT_DISK_SDHC0_BUS_NAME DT_ST_STM32_SPI_40003800_ZEPHYR_MMC_SPI_SLOT_0_BUS_NAME
|
#define DT_DISK_SDHC0_BUS_NAME DT_ST_STM32_SPI_40003800_ZEPHYR_MMC_SPI_SLOT_0_BUS_NAME
|
||||||
#define DT_DISK_SDHC0_CS_GPIOS_CONTROLLER DT_ST_STM32_SPI_40003800_CS_GPIOS_CONTROLLER
|
#define DT_DISK_SDHC0_CS_GPIOS_CONTROLLER DT_ST_STM32_SPI_40003800_CS_GPIOS_CONTROLLER
|
||||||
|
|
|
@ -973,18 +973,18 @@ void HAL_PCDEx_SetConnectionState(PCD_HandleTypeDef *hpcd, uint8_t state)
|
||||||
struct device *usb_disconnect;
|
struct device *usb_disconnect;
|
||||||
|
|
||||||
usb_disconnect = device_get_binding(
|
usb_disconnect = device_get_binding(
|
||||||
DT_USB_DC_STM32_DISCONN_GPIO_PORT_NAME);
|
DT_ST_STM32_USB_0_DISCONNECT_GPIOS_CONTROLLER);
|
||||||
gpio_pin_configure(usb_disconnect,
|
gpio_pin_configure(usb_disconnect,
|
||||||
DT_USB_DC_STM32_DISCONN_PIN, GPIO_DIR_OUT);
|
DT_ST_STM32_USB_0_DISCONNECT_GPIOS_PIN, GPIO_DIR_OUT);
|
||||||
|
|
||||||
if (state) {
|
if (state) {
|
||||||
gpio_pin_write(usb_disconnect,
|
gpio_pin_write(usb_disconnect,
|
||||||
DT_USB_DC_STM32_DISCONN_PIN,
|
DT_ST_STM32_USB_0_DISCONNECT_GPIOS_PIN,
|
||||||
DT_USB_DC_STM32_DISCONN_PIN_LEVEL);
|
DT_ST_STM32_USB_0_DISCONNECT_GPIOS_FLAGS);
|
||||||
} else {
|
} else {
|
||||||
gpio_pin_write(usb_disconnect,
|
gpio_pin_write(usb_disconnect,
|
||||||
DT_USB_DC_STM32_DISCONN_PIN,
|
DT_ST_STM32_USB_0_DISCONNECT_GPIOS_PIN,
|
||||||
!DT_USB_DC_STM32_DISCONN_PIN_LEVEL);
|
!DT_ST_STM32_USB_0_DISCONNECT_GPIOS_FLAGS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* USB && CONFIG_USB_DC_STM32_DISCONN_ENABLE */
|
#endif /* USB && CONFIG_USB_DC_STM32_DISCONN_ENABLE */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue