linux/drivers/hid/hid-cmedia.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * HID driver for CMedia CM6533 audio jack controls
 * and HS100B mute buttons
 *
 * Copyright (C) 2015 Ben Chen <[email protected]>
 * Copyright (C) 2021 Thomas Weißschuh <[email protected]>
 */

#include <linux/device.h>
#include <linux/hid.h>
#include <linux/module.h>
#include "hid-ids.h"

MODULE_AUTHOR();
MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();

#define CM6533_JD_TYPE_COUNT
#define CM6533_JD_RAWEV_LEN
#define CM6533_JD_SFX_OFFSET

#define HS100B_RDESC_ORIG_SIZE

/* Fixed report descriptor of HS-100B audio chip
 * Bit 4 is an abolute Microphone mute usage instead of being unassigned.
 */
static __u8 hs100b_rdesc_fixed[] =;

/*
*
*CM6533 audio jack HID raw events:
*
*Plug in:
*01000600 002083xx 080008c0 10000000
*about 3 seconds later...
*01000a00 002083xx 08000380 10000000
*01000600 002083xx 08000380 10000000
*
*Plug out:
*01000400 002083xx 080008c0 x0000000
*/

static const u8 ji_sfx[] =;
static const u8 ji_in[]  =;
static const u8 ji_out[] =;

static int jack_switch_types[CM6533_JD_TYPE_COUNT] =;

struct cmhid {};

static void hp_ev(struct hid_device *hid, struct cmhid *cm, int value)
{}

static int cmhid_raw_event(struct hid_device *hid, struct hid_report *report,
	 u8 *data, int len)
{}

static int cmhid_input_configured(struct hid_device *hid,
		struct hid_input *hidinput)
{}

static int cmhid_input_mapping(struct hid_device *hid,
		struct hid_input *hi, struct hid_field *field,
		struct hid_usage *usage, unsigned long **bit, int *max)
{}

static int cmhid_probe(struct hid_device *hid, const struct hid_device_id *id)
{}

static void cmhid_remove(struct hid_device *hid)
{}

static const struct hid_device_id cmhid_devices[] =;
MODULE_DEVICE_TABLE(hid, cmhid_devices);

static struct hid_driver cmhid_driver =;

static __u8 *cmhid_hs100b_report_fixup(struct hid_device *hid, __u8 *rdesc,
				       unsigned int *rsize)
{}

static const struct hid_device_id cmhid_hs100b_devices[] =;
MODULE_DEVICE_TABLE(hid, cmhid_hs100b_devices);

static struct hid_driver cmhid_hs100b_driver =;

static int cmedia_init(void)
{}
module_init();

static void cmedia_exit(void)
{}
module_exit(cmedia_exit);