Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 263273
b: refs/heads/master
c: 2cb5e4b
h: refs/heads/master
i:
  263271: f6db90c
v: v3
  • Loading branch information
David Herrmann authored and Jiri Kosina committed Aug 23, 2011
1 parent 7381d03 commit f848ef3
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 23a5a4a39eddbe515a832767a371cc54e82cc25e
refs/heads/master: 2cb5e4bc530471e9596cd32390bf70c8ada13d9a
26 changes: 26 additions & 0 deletions trunk/drivers/hid/hid-wiimote.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ struct wiimote_data {
#define WIIPROTO_FLAG_LED(num) (WIIPROTO_FLAG_LED1 << (num - 1))

enum wiiproto_reqs {
WIIPROTO_REQ_NULL = 0x0,
WIIPROTO_REQ_LED = 0x11,
WIIPROTO_REQ_DRM = 0x12,
WIIPROTO_REQ_DRM_K = 0x30,
};

Expand Down Expand Up @@ -192,6 +194,30 @@ static void wiiproto_req_leds(struct wiimote_data *wdata, int leds)
wiimote_queue(wdata, cmd, sizeof(cmd));
}

/*
* Check what peripherals of the wiimote are currently
* active and select a proper DRM that supports all of
* the requested data inputs.
*/
static __u8 select_drm(struct wiimote_data *wdata)
{
return WIIPROTO_REQ_DRM_K;
}

static void wiiproto_req_drm(struct wiimote_data *wdata, __u8 drm)
{
__u8 cmd[3];

if (drm == WIIPROTO_REQ_NULL)
drm = select_drm(wdata);

cmd[0] = WIIPROTO_REQ_DRM;
cmd[1] = 0;
cmd[2] = drm;

wiimote_queue(wdata, cmd, sizeof(cmd));
}

static enum led_brightness wiimote_leds_get(struct led_classdev *led_dev)
{
struct wiimote_data *wdata;
Expand Down

0 comments on commit f848ef3

Please sign in to comment.