Commit 4e355f51 authored by Philipp Zabel's avatar Philipp Zabel Committed by Wolfram Sang

i2c: imx: whitespace and checkpatch cleanup

This patch fixes up some whitespace issues and addresses a few
checkpatch warnings.
Signed-off-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
Acked-by: default avatarFugang Duan <B38611@freescale.com>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
parent a5eb71b2
...@@ -201,7 +201,7 @@ struct imx_i2c_struct { ...@@ -201,7 +201,7 @@ struct imx_i2c_struct {
void __iomem *base; void __iomem *base;
wait_queue_head_t queue; wait_queue_head_t queue;
unsigned long i2csr; unsigned long i2csr;
unsigned int disable_delay; unsigned int disable_delay;
int stopped; int stopped;
unsigned int ifdr; /* IMX_I2C_IFDR */ unsigned int ifdr; /* IMX_I2C_IFDR */
unsigned int cur_clk; unsigned int cur_clk;
...@@ -479,8 +479,8 @@ static void i2c_imx_set_clk(struct imx_i2c_struct *i2c_imx) ...@@ -479,8 +479,8 @@ static void i2c_imx_set_clk(struct imx_i2c_struct *i2c_imx)
i2c_clk_rate = clk_get_rate(i2c_imx->clk); i2c_clk_rate = clk_get_rate(i2c_imx->clk);
if (i2c_imx->cur_clk == i2c_clk_rate) if (i2c_imx->cur_clk == i2c_clk_rate)
return; return;
else
i2c_imx->cur_clk = i2c_clk_rate; i2c_imx->cur_clk = i2c_clk_rate;
div = (i2c_clk_rate + i2c_imx->bitrate - 1) / i2c_imx->bitrate; div = (i2c_clk_rate + i2c_imx->bitrate - 1) / i2c_imx->bitrate;
if (div < i2c_clk_div[0].div) if (div < i2c_clk_div[0].div)
...@@ -488,7 +488,8 @@ static void i2c_imx_set_clk(struct imx_i2c_struct *i2c_imx) ...@@ -488,7 +488,8 @@ static void i2c_imx_set_clk(struct imx_i2c_struct *i2c_imx)
else if (div > i2c_clk_div[i2c_imx->hwdata->ndivs - 1].div) else if (div > i2c_clk_div[i2c_imx->hwdata->ndivs - 1].div)
i = i2c_imx->hwdata->ndivs - 1; i = i2c_imx->hwdata->ndivs - 1;
else else
for (i = 0; i2c_clk_div[i].div < div; i++); for (i = 0; i2c_clk_div[i].div < div; i++)
;
/* Store divider value */ /* Store divider value */
i2c_imx->ifdr = i2c_clk_div[i].val; i2c_imx->ifdr = i2c_clk_div[i].val;
...@@ -820,6 +821,7 @@ static int i2c_imx_read(struct imx_i2c_struct *i2c_imx, struct i2c_msg *msgs, bo ...@@ -820,6 +821,7 @@ static int i2c_imx_read(struct imx_i2c_struct *i2c_imx, struct i2c_msg *msgs, bo
/* read data */ /* read data */
for (i = 0; i < msgs->len; i++) { for (i = 0; i < msgs->len; i++) {
u8 len = 0; u8 len = 0;
result = i2c_imx_trx_complete(i2c_imx); result = i2c_imx_trx_complete(i2c_imx);
if (result) if (result)
return result; return result;
...@@ -915,15 +917,16 @@ static int i2c_imx_xfer(struct i2c_adapter *adapter, ...@@ -915,15 +917,16 @@ static int i2c_imx_xfer(struct i2c_adapter *adapter,
/* write/read data */ /* write/read data */
#ifdef CONFIG_I2C_DEBUG_BUS #ifdef CONFIG_I2C_DEBUG_BUS
temp = imx_i2c_read_reg(i2c_imx, IMX_I2C_I2CR); temp = imx_i2c_read_reg(i2c_imx, IMX_I2C_I2CR);
dev_dbg(&i2c_imx->adapter.dev, "<%s> CONTROL: IEN=%d, IIEN=%d, " dev_dbg(&i2c_imx->adapter.dev,
"MSTA=%d, MTX=%d, TXAK=%d, RSTA=%d\n", __func__, "<%s> CONTROL: IEN=%d, IIEN=%d, MSTA=%d, MTX=%d, TXAK=%d, RSTA=%d\n",
__func__,
(temp & I2CR_IEN ? 1 : 0), (temp & I2CR_IIEN ? 1 : 0), (temp & I2CR_IEN ? 1 : 0), (temp & I2CR_IIEN ? 1 : 0),
(temp & I2CR_MSTA ? 1 : 0), (temp & I2CR_MTX ? 1 : 0), (temp & I2CR_MSTA ? 1 : 0), (temp & I2CR_MTX ? 1 : 0),
(temp & I2CR_TXAK ? 1 : 0), (temp & I2CR_RSTA ? 1 : 0)); (temp & I2CR_TXAK ? 1 : 0), (temp & I2CR_RSTA ? 1 : 0));
temp = imx_i2c_read_reg(i2c_imx, IMX_I2C_I2SR); temp = imx_i2c_read_reg(i2c_imx, IMX_I2C_I2SR);
dev_dbg(&i2c_imx->adapter.dev, dev_dbg(&i2c_imx->adapter.dev,
"<%s> STATUS: ICF=%d, IAAS=%d, IBB=%d, " "<%s> STATUS: ICF=%d, IAAS=%d, IBB=%d, IAL=%d, SRW=%d, IIF=%d, RXAK=%d\n",
"IAL=%d, SRW=%d, IIF=%d, RXAK=%d\n", __func__, __func__,
(temp & I2SR_ICF ? 1 : 0), (temp & I2SR_IAAS ? 1 : 0), (temp & I2SR_ICF ? 1 : 0), (temp & I2SR_IAAS ? 1 : 0),
(temp & I2SR_IBB ? 1 : 0), (temp & I2SR_IAL ? 1 : 0), (temp & I2SR_IBB ? 1 : 0), (temp & I2SR_IAL ? 1 : 0),
(temp & I2SR_SRW ? 1 : 0), (temp & I2SR_IIF ? 1 : 0), (temp & I2SR_SRW ? 1 : 0), (temp & I2SR_IIF ? 1 : 0),
...@@ -1002,7 +1005,7 @@ static int i2c_imx_probe(struct platform_device *pdev) ...@@ -1002,7 +1005,7 @@ static int i2c_imx_probe(struct platform_device *pdev)
i2c_imx->adapter.owner = THIS_MODULE; i2c_imx->adapter.owner = THIS_MODULE;
i2c_imx->adapter.algo = &i2c_imx_algo; i2c_imx->adapter.algo = &i2c_imx_algo;
i2c_imx->adapter.dev.parent = &pdev->dev; i2c_imx->adapter.dev.parent = &pdev->dev;
i2c_imx->adapter.nr = pdev->id; i2c_imx->adapter.nr = pdev->id;
i2c_imx->adapter.dev.of_node = pdev->dev.of_node; i2c_imx->adapter.dev.of_node = pdev->dev.of_node;
i2c_imx->base = base; i2c_imx->base = base;
...@@ -1061,7 +1064,7 @@ static int i2c_imx_probe(struct platform_device *pdev) ...@@ -1061,7 +1064,7 @@ static int i2c_imx_probe(struct platform_device *pdev)
i2c_imx->adapter.name); i2c_imx->adapter.name);
dev_info(&i2c_imx->adapter.dev, "IMX I2C adapter registered\n"); dev_info(&i2c_imx->adapter.dev, "IMX I2C adapter registered\n");
/* Init DMA config if support*/ /* Init DMA config if supported */
i2c_imx_dma_request(i2c_imx, phy_addr); i2c_imx_dma_request(i2c_imx, phy_addr);
return 0; /* Return OK */ return 0; /* Return OK */
......
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