diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2014-08-07 13:13:45 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2014-08-07 13:13:45 +0200 |
commit | 9cce00617bf67a462eabd8c473c423f78414a8e8 (patch) | |
tree | 950cab0665633f390ad04b9b2b5147f10a4be896 /lib | |
parent | ba465b6c4dc4b0729e98f1581a13ad7e01032461 (diff) | |
parent | 642f8fbed8b4c55d56a0934b803146009539905e (diff) | |
download | barebox-9cce00617bf67a462eabd8c473c423f78414a8e8.tar.gz barebox-9cce00617bf67a462eabd8c473c423f78414a8e8.tar.xz |
Merge branch 'for-next/rtc'
Conflicts:
arch/mips/dts/jz4755.dtsi
commands/Makefile
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Makefile | 1 | ||||
-rw-r--r-- | lib/bcd.c | 14 |
2 files changed, 15 insertions, 0 deletions
diff --git a/lib/Makefile b/lib/Makefile index 77207dc773..1a345442aa 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -1,3 +1,4 @@ +obj-y += bcd.o obj-$(CONFIG_BOOTSTRAP) += bootstrap/ obj-y += ctype.o obj-y += rbtree.o diff --git a/lib/bcd.c b/lib/bcd.c new file mode 100644 index 0000000000..b072d50a90 --- /dev/null +++ b/lib/bcd.c @@ -0,0 +1,14 @@ +#include <linux/bcd.h> +#include <module.h> + +unsigned _bcd2bin(unsigned char val) +{ + return (val & 0x0f) + (val >> 4) * 10; +} +EXPORT_SYMBOL(_bcd2bin); + +unsigned char _bin2bcd(unsigned val) +{ + return ((val / 10) << 4) + val % 10; +} +EXPORT_SYMBOL(_bin2bcd); |