Commit 7e016d146f90530545798ad46ec0662c1c69c505
Exists in
smarc-imx_3.14.28_1.0.0_ga
and in
1 other branch
Merge remote-tracking branch 'spi/topic/pxa' into spi-next
Showing 2 changed files Side-by-side Diff
drivers/spi/spi-pxa2xx-dma.c
... | ... | @@ -327,22 +327,23 @@ |
327 | 327 | int pxa2xx_spi_dma_setup(struct driver_data *drv_data) |
328 | 328 | { |
329 | 329 | struct pxa2xx_spi_master *pdata = drv_data->master_info; |
330 | + struct device *dev = &drv_data->pdev->dev; | |
330 | 331 | dma_cap_mask_t mask; |
331 | 332 | |
332 | 333 | dma_cap_zero(mask); |
333 | 334 | dma_cap_set(DMA_SLAVE, mask); |
334 | 335 | |
335 | - drv_data->dummy = devm_kzalloc(&drv_data->pdev->dev, SZ_2K, GFP_KERNEL); | |
336 | + drv_data->dummy = devm_kzalloc(dev, SZ_2K, GFP_KERNEL); | |
336 | 337 | if (!drv_data->dummy) |
337 | 338 | return -ENOMEM; |
338 | 339 | |
339 | - drv_data->tx_chan = dma_request_channel(mask, pxa2xx_spi_dma_filter, | |
340 | - pdata); | |
340 | + drv_data->tx_chan = dma_request_slave_channel_compat(mask, | |
341 | + pxa2xx_spi_dma_filter, pdata, dev, "tx"); | |
341 | 342 | if (!drv_data->tx_chan) |
342 | 343 | return -ENODEV; |
343 | 344 | |
344 | - drv_data->rx_chan = dma_request_channel(mask, pxa2xx_spi_dma_filter, | |
345 | - pdata); | |
345 | + drv_data->rx_chan = dma_request_slave_channel_compat(mask, | |
346 | + pxa2xx_spi_dma_filter, pdata, dev, "rx"); | |
346 | 347 | if (!drv_data->rx_chan) { |
347 | 348 | dma_release_channel(drv_data->tx_chan); |
348 | 349 | drv_data->tx_chan = NULL; |
drivers/spi/spi-pxa2xx.c
... | ... | @@ -1022,32 +1022,10 @@ |
1022 | 1022 | } |
1023 | 1023 | |
1024 | 1024 | #ifdef CONFIG_ACPI |
1025 | -static int pxa2xx_spi_acpi_add_dma(struct acpi_resource *res, void *data) | |
1026 | -{ | |
1027 | - struct pxa2xx_spi_master *pdata = data; | |
1028 | - | |
1029 | - if (res->type == ACPI_RESOURCE_TYPE_FIXED_DMA) { | |
1030 | - const struct acpi_resource_fixed_dma *dma; | |
1031 | - | |
1032 | - dma = &res->data.fixed_dma; | |
1033 | - if (pdata->tx_slave_id < 0) { | |
1034 | - pdata->tx_slave_id = dma->request_lines; | |
1035 | - pdata->tx_chan_id = dma->channels; | |
1036 | - } else if (pdata->rx_slave_id < 0) { | |
1037 | - pdata->rx_slave_id = dma->request_lines; | |
1038 | - pdata->rx_chan_id = dma->channels; | |
1039 | - } | |
1040 | - } | |
1041 | - | |
1042 | - /* Tell the ACPI core to skip this resource */ | |
1043 | - return 1; | |
1044 | -} | |
1045 | - | |
1046 | 1025 | static struct pxa2xx_spi_master * |
1047 | 1026 | pxa2xx_spi_acpi_get_pdata(struct platform_device *pdev) |
1048 | 1027 | { |
1049 | 1028 | struct pxa2xx_spi_master *pdata; |
1050 | - struct list_head resource_list; | |
1051 | 1029 | struct acpi_device *adev; |
1052 | 1030 | struct ssp_device *ssp; |
1053 | 1031 | struct resource *res; |
... | ... | @@ -1073,7 +1051,7 @@ |
1073 | 1051 | ssp->phys_base = res->start; |
1074 | 1052 | ssp->mmio_base = devm_ioremap_resource(&pdev->dev, res); |
1075 | 1053 | if (IS_ERR(ssp->mmio_base)) |
1076 | - return PTR_ERR(ssp->mmio_base); | |
1054 | + return NULL; | |
1077 | 1055 | |
1078 | 1056 | ssp->clk = devm_clk_get(&pdev->dev, NULL); |
1079 | 1057 | ssp->irq = platform_get_irq(pdev, 0); |
1080 | 1058 | |
1081 | 1059 | |
... | ... | @@ -1085,22 +1063,15 @@ |
1085 | 1063 | ssp->port_id = devid; |
1086 | 1064 | |
1087 | 1065 | pdata->num_chipselect = 1; |
1088 | - pdata->rx_slave_id = -1; | |
1089 | - pdata->tx_slave_id = -1; | |
1066 | + pdata->enable_dma = true; | |
1090 | 1067 | |
1091 | - INIT_LIST_HEAD(&resource_list); | |
1092 | - acpi_dev_get_resources(adev, &resource_list, pxa2xx_spi_acpi_add_dma, | |
1093 | - pdata); | |
1094 | - acpi_dev_free_resource_list(&resource_list); | |
1095 | - | |
1096 | - pdata->enable_dma = pdata->rx_slave_id >= 0 && pdata->tx_slave_id >= 0; | |
1097 | - | |
1098 | 1068 | return pdata; |
1099 | 1069 | } |
1100 | 1070 | |
1101 | 1071 | static struct acpi_device_id pxa2xx_spi_acpi_match[] = { |
1102 | 1072 | { "INT33C0", 0 }, |
1103 | 1073 | { "INT33C1", 0 }, |
1074 | + { "80860F0E", 0 }, | |
1104 | 1075 | { }, |
1105 | 1076 | }; |
1106 | 1077 | MODULE_DEVICE_TABLE(acpi, pxa2xx_spi_acpi_match); |
... | ... | @@ -1198,7 +1169,7 @@ |
1198 | 1169 | if (platform_info->enable_dma) { |
1199 | 1170 | status = pxa2xx_spi_dma_setup(drv_data); |
1200 | 1171 | if (status) { |
1201 | - dev_warn(dev, "failed to setup DMA, using PIO\n"); | |
1172 | + dev_dbg(dev, "no DMA channels available, using PIO\n"); | |
1202 | 1173 | platform_info->enable_dma = false; |
1203 | 1174 | } |
1204 | 1175 | } |