From e39bdcd6da4de815f85e5aa2ceb19fe769d53688 Mon Sep 17 00:00:00 2001
From: Wujun Zhou <zwj.echo@gmail.com>
Date: Mon, 8 Jul 2013 20:54:49 -0700
Subject: [PATCH] HID: Fix logitech-dj: missing Unifying pair notification

---
 drivers/hid/hid-logitech-dj.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/hid/hid-logitech-dj.c b/drivers/hid/hid-logitech-dj.c
index 5207591a..1a332b2 100644
--- a/drivers/hid/hid-logitech-dj.c
+++ b/drivers/hid/hid-logitech-dj.c
@@ -192,6 +192,7 @@ static struct hid_ll_driver logi_dj_ll_driver;
 static int logi_dj_output_hidraw_report(struct hid_device *hid, u8 * buf,
 					size_t count,
 					unsigned char report_type);
+static int logi_dj_recv_query_paired_devices(struct dj_receiver_dev *djrcv_dev);
 
 static void logi_dj_recv_destroy_djhid_device(struct dj_receiver_dev *djrcv_dev,
 						struct dj_report *dj_report)
@@ -305,6 +306,7 @@ static void delayedwork_callback(struct work_struct *work)
 	struct dj_report dj_report;
 	unsigned long flags;
 	int count;
+	int retval;
 
 	dbg_hid("%s\n", __func__);
 
@@ -336,6 +338,14 @@ static void delayedwork_callback(struct work_struct *work)
 	case REPORT_TYPE_NOTIF_DEVICE_UNPAIRED:
 		logi_dj_recv_destroy_djhid_device(djrcv_dev, &dj_report);
 		break;
+	case REPORT_TYPE_NOTIF_CONNECTION_STATUS:
+		retval = logi_dj_recv_query_paired_devices(djrcv_dev);
+		if (retval) {
+			dev_err(&djrcv_dev->hdev->dev,
+				"%s:logi_dj_recv_query_paired_devices "
+				"error:%d\n", __func__, retval);
+		}
+		break;
 	default:
 		dbg_hid("%s: unexpected report type\n", __func__);
 	}
@@ -672,6 +682,8 @@ static int logi_dj_raw_event(struct hid_device *hdev,
 			if (dj_report->report_params[CONNECTION_STATUS_PARAM_STATUS] ==
 			    STATUS_LINKLOSS) {
 				logi_dj_recv_forward_null_report(djrcv_dev, dj_report);
+			} else {
+				logi_dj_recv_queue_notification(djrcv_dev, dj_report);
 			}
 			break;
 		default:
-- 
1.8.1.5

