0068-spi-qup-Convert-ot-let-spi-core-handle-checking-tran.patch 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. From a4b122f945c564e47a42a9665b484785e86648de Mon Sep 17 00:00:00 2001
  2. From: Axel Lin <[email protected]>
  3. Date: Fri, 21 Feb 2014 09:34:16 +0800
  4. Subject: [PATCH 068/182] spi: qup: Convert ot let spi core handle checking
  5. transfer speed
  6. Set master->max_speed_hz then spi core will handle checking transfer speed.
  7. So we can remove the same checking in this driver.
  8. Also remove checking spi->chip_select in spi_qup_setup(), the checking is done
  9. by spi core.
  10. Signed-off-by: Axel Lin <[email protected]>
  11. Acked-by: Ivan T. Ivanov <[email protected]>
  12. Signed-off-by: Mark Brown <[email protected]>
  13. ---
  14. drivers/spi/spi-qup.c | 15 +--------------
  15. 1 file changed, 1 insertion(+), 14 deletions(-)
  16. --- a/drivers/spi/spi-qup.c
  17. +++ b/drivers/spi/spi-qup.c
  18. @@ -134,7 +134,6 @@ struct spi_qup {
  19. struct clk *cclk; /* core clock */
  20. struct clk *iclk; /* interface clock */
  21. int irq;
  22. - u32 max_speed_hz;
  23. spinlock_t lock;
  24. int in_fifo_sz;
  25. @@ -517,18 +516,6 @@ static int spi_qup_setup(struct spi_devi
  26. struct spi_qup *controller = spi_master_get_devdata(spi->master);
  27. struct spi_qup_device *chip = spi_get_ctldata(spi);
  28. - if (spi->chip_select >= spi->master->num_chipselect) {
  29. - dev_err(controller->dev, "invalid chip_select %d\n",
  30. - spi->chip_select);
  31. - return -EINVAL;
  32. - }
  33. -
  34. - if (spi->max_speed_hz > controller->max_speed_hz) {
  35. - dev_err(controller->dev, "invalid max_speed_hz %d\n",
  36. - spi->max_speed_hz);
  37. - return -EINVAL;
  38. - }
  39. -
  40. if (!chip) {
  41. /* First setup */
  42. chip = kzalloc(sizeof(*chip), GFP_KERNEL);
  43. @@ -629,6 +616,7 @@ static int spi_qup_probe(struct platform
  44. master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH | SPI_LOOP;
  45. master->num_chipselect = SPI_NUM_CHIPSELECTS;
  46. master->bits_per_word_mask = SPI_BPW_RANGE_MASK(4, 32);
  47. + master->max_speed_hz = max_freq;
  48. master->setup = spi_qup_setup;
  49. master->cleanup = spi_qup_cleanup;
  50. master->set_cs = spi_qup_set_cs;
  51. @@ -645,7 +633,6 @@ static int spi_qup_probe(struct platform
  52. controller->iclk = iclk;
  53. controller->cclk = cclk;
  54. controller->irq = irq;
  55. - controller->max_speed_hz = max_freq;
  56. spin_lock_init(&controller->lock);
  57. init_completion(&controller->done);