steam             129 drivers/hid/hid-steam.c static int steam_recv_report(struct steam_device *steam,
steam             136 drivers/hid/hid-steam.c 	r = steam->hdev->report_enum[HID_FEATURE_REPORT].report_id_hash[0];
steam             150 drivers/hid/hid-steam.c 	ret = hid_hw_raw_request(steam->hdev, 0x00,
steam             159 drivers/hid/hid-steam.c static int steam_send_report(struct steam_device *steam,
steam             167 drivers/hid/hid-steam.c 	r = steam->hdev->report_enum[HID_FEATURE_REPORT].report_id_hash[0];
steam             185 drivers/hid/hid-steam.c 		ret = hid_hw_raw_request(steam->hdev, 0,
steam             195 drivers/hid/hid-steam.c 		hid_err(steam->hdev, "%s: error %d (%*ph)\n", __func__,
steam             200 drivers/hid/hid-steam.c static inline int steam_send_report_byte(struct steam_device *steam, u8 cmd)
steam             202 drivers/hid/hid-steam.c 	return steam_send_report(steam, &cmd, 1);
steam             205 drivers/hid/hid-steam.c static int steam_write_registers(struct steam_device *steam,
steam             214 drivers/hid/hid-steam.c 	va_start(args, steam);
steam             227 drivers/hid/hid-steam.c 	return steam_send_report(steam, cmd, 2 + cmd[1]);
steam             230 drivers/hid/hid-steam.c static int steam_get_serial(struct steam_device *steam)
steam             240 drivers/hid/hid-steam.c 	ret = steam_send_report(steam, cmd, sizeof(cmd));
steam             243 drivers/hid/hid-steam.c 	ret = steam_recv_report(steam, reply, sizeof(reply));
steam             249 drivers/hid/hid-steam.c 	strlcpy(steam->serial_no, reply + 3, sizeof(steam->serial_no));
steam             258 drivers/hid/hid-steam.c static inline int steam_request_conn_status(struct steam_device *steam)
steam             260 drivers/hid/hid-steam.c 	return steam_send_report_byte(steam, STEAM_CMD_REQUEST_COMM_STATUS);
steam             263 drivers/hid/hid-steam.c static void steam_set_lizard_mode(struct steam_device *steam, bool enable)
steam             267 drivers/hid/hid-steam.c 		steam_send_report_byte(steam, STEAM_CMD_DEFAULT_MAPPINGS);
steam             269 drivers/hid/hid-steam.c 		steam_send_report_byte(steam, STEAM_CMD_DEFAULT_MOUSE);
steam             270 drivers/hid/hid-steam.c 		steam_write_registers(steam,
steam             275 drivers/hid/hid-steam.c 		steam_send_report_byte(steam, STEAM_CMD_CLEAR_MAPPINGS);
steam             276 drivers/hid/hid-steam.c 		steam_write_registers(steam,
steam             285 drivers/hid/hid-steam.c 	struct steam_device *steam = input_get_drvdata(dev);
steam             287 drivers/hid/hid-steam.c 	mutex_lock(&steam->mutex);
steam             288 drivers/hid/hid-steam.c 	if (!steam->client_opened && lizard_mode)
steam             289 drivers/hid/hid-steam.c 		steam_set_lizard_mode(steam, false);
steam             290 drivers/hid/hid-steam.c 	mutex_unlock(&steam->mutex);
steam             296 drivers/hid/hid-steam.c 	struct steam_device *steam = input_get_drvdata(dev);
steam             298 drivers/hid/hid-steam.c 	mutex_lock(&steam->mutex);
steam             299 drivers/hid/hid-steam.c 	if (!steam->client_opened && lizard_mode)
steam             300 drivers/hid/hid-steam.c 		steam_set_lizard_mode(steam, true);
steam             301 drivers/hid/hid-steam.c 	mutex_unlock(&steam->mutex);
steam             315 drivers/hid/hid-steam.c 	struct steam_device *steam = power_supply_get_drvdata(psy);
steam             321 drivers/hid/hid-steam.c 	spin_lock_irqsave(&steam->lock, flags);
steam             322 drivers/hid/hid-steam.c 	volts = steam->voltage;
steam             323 drivers/hid/hid-steam.c 	batt = steam->battery_charge;
steam             324 drivers/hid/hid-steam.c 	spin_unlock_irqrestore(&steam->lock, flags);
steam             346 drivers/hid/hid-steam.c static int steam_battery_register(struct steam_device *steam)
steam             349 drivers/hid/hid-steam.c 	struct power_supply_config battery_cfg = { .drv_data = steam, };
steam             353 drivers/hid/hid-steam.c 	steam->battery_desc.type = POWER_SUPPLY_TYPE_BATTERY;
steam             354 drivers/hid/hid-steam.c 	steam->battery_desc.properties = steam_battery_props;
steam             355 drivers/hid/hid-steam.c 	steam->battery_desc.num_properties = ARRAY_SIZE(steam_battery_props);
steam             356 drivers/hid/hid-steam.c 	steam->battery_desc.get_property = steam_battery_get_property;
steam             357 drivers/hid/hid-steam.c 	steam->battery_desc.name = devm_kasprintf(&steam->hdev->dev,
steam             359 drivers/hid/hid-steam.c 			steam->serial_no);
steam             360 drivers/hid/hid-steam.c 	if (!steam->battery_desc.name)
steam             364 drivers/hid/hid-steam.c 	spin_lock_irqsave(&steam->lock, flags);
steam             365 drivers/hid/hid-steam.c 	steam->voltage = 3000;
steam             366 drivers/hid/hid-steam.c 	steam->battery_charge = 100;
steam             367 drivers/hid/hid-steam.c 	spin_unlock_irqrestore(&steam->lock, flags);
steam             369 drivers/hid/hid-steam.c 	battery = power_supply_register(&steam->hdev->dev,
steam             370 drivers/hid/hid-steam.c 			&steam->battery_desc, &battery_cfg);
steam             373 drivers/hid/hid-steam.c 		hid_err(steam->hdev,
steam             378 drivers/hid/hid-steam.c 	rcu_assign_pointer(steam->battery, battery);
steam             379 drivers/hid/hid-steam.c 	power_supply_powers(battery, &steam->hdev->dev);
steam             383 drivers/hid/hid-steam.c static int steam_input_register(struct steam_device *steam)
steam             385 drivers/hid/hid-steam.c 	struct hid_device *hdev = steam->hdev;
steam             390 drivers/hid/hid-steam.c 	input = rcu_dereference(steam->input);
steam             401 drivers/hid/hid-steam.c 	input_set_drvdata(input, steam);
steam             406 drivers/hid/hid-steam.c 	input->name = (steam->quirks & STEAM_QUIRK_WIRELESS) ?
steam             410 drivers/hid/hid-steam.c 	input->uniq = steam->serial_no;
steam             463 drivers/hid/hid-steam.c 	rcu_assign_pointer(steam->input, input);
steam             471 drivers/hid/hid-steam.c static void steam_input_unregister(struct steam_device *steam)
steam             475 drivers/hid/hid-steam.c 	input = rcu_dereference(steam->input);
steam             479 drivers/hid/hid-steam.c 	RCU_INIT_POINTER(steam->input, NULL);
steam             484 drivers/hid/hid-steam.c static void steam_battery_unregister(struct steam_device *steam)
steam             489 drivers/hid/hid-steam.c 	battery = rcu_dereference(steam->battery);
steam             494 drivers/hid/hid-steam.c 	RCU_INIT_POINTER(steam->battery, NULL);
steam             499 drivers/hid/hid-steam.c static int steam_register(struct steam_device *steam)
steam             510 drivers/hid/hid-steam.c 	if (!steam->serial_no[0]) {
steam             515 drivers/hid/hid-steam.c 		mutex_lock(&steam->mutex);
steam             516 drivers/hid/hid-steam.c 		if (steam_get_serial(steam) < 0)
steam             517 drivers/hid/hid-steam.c 			strlcpy(steam->serial_no, "XXXXXXXXXX",
steam             518 drivers/hid/hid-steam.c 					sizeof(steam->serial_no));
steam             519 drivers/hid/hid-steam.c 		mutex_unlock(&steam->mutex);
steam             521 drivers/hid/hid-steam.c 		hid_info(steam->hdev, "Steam Controller '%s' connected",
steam             522 drivers/hid/hid-steam.c 				steam->serial_no);
steam             525 drivers/hid/hid-steam.c 		if (steam->quirks & STEAM_QUIRK_WIRELESS)
steam             526 drivers/hid/hid-steam.c 			steam_battery_register(steam);
steam             529 drivers/hid/hid-steam.c 		list_add(&steam->list, &steam_devices);
steam             533 drivers/hid/hid-steam.c 	mutex_lock(&steam->mutex);
steam             534 drivers/hid/hid-steam.c 	client_opened = steam->client_opened;
steam             536 drivers/hid/hid-steam.c 		steam_set_lizard_mode(steam, lizard_mode);
steam             537 drivers/hid/hid-steam.c 	mutex_unlock(&steam->mutex);
steam             540 drivers/hid/hid-steam.c 		ret = steam_input_register(steam);
steam             547 drivers/hid/hid-steam.c static void steam_unregister(struct steam_device *steam)
steam             549 drivers/hid/hid-steam.c 	steam_battery_unregister(steam);
steam             550 drivers/hid/hid-steam.c 	steam_input_unregister(steam);
steam             551 drivers/hid/hid-steam.c 	if (steam->serial_no[0]) {
steam             552 drivers/hid/hid-steam.c 		hid_info(steam->hdev, "Steam Controller '%s' disconnected",
steam             553 drivers/hid/hid-steam.c 				steam->serial_no);
steam             555 drivers/hid/hid-steam.c 		list_del(&steam->list);
steam             557 drivers/hid/hid-steam.c 		steam->serial_no[0] = 0;
steam             563 drivers/hid/hid-steam.c 	struct steam_device *steam = container_of(work, struct steam_device,
steam             569 drivers/hid/hid-steam.c 	spin_lock_irqsave(&steam->lock, flags);
steam             570 drivers/hid/hid-steam.c 	connected = steam->connected;
steam             571 drivers/hid/hid-steam.c 	spin_unlock_irqrestore(&steam->lock, flags);
steam             574 drivers/hid/hid-steam.c 		ret = steam_register(steam);
steam             576 drivers/hid/hid-steam.c 			hid_err(steam->hdev,
steam             581 drivers/hid/hid-steam.c 		steam_unregister(steam);
steam             606 drivers/hid/hid-steam.c 	struct steam_device *steam = hdev->driver_data;
steam             608 drivers/hid/hid-steam.c 	return hid_parse_report(hdev, steam->hdev->dev_rdesc,
steam             609 drivers/hid/hid-steam.c 			steam->hdev->dev_rsize);
steam             623 drivers/hid/hid-steam.c 	struct steam_device *steam = hdev->driver_data;
steam             625 drivers/hid/hid-steam.c 	mutex_lock(&steam->mutex);
steam             626 drivers/hid/hid-steam.c 	steam->client_opened = true;
steam             627 drivers/hid/hid-steam.c 	mutex_unlock(&steam->mutex);
steam             629 drivers/hid/hid-steam.c 	steam_input_unregister(steam);
steam             636 drivers/hid/hid-steam.c 	struct steam_device *steam = hdev->driver_data;
steam             641 drivers/hid/hid-steam.c 	spin_lock_irqsave(&steam->lock, flags);
steam             642 drivers/hid/hid-steam.c 	connected = steam->connected;
steam             643 drivers/hid/hid-steam.c 	spin_unlock_irqrestore(&steam->lock, flags);
steam             645 drivers/hid/hid-steam.c 	mutex_lock(&steam->mutex);
steam             646 drivers/hid/hid-steam.c 	steam->client_opened = false;
steam             648 drivers/hid/hid-steam.c 		steam_set_lizard_mode(steam, lizard_mode);
steam             649 drivers/hid/hid-steam.c 	mutex_unlock(&steam->mutex);
steam             652 drivers/hid/hid-steam.c 		steam_input_register(steam);
steam             660 drivers/hid/hid-steam.c 	struct steam_device *steam = hdev->driver_data;
steam             662 drivers/hid/hid-steam.c 	return hid_hw_raw_request(steam->hdev, reportnum, buf, count,
steam             707 drivers/hid/hid-steam.c 	struct steam_device *steam;
steam             730 drivers/hid/hid-steam.c 	steam = devm_kzalloc(&hdev->dev, sizeof(*steam), GFP_KERNEL);
steam             731 drivers/hid/hid-steam.c 	if (!steam) {
steam             735 drivers/hid/hid-steam.c 	steam->hdev = hdev;
steam             736 drivers/hid/hid-steam.c 	hid_set_drvdata(hdev, steam);
steam             737 drivers/hid/hid-steam.c 	spin_lock_init(&steam->lock);
steam             738 drivers/hid/hid-steam.c 	mutex_init(&steam->mutex);
steam             739 drivers/hid/hid-steam.c 	steam->quirks = id->driver_data;
steam             740 drivers/hid/hid-steam.c 	INIT_WORK(&steam->work_connect, steam_work_connect_cb);
steam             742 drivers/hid/hid-steam.c 	steam->client_hdev = steam_create_client_hid(hdev);
steam             743 drivers/hid/hid-steam.c 	if (IS_ERR(steam->client_hdev)) {
steam             744 drivers/hid/hid-steam.c 		ret = PTR_ERR(steam->client_hdev);
steam             747 drivers/hid/hid-steam.c 	steam->client_hdev->driver_data = steam;
steam             757 drivers/hid/hid-steam.c 	ret = hid_add_device(steam->client_hdev);
steam             769 drivers/hid/hid-steam.c 	if (steam->quirks & STEAM_QUIRK_WIRELESS) {
steam             772 drivers/hid/hid-steam.c 		steam->connected = false;
steam             773 drivers/hid/hid-steam.c 		steam_request_conn_status(steam);
steam             776 drivers/hid/hid-steam.c 		steam->connected = true;
steam             777 drivers/hid/hid-steam.c 		ret = steam_register(steam);
steam             793 drivers/hid/hid-steam.c 	hid_destroy_device(steam->client_hdev);
steam             795 drivers/hid/hid-steam.c 	cancel_work_sync(&steam->work_connect);
steam             804 drivers/hid/hid-steam.c 	struct steam_device *steam = hid_get_drvdata(hdev);
steam             806 drivers/hid/hid-steam.c 	if (!steam || hdev->group == HID_GROUP_STEAM) {
steam             811 drivers/hid/hid-steam.c 	hid_destroy_device(steam->client_hdev);
steam             812 drivers/hid/hid-steam.c 	steam->client_opened = false;
steam             813 drivers/hid/hid-steam.c 	cancel_work_sync(&steam->work_connect);
steam             814 drivers/hid/hid-steam.c 	if (steam->quirks & STEAM_QUIRK_WIRELESS) {
steam             819 drivers/hid/hid-steam.c 	steam_unregister(steam);
steam             822 drivers/hid/hid-steam.c static void steam_do_connect_event(struct steam_device *steam, bool connected)
steam             827 drivers/hid/hid-steam.c 	spin_lock_irqsave(&steam->lock, flags);
steam             828 drivers/hid/hid-steam.c 	changed = steam->connected != connected;
steam             829 drivers/hid/hid-steam.c 	steam->connected = connected;
steam             830 drivers/hid/hid-steam.c 	spin_unlock_irqrestore(&steam->lock, flags);
steam             832 drivers/hid/hid-steam.c 	if (changed && schedule_work(&steam->work_connect) == 0)
steam             915 drivers/hid/hid-steam.c static void steam_do_input_event(struct steam_device *steam,
steam             994 drivers/hid/hid-steam.c static void steam_do_battery_event(struct steam_device *steam,
steam            1004 drivers/hid/hid-steam.c 	battery = rcu_dereference(steam->battery);
steam            1006 drivers/hid/hid-steam.c 		spin_lock_irqsave(&steam->lock, flags);
steam            1007 drivers/hid/hid-steam.c 		steam->voltage = volts;
steam            1008 drivers/hid/hid-steam.c 		steam->battery_charge = batt;
steam            1009 drivers/hid/hid-steam.c 		spin_unlock_irqrestore(&steam->lock, flags);
steam            1019 drivers/hid/hid-steam.c 	struct steam_device *steam = hid_get_drvdata(hdev);
steam            1023 drivers/hid/hid-steam.c 	if (!steam)
steam            1026 drivers/hid/hid-steam.c 	if (steam->client_opened)
steam            1027 drivers/hid/hid-steam.c 		hid_input_report(steam->client_hdev, HID_FEATURE_REPORT,
steam            1050 drivers/hid/hid-steam.c 		if (steam->client_opened)
steam            1053 drivers/hid/hid-steam.c 		input = rcu_dereference(steam->input);
steam            1055 drivers/hid/hid-steam.c 			steam_do_input_event(steam, input, data);
steam            1066 drivers/hid/hid-steam.c 			steam_do_connect_event(steam, false);
steam            1069 drivers/hid/hid-steam.c 			steam_do_connect_event(steam, true);
steam            1074 drivers/hid/hid-steam.c 		if (steam->quirks & STEAM_QUIRK_WIRELESS) {
steam            1076 drivers/hid/hid-steam.c 			battery = rcu_dereference(steam->battery);
steam            1078 drivers/hid/hid-steam.c 				steam_do_battery_event(steam, battery, data);
steam            1083 drivers/hid/hid-steam.c 				steam_do_connect_event(steam, true);
steam            1095 drivers/hid/hid-steam.c 	struct steam_device *steam;
steam            1103 drivers/hid/hid-steam.c 	list_for_each_entry(steam, &steam_devices, list) {
steam            1104 drivers/hid/hid-steam.c 		mutex_lock(&steam->mutex);
steam            1105 drivers/hid/hid-steam.c 		if (!steam->client_opened)
steam            1106 drivers/hid/hid-steam.c 			steam_set_lizard_mode(steam, lizard_mode);
steam            1107 drivers/hid/hid-steam.c 		mutex_unlock(&steam->mutex);
steam              39 include/net/sctp/stream_sched.h 	void (*sched_all)(struct sctp_stream *steam);
steam              41 include/net/sctp/stream_sched.h 	void (*unsched_all)(struct sctp_stream *steam);