Linux Samsung SOC development
 help / color / mirror / Atom feed
* [PATCH v3 3/5] i2c: exynos5: Remove suspension check
       [not found] <1405608520-5644-1-git-send-email-hechtb@gmail.com>
@ 2014-07-17 14:48 ` Bastian Hecht
  2014-07-17 16:54   ` Bastian Hecht
  2014-07-17 14:48 ` [PATCH v2 4/5] i2c: sc3c2410: " Bastian Hecht
  1 sibling, 1 reply; 3+ messages in thread
From: Bastian Hecht @ 2014-07-17 14:48 UTC (permalink / raw)
  To: linux-i2c
  Cc: Linux-SH, Tomoya MORINAGA, Wolfram Sang, linux-arm-kernel,
	Bastian Hecht, Kukjin Kim, Naveen Krishna Ch, Jingoo Han,
	Jean Delvare, Linus Walleij, Masanari Iida, Sachin Kamat,
	moderated list:ARM/S5P EXYNOS AR..., open list

We now take care of suspension in the i2c core code. So we can remove this
check here.

Signed-off-by: Bastian Hecht <hechtb@gmail.com>
---
same as v1

 drivers/i2c/busses/i2c-exynos5.c | 20 +-------------------
 1 file changed, 1 insertion(+), 19 deletions(-)

diff --git a/drivers/i2c/busses/i2c-exynos5.c b/drivers/i2c/busses/i2c-exynos5.c
index 63d2292..a80cf28 100644
--- a/drivers/i2c/busses/i2c-exynos5.c
+++ b/drivers/i2c/busses/i2c-exynos5.c
@@ -145,7 +145,6 @@
 
 struct exynos5_i2c {
 	struct i2c_adapter	adap;
-	unsigned int		suspended:1;
 
 	struct i2c_msg		*msg;
 	struct completion	msg_complete;
@@ -610,11 +609,6 @@ static int exynos5_i2c_xfer(struct i2c_adapter *adap,
 	struct exynos5_i2c *i2c = adap->algo_data;
 	int i = 0, ret = 0, stop = 0;
 
-	if (i2c->suspended) {
-		dev_err(i2c->dev, "HS-I2C is not initialized.\n");
-		return -EIO;
-	}
-
 	clk_prepare_enable(i2c->clk);
 
 	for (i = 0; i < num; i++, msgs++) {
@@ -757,16 +751,6 @@ static int exynos5_i2c_remove(struct platform_device *pdev)
 }
 
 #ifdef CONFIG_PM_SLEEP
-static int exynos5_i2c_suspend_noirq(struct device *dev)
-{
-	struct platform_device *pdev = to_platform_device(dev);
-	struct exynos5_i2c *i2c = platform_get_drvdata(pdev);
-
-	i2c->suspended = 1;
-
-	return 0;
-}
-
 static int exynos5_i2c_resume_noirq(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
@@ -783,14 +767,12 @@ static int exynos5_i2c_resume_noirq(struct device *dev)
 
 	exynos5_i2c_init(i2c);
 	clk_disable_unprepare(i2c->clk);
-	i2c->suspended = 0;
 
 	return 0;
 }
 #endif
 
-static SIMPLE_DEV_PM_OPS(exynos5_i2c_dev_pm_ops, exynos5_i2c_suspend_noirq,
-			 exynos5_i2c_resume_noirq);
+static SIMPLE_DEV_PM_OPS(exynos5_i2c_dev_pm_ops, exynos5_i2c_resume_noirq);
 
 static struct platform_driver exynos5_i2c_driver = {
 	.probe		= exynos5_i2c_probe,
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH v2 4/5] i2c: sc3c2410: Remove suspension check
       [not found] <1405608520-5644-1-git-send-email-hechtb@gmail.com>
  2014-07-17 14:48 ` [PATCH v3 3/5] i2c: exynos5: Remove suspension check Bastian Hecht
@ 2014-07-17 14:48 ` Bastian Hecht
  1 sibling, 0 replies; 3+ messages in thread
From: Bastian Hecht @ 2014-07-17 14:48 UTC (permalink / raw)
  To: linux-i2c
  Cc: Linux-SH, Tomoya MORINAGA, Wolfram Sang, linux-arm-kernel,
	Bastian Hecht, Ben Dooks, Kukjin Kim,
	moderated list:ARM/SAMSUNG ARM A..., open list

We now take care of suspension in the i2c core code. So we can remove this
check here.

Signed-off-by: Bastian Hecht <hechtb@gmail.com>
---
same as v1

 drivers/i2c/busses/i2c-s3c2410.c | 16 ----------------
 1 file changed, 16 deletions(-)

diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index e828a1d..568b993 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -103,7 +103,6 @@ enum s3c24xx_i2c_state {
 struct s3c24xx_i2c {
 	wait_queue_head_t	wait;
 	kernel_ulong_t		quirks;
-	unsigned int		suspended:1;
 
 	struct i2c_msg		*msg;
 	unsigned int		msg_num;
@@ -714,9 +713,6 @@ static int s3c24xx_i2c_doxfer(struct s3c24xx_i2c *i2c,
 	unsigned long timeout;
 	int ret;
 
-	if (i2c->suspended)
-		return -EIO;
-
 	ret = s3c24xx_i2c_set_master(i2c);
 	if (ret != 0) {
 		dev_err(i2c->dev, "cannot get bus (error %d)\n", ret);
@@ -1257,16 +1253,6 @@ static int s3c24xx_i2c_remove(struct platform_device *pdev)
 }
 
 #ifdef CONFIG_PM_SLEEP
-static int s3c24xx_i2c_suspend_noirq(struct device *dev)
-{
-	struct platform_device *pdev = to_platform_device(dev);
-	struct s3c24xx_i2c *i2c = platform_get_drvdata(pdev);
-
-	i2c->suspended = 1;
-
-	return 0;
-}
-
 static int s3c24xx_i2c_resume(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
@@ -1275,7 +1261,6 @@ static int s3c24xx_i2c_resume(struct device *dev)
 	clk_prepare_enable(i2c->clk);
 	s3c24xx_i2c_init(i2c);
 	clk_disable_unprepare(i2c->clk);
-	i2c->suspended = 0;
 
 	return 0;
 }
@@ -1284,7 +1269,6 @@ static int s3c24xx_i2c_resume(struct device *dev)
 #ifdef CONFIG_PM
 static const struct dev_pm_ops s3c24xx_i2c_dev_pm_ops = {
 #ifdef CONFIG_PM_SLEEP
-	.suspend_noirq = s3c24xx_i2c_suspend_noirq,
 	.resume = s3c24xx_i2c_resume,
 #endif
 };
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v3 3/5] i2c: exynos5: Remove suspension check
  2014-07-17 14:48 ` [PATCH v3 3/5] i2c: exynos5: Remove suspension check Bastian Hecht
@ 2014-07-17 16:54   ` Bastian Hecht
  0 siblings, 0 replies; 3+ messages in thread
From: Bastian Hecht @ 2014-07-17 16:54 UTC (permalink / raw)
  To: linux-i2c
  Cc: Jingoo Han, Kukjin Kim, Wolfram Sang, Linux-SH, Linus Walleij,
	Tomoya MORINAGA, open list, Masanari Iida, Bastian Hecht,
	moderated list:ARM/S5P EXYNOS AR..., Jean Delvare,
	Naveen Krishna Ch, linux-arm-kernel@lists.infradead.org,
	Sachin Kamat

2014-07-17 16:48 GMT+02:00 Bastian Hecht <hechtb@gmail.com>:
> We now take care of suspension in the i2c core code. So we can remove this
> check here.
>
> Signed-off-by: Bastian Hecht <hechtb@gmail.com>
> ---
> same as v1
>
>  drivers/i2c/busses/i2c-exynos5.c | 20 +-------------------
>  1 file changed, 1 insertion(+), 19 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-exynos5.c b/drivers/i2c/busses/i2c-exynos5.c
> index 63d2292..a80cf28 100644
> --- a/drivers/i2c/busses/i2c-exynos5.c
> +++ b/drivers/i2c/busses/i2c-exynos5.c
> @@ -145,7 +145,6 @@
>
>  struct exynos5_i2c {
>         struct i2c_adapter      adap;
> -       unsigned int            suspended:1;
>
>         struct i2c_msg          *msg;
>         struct completion       msg_complete;
> @@ -610,11 +609,6 @@ static int exynos5_i2c_xfer(struct i2c_adapter *adap,
>         struct exynos5_i2c *i2c = adap->algo_data;
>         int i = 0, ret = 0, stop = 0;
>
> -       if (i2c->suspended) {
> -               dev_err(i2c->dev, "HS-I2C is not initialized.\n");
> -               return -EIO;
> -       }
> -
>         clk_prepare_enable(i2c->clk);
>
>         for (i = 0; i < num; i++, msgs++) {
> @@ -757,16 +751,6 @@ static int exynos5_i2c_remove(struct platform_device *pdev)
>  }
>
>  #ifdef CONFIG_PM_SLEEP
> -static int exynos5_i2c_suspend_noirq(struct device *dev)
> -{
> -       struct platform_device *pdev = to_platform_device(dev);
> -       struct exynos5_i2c *i2c = platform_get_drvdata(pdev);
> -
> -       i2c->suspended = 1;
> -
> -       return 0;
> -}
> -
>  static int exynos5_i2c_resume_noirq(struct device *dev)
>  {
>         struct platform_device *pdev = to_platform_device(dev);
> @@ -783,14 +767,12 @@ static int exynos5_i2c_resume_noirq(struct device *dev)
>
>         exynos5_i2c_init(i2c);
>         clk_disable_unprepare(i2c->clk);
> -       i2c->suspended = 0;
>
>         return 0;
>  }
>  #endif
>
> -static SIMPLE_DEV_PM_OPS(exynos5_i2c_dev_pm_ops, exynos5_i2c_suspend_noirq,
> -                        exynos5_i2c_resume_noirq);
> +static SIMPLE_DEV_PM_OPS(exynos5_i2c_dev_pm_ops, exynos5_i2c_resume_noirq);

This should be

+static SIMPLE_DEV_PM_OPS(exynos5_i2c_dev_pm_ops, NULL,
exynos5_i2c_resume_noirq);

And this is v2, not v3.

>  static struct platform_driver exynos5_i2c_driver = {
>         .probe          = exynos5_i2c_probe,
> --
> 1.9.1
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-07-17 16:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1405608520-5644-1-git-send-email-hechtb@gmail.com>
2014-07-17 14:48 ` [PATCH v3 3/5] i2c: exynos5: Remove suspension check Bastian Hecht
2014-07-17 16:54   ` Bastian Hecht
2014-07-17 14:48 ` [PATCH v2 4/5] i2c: sc3c2410: " Bastian Hecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox