.. | .. |
---|
22 | 22 | #include <linux/ioport.h> |
---|
23 | 23 | #include <linux/of.h> |
---|
24 | 24 | #include <linux/of_device.h> |
---|
25 | | -#include <linux/of_gpio.h> |
---|
26 | 25 | #include <linux/platform_device.h> |
---|
27 | 26 | #include <linux/delay.h> |
---|
28 | 27 | #include <linux/interrupt.h> |
---|
.. | .. |
---|
32 | 31 | #include <linux/clk.h> |
---|
33 | 32 | #include <linux/err.h> |
---|
34 | 33 | #include <linux/completion.h> |
---|
35 | | -#include <linux/gpio.h> |
---|
| 34 | +#include <linux/pinctrl/consumer.h> |
---|
36 | 35 | #include <linux/regulator/consumer.h> |
---|
37 | 36 | #include <linux/pm_runtime.h> |
---|
38 | 37 | #include <linux/module.h> |
---|
39 | 38 | #include <linux/stmp_device.h> |
---|
40 | 39 | #include <linux/spi/spi.h> |
---|
41 | 40 | #include <linux/spi/mxs-spi.h> |
---|
| 41 | +#include <trace/events/spi.h> |
---|
42 | 42 | |
---|
43 | 43 | #define DRIVER_NAME "mxs-spi" |
---|
44 | 44 | |
---|
.. | .. |
---|
374 | 374 | |
---|
375 | 375 | list_for_each_entry(t, &m->transfers, transfer_list) { |
---|
376 | 376 | |
---|
| 377 | + trace_spi_transfer_start(m, t); |
---|
| 378 | + |
---|
377 | 379 | status = mxs_spi_setup_transfer(m->spi, t); |
---|
378 | 380 | if (status) |
---|
379 | 381 | break; |
---|
.. | .. |
---|
418 | 420 | t->rx_buf, t->len, |
---|
419 | 421 | flag); |
---|
420 | 422 | } |
---|
| 423 | + |
---|
| 424 | + trace_spi_transfer_stop(m, t); |
---|
421 | 425 | |
---|
422 | 426 | if (status) { |
---|
423 | 427 | stmp_reset_block(ssp->base); |
---|
.. | .. |
---|
527 | 531 | struct spi_master *master; |
---|
528 | 532 | struct mxs_spi *spi; |
---|
529 | 533 | struct mxs_ssp *ssp; |
---|
530 | | - struct resource *iores; |
---|
531 | 534 | struct clk *clk; |
---|
532 | 535 | void __iomem *base; |
---|
533 | 536 | int devid, clk_freq; |
---|
.. | .. |
---|
540 | 543 | */ |
---|
541 | 544 | const int clk_freq_default = 160000000; |
---|
542 | 545 | |
---|
543 | | - iores = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
---|
544 | 546 | irq_err = platform_get_irq(pdev, 0); |
---|
545 | 547 | if (irq_err < 0) |
---|
546 | 548 | return irq_err; |
---|
547 | 549 | |
---|
548 | | - base = devm_ioremap_resource(&pdev->dev, iores); |
---|
| 550 | + base = devm_platform_ioremap_resource(pdev, 0); |
---|
549 | 551 | if (IS_ERR(base)) |
---|
550 | 552 | return PTR_ERR(base); |
---|
551 | 553 | |
---|
.. | .. |
---|
587 | 589 | if (ret) |
---|
588 | 590 | goto out_master_free; |
---|
589 | 591 | |
---|
590 | | - ssp->dmach = dma_request_slave_channel(&pdev->dev, "rx-tx"); |
---|
591 | | - if (!ssp->dmach) { |
---|
| 592 | + ssp->dmach = dma_request_chan(&pdev->dev, "rx-tx"); |
---|
| 593 | + if (IS_ERR(ssp->dmach)) { |
---|
592 | 594 | dev_err(ssp->dev, "Failed to request DMA\n"); |
---|
593 | | - ret = -ENODEV; |
---|
| 595 | + ret = PTR_ERR(ssp->dmach); |
---|
594 | 596 | goto out_master_free; |
---|
595 | 597 | } |
---|
596 | 598 | |
---|