diff mbox

OMAP3 PM Add sysfs entry for EFuse values

Message ID 1255358890-9434-1-git-send-email-peter.de-schrijver@nokia.com (mailing list archive)
State Changes Requested
Delegated to: Kevin Hilman
Headers show

Commit Message

Peter 'p2' De Schrijver Oct. 12, 2009, 2:48 p.m. UTC
None
diff mbox

Patch

diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
index 9fa033d..3c506d1 100644
--- a/arch/arm/mach-omap2/smartreflex.c
+++ b/arch/arm/mach-omap2/smartreflex.c
@@ -759,7 +759,24 @@  static struct kobj_attribute sr_vdd2_autocomp = {
 	.store = omap_sr_vdd2_autocomp_store,
 };
 
+static ssize_t omap_sr_opp1_efuse_show(struct kobject *kobj,
+					struct kobj_attribute *attr,
+					char *buf)
+{
+	return sprintf(buf, "%08x\n%08x\n%08x\n%08x\n%08x\n", sr1.opp1_nvalue,
+							sr1.opp2_nvalue,
+							sr1.opp3_nvalue,
+							sr1.opp4_nvalue,
+							sr1.opp5_nvalue);
+}
 
+static struct kobj_attribute sr_efuse = {
+	.attr = {
+	.name = "Efuse",
+	.mode = 0444,
+	},
+	.show = omap_sr_opp1_efuse_show,
+};
 
 static int __init omap3_sr_init(void)
 {
@@ -807,6 +824,11 @@  static int __init omap3_sr_init(void)
 	if (ret)
 		printk(KERN_ERR "sysfs_create_file failed: %d\n", ret);
 
+	ret = sysfs_create_file(power_kobj, &sr_efuse.attr);
+	if (ret)
+		printk(KERN_ERR "sysfs_create_file failed for OPP data: %d\n",
+			ret);
+
 	return 0;
 }