aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c
diff options
context:
space:
mode:
authorOleksij Rempel <o.rempel@pengutronix.de>2019-01-09 00:56:49 -0500
committerWolfram Sang <wsa@the-dreams.de>2019-01-15 16:53:46 -0500
commit5b3a23a3cc94864aacc012532b36afa92a25b9c0 (patch)
treefda0f61185897959e4717d9887f7d3d8abd242be /drivers/i2c
parent18569fa89a4db9ed6b5181624788a1574a9b6ed7 (diff)
i2c: imx: notify about real errors on dma i2c_imx_dma_request
At least on i.MX5x, the DMA events for I2C and SDHC use the same channel and there can only be a single user. So in this case there should be no message emitted that looks like an error if the I2C device doesn't have an assigned DMA channel. In contrast real problems that were only emitted at debug level before should be described at a higher level to be better visible and so understandable. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/busses/i2c-imx.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
index fa9ad53845d9..e28ef494dac8 100644
--- a/drivers/i2c/busses/i2c-imx.c
+++ b/drivers/i2c/busses/i2c-imx.c
@@ -285,9 +285,11 @@ static void i2c_imx_dma_request(struct imx_i2c_struct *i2c_imx,
285 if (!dma) 285 if (!dma)
286 return; 286 return;
287 287
288 dma->chan_tx = dma_request_slave_channel(dev, "tx"); 288 dma->chan_tx = dma_request_chan(dev, "tx");
289 if (!dma->chan_tx) { 289 if (IS_ERR(dma->chan_tx)) {
290 dev_dbg(dev, "can't request DMA tx channel\n"); 290 ret = PTR_ERR(dma->chan_rx);
291 if (ret != -ENODEV && ret != -EPROBE_DEFER)
292 dev_err(dev, "can't request DMA tx channel (%d)\n", ret);
291 goto fail_al; 293 goto fail_al;
292 } 294 }
293 295
@@ -298,13 +300,15 @@ static void i2c_imx_dma_request(struct imx_i2c_struct *i2c_imx,
298 dma_sconfig.direction = DMA_MEM_TO_DEV; 300 dma_sconfig.direction = DMA_MEM_TO_DEV;
299 ret = dmaengine_slave_config(dma->chan_tx, &dma_sconfig); 301 ret = dmaengine_slave_config(dma->chan_tx, &dma_sconfig);
300 if (ret < 0) { 302 if (ret < 0) {
301 dev_dbg(dev, "can't configure tx channel\n"); 303 dev_err(dev, "can't configure tx channel (%d)\n", ret);
302 goto fail_tx; 304 goto fail_tx;
303 } 305 }
304 306
305 dma->chan_rx = dma_request_slave_channel(dev, "rx"); 307 dma->chan_rx = dma_request_chan(dev, "rx");
306 if (!dma->chan_rx) { 308 if (IS_ERR(dma->chan_rx)) {
307 dev_dbg(dev, "can't request DMA rx channel\n"); 309 ret = PTR_ERR(dma->chan_rx);
310 if (ret != -ENODEV && ret != -EPROBE_DEFER)
311 dev_err(dev, "can't request DMA rx channel (%d)\n", ret);
308 goto fail_tx; 312 goto fail_tx;
309 } 313 }
310 314
@@ -315,7 +319,7 @@ static void i2c_imx_dma_request(struct imx_i2c_struct *i2c_imx,
315 dma_sconfig.direction = DMA_DEV_TO_MEM; 319 dma_sconfig.direction = DMA_DEV_TO_MEM;
316 ret = dmaengine_slave_config(dma->chan_rx, &dma_sconfig); 320 ret = dmaengine_slave_config(dma->chan_rx, &dma_sconfig);
317 if (ret < 0) { 321 if (ret < 0) {
318 dev_dbg(dev, "can't configure rx channel\n"); 322 dev_err(dev, "can't configure rx channel (%d)\n", ret);
319 goto fail_rx; 323 goto fail_rx;
320 } 324 }
321 325
@@ -332,7 +336,6 @@ fail_tx:
332 dma_release_channel(dma->chan_tx); 336 dma_release_channel(dma->chan_tx);
333fail_al: 337fail_al:
334 devm_kfree(dev, dma); 338 devm_kfree(dev, dma);
335 dev_info(dev, "can't use DMA, using PIO instead.\n");
336} 339}
337 340
338static void i2c_imx_dma_callback(void *arg) 341static void i2c_imx_dma_callback(void *arg)