disk: sdhc: Convert to new DT_<COMPAT>_<INSTANCE> defines

Convert disk_access_sdhc  driver 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:
Kumar Gala 2019-02-03 09:45:49 -06:00 committed by Anas Nashif
commit dee63e200c
3 changed files with 4 additions and 29 deletions

View file

@ -1,16 +0,0 @@
/*
* Copyright (c) 2019 Tavish Naruka <tavishnaruka@gmail.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
/* This file is a temporary workaround for mapping of the generated information
* to the current driver definitions. This will be removed when the drivers
* are modified to handle the generated information, or the mapping of
* generated data matches the driver definitions.
*/
#define DT_DISK_SDHC0_BUS_ADDRESS DT_NORDIC_NRF_SPI_40004000_ZEPHYR_MMC_SPI_SLOT_0_BASE_ADDRESS
#define DT_DISK_SDHC0_BUS_NAME DT_NORDIC_NRF_SPI_40004000_ZEPHYR_MMC_SPI_SLOT_0_BUS_NAME
#define DT_DISK_SDHC0_CS_GPIOS_CONTROLLER SPI_1_CS_GPIOS_CONTROLLER
#define DT_DISK_SDHC0_CS_GPIOS_PIN SPI_1_CS_GPIOS_PIN

View file

@ -1,9 +0,0 @@
/* This file is a temporary workaround for mapping of the generated information
* to the current driver definitions. This will be removed when the drivers
* are modified to handle the generated information, or the mapping of
* generated data matches the driver definitions.
*/
#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_CS_GPIOS_CONTROLLER DT_ST_STM32_SPI_40003800_CS_GPIOS_CONTROLLER
#define DT_DISK_SDHC0_CS_GPIOS_PIN DT_ST_STM32_SPI_40003800_CS_GPIOS_PIN

View file

@ -897,15 +897,15 @@ static int sdhc_init(struct device *dev)
{ {
struct sdhc_data *data = dev->driver_data; struct sdhc_data *data = dev->driver_data;
data->spi = device_get_binding(DT_DISK_SDHC0_BUS_NAME); data->spi = device_get_binding(DT_ZEPHYR_MMC_SPI_SLOT_0_BUS_NAME);
data->cfg.frequency = SDHC_INITIAL_SPEED; data->cfg.frequency = SDHC_INITIAL_SPEED;
data->cfg.operation = SPI_WORD_SET(8) | SPI_HOLD_ON_CS; data->cfg.operation = SPI_WORD_SET(8) | SPI_HOLD_ON_CS;
data->cfg.slave = DT_DISK_SDHC0_BUS_ADDRESS; data->cfg.slave = DT_ZEPHYR_MMC_SPI_SLOT_0_BASE_ADDRESS;
data->cs = device_get_binding(DT_DISK_SDHC0_CS_GPIOS_CONTROLLER); data->cs = device_get_binding(DT_ZEPHYR_MMC_SPI_SLOT_0_CS_GPIO_CONTROLLER);
__ASSERT_NO_MSG(data->cs != NULL); __ASSERT_NO_MSG(data->cs != NULL);
data->pin = DT_DISK_SDHC0_CS_GPIOS_PIN; data->pin = DT_ZEPHYR_MMC_SPI_SLOT_0_CS_GPIO_PIN;
disk_sdhc_init(dev); disk_sdhc_init(dev);