~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise-security

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Paolo Pisati, Paolo Pisati
  • Date: 2011-12-06 15:56:07 UTC
  • Revision ID: package-import@ubuntu.com-20111206155607-pcf44kv5fmhk564f
Tags: 3.2.0-1401.1
[ Paolo Pisati ]

* Rebased on top of Ubuntu-3.2.0-3.8
* Tilt-tracking @ ef2487af4bb15bdd0689631774b5a5e3a59f74e2
* Delete debian.ti-omap4/control, it shoudln't be tracked
* Fix architecture spelling (s/armel/armhf/)
* [Config] Update configs following 3.2 import
* [Config] Fix compilation: disable CODA and ARCH_OMAP3
* [Config] Fix compilation: disable Ethernet Faraday
* Update series to precise

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
 
32
32
static bool sr_enable_on_init;
33
33
 
34
 
static struct omap_device_pm_latency omap_sr_latency[] = {
35
 
        {
36
 
                .deactivate_func = omap_device_idle_hwmods,
37
 
                .activate_func   = omap_device_enable_hwmods,
38
 
                .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST
39
 
        },
40
 
};
41
 
 
42
34
/* Read EFUSE values from control registers for OMAP3430 */
43
35
static void __init sr_set_nvalues(struct omap_volt_data *volt_data,
44
36
                                struct omap_sr_data *sr_data)
80
72
static int sr_dev_init(struct omap_hwmod *oh, void *user)
81
73
{
82
74
        struct omap_sr_data *sr_data;
83
 
        struct omap_device *od;
 
75
        struct platform_device *pdev;
84
76
        struct omap_volt_data *volt_data;
 
77
        struct omap_smartreflex_dev_attr *sr_dev_attr;
85
78
        char *name = "smartreflex";
86
79
        static int i;
87
80
 
92
85
                return -ENOMEM;
93
86
        }
94
87
 
95
 
        if (!oh->vdd_name) {
 
88
        sr_dev_attr = (struct omap_smartreflex_dev_attr *)oh->dev_attr;
 
89
        if (!sr_dev_attr || !sr_dev_attr->sensor_voltdm_name) {
96
90
                pr_err("%s: No voltage domain specified for %s."
97
 
                        "Cannot initialize\n", __func__, oh->name);
 
91
                                "Cannot initialize\n", __func__,
 
92
                                        oh->name);
98
93
                goto exit;
99
94
        }
100
95
 
102
97
        sr_data->senn_mod = 0x1;
103
98
        sr_data->senp_mod = 0x1;
104
99
 
105
 
        sr_data->voltdm = omap_voltage_domain_lookup(oh->vdd_name);
 
100
        sr_data->voltdm = voltdm_lookup(sr_dev_attr->sensor_voltdm_name);
106
101
        if (IS_ERR(sr_data->voltdm)) {
107
102
                pr_err("%s: Unable to get voltage domain pointer for VDD %s\n",
108
 
                        __func__, oh->vdd_name);
 
103
                        __func__, sr_dev_attr->sensor_voltdm_name);
109
104
                goto exit;
110
105
        }
111
106
 
120
115
 
121
116
        sr_data->enable_on_init = sr_enable_on_init;
122
117
 
123
 
        od = omap_device_build(name, i, oh, sr_data, sizeof(*sr_data),
124
 
                               omap_sr_latency,
125
 
                               ARRAY_SIZE(omap_sr_latency), 0);
126
 
        if (IS_ERR(od))
 
118
        pdev = omap_device_build(name, i, oh, sr_data, sizeof(*sr_data),
 
119
                                 NULL, 0, 0);
 
120
        if (IS_ERR(pdev))
127
121
                pr_warning("%s: Could not build omap_device for %s: %s.\n\n",
128
122
                        __func__, name, oh->name);
129
123
exit: