spi-pxa2xx.c (1f99f8938bcd90d1b98d66b4ec6e2585ead488f2) spi-pxa2xx.c (8ae55af38817a0e0a9bd2987c4e5aa40db4ce5dd)
1/*
2 * Copyright (C) 2005 Stephen Street / StreetFire Sound Labs
3 * Copyright (C) 2013, Intel Corporation
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.

--- 1015 unchanged lines hidden (view full) ---

1024
1025 /* Check if we can DMA this transfer */
1026 if (transfer->len > MAX_DMA_LEN && chip->enable_dma) {
1027
1028 /* reject already-mapped transfers; PIO won't always work */
1029 if (message->is_dma_mapped
1030 || transfer->rx_dma || transfer->tx_dma) {
1031 dev_err(&drv_data->pdev->dev,
1/*
2 * Copyright (C) 2005 Stephen Street / StreetFire Sound Labs
3 * Copyright (C) 2013, Intel Corporation
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.

--- 1015 unchanged lines hidden (view full) ---

1024
1025 /* Check if we can DMA this transfer */
1026 if (transfer->len > MAX_DMA_LEN && chip->enable_dma) {
1027
1028 /* reject already-mapped transfers; PIO won't always work */
1029 if (message->is_dma_mapped
1030 || transfer->rx_dma || transfer->tx_dma) {
1031 dev_err(&drv_data->pdev->dev,
1032 "pump_transfers: mapped transfer length of "
1033 "%u is greater than %d\n",
1032 "Mapped transfer length of %u is greater than %d\n",
1034 transfer->len, MAX_DMA_LEN);
1035 message->status = -EINVAL;
1036 giveback(drv_data);
1037 return;
1038 }
1039
1040 /* warn ... we force this to PIO mode */
1041 dev_warn_ratelimited(&message->spi->dev,
1033 transfer->len, MAX_DMA_LEN);
1034 message->status = -EINVAL;
1035 giveback(drv_data);
1036 return;
1037 }
1038
1039 /* warn ... we force this to PIO mode */
1040 dev_warn_ratelimited(&message->spi->dev,
1042 "pump_transfers: DMA disabled for transfer length %ld "
1043 "greater than %d\n",
1041 "DMA disabled for transfer length %ld greater than %d\n",
1044 (long)drv_data->len, MAX_DMA_LEN);
1045 }
1046
1047 /* Setup the transfer state based on the type of transfer */
1048 if (pxa2xx_spi_flush(drv_data) == 0) {
1042 (long)drv_data->len, MAX_DMA_LEN);
1043 }
1044
1045 /* Setup the transfer state based on the type of transfer */
1046 if (pxa2xx_spi_flush(drv_data) == 0) {
1049 dev_err(&drv_data->pdev->dev, "pump_transfers: flush failed\n");
1047 dev_err(&drv_data->pdev->dev, "Flush failed\n");
1050 message->status = -EIO;
1051 giveback(drv_data);
1052 return;
1053 }
1054 drv_data->n_bytes = chip->n_bytes;
1055 drv_data->tx = (void *)transfer->tx_buf;
1056 drv_data->tx_end = drv_data->tx + transfer->len;
1057 drv_data->rx = transfer->rx_buf;

--- 32 unchanged lines hidden (view full) ---

1090 * thresholds and burst also
1091 */
1092 if (chip->enable_dma) {
1093 if (pxa2xx_spi_set_dma_burst_and_threshold(chip,
1094 message->spi,
1095 bits, &dma_burst,
1096 &dma_thresh))
1097 dev_warn_ratelimited(&message->spi->dev,
1048 message->status = -EIO;
1049 giveback(drv_data);
1050 return;
1051 }
1052 drv_data->n_bytes = chip->n_bytes;
1053 drv_data->tx = (void *)transfer->tx_buf;
1054 drv_data->tx_end = drv_data->tx + transfer->len;
1055 drv_data->rx = transfer->rx_buf;

--- 32 unchanged lines hidden (view full) ---

1088 * thresholds and burst also
1089 */
1090 if (chip->enable_dma) {
1091 if (pxa2xx_spi_set_dma_burst_and_threshold(chip,
1092 message->spi,
1093 bits, &dma_burst,
1094 &dma_thresh))
1095 dev_warn_ratelimited(&message->spi->dev,
1098 "pump_transfers: DMA burst size reduced to match bits_per_word\n");
1096 "DMA burst size reduced to match bits_per_word\n");
1099 }
1100
1101 message->state = RUNNING_STATE;
1102
1103 dma_mapped = master->can_dma &&
1104 master->can_dma(master, message->spi, transfer) &&
1105 master->cur_msg_mapped;
1106 if (dma_mapped) {

--- 842 unchanged lines hidden ---
1097 }
1098
1099 message->state = RUNNING_STATE;
1100
1101 dma_mapped = master->can_dma &&
1102 master->can_dma(master, message->spi, transfer) &&
1103 master->cur_msg_mapped;
1104 if (dma_mapped) {

--- 842 unchanged lines hidden ---