++static DEVICE_ATTR(backup_batt_voltage, 0444, n810bm_attr_backup_batt_voltage_show, NULL);
++
++static ssize_t n810bm_attr_batt_current_show(struct device *dev,
++ struct device_attribute *attr,
++ char *buf)
++{
++ struct n810bm *bm = device_to_n810bm(dev);
++ ssize_t count = 0;
++ int ma;
++
++ spin_lock_irq(&bm->lock);
++ if (bm->battery_present) {
++ ma = n810bm_measure_batt_current(bm);//FIXME
++ count = snprintf(buf, PAGE_SIZE, "%d\n", ma);
++ } else
++ count = snprintf(buf, PAGE_SIZE, "no battery\n");
++ spin_unlock_irq(&bm->lock);
++
++ return count;
++}
++static DEVICE_ATTR(batt_current, 0444, n810bm_attr_batt_current_show, NULL);
++
++//TODO remove this
++static ssize_t n810bm_attr_charger_status_show(struct device *dev,
++ struct device_attribute *attr,
++ char *buf)
++{
++ struct n810bm *bm = device_to_n810bm(dev);
++ ssize_t count = 0;
++ unsigned int stat;
++
++ spin_lock_irq(&bm->lock);
++ stat = retu_read(bm, RETU_REG_STATUS);
++ count = snprintf(buf, PAGE_SIZE, "0x%X\n", stat);
++ spin_unlock_irq(&bm->lock);
++
++ return count;
++}
++static DEVICE_ATTR(charger_status, 0444, n810bm_attr_charger_status_show, NULL);
++
++//TODO remove this
++static ssize_t n810bm_attr_charge_current_show(struct device *dev,
++ struct device_attribute *attr,
++ char *buf)
++{
++ struct n810bm *bm = device_to_n810bm(dev);
++ ssize_t count = 0;
++ unsigned int val;
++
++ spin_lock_irq(&bm->lock);
++ val = tahvo_read(bm, TAHVO_REG_CHGCURR);
++ count = snprintf(buf, PAGE_SIZE, "0x%X\n", val);
++ spin_unlock_irq(&bm->lock);
++
++ return count;
++}
++
++static ssize_t n810bm_attr_charge_current_store(struct device *dev,
++ struct device_attribute *attr,
++ const char *buf, size_t count)
++{
++ struct n810bm *bm = device_to_n810bm(dev);
++ unsigned long val;
++ int err;
++
++ spin_lock_irq(&bm->lock);
++ err = strict_strtoul(buf, 0, &val);
++ if (!err && val <= 0xFF)
++ tahvo_write(bm, TAHVO_REG_CHGCURR, val);
++ spin_unlock_irq(&bm->lock);
++
++ return err ? err : count;
++}
++static DEVICE_ATTR(charge_current, 0644,
++ n810bm_attr_charge_current_show,
++ n810bm_attr_charge_current_store);
++
++static const struct device_attribute *n810bm_attrs[] = {
++ &dev_attr_batt_present,
++ &dev_attr_batt_charge,
++ &dev_attr_batt_current,
++ &dev_attr_batt_capacity,
++ &dev_attr_batt_temp,
++ &dev_attr_backup_batt_voltage,
++ &dev_attr_charger_present,
++ &dev_attr_charger_voltage,
++ &dev_attr_charger_status,
++ &dev_attr_charger_enable,
++ &dev_attr_charge_current,
++};