gpio: Fix designware's driver set bit function

This commit fixes the set bit function.
If the value to set is different from zero, then
the indicated bit will be set.

Change-Id: I9c42f683d108b371ca821f446ac5a10541b89b9f
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
This commit is contained in:
Juan Manuel Cruz 2015-08-26 13:47:29 -05:00 committed by Anas Nashif
parent 77a78f0827
commit 5ad14313bc

View File

@ -76,7 +76,7 @@ static void dw_set_bit(uint32_t base_addr, uint32_t offset,
reg = dw_read(base_addr, offset);
reg &= ~BIT(bit);
reg |= ((value & 0x1) << bit);
reg |= (((!!value) & 0x1) << bit);
dw_write(base_addr, offset, reg);
}