aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-davinci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/i2c/busses/i2c-davinci.c')
-rw-r--r--drivers/i2c/busses/i2c-davinci.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/drivers/i2c/busses/i2c-davinci.c b/drivers/i2c/busses/i2c-davinci.c
index 3fae3a91ce5b..c89687a10835 100644
--- a/drivers/i2c/busses/i2c-davinci.c
+++ b/drivers/i2c/busses/i2c-davinci.c
@@ -187,6 +187,11 @@ static int i2c_davinci_init(struct davinci_i2c_dev *dev)
187 davinci_i2c_write_reg(dev, DAVINCI_I2C_CLKH_REG, clkh); 187 davinci_i2c_write_reg(dev, DAVINCI_I2C_CLKH_REG, clkh);
188 davinci_i2c_write_reg(dev, DAVINCI_I2C_CLKL_REG, clkl); 188 davinci_i2c_write_reg(dev, DAVINCI_I2C_CLKL_REG, clkl);
189 189
190 /* Respond at reserved "SMBus Host" slave address" (and zero);
191 * we seem to have no option to not respond...
192 */
193 davinci_i2c_write_reg(dev, DAVINCI_I2C_OAR_REG, 0x08);
194
190 dev_dbg(dev->dev, "input_clock = %d, CLK = %d\n", input_clock, clk); 195 dev_dbg(dev->dev, "input_clock = %d, CLK = %d\n", input_clock, clk);
191 dev_dbg(dev->dev, "PSC = %d\n", 196 dev_dbg(dev->dev, "PSC = %d\n",
192 davinci_i2c_read_reg(dev, DAVINCI_I2C_PSC_REG)); 197 davinci_i2c_read_reg(dev, DAVINCI_I2C_PSC_REG));
@@ -387,7 +392,7 @@ static void terminate_write(struct davinci_i2c_dev *dev)
387 davinci_i2c_write_reg(dev, DAVINCI_I2C_MDR_REG, w); 392 davinci_i2c_write_reg(dev, DAVINCI_I2C_MDR_REG, w);
388 393
389 if (!dev->terminate) 394 if (!dev->terminate)
390 dev_err(dev->dev, "TDR IRQ while no data to send\n"); 395 dev_dbg(dev->dev, "TDR IRQ while no data to send\n");
391} 396}
392 397
393/* 398/*
@@ -473,9 +478,14 @@ static irqreturn_t i2c_davinci_isr(int this_irq, void *dev_id)
473 break; 478 break;
474 479
475 case DAVINCI_I2C_IVR_AAS: 480 case DAVINCI_I2C_IVR_AAS:
476 dev_warn(dev->dev, "Address as slave interrupt\n"); 481 dev_dbg(dev->dev, "Address as slave interrupt\n");
477 }/* switch */ 482 break;
478 }/* while */ 483
484 default:
485 dev_warn(dev->dev, "Unrecognized irq stat %d\n", stat);
486 break;
487 }
488 }
479 489
480 return count ? IRQ_HANDLED : IRQ_NONE; 490 return count ? IRQ_HANDLED : IRQ_NONE;
481} 491}
@@ -505,7 +515,7 @@ static int davinci_i2c_probe(struct platform_device *pdev)
505 return -ENODEV; 515 return -ENODEV;
506 } 516 }
507 517
508 ioarea = request_mem_region(mem->start, (mem->end - mem->start) + 1, 518 ioarea = request_mem_region(mem->start, resource_size(mem),
509 pdev->name); 519 pdev->name);
510 if (!ioarea) { 520 if (!ioarea) {
511 dev_err(&pdev->dev, "I2C region already claimed\n"); 521 dev_err(&pdev->dev, "I2C region already claimed\n");
@@ -523,7 +533,7 @@ static int davinci_i2c_probe(struct platform_device *pdev)
523 dev->irq = irq->start; 533 dev->irq = irq->start;
524 platform_set_drvdata(pdev, dev); 534 platform_set_drvdata(pdev, dev);
525 535
526 dev->clk = clk_get(&pdev->dev, "I2CCLK"); 536 dev->clk = clk_get(&pdev->dev, NULL);
527 if (IS_ERR(dev->clk)) { 537 if (IS_ERR(dev->clk)) {
528 r = -ENODEV; 538 r = -ENODEV;
529 goto err_free_mem; 539 goto err_free_mem;
@@ -568,7 +578,7 @@ err_free_mem:
568 put_device(&pdev->dev); 578 put_device(&pdev->dev);
569 kfree(dev); 579 kfree(dev);
570err_release_region: 580err_release_region:
571 release_mem_region(mem->start, (mem->end - mem->start) + 1); 581 release_mem_region(mem->start, resource_size(mem));
572 582
573 return r; 583 return r;
574} 584}
@@ -591,7 +601,7 @@ static int davinci_i2c_remove(struct platform_device *pdev)
591 kfree(dev); 601 kfree(dev);
592 602
593 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 603 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
594 release_mem_region(mem->start, (mem->end - mem->start) + 1); 604 release_mem_region(mem->start, resource_size(mem));
595 return 0; 605 return 0;
596} 606}
597 607