Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2517571imu; Thu, 29 Nov 2018 06:18:21 -0800 (PST) X-Google-Smtp-Source: AFSGD/WMfew+vxn/mJG0javCOUGOX9GfTU3qFitKpoDfgG7KzOdTE4pMcK7JFV0KbAuoe1Y/ZPoU X-Received: by 2002:a62:a209:: with SMTP id m9mr1599538pff.218.1543501101122; Thu, 29 Nov 2018 06:18:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543501101; cv=none; d=google.com; s=arc-20160816; b=QqYc8AXwsQUWXID4GAk4YOtvg0fZQwHKZF4novcxE+JiULaC1kRbl97OXLnbaqptBx M9B6puxgY2vTN92xMi3kK6eVZNsEO68rqN8bMV6IWZVvlrkQ05EIxyutz+gYdNULPmxQ HCd0z5cHszuclr1fuKOxtO1IV/HK9LXCWsOLxHf3glr+SFXbNQreh5zGgO45GFvwAwiS Hxh69HHDTS5gLLIXwxYGzrK221m2Bwmw0PoFgcjHngxK2Ccq9MX7pxgjTqJ16JeY8n3N X4bp/WPiPOLjjHSWVe6IFS1prT2RxuhXAyMGtsFbR2MiGfOtCrdYD4lFE0qv/nrKoNOK Rm0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=qdJevvh7udTPxLzMTMX86Qen9gJM7l4R+Sv2EvfVM08=; b=QpH9KJGRWeaSP4+BB1ZtLkCN2dX8e1jVoNe48gNVaH3UGp3J57xQQN+buFsPcxMnvb UELiKrxSG5mwdbeshYRb4tuXXY1Ap2eJ6Z9HUuhJuwCPvG8Sh0jge2j2dgXoYn4wwH0j EBgjDrodAQ0Xywb5O0Pg0bSQT+c8cpal7K154CEC1qhx0ucM64nlIdRjOJh6oCMmIe3k mY+V1MuRrkbX8tsdKboWHQ5K6Xe+eEInMONzL/c9CSGwTfkJcCzN2mjez1vgcB5FNrtm KLyre3LNpF6CLvWJCIeURjfXW13W/LdGvku+0yzrRSKfzFc/bKtDXqzpOID5pNV83kyf OjpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=sGhK44gN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v17si2070119pga.566.2018.11.29.06.18.05; Thu, 29 Nov 2018 06:18:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=sGhK44gN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729677AbeK3BVG (ORCPT + 99 others); Thu, 29 Nov 2018 20:21:06 -0500 Received: from mail.kernel.org ([198.145.29.99]:42274 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728241AbeK3BVF (ORCPT ); Thu, 29 Nov 2018 20:21:05 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0FCB3208E7; Thu, 29 Nov 2018 14:15:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543500935; bh=e9NJlbHe/xhdbyY7v9w+45TkH3HG/M47KHi95nwDxOE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sGhK44gNkqpCszfibdOtLyoUIYzpseMjTnEKAawk1CzpjB+PYaYTsiji5gQDZUfxI 5sYe3fQJ214RhHIewCpXQJhLwGT9o2eY248rLTRz/TP5q+MU3DkDm7+BgH2HK8Ktgt HOjbyZgSUCM3+PdlxrtEuuU4/hNo2Aybxo3FT0nU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Cameron Gutman , Dmitry Torokhov , Sasha Levin Subject: [PATCH 3.18 58/83] Input: xpad - restore LED state after device resume Date: Thu, 29 Nov 2018 15:12:16 +0100 Message-Id: <20181129140140.948151230@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181129140138.002176596@linuxfoundation.org> References: <20181129140138.002176596@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.18-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit a1fbf5bbef025b4844162b3b8868888003a7ee9c ] Set the LED_CORE_SUSPENDRESUME flag on our LED device so the LED state will be automatically restored by LED core on resume. Since Xbox One pads stop flashing only when reinitialized, we'll send them the initialization packet so they calm down too. Signed-off-by: Cameron Gutman Signed-off-by: Dmitry Torokhov Signed-off-by: Sasha Levin --- drivers/input/joystick/xpad.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c index 14da79ead653..153b1ee13e03 100644 --- a/drivers/input/joystick/xpad.c +++ b/drivers/input/joystick/xpad.c @@ -1213,6 +1213,7 @@ static int xpad_led_probe(struct usb_xpad *xpad) led_cdev = &led->led_cdev; led_cdev->name = led->name; led_cdev->brightness_set = xpad_led_set; + led_cdev->flags = LED_CORE_SUSPENDRESUME; error = led_classdev_register(&xpad->udev->dev, led_cdev); if (error) @@ -1689,8 +1690,16 @@ static int xpad_resume(struct usb_interface *intf) retval = xpad360w_start_input(xpad); } else { mutex_lock(&input->mutex); - if (input->users) + if (input->users) { retval = xpad_start_input(xpad); + } else if (xpad->xtype == XTYPE_XBOXONE) { + /* + * Even if there are no users, we'll send Xbox One pads + * the startup sequence so they don't sit there and + * blink until somebody opens the input device again. + */ + retval = xpad_start_xbox_one(xpad); + } mutex_unlock(&input->mutex); } -- 2.17.1