++static ssize_t n810bm_attr_battemp_show(struct device *dev,
++ struct device_attribute *attr,
++ char *buf)
++{
++ struct platform_device *pdev = to_platform_device(dev);
++ struct n810bm *bm = platform_get_drvdata(pdev);
++ ssize_t count = 0;
++ int k, err = -ENODEV;
++
++ spin_lock_irq(&bm->lock);
++ k = n810bm_measure_batt_temp(bm);
++ if (k >= 0) {
++ count = snprintf(buf, PAGE_SIZE, "%d\n", k);
++ err = 0;
++ }
++ spin_unlock_irq(&bm->lock);
++
++ return err ? err : count;
++}
++static DEVICE_ATTR(batt_temp, 0444, n810bm_attr_battemp_show, NULL);
++
++static ssize_t n810bm_attr_charger_voltage(struct device *dev,
++ struct device_attribute *attr,
++ char *buf)
++{
++ struct platform_device *pdev = to_platform_device(dev);
++ struct n810bm *bm = platform_get_drvdata(pdev);
++ ssize_t count = 0;
++ int mv, err = -ENODEV;
++
++ spin_lock_irq(&bm->lock);
++ mv = n810bm_measure_charger_voltage(bm);
++ if (mv >= 0) {
++ count = snprintf(buf, PAGE_SIZE, "%d\n", mv);
++ err = 0;
++ }
++ spin_unlock_irq(&bm->lock);
++
++ return err ? err : count;
++}
++static DEVICE_ATTR(charger_voltage, 0444, n810bm_attr_charger_voltage, NULL);
++
++static ssize_t n810bm_attr_backup_batt_voltage(struct device *dev,
++ struct device_attribute *attr,
++ char *buf)
++{
++ struct platform_device *pdev = to_platform_device(dev);
++ struct n810bm *bm = platform_get_drvdata(pdev);
++ ssize_t count = 0;
++ int mv, err = -ENODEV;
++
++ spin_lock_irq(&bm->lock);
++ mv = n810bm_measure_backup_batt_voltage(bm);
++ if (mv >= 0) {
++ count = snprintf(buf, PAGE_SIZE, "%d\n", mv);
++ err = 0;
++ }
++ spin_unlock_irq(&bm->lock);
++
++ return err ? err : count;
++}
++static DEVICE_ATTR(backup_batt_voltage, 0444, n810bm_attr_backup_batt_voltage, NULL);
++