linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] i2c: s3c2410: Add fix for i2c suspend/resume
@ 2012-11-06  6:10 Abhilash Kesavan
       [not found] ` <1352182259-28903-1-git-send-email-a.kesavan-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Abhilash Kesavan @ 2012-11-06  6:10 UTC (permalink / raw)
  To: w.sang-bIcnvbaLZ9MEGnE8C9+IrQ, linux-i2c-u79uwXL29TY76Z2rM5mHXA
  Cc: khali-PUYAD+kWke1g9hUCZPvPmw, ben-linux-elnMNo+KYs3YtjvyW6yDsg

The I2C driver makes a gpio_request during initialization. This request
happens again on resume and fails due to the earlier successful request.
Modify the suspend code to free the earlier requested gpios.

Errors on resume without this:
[   16.020000] s3c-i2c s3c2440-i2c.0: gpio [42] request failed
[   16.020000] s3c-i2c s3c2440-i2c.1: gpio [44] request failed
[   16.020000] s3c-i2c s3c2440-i2c.2: gpio [6] request failed

Signed-off-by: Abhilash Kesavan <a.kesavan-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
---
 drivers/i2c/busses/i2c-s3c2410.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index 3e0335f..9bec49e 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -806,6 +806,7 @@ static int s3c24xx_i2c_parse_dt_gpio(struct s3c24xx_i2c *i2c)
 			dev_err(i2c->dev, "invalid gpio[%d]: %d\n", idx, gpio);
 			goto free_gpio;
 		}
+		i2c->gpios[idx] = gpio;
 
 		ret = gpio_request(gpio, "i2c-bus");
 		if (ret) {
@@ -1125,6 +1126,7 @@ static int s3c24xx_i2c_suspend_noirq(struct device *dev)
 	struct s3c24xx_i2c *i2c = platform_get_drvdata(pdev);
 
 	i2c->suspended = 1;
+	s3c24xx_i2c_dt_gpio_free(i2c);
 
 	return 0;
 }
-- 
1.6.6.1

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

end of thread, other threads:[~2012-11-16 12:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-06  6:10 [PATCH] i2c: s3c2410: Add fix for i2c suspend/resume Abhilash Kesavan
     [not found] ` <1352182259-28903-1-git-send-email-a.kesavan-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2012-11-06  6:12   ` Shubhrajyoti Datta
     [not found]     ` <CAM=Q2ctBMmg32-Dd6V5pwEEzxCnATs1se4RD_+zgLLOGohgSzw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-11-06  7:38       ` Abhilash Kesavan
     [not found]         ` <CAM4voa=hnKR_ovUu_uzy8o5wQ2WXazKceLTWh=tj02YWRgRbYA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-11-14  3:40           ` Abhilash Kesavan
     [not found]             ` <CAM4voa==f81W-pC80Q43NzvF6uXXVZmLH2_Ta4A3x3EuboQWVA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-11-16 11:46               ` Wolfram Sang
     [not found]                 ` <20121116114617.GE19028-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-11-16 12:07                   ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).