~ubuntu-branches/ubuntu/trusty/linux-linaro-u8500/trusty

« back to all changes in this revision

Viewing changes to arch/arm/mach-omap2/smartreflex.c

  • Committer: Bazaar Package Importer
  • Author(s): John Rigby, Upstream Fixes, Andy Green, John Rigby
  • Date: 2011-04-14 12:16:06 UTC
  • Revision ID: james.westby@ubuntu.com-20110414121606-b77podkyqgr2oix7
Tags: 2.6.38-1002.3
[ Upstream Fixes ]

* MUSB: shutdown: Make sure block is awake before doing shutdown
  - LP: #745737
* Fixed gpio polarity of gpio USB-phy reset.
  - LP: #747639

[ Andy Green ]

* LINARO: SAUCE: disable CONFIG_OMAP_RESET_CLOCKS
  - LP: #752900

[ John Rigby ]

* Rebase to new upstreams:
  Linux v2.6.38.1
  linaro-linux-2.6.38-upstream-29Mar2011
  Ubuntu-2.6.38-7.35
* SAUCE: OMAP4: clock: wait for module to become accessible on
  a clk enable
  - LP: #745737
* Rebase to new upstreams:
  Linux v2.6.38.2
  linaro-linux-2.6.38-upstream-5Apr2011
  Ubuntu-2.6.38-8.41
  - LP: #732842
* Update configs for device tree, dvfs and lttng
* LINARO: add building of dtb's
* LINARO: SAUCE: Disable lowest operating freqs on omap34xx
  - LP: #732912

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
#include <linux/pm_runtime.h>
27
27
 
28
28
#include <plat/common.h>
29
 
#include <plat/smartreflex.h>
30
29
 
31
30
#include "pm.h"
 
31
#include "smartreflex.h"
32
32
 
33
33
#define SMARTREFLEX_NAME_LEN    16
34
34
#define NVALUE_NAME_LEN         40
54
54
        struct list_head                node;
55
55
        struct omap_sr_nvalue_table     *nvalue_table;
56
56
        struct voltagedomain            *voltdm;
 
57
        struct dentry                   *dbg_dir;
57
58
};
58
59
 
59
60
/* sr_list contains all the instances of smartreflex module */
260
261
        if (sr_class->class_type == SR_CLASS2 &&
261
262
                sr_class->notify_flags && sr_info->irq) {
262
263
 
263
 
                name = kzalloc(SMARTREFLEX_NAME_LEN + 1, GFP_KERNEL);
264
 
                strcpy(name, "sr_");
265
 
                strcat(name, sr_info->voltdm->name);
 
264
                name = kasprintf(GFP_KERNEL, "sr_%s", sr_info->voltdm->name);
 
265
                if (name == NULL) {
 
266
                        ret = -ENOMEM;
 
267
                        goto error;
 
268
                }
266
269
                ret = request_irq(sr_info->irq, sr_interrupt,
267
270
                                0, name, (void *)sr_info);
268
271
                if (ret)
821
824
        struct omap_sr *sr_info = kzalloc(sizeof(struct omap_sr), GFP_KERNEL);
822
825
        struct omap_sr_data *pdata = pdev->dev.platform_data;
823
826
        struct resource *mem, *irq;
824
 
        struct dentry *vdd_dbg_dir, *dbg_dir, *nvalue_dir;
 
827
        struct dentry *vdd_dbg_dir, *nvalue_dir;
825
828
        struct omap_volt_data *volt_data;
826
829
        int i, ret = 0;
827
830
 
896
899
                goto err_release_region;
897
900
        }
898
901
 
899
 
        dbg_dir = debugfs_create_dir("smartreflex", vdd_dbg_dir);
900
 
        if (IS_ERR(dbg_dir)) {
 
902
        sr_info->dbg_dir = debugfs_create_dir("smartreflex", vdd_dbg_dir);
 
903
        if (IS_ERR(sr_info->dbg_dir)) {
901
904
                dev_err(&pdev->dev, "%s: Unable to create debugfs directory\n",
902
905
                        __func__);
903
 
                ret = PTR_ERR(dbg_dir);
 
906
                ret = PTR_ERR(sr_info->dbg_dir);
904
907
                goto err_release_region;
905
908
        }
906
909
 
907
 
        (void) debugfs_create_file("autocomp", S_IRUGO | S_IWUSR, dbg_dir,
908
 
                                (void *)sr_info, &pm_sr_fops);
909
 
        (void) debugfs_create_x32("errweight", S_IRUGO, dbg_dir,
 
910
        (void) debugfs_create_file("autocomp", S_IRUGO | S_IWUSR,
 
911
                        sr_info->dbg_dir, (void *)sr_info, &pm_sr_fops);
 
912
        (void) debugfs_create_x32("errweight", S_IRUGO, sr_info->dbg_dir,
910
913
                        &sr_info->err_weight);
911
 
        (void) debugfs_create_x32("errmaxlimit", S_IRUGO, dbg_dir,
 
914
        (void) debugfs_create_x32("errmaxlimit", S_IRUGO, sr_info->dbg_dir,
912
915
                        &sr_info->err_maxlimit);
913
 
        (void) debugfs_create_x32("errminlimit", S_IRUGO, dbg_dir,
 
916
        (void) debugfs_create_x32("errminlimit", S_IRUGO, sr_info->dbg_dir,
914
917
                        &sr_info->err_minlimit);
915
918
 
916
 
        nvalue_dir = debugfs_create_dir("nvalue", dbg_dir);
 
919
        nvalue_dir = debugfs_create_dir("nvalue", sr_info->dbg_dir);
917
920
        if (IS_ERR(nvalue_dir)) {
918
921
                dev_err(&pdev->dev, "%s: Unable to create debugfs directory"
919
922
                        "for n-values\n", __func__);
970
973
 
971
974
        if (sr_info->autocomp_active)
972
975
                sr_stop_vddautocomp(sr_info);
 
976
        if (sr_info->dbg_dir)
 
977
                debugfs_remove_recursive(sr_info->dbg_dir);
973
978
 
974
979
        list_del(&sr_info->node);
975
980
        iounmap(sr_info->base);