tnt has uploaded this change for review.

View Change

icE1usb: Show accumulated error count from GPSDO state in sysfs

Change-Id: Idc4ff2a3a7411df758a432fc4c6fe5a88963b626
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
---
M drivers/dahdi/icE1usb/icE1usb.c
1 file changed, 24 insertions(+), 0 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/dahdi-linux refs/changes/95/36695/1
diff --git a/drivers/dahdi/icE1usb/icE1usb.c b/drivers/dahdi/icE1usb/icE1usb.c
index 867b4f2..a861515 100644
--- a/drivers/dahdi/icE1usb/icE1usb.c
+++ b/drivers/dahdi/icE1usb/icE1usb.c
@@ -1119,6 +1119,18 @@

static DEVICE_ATTR(gpsdo_freq_est, 0444, e1u_gpsdo_freq_est_show, NULL);

+static ssize_t e1u_gpsdo_err_acc_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ struct ice1usb_gpsdo *e1d = dev_get_drvdata(dev);
+ int rc = e1u_update_gpsdo(e1d);
+ if (rc < 0)
+ return rc;
+ return sprintf(buf, "%d\n", (int)e1d->gpsdo_status.err_acc);
+}
+
+static DEVICE_ATTR(gpsdo_err_acc, 0444, e1u_gpsdo_err_acc_show, NULL);
+
static ssize_t e1u_fw_build_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
@@ -1138,6 +1150,7 @@
device_create_file(&e1d->usb_intf->dev, &dev_attr_gpsdo_tune_coarse);
device_create_file(&e1d->usb_intf->dev, &dev_attr_gpsdo_tune_fine);
device_create_file(&e1d->usb_intf->dev, &dev_attr_gpsdo_freq_est);
+ device_create_file(&e1d->usb_intf->dev, &dev_attr_gpsdo_err_acc);
device_create_file(&e1d->usb_intf->dev, &dev_attr_fw_build);
}

@@ -1150,6 +1163,7 @@
device_remove_file(&e1d->usb_intf->dev, &dev_attr_gpsdo_tune_coarse);
device_remove_file(&e1d->usb_intf->dev, &dev_attr_gpsdo_tune_fine);
device_remove_file(&e1d->usb_intf->dev, &dev_attr_gpsdo_freq_est);
+ device_remove_file(&e1d->usb_intf->dev, &dev_attr_gpsdo_err_acc);
device_remove_file(&e1d->usb_intf->dev, &dev_attr_fw_build);
}


To view, visit change 36695. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: dahdi-linux
Gerrit-Branch: master
Gerrit-Change-Id: Idc4ff2a3a7411df758a432fc4c6fe5a88963b626
Gerrit-Change-Number: 36695
Gerrit-PatchSet: 1
Gerrit-Owner: tnt <tnt@246tNt.com>
Gerrit-MessageType: newchange