linux/drivers/hid/hid-wiimote.h

/* SPDX-License-Identifier: GPL-2.0-or-later */
#ifndef __HID_WIIMOTE_H
#define __HID_WIIMOTE_H

/*
 * HID driver for Nintendo Wii / Wii U peripherals
 * Copyright (c) 2011-2013 David Herrmann <[email protected]>
 */

/*
 */

#include <linux/completion.h>
#include <linux/device.h>
#include <linux/hid.h>
#include <linux/input.h>
#include <linux/leds.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/power_supply.h>
#include <linux/spinlock.h>
#include <linux/timer.h>

#define WIIMOTE_NAME
#define WIIMOTE_BUFSIZE

#define WIIPROTO_FLAG_LED1
#define WIIPROTO_FLAG_LED2
#define WIIPROTO_FLAG_LED3
#define WIIPROTO_FLAG_LED4
#define WIIPROTO_FLAG_RUMBLE
#define WIIPROTO_FLAG_ACCEL
#define WIIPROTO_FLAG_IR_BASIC
#define WIIPROTO_FLAG_IR_EXT
#define WIIPROTO_FLAG_IR_FULL
#define WIIPROTO_FLAG_EXT_PLUGGED
#define WIIPROTO_FLAG_EXT_USED
#define WIIPROTO_FLAG_EXT_ACTIVE
#define WIIPROTO_FLAG_MP_PLUGGED
#define WIIPROTO_FLAG_MP_USED
#define WIIPROTO_FLAG_MP_ACTIVE
#define WIIPROTO_FLAG_EXITING
#define WIIPROTO_FLAG_DRM_LOCKED
#define WIIPROTO_FLAG_BUILTIN_MP
#define WIIPROTO_FLAG_NO_MP
#define WIIPROTO_FLAG_PRO_CALIB_DONE

#define WIIPROTO_FLAGS_LEDS
#define WIIPROTO_FLAGS_IR

/* return flag for led \num */
#define WIIPROTO_FLAG_LED(num)

enum wiiproto_keys {};

enum wiimote_devtype {};

enum wiimote_exttype {};

enum wiimote_mptype {};

struct wiimote_buf {};

struct wiimote_queue {};

struct wiimote_state {};

struct wiimote_data {};

extern bool wiimote_dpad_as_analog;

/* wiimote modules */

enum wiimod_module {};

#define WIIMOD_FLAG_INPUT
#define WIIMOD_FLAG_EXT8
#define WIIMOD_FLAG_EXT16

struct wiimod_ops {};

extern const struct wiimod_ops *wiimod_table[WIIMOD_NUM];
extern const struct wiimod_ops *wiimod_ext_table[WIIMOTE_EXT_NUM];
extern const struct wiimod_ops wiimod_mp;

/* wiimote requests */

enum wiiproto_reqs {};

#define dev_to_wii(pdev)

void __wiimote_schedule(struct wiimote_data *wdata);

extern void wiiproto_req_drm(struct wiimote_data *wdata, __u8 drm);
extern void wiiproto_req_rumble(struct wiimote_data *wdata, __u8 rumble);
extern void wiiproto_req_leds(struct wiimote_data *wdata, int leds);
extern void wiiproto_req_status(struct wiimote_data *wdata);
extern void wiiproto_req_accel(struct wiimote_data *wdata, __u8 accel);
extern void wiiproto_req_ir1(struct wiimote_data *wdata, __u8 flags);
extern void wiiproto_req_ir2(struct wiimote_data *wdata, __u8 flags);
extern int wiimote_cmd_write(struct wiimote_data *wdata, __u32 offset,
						const __u8 *wmem, __u8 size);
extern ssize_t wiimote_cmd_read(struct wiimote_data *wdata, __u32 offset,
							__u8 *rmem, __u8 size);

#define wiiproto_req_rreg(wdata, os, sz)
#define wiiproto_req_reeprom(wdata, os, sz)
extern void wiiproto_req_rmem(struct wiimote_data *wdata, bool eeprom,
						__u32 offset, __u16 size);

#ifdef CONFIG_DEBUG_FS

extern int wiidebug_init(struct wiimote_data *wdata);
extern void wiidebug_deinit(struct wiimote_data *wdata);

#else

static inline int wiidebug_init(void *u) { return 0; }
static inline void wiidebug_deinit(void *u) { }

#endif

/* requires the state.lock spinlock to be held */
static inline bool wiimote_cmd_pending(struct wiimote_data *wdata, int cmd,
								__u32 opt)
{}

/* requires the state.lock spinlock to be held */
static inline void wiimote_cmd_complete(struct wiimote_data *wdata)
{}

/* requires the state.lock spinlock to be held */
static inline void wiimote_cmd_abort(struct wiimote_data *wdata)
{}

static inline int wiimote_cmd_acquire(struct wiimote_data *wdata)
{}

static inline void wiimote_cmd_acquire_noint(struct wiimote_data *wdata)
{}

/* requires the state.lock spinlock to be held */
static inline void wiimote_cmd_set(struct wiimote_data *wdata, int cmd,
								__u32 opt)
{}

static inline void wiimote_cmd_release(struct wiimote_data *wdata)
{}

static inline int wiimote_cmd_wait(struct wiimote_data *wdata)
{}

static inline int wiimote_cmd_wait_noint(struct wiimote_data *wdata)
{}

#endif