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

« back to all changes in this revision

Viewing changes to drivers/input/xen-kbdfront.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:
110
110
static int __devinit xenkbd_probe(struct xenbus_device *dev,
111
111
                                  const struct xenbus_device_id *id)
112
112
{
113
 
        int ret, i;
 
113
        int ret, i, abs;
114
114
        struct xenkbd_info *info;
115
115
        struct input_dev *kbd, *ptr;
116
116
 
128
128
        if (!info->page)
129
129
                goto error_nomem;
130
130
 
 
131
        if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-abs-pointer", "%d", &abs) < 0)
 
132
                abs = 0;
 
133
        if (abs)
 
134
                xenbus_printf(XBT_NIL, dev->nodename, "request-abs-pointer", "1");
 
135
 
131
136
        /* keyboard */
132
137
        kbd = input_allocate_device();
133
138
        if (!kbd)
137
142
        kbd->id.bustype = BUS_PCI;
138
143
        kbd->id.vendor = 0x5853;
139
144
        kbd->id.product = 0xffff;
140
 
        kbd->evbit[0] = BIT(EV_KEY);
 
145
 
 
146
        __set_bit(EV_KEY, kbd->evbit);
141
147
        for (i = KEY_ESC; i < KEY_UNKNOWN; i++)
142
 
                set_bit(i, kbd->keybit);
 
148
                __set_bit(i, kbd->keybit);
143
149
        for (i = KEY_OK; i < KEY_MAX; i++)
144
 
                set_bit(i, kbd->keybit);
 
150
                __set_bit(i, kbd->keybit);
145
151
 
146
152
        ret = input_register_device(kbd);
147
153
        if (ret) {
160
166
        ptr->id.bustype = BUS_PCI;
161
167
        ptr->id.vendor = 0x5853;
162
168
        ptr->id.product = 0xfffe;
163
 
        ptr->evbit[0] = BIT(EV_KEY) | BIT(EV_REL) | BIT(EV_ABS);
 
169
 
 
170
        if (abs) {
 
171
                __set_bit(EV_ABS, ptr->evbit);
 
172
                input_set_abs_params(ptr, ABS_X, 0, XENFB_WIDTH, 0, 0);
 
173
                input_set_abs_params(ptr, ABS_Y, 0, XENFB_HEIGHT, 0, 0);
 
174
        } else {
 
175
                input_set_capability(ptr, EV_REL, REL_X);
 
176
                input_set_capability(ptr, EV_REL, REL_Y);
 
177
        }
 
178
        input_set_capability(ptr, EV_REL, REL_WHEEL);
 
179
 
 
180
        __set_bit(EV_KEY, ptr->evbit);
164
181
        for (i = BTN_LEFT; i <= BTN_TASK; i++)
165
 
                set_bit(i, ptr->keybit);
166
 
        ptr->relbit[0] = BIT(REL_X) | BIT(REL_Y) | BIT(REL_WHEEL);
167
 
        input_set_abs_params(ptr, ABS_X, 0, XENFB_WIDTH, 0, 0);
168
 
        input_set_abs_params(ptr, ABS_Y, 0, XENFB_HEIGHT, 0, 0);
 
182
                __set_bit(i, ptr->keybit);
169
183
 
170
184
        ret = input_register_device(ptr);
171
185
        if (ret) {
272
286
                                   enum xenbus_state backend_state)
273
287
{
274
288
        struct xenkbd_info *info = dev_get_drvdata(&dev->dev);
275
 
        int ret, val;
 
289
        int val;
276
290
 
277
291
        switch (backend_state) {
278
292
        case XenbusStateInitialising:
285
299
 
286
300
        case XenbusStateInitWait:
287
301
InitWait:
288
 
                ret = xenbus_scanf(XBT_NIL, info->xbdev->otherend,
289
 
                                   "feature-abs-pointer", "%d", &val);
290
 
                if (ret < 0)
291
 
                        val = 0;
292
 
                if (val) {
293
 
                        ret = xenbus_printf(XBT_NIL, info->xbdev->nodename,
294
 
                                            "request-abs-pointer", "1");
295
 
                        if (ret)
296
 
                                pr_warning("can't request abs-pointer\n");
297
 
                }
298
302
                xenbus_switch_state(dev, XenbusStateConnected);
299
303
                break;
300
304