* [PATCH] OMAP3 PM Add sysfs entry for EFuse values
@ 2009-10-12 14:48 Peter 'p2' De Schrijver
2009-10-13 18:44 ` Kevin Hilman
0 siblings, 1 reply; 3+ messages in thread
From: Peter 'p2' De Schrijver @ 2009-10-12 14:48 UTC (permalink / raw)
To: linux-omap; +Cc: Peter 'p2' De Schrijver
This patch exports the smartreflex efuse values for all 5 OPPs via
sysfs. This can be useful to track down silicon specific problems.
Signed-off-by: Peter 'p2' De Schrijver <peter.de-schrijver@nokia.com>
---
arch/arm/mach-omap2/smartreflex.c | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
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;
}
--
1.6.2.4
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] OMAP3 PM Add sysfs entry for EFuse values
2009-10-12 14:48 [PATCH] OMAP3 PM Add sysfs entry for EFuse values Peter 'p2' De Schrijver
@ 2009-10-13 18:44 ` Kevin Hilman
2009-10-13 19:38 ` Nishanth Menon
0 siblings, 1 reply; 3+ messages in thread
From: Kevin Hilman @ 2009-10-13 18:44 UTC (permalink / raw)
To: Peter 'p2' De Schrijver, Nishanth Menon; +Cc: linux-omap
"Peter 'p2' De Schrijver" <peter.de-schrijver@nokia.com> writes:
> This patch exports the smartreflex efuse values for all 5 OPPs via
> sysfs. This can be useful to track down silicon specific problems.
>
> Signed-off-by: Peter 'p2' De Schrijver <peter.de-schrijver@nokia.com>
These should be exported via debugfs instead of sysfs.
Also, the SR rewrite is underway and will be merged shortly, so I
recommend waiting until that is in place before we add this. Unless
Nishanth wants to add it sooner.
Kevin
> ---
> arch/arm/mach-omap2/smartreflex.c | 22 ++++++++++++++++++++++
> 1 files changed, 22 insertions(+), 0 deletions(-)
>
> 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;
> }
>
> --
> 1.6.2.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] OMAP3 PM Add sysfs entry for EFuse values
2009-10-13 18:44 ` Kevin Hilman
@ 2009-10-13 19:38 ` Nishanth Menon
0 siblings, 0 replies; 3+ messages in thread
From: Nishanth Menon @ 2009-10-13 19:38 UTC (permalink / raw)
To: Kevin Hilman; +Cc: Peter 'p2' De Schrijver, linux-omap
On Tue, Oct 13, 2009 at 1:44 PM, Kevin Hilman
<khilman@deeprootsystems.com> wrote:
> "Peter 'p2' De Schrijver" <peter.de-schrijver@nokia.com> writes:
>
>> This patch exports the smartreflex efuse values for all 5 OPPs via
>> sysfs. This can be useful to track down silicon specific problems.
>>
>> Signed-off-by: Peter 'p2' De Schrijver <peter.de-schrijver@nokia.com>
>
> These should be exported via debugfs instead of sysfs.
>
> Also, the SR rewrite is underway and will be merged shortly, so I
> recommend waiting until that is in place before we add this. Unless
> Nishanth wants to add it sooner.
>
I can add it as part of my v3 patchset.
Regards,
Nishanth Menon
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-10-13 19:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-12 14:48 [PATCH] OMAP3 PM Add sysfs entry for EFuse values Peter 'p2' De Schrijver
2009-10-13 18:44 ` Kevin Hilman
2009-10-13 19:38 ` Nishanth Menon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox