spi-s3c64xx.c (6ad30ce046aefbdc3848232c665a728860d7bb68) spi-s3c64xx.c (8074cf063e410a2c0cf1704c3b31002e21f5df7c)
1/*
2 * Copyright (C) 2009 Samsung Electronics Ltd.
3 * Jaswinder Singh <jassi.brar@samsung.com>
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.

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

429static int s3c64xx_spi_prepare_transfer(struct spi_master *spi)
430{
431 struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(spi);
432 dma_filter_fn filter = sdd->cntrlr_info->filter;
433 struct device *dev = &sdd->pdev->dev;
434 dma_cap_mask_t mask;
435 int ret;
436
1/*
2 * Copyright (C) 2009 Samsung Electronics Ltd.
3 * Jaswinder Singh <jassi.brar@samsung.com>
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.

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

429static int s3c64xx_spi_prepare_transfer(struct spi_master *spi)
430{
431 struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(spi);
432 dma_filter_fn filter = sdd->cntrlr_info->filter;
433 struct device *dev = &sdd->pdev->dev;
434 dma_cap_mask_t mask;
435 int ret;
436
437 if (is_polling(sdd))
438 return 0;
439
440 dma_cap_zero(mask);
441 dma_cap_set(DMA_SLAVE, mask);
442
443 /* Acquire DMA channels */
444 sdd->rx_dma.ch = dma_request_slave_channel_compat(mask, filter,
445 (void*)sdd->rx_dma.dmach, dev, "rx");
446 if (!sdd->rx_dma.ch) {
447 dev_err(dev, "Failed to get RX DMA channel\n");

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

1270 sci->num_cs = temp;
1271 }
1272
1273 return sci;
1274}
1275#else
1276static struct s3c64xx_spi_info *s3c64xx_spi_parse_dt(struct device *dev)
1277{
437 dma_cap_zero(mask);
438 dma_cap_set(DMA_SLAVE, mask);
439
440 /* Acquire DMA channels */
441 sdd->rx_dma.ch = dma_request_slave_channel_compat(mask, filter,
442 (void*)sdd->rx_dma.dmach, dev, "rx");
443 if (!sdd->rx_dma.ch) {
444 dev_err(dev, "Failed to get RX DMA channel\n");

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

1267 sci->num_cs = temp;
1268 }
1269
1270 return sci;
1271}
1272#else
1273static struct s3c64xx_spi_info *s3c64xx_spi_parse_dt(struct device *dev)
1274{
1278 return dev->platform_data;
1275 return dev_get_platdata(dev);
1279}
1280#endif
1281
1282static const struct of_device_id s3c64xx_spi_dt_match[];
1283
1284static inline struct s3c64xx_spi_port_config *s3c64xx_spi_get_port_config(
1285 struct platform_device *pdev)
1286{

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

1295 platform_get_device_id(pdev)->driver_data;
1296}
1297
1298static int s3c64xx_spi_probe(struct platform_device *pdev)
1299{
1300 struct resource *mem_res;
1301 struct resource *res;
1302 struct s3c64xx_spi_driver_data *sdd;
1276}
1277#endif
1278
1279static const struct of_device_id s3c64xx_spi_dt_match[];
1280
1281static inline struct s3c64xx_spi_port_config *s3c64xx_spi_get_port_config(
1282 struct platform_device *pdev)
1283{

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

1292 platform_get_device_id(pdev)->driver_data;
1293}
1294
1295static int s3c64xx_spi_probe(struct platform_device *pdev)
1296{
1297 struct resource *mem_res;
1298 struct resource *res;
1299 struct s3c64xx_spi_driver_data *sdd;
1303 struct s3c64xx_spi_info *sci = pdev->dev.platform_data;
1300 struct s3c64xx_spi_info *sci = dev_get_platdata(&pdev->dev);
1304 struct spi_master *master;
1305 int ret, irq;
1306 char clk_name[16];
1307
1308 if (!sci && pdev->dev.of_node) {
1309 sci = s3c64xx_spi_parse_dt(&pdev->dev);
1310 if (IS_ERR(sci))
1311 return PTR_ERR(sci);

--- 372 unchanged lines hidden ---
1301 struct spi_master *master;
1302 int ret, irq;
1303 char clk_name[16];
1304
1305 if (!sci && pdev->dev.of_node) {
1306 sci = s3c64xx_spi_parse_dt(&pdev->dev);
1307 if (IS_ERR(sci))
1308 return PTR_ERR(sci);

--- 372 unchanged lines hidden ---