All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: SAMSUNG: Add locking sequence for nomal mode
@ 2012-02-11  2:53 ` Huisung Kang
  0 siblings, 0 replies; 2+ messages in thread
From: Huisung Kang @ 2012-02-11  2:53 UTC (permalink / raw)
  To: linux-arm-kernel, linux-samsung-soc; +Cc: kgene.kim, dsfine.ha

From: Dongsoo Ha <dsfine.ha@samsung.com>

ADC need to lock the data when read the data from register.
It is a complicated timing issue. Lock the data before start ADC and keep it.

Signed-off-by: Dongsoo Ha <dsfine.ha@samsung.com>
Signed-off-by: Huisung Kang <hs1218.kang@samsung.com>
---
 arch/arm/plat-samsung/adc.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-samsung/adc.c b/arch/arm/plat-samsung/adc.c index fccc644..c68d56f 100644
--- a/arch/arm/plat-samsung/adc.c
+++ b/arch/arm/plat-samsung/adc.c
@@ -224,11 +224,16 @@ int s3c_adc_read(struct s3c_adc_client *client, unsigned int ch)  {
 	DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wake);
 	int ret;
+	unsigned long flags;
+
+	spin_lock_irqsave(&adc_dev->lock, flags);
 
 	client->convert_cb = s3c_convert_done;
 	client->wait = &wake;
 	client->result = -1;
 
+	spin_unlock_irqrestore(&adc_dev->lock, flags);
+
 	ret = s3c_adc_start(client, ch, 1);
 	if (ret < 0)
 		goto err;
--
1.7.1

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

* [PATCH] ARM: SAMSUNG: Add locking sequence for nomal mode
@ 2012-02-11  2:53 ` Huisung Kang
  0 siblings, 0 replies; 2+ messages in thread
From: Huisung Kang @ 2012-02-11  2:53 UTC (permalink / raw)
  To: linux-arm-kernel

From: Dongsoo Ha <dsfine.ha@samsung.com>

ADC need to lock the data when read the data from register.
It is a complicated timing issue. Lock the data before start ADC and keep it.

Signed-off-by: Dongsoo Ha <dsfine.ha@samsung.com>
Signed-off-by: Huisung Kang <hs1218.kang@samsung.com>
---
 arch/arm/plat-samsung/adc.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-samsung/adc.c b/arch/arm/plat-samsung/adc.c index fccc644..c68d56f 100644
--- a/arch/arm/plat-samsung/adc.c
+++ b/arch/arm/plat-samsung/adc.c
@@ -224,11 +224,16 @@ int s3c_adc_read(struct s3c_adc_client *client, unsigned int ch)  {
 	DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wake);
 	int ret;
+	unsigned long flags;
+
+	spin_lock_irqsave(&adc_dev->lock, flags);
 
 	client->convert_cb = s3c_convert_done;
 	client->wait = &wake;
 	client->result = -1;
 
+	spin_unlock_irqrestore(&adc_dev->lock, flags);
+
 	ret = s3c_adc_start(client, ch, 1);
 	if (ret < 0)
 		goto err;
--
1.7.1

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

end of thread, other threads:[~2012-02-11  2:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-11  2:53 [PATCH] ARM: SAMSUNG: Add locking sequence for nomal mode Huisung Kang
2012-02-11  2:53 ` Huisung Kang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.