~ubuntu-branches/ubuntu/saucy/linux-ti-omap4/saucy-proposed

« back to all changes in this revision

Viewing changes to drivers/staging/olpc_dcon/olpc_dcon.c

  • Committer: Package Import Robot
  • Author(s): Paolo Pisati, Paolo Pisati, Stefan Bader, Upstream Kernel Changes
  • Date: 2012-08-15 17:17:43 UTC
  • Revision ID: package-import@ubuntu.com-20120815171743-h5wnuf51xe7pvdid
Tags: 3.5.0-207.13
[ Paolo Pisati ]

* Start new release

[ Stefan Bader ]

* (config) Enable getabis to use local package copies

[ Upstream Kernel Changes ]

* fixup: gargabe collect iva_seq[0|1] init
* [Config] enable all SND_OMAP_SOC_*s
* fixup: cm2xxx_3xxx.o is needed for omap2_cm_read|write_reg
* fixup: add some snd_soc_dai* helper functions
* fixup: s/snd_soc_dpcm_params/snd_soc_dpcm/g
* fixup: typo, no_host_mode and useless SDP4430 init
* fixup: enable again aess hwmod

Show diffs side-by-side

added added

removed removed

Lines of Context:
71
71
 
72
72
        ver = dcon_read(dcon, DCON_REG_ID);
73
73
        if ((ver >> 8) != 0xDC) {
74
 
                printk(KERN_ERR "olpc-dcon:  DCON ID not 0xDCxx: 0x%04x "
75
 
                                "instead.\n", ver);
 
74
                printk(KERN_ERR "olpc-dcon:  DCON ID not 0xDCxx: 0x%04x instead.\n",
 
75
                        ver);
76
76
                rc = -ENXIO;
77
77
                goto err;
78
78
        }
134
134
power_up:
135
135
        if (is_powered_down) {
136
136
                x = 1;
137
 
                x = olpc_ec_cmd(0x26, (unsigned char *) &x, 1, NULL, 0);
 
137
                x = olpc_ec_cmd(0x26, (unsigned char *)&x, 1, NULL, 0);
138
138
                if (x) {
139
 
                        printk(KERN_WARNING "olpc-dcon:  unable to force dcon "
140
 
                                        "to power up: %d!\n", x);
 
139
                        printk(KERN_WARNING "olpc-dcon:  unable to force dcon to power up: %d!\n",
 
140
                                x);
141
141
                        return x;
142
142
                }
143
143
                msleep(10); /* we'll be conservative */
150
150
                x = dcon_read(dcon, DCON_REG_ID);
151
151
        }
152
152
        if (x < 0) {
153
 
                printk(KERN_ERR "olpc-dcon:  unable to stabilize dcon's "
154
 
                                "smbus, reasserting power and praying.\n");
 
153
                printk(KERN_ERR "olpc-dcon:  unable to stabilize dcon's smbus, reasserting power and praying.\n");
155
154
                BUG_ON(olpc_board_at_least(olpc_board(0xc2)));
156
155
                x = 0;
157
 
                olpc_ec_cmd(0x26, (unsigned char *) &x, 1, NULL, 0);
 
156
                olpc_ec_cmd(0x26, (unsigned char *)&x, 1, NULL, 0);
158
157
                msleep(100);
159
158
                is_powered_down = 1;
160
159
                goto power_up;  /* argh, stupid hardware.. */
220
219
 
221
220
        if (sleep) {
222
221
                x = 0;
223
 
                x = olpc_ec_cmd(0x26, (unsigned char *) &x, 1, NULL, 0);
 
222
                x = olpc_ec_cmd(0x26, (unsigned char *)&x, 1, NULL, 0);
224
223
                if (x)
225
 
                        printk(KERN_WARNING "olpc-dcon:  unable to force dcon "
226
 
                                        "to power down: %d!\n", x);
 
224
                        printk(KERN_WARNING "olpc-dcon:  unable to force dcon to power down: %d!\n",
 
225
                                x);
227
226
                else
228
227
                        dcon->asleep = sleep;
229
228
        } else {
232
231
                        dcon->disp_mode |= MODE_BL_ENABLE;
233
232
                x = dcon_bus_stabilize(dcon, 1);
234
233
                if (x)
235
 
                        printk(KERN_WARNING "olpc-dcon:  unable to reinit dcon"
236
 
                                        " hardware: %d!\n", x);
 
234
                        printk(KERN_WARNING "olpc-dcon:  unable to reinit dcon hardware: %d!\n",
 
235
                                x);
237
236
                else
238
237
                        dcon->asleep = sleep;
239
238
 
304
303
 
305
304
        switch (source) {
306
305
        case DCON_SOURCE_CPU:
307
 
                printk("dcon_source_switch to CPU\n");
 
306
                printk(KERN_INFO "dcon_source_switch to CPU\n");
308
307
                /* Enable the scanline interrupt bit */
309
308
                if (dcon_write(dcon, DCON_REG_MODE,
310
309
                                dcon->disp_mode | MODE_SCAN_INT))
599
598
        struct fb_event *evdata = data;
600
599
        struct dcon_priv *dcon = container_of(self, struct dcon_priv,
601
600
                        fbevent_nb);
602
 
        int *blank = (int *) evdata->data;
 
601
        int *blank = (int *)evdata->data;
603
602
        if (((event != FB_EVENT_BLANK) && (event != FB_EVENT_CONBLANK)) ||
604
603
                        dcon->ignore_fb_events)
605
604
                return 0;