lib/linux-5.18-rc3-smdk/drivers/rtc/rtc-ds1685.c
/**
 * ds1685_rtc_bcd2bin - bcd2bin wrapper in case platform doesn't support BCD.
 * @rtc: pointer to the ds1685 rtc structure.
 * @val: u8 time value to consider converting.
 * @bcd_mask: u8 mask value if BCD mode is used.
 * @bin_mask: u8 mask value if BIN mode is used.
 *
 * Returns the value, converted to BIN if originally in BCD and bcd_mode TRUE.
 */
bcd2bin wrapper in case platform doesn't support BCD.
@rtc: pointer to the ds1685 rtc structure.
@val: u8 time value to consider converting.
@bcd_mask: u8 mask value if BCD mode is used.
@bin_mask: u8 mask value if BIN mode is used.

Returns the value, converted to BIN if originally in BCD and bcd_mode TRUE.
bcd2bin wrapper in case platform doesn ' t support BCD . @rtc : pointer to the ds1685 rtc structure . @val : u8 time value to consider converting . @bcd_mask : u8 mask value if BCD mode is used . @bin_mask : u8 mask value if BIN mode is used . Returns the value converted to BIN if originally in BCD and bcd_mode TRUE .
static inline u8
ds1685_rtc_bcd2bin(struct ds1685_priv *rtc, u8 val, u8 bcd_mask, u8 bin_mask)
{
	if (rtc->bcd_mode)
		return (bcd2bin(val) & bcd_mask);
	return (val & bin_mask);
}
static inline u8 ds1685_rtc_bcd2bin ( struct ds1685_priv * rtc , u8 val , u8 bcd_mask , u8 bin_mask ) { if ( rtc -> bcd_mode ) return ( bcd2bin ( val ) & bcd_mask ) ; return ( val & bin_mask ) ; }
ds1685_rtc_bcd2bin - bcd2bin wrapper in case platform doesn't support BCD.
ds1685_rtc_bcd2bin - bcd2bin wrapper in case platform doesn ' t support BCD .