提交 9a25e80d 编写于 作者: F Fang Yafen 提交者: Zheng Zengkai

some drivers: keep the original function for non-RPi

raspberrypi inclusion
category: feature
bugzilla: 50432

------------------------------

This patch adjusts following mmc/spi driver related patches for
raspberry pi on non-Raspberry Pi platforms, using specific
config CONFIG_OPENEULER_RASPBERRYPI to distinguish them:

f3badb78 of: overlay: Correct symbol path fixups
8f150108 mmc: sdhci: Silence MMC warnings
893e457c spi: Force CS_HIGH if GPIO descriptors are used
Signed-off-by: NFang Yafen <yafen@iscas.ac.cn>
Reviewed-by: NXie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 e1a2bef3
...@@ -40,8 +40,13 @@ ...@@ -40,8 +40,13 @@
#define DBG(f, x...) \ #define DBG(f, x...) \
pr_debug("%s: " DRIVER_NAME ": " f, mmc_hostname(host->mmc), ## x) pr_debug("%s: " DRIVER_NAME ": " f, mmc_hostname(host->mmc), ## x)
#ifdef CONFIG_OPENEULER_RASPBERRYPI
#define SDHCI_DUMP(f, x...) \ #define SDHCI_DUMP(f, x...) \
pr_debug("%s: " DRIVER_NAME ": " f, mmc_hostname(host->mmc), ## x) pr_debug("%s: " DRIVER_NAME ": " f, mmc_hostname(host->mmc), ## x)
#else
#define SDHCI_DUMP(f, x...) \
pr_err("%s: " DRIVER_NAME ": " f, mmc_hostname(host->mmc), ## x)
#endif
#define MAX_TUNING_LOOP 40 #define MAX_TUNING_LOOP 40
...@@ -3120,8 +3125,13 @@ static void sdhci_timeout_timer(struct timer_list *t) ...@@ -3120,8 +3125,13 @@ static void sdhci_timeout_timer(struct timer_list *t)
spin_lock_irqsave(&host->lock, flags); spin_lock_irqsave(&host->lock, flags);
if (host->cmd && !sdhci_data_line_cmd(host->cmd)) { if (host->cmd && !sdhci_data_line_cmd(host->cmd)) {
#ifdef CONFIG_OPENEULER_RASPBERRYPI
pr_debug("%s: Timeout waiting for hardware cmd interrupt.\n", pr_debug("%s: Timeout waiting for hardware cmd interrupt.\n",
mmc_hostname(host->mmc)); mmc_hostname(host->mmc));
#else
pr_err("%s: Timeout waiting for hardware cmd interrupt.\n",
mmc_hostname(host->mmc));
#endif
sdhci_dumpregs(host); sdhci_dumpregs(host);
host->cmd->error = -ETIMEDOUT; host->cmd->error = -ETIMEDOUT;
...@@ -3142,8 +3152,13 @@ static void sdhci_timeout_data_timer(struct timer_list *t) ...@@ -3142,8 +3152,13 @@ static void sdhci_timeout_data_timer(struct timer_list *t)
if (host->data || host->data_cmd || if (host->data || host->data_cmd ||
(host->cmd && sdhci_data_line_cmd(host->cmd))) { (host->cmd && sdhci_data_line_cmd(host->cmd))) {
#ifdef CONFIG_OPENEULER_RASPBERRYPI
pr_debug("%s: Timeout waiting for hardware interrupt.\n", pr_debug("%s: Timeout waiting for hardware interrupt.\n",
mmc_hostname(host->mmc)); mmc_hostname(host->mmc));
#else
pr_err("%s: Timeout waiting for hardware interrupt.\n",
mmc_hostname(host->mmc));
#endif
sdhci_dumpregs(host); sdhci_dumpregs(host);
if (host->data) { if (host->data) {
......
...@@ -245,8 +245,10 @@ static struct property *dup_and_fixup_symbol_prop( ...@@ -245,8 +245,10 @@ static struct property *dup_and_fixup_symbol_prop(
if (!target_path) if (!target_path)
return NULL; return NULL;
target_path_len = strlen(target_path); target_path_len = strlen(target_path);
#ifdef CONFIG_OPENEULER_RASPBERRYPI
if (!strcmp(target_path, "/")) if (!strcmp(target_path, "/"))
target_path_len = 0; target_path_len = 0;
#endif
new_prop = kzalloc(sizeof(*new_prop), GFP_KERNEL); new_prop = kzalloc(sizeof(*new_prop), GFP_KERNEL);
if (!new_prop) if (!new_prop)
......
...@@ -3322,7 +3322,9 @@ static int __spi_validate_bits_per_word(struct spi_controller *ctlr, ...@@ -3322,7 +3322,9 @@ static int __spi_validate_bits_per_word(struct spi_controller *ctlr,
*/ */
int spi_setup(struct spi_device *spi) int spi_setup(struct spi_device *spi)
{ {
#ifdef CONFIG_OPENEULER_RASPBERRYPI
struct spi_controller *ctlr = spi->controller; struct spi_controller *ctlr = spi->controller;
#endif
unsigned bad_bits, ugly_bits; unsigned bad_bits, ugly_bits;
int status; int status;
...@@ -3341,12 +3343,14 @@ int spi_setup(struct spi_device *spi) ...@@ -3341,12 +3343,14 @@ int spi_setup(struct spi_device *spi)
SPI_RX_DUAL | SPI_RX_QUAD | SPI_RX_OCTAL))) SPI_RX_DUAL | SPI_RX_QUAD | SPI_RX_OCTAL)))
return -EINVAL; return -EINVAL;
#ifdef CONFIG_OPENEULER_RASPBERRYPI
if (ctlr->use_gpio_descriptors && ctlr->cs_gpiods && if (ctlr->use_gpio_descriptors && ctlr->cs_gpiods &&
ctlr->cs_gpiods[spi->chip_select] && !(spi->mode & SPI_CS_HIGH)) { ctlr->cs_gpiods[spi->chip_select] && !(spi->mode & SPI_CS_HIGH)) {
dev_dbg(&spi->dev, dev_dbg(&spi->dev,
"setup: forcing CS_HIGH (use_gpio_descriptors)\n"); "setup: forcing CS_HIGH (use_gpio_descriptors)\n");
spi->mode |= SPI_CS_HIGH; spi->mode |= SPI_CS_HIGH;
} }
#endif
/* help drivers fail *cleanly* when they need options /* help drivers fail *cleanly* when they need options
* that aren't supported with their current controller * that aren't supported with their current controller
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册