2024-09-09 08:52:07 +00:00
|
|
|
#include <linux/bcd.h>
|
|
|
|
#include <linux/export.h>
|
|
|
|
|
2024-09-09 08:57:42 +00:00
|
|
|
unsigned _bcd2bin(unsigned char val)
|
2024-09-09 08:52:07 +00:00
|
|
|
{
|
|
|
|
return (val & 0x0f) + (val >> 4) * 10;
|
|
|
|
}
|
2024-09-09 08:57:42 +00:00
|
|
|
EXPORT_SYMBOL(_bcd2bin);
|
2024-09-09 08:52:07 +00:00
|
|
|
|
2024-09-09 08:57:42 +00:00
|
|
|
unsigned char _bin2bcd(unsigned val)
|
2024-09-09 08:52:07 +00:00
|
|
|
{
|
|
|
|
return ((val / 10) << 4) + val % 10;
|
|
|
|
}
|
2024-09-09 08:57:42 +00:00
|
|
|
EXPORT_SYMBOL(_bin2bcd);
|