#include <linux/hid.h>
#include <linux/idr.h>
#include <linux/input-event-codes.h>
#include <linux/input.h>
#include <linux/jiffies.h>
#include <linux/leds.h>
#include <linux/module.h>
#include <linux/power_supply.h>
#include <linux/spinlock.h>
#include <linux/timer.h>
#include <linux/workqueue.h>
#include "hid-ids.h"
#define NOT_INIT_STR …
#define android_map_key(c) …
enum { … };
enum { … };
enum { … };
enum { … };
enum { … };
struct power_supply_dev { … };
struct thunderstrike_psy_prop_values { … };
static const enum power_supply_property thunderstrike_battery_props[] = …;
enum thunderstrike_led_state { … } __packed;
static_assert(…);
struct thunderstrike_hostcmd_battery { … } __packed;
enum thunderstrike_charger_type { … } __packed;
static_assert(…);
enum thunderstrike_charger_state { … } __packed;
static_assert(…);
struct thunderstrike_hostcmd_charger { … } __packed;
struct thunderstrike_hostcmd_board_info { … } __packed;
struct thunderstrike_hostcmd_haptics { … } __packed;
struct thunderstrike_hostcmd_resp_report { … } __packed;
static_assert(…);
struct thunderstrike_hostcmd_req_report { … } __packed;
static_assert(…);
struct shield_device { … };
static DEFINE_IDA(thunderstrike_ida);
struct thunderstrike { … };
static inline void thunderstrike_hostcmd_req_report_init(
struct thunderstrike_hostcmd_req_report *report, u8 cmd_id)
{ … }
static inline void shield_strrev(char *dest, size_t len, u16 rev)
{ … }
static struct input_dev *shield_allocate_input_dev(struct hid_device *hdev,
const char *name_suffix)
{ … }
static struct input_dev *shield_haptics_create(
struct shield_device *dev,
int (*play_effect)(struct input_dev *, void *, struct ff_effect *))
{ … }
static inline void thunderstrike_send_hostcmd_request(struct thunderstrike *ts)
{ … }
static void thunderstrike_hostcmd_req_work_handler(struct work_struct *work)
{ … }
static inline void thunderstrike_request_firmware_version(struct thunderstrike *ts)
{ … }
static inline void thunderstrike_request_board_info(struct thunderstrike *ts)
{ … }
static inline int
thunderstrike_update_haptics(struct thunderstrike *ts,
struct thunderstrike_hostcmd_haptics *motors)
{ … }
static int thunderstrike_play_effect(struct input_dev *idev, void *data,
struct ff_effect *effect)
{ … }
static enum led_brightness
thunderstrike_led_get_brightness(struct led_classdev *led)
{ … }
static void thunderstrike_led_set_brightness(struct led_classdev *led,
enum led_brightness value)
{ … }
static int thunderstrike_battery_get_property(struct power_supply *psy,
enum power_supply_property psp,
union power_supply_propval *val)
{ … }
static inline void thunderstrike_request_psy_stats(struct thunderstrike *ts)
{ … }
static void thunderstrike_psy_stats_timer_handler(struct timer_list *timer)
{ … }
static void
thunderstrike_parse_fw_version_payload(struct shield_device *shield_dev,
__le16 fw_version)
{ … }
static void
thunderstrike_parse_board_info_payload(struct shield_device *shield_dev,
struct thunderstrike_hostcmd_board_info *board_info)
{ … }
static inline void
thunderstrike_parse_haptics_payload(struct shield_device *shield_dev,
struct thunderstrike_hostcmd_haptics *haptics)
{ … }
static void
thunderstrike_parse_led_payload(struct shield_device *shield_dev,
enum thunderstrike_led_state led_state)
{ … }
static void thunderstrike_parse_battery_payload(
struct shield_device *shield_dev,
struct thunderstrike_hostcmd_battery *battery)
{ … }
static void thunderstrike_parse_charger_payload(
struct shield_device *shield_dev,
struct thunderstrike_hostcmd_charger *charger)
{ … }
static inline void thunderstrike_device_init_info(struct shield_device *shield_dev)
{ … }
static int thunderstrike_parse_report(struct shield_device *shield_dev,
struct hid_report *report, u8 *data,
int size)
{ … }
static inline int thunderstrike_led_create(struct thunderstrike *ts)
{ … }
static inline int thunderstrike_psy_create(struct shield_device *shield_dev)
{ … }
static struct shield_device *thunderstrike_create(struct hid_device *hdev)
{ … }
static void thunderstrike_destroy(struct thunderstrike *ts)
{ … }
static int android_input_mapping(struct hid_device *hdev, struct hid_input *hi,
struct hid_field *field,
struct hid_usage *usage, unsigned long **bit,
int *max)
{ … }
static ssize_t firmware_version_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(firmware_version);
static ssize_t hardware_version_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(hardware_version);
static ssize_t serial_number_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(serial_number);
static struct attribute *shield_device_attrs[] = …;
ATTRIBUTE_GROUPS(…);
static int shield_raw_event(struct hid_device *hdev, struct hid_report *report,
u8 *data, int size)
{ … }
static int shield_probe(struct hid_device *hdev, const struct hid_device_id *id)
{ … }
static void shield_remove(struct hid_device *hdev)
{ … }
static const struct hid_device_id shield_devices[] = …;
MODULE_DEVICE_TABLE(hid, shield_devices);
static struct hid_driver shield_driver = …;
module_hid_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;