linux/drivers/rtc/rtc-ds1685.c
/**
 * ds1685_rtc_sysfs_auxbatt_show - sysfs file for aux battery status.
 * @dev: pointer to device structure.
 * @attr: pointer to device_attribute structure.
 * @buf: pointer to char array to hold the output.
 */
sysfs file for aux battery status.
@dev: pointer to device structure.
@attr: pointer to device_attribute structure.
@buf: pointer to char array to hold the output.
sysfs file for aux battery status . @dev : pointer to device structure . @attr : pointer to device_attribute structure . @buf : pointer to char array to hold the output .
static ssize_t
ds1685_rtc_sysfs_auxbatt_show(struct device *dev,
			      struct device_attribute *attr, char *buf)
{
	struct ds1685_priv *rtc = dev_get_drvdata(dev);
	u8 ctrl4a;
	ds1685_rtc_switch_to_bank1(rtc);
	ctrl4a = rtc->read(rtc, RTC_EXT_CTRL_4A);
	ds1685_rtc_switch_to_bank0(rtc);
	return sprintf(buf, "%s\n",
			(ctrl4a & RTC_CTRL_4A_VRT2) ? "ok" : "not ok or N/A");
}
static ssize_t ds1685_rtc_sysfs_auxbatt_show ( struct device * dev , struct device_attribute * attr , char * buf ) { struct ds1685_priv * rtc = dev_get_drvdata ( dev ) ; u8 ctrl4a ; ds1685_rtc_switch_to_bank1 ( rtc ) ; ctrl4a = rtc -> read ( rtc , RTC_EXT_CTRL_4A ) ; ds1685_rtc_switch_to_bank0 ( rtc ) ; return sprintf ( buf , " \n " , ( ctrl4a & RTC_CTRL_4A_VRT2 ) ? " " : " " ) ; }
ds1685_rtc_sysfs_auxbatt_show - sysfs file for aux battery status.
ds1685_rtc_sysfs_auxbatt_show - sysfs file for aux battery status .