Commit 3c2b1ff3 authored by Wolfram Sang's avatar Wolfram Sang Committed by Wolfram Sang

i2c: rcar: clean up after refactoring

Update the comments to match current behaviour. Shorten some comments.
Update copyrights.
Signed-off-by: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
parent 52df445f
/* /*
* Driver for the Renesas RCar I2C unit * Driver for the Renesas RCar I2C unit
* *
* Copyright (C) 2014 Wolfram Sang <wsa@sang-engineering.com> * Copyright (C) 2014-15 Wolfram Sang <wsa@sang-engineering.com>
* Copyright (C) 2011-2015 Renesas Electronics Corporation
* *
* Copyright (C) 2012-14 Renesas Solutions Corp. * Copyright (C) 2012-14 Renesas Solutions Corp.
* Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> * Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
...@@ -9,9 +10,6 @@ ...@@ -9,9 +10,6 @@
* This file is based on the drivers/i2c/busses/i2c-sh7760.c * This file is based on the drivers/i2c/busses/i2c-sh7760.c
* (c) 2005-2008 MSC Vertriebsges.m.b.H, Manuel Lauss <mlau@msc-ge.com> * (c) 2005-2008 MSC Vertriebsges.m.b.H, Manuel Lauss <mlau@msc-ge.com>
* *
* This file used out-of-tree driver i2c-rcar.c
* Copyright (C) 2011-2012 Renesas Electronics Corporation
*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License. * the Free Software Foundation; version 2 of the License.
...@@ -245,9 +243,7 @@ static int rcar_i2c_clock_calculate(struct rcar_i2c_priv *priv, ...@@ -245,9 +243,7 @@ static int rcar_i2c_clock_calculate(struct rcar_i2c_priv *priv,
dev_dbg(dev, "clk %d/%d(%lu), round %u, CDF:0x%x, SCGD: 0x%x\n", dev_dbg(dev, "clk %d/%d(%lu), round %u, CDF:0x%x, SCGD: 0x%x\n",
scl, bus_speed, clk_get_rate(priv->clk), round, cdf, scgd); scl, bus_speed, clk_get_rate(priv->clk), round, cdf, scgd);
/* /* keep icccr value */
* keep icccr value
*/
priv->icccr = scgd << cdf_width | cdf; priv->icccr = scgd << cdf_width | cdf;
return 0; return 0;
...@@ -282,11 +278,7 @@ static void rcar_i2c_irq_send(struct rcar_i2c_priv *priv, u32 msr) ...@@ -282,11 +278,7 @@ static void rcar_i2c_irq_send(struct rcar_i2c_priv *priv, u32 msr)
{ {
struct i2c_msg *msg = priv->msg; struct i2c_msg *msg = priv->msg;
/* /* FIXME: sometimes, unknown interrupt happened. Do nothing */
* FIXME
* sometimes, unknown interrupt happened.
* Do nothing
*/
if (!(msr & MDE)) if (!(msr & MDE))
return; return;
...@@ -330,28 +322,22 @@ static void rcar_i2c_irq_recv(struct rcar_i2c_priv *priv, u32 msr) ...@@ -330,28 +322,22 @@ static void rcar_i2c_irq_recv(struct rcar_i2c_priv *priv, u32 msr)
{ {
struct i2c_msg *msg = priv->msg; struct i2c_msg *msg = priv->msg;
/* /* FIXME: sometimes, unknown interrupt happened. Do nothing */
* FIXME
* sometimes, unknown interrupt happened.
* Do nothing
*/
if (!(msr & MDR)) if (!(msr & MDR))
return; return;
if (msr & MAT) { if (msr & MAT) {
/* Address transfer phase finished, but no data at this point. */ /* Address transfer phase finished, but no data at this point. */
} else if (priv->pos < msg->len) { } else if (priv->pos < msg->len) {
/* /* get received data */
* get received data
*/
msg->buf[priv->pos] = rcar_i2c_read(priv, ICRXTX); msg->buf[priv->pos] = rcar_i2c_read(priv, ICRXTX);
priv->pos++; priv->pos++;
} }
/* /*
* If next received data is the _LAST_, * If next received data is the _LAST_, go to STOP phase. Might be
* go to STOP phase, * overwritten by REP START when setting up a new msg. Not elegant
* otherwise, go to DATA phase. * but the only stable sequence for REP START I have found so far.
*/ */
if (priv->pos + 1 >= msg->len) if (priv->pos + 1 >= msg->len)
rcar_i2c_write(priv, ICMCR, RCAR_BUS_PHASE_STOP); rcar_i2c_write(priv, ICMCR, RCAR_BUS_PHASE_STOP);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment