/*
* @file hv_drv_UsbUtilHid.h (u_hid.h)
* @brief Utility definitions for the hid function. 
*
* @author HiView SoC Software Team
* @version 1.0.0
* @date 2022-06-15
*/

#ifndef __HV_DRV_USB_UTILITY_HID_H
#define __HV_DRV_USB_UTILITY_HID_H

#include "hv_drv_UsbGadgetComposite.h"

struct f_hid_opts {
    struct usb_function_instance    func_inst;
    int                             minor;
    unsigned char                   subclass;
    unsigned char                   protocol;
    unsigned short                  report_length;
    unsigned short                  report_desc_length;
    unsigned char                   *report_desc;
    bool                            report_desc_alloc;

    /*
     * Protect the data form concurrent access by read/write
     * and create symlink/remove symlink.
     */
     struct mutex                   lock;
     int                            refcnt;
};

int ghid_setup(struct usb_gadget *g, int count);
void ghid_cleanup(void);

int hidg_init(void);

int hid_modinit(void);

void hidg_cleanup(void);

#endif

