ARM: SAMSUNG: Add locking sequence for nomal mode
Subsystems (3)
PATCH 1/1 ARM: SAMSUNG: Add locking sequence for nomal mode
From: Dongsoo Ha <[email protected]>
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 <[email protected]>
Signed-off-by Huisung Kang <[email protected]>
--- arch/arm/plat-samsung/adc.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
arch/arm/plat-samsung/adc.c +5 -1
@@ -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