From: Imre Deak Date: Fri, 29 Sep 2006 21:07:55 +0000 (-0400) Subject: CBUS: Retu: add atomic set and clear register bits function X-Git-Tag: v2.6.18-omap1~22 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=77845293a4eb6cfea806ecc74ea9988c044a76bc;p=linux-2.6-omap-h63xx.git CBUS: Retu: add atomic set and clear register bits function Signed-off-by: Imre Deak Signed-off-by: Juha Yrjola --- diff --git a/drivers/cbus/retu.c b/drivers/cbus/retu.c index e35e6605d12..0218050f47e 100644 --- a/drivers/cbus/retu.c +++ b/drivers/cbus/retu.c @@ -91,6 +91,19 @@ void retu_write_reg(int reg, u16 val) cbus_write_reg(cbus_host, RETU_ID, reg, val); } +void retu_set_clear_reg_bits(int reg, u16 set, u16 clear) +{ + unsigned long flags; + u16 w; + + spin_lock_irqsave(&retu_lock, flags); + w = retu_read_reg(reg); + w &= ~clear; + w |= set; + retu_write_reg(reg, w); + spin_unlock_irqrestore(&retu_lock, flags); +} + #define ADC_MAX_CHAN_NUMBER 13 int retu_read_adc(int channel) diff --git a/drivers/cbus/retu.h b/drivers/cbus/retu.h index db20afc13d2..02be6d4defc 100644 --- a/drivers/cbus/retu.h +++ b/drivers/cbus/retu.h @@ -55,6 +55,7 @@ int retu_read_reg(int reg); void retu_write_reg(int reg, u16 val); +void retu_set_clear_reg_bits(int reg, u16 set, u16 clear); int retu_read_adc(int channel); int retu_request_irq(int id, void *irq_handler, unsigned long arg, char *name); void retu_free_irq(int id);