From patchwork Fri Jun 26 19:24:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Gundersen X-Patchwork-Id: 6682791 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 545B79F399 for ; Fri, 26 Jun 2015 19:24:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 60AC220680 for ; Fri, 26 Jun 2015 19:24:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DA82C20671 for ; Fri, 26 Jun 2015 19:24:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752596AbbFZTYY (ORCPT ); Fri, 26 Jun 2015 15:24:24 -0400 Received: from mail-la0-f53.google.com ([209.85.215.53]:36427 "EHLO mail-la0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752568AbbFZTYX (ORCPT ); Fri, 26 Jun 2015 15:24:23 -0400 Received: by lacny3 with SMTP id ny3so69214985lac.3 for ; Fri, 26 Jun 2015 12:24:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=zrwkl5yXahn3jFt9RZhmK3RxCUyAI/ylAxJajdgN3lo=; b=bEpvEWsbIWiOA/LbWAZDpOpUhAis0BKsSaDvSPEQtPvBqx2bjspkQWcLetDFNakgG9 Dxtrkwx8LqIZT30ERI/aZSzInL3ckNAGR+fCHPLxCPNbC+M+5wmd8rLAYxdlUxmxH0Hz 1WGBJooBKETnelTueNWg+sF/fjy3ECCfWFTeeQu6M+SzPl0eblHs6y8sOKamskzv0XQw sQ7FC/vvDFDlrshoO06d3EXUR6aWoegenskn4r8GlDJuG6FIdJUg9p9a9HzPpu4xk4qn /p1zas2tL5iOqG5QjsToWduxkVoD3xOgSYbjWfW0xWlVXflusUc4eRxjWvROf+ICANQY xOuQ== X-Gm-Message-State: ALoCoQl8oNxCZQg0uVxqBc2odJMSDi1iUFl2Ndfkqf3q+UWFjAavs7vJFqhbDJcezsbQacXS896j X-Received: by 10.152.5.227 with SMTP id v3mr502365lav.39.1435346661619; Fri, 26 Jun 2015 12:24:21 -0700 (PDT) Received: from localhost.localdomain (cm-84.208.139.44.getinternet.no. [84.208.139.44]) by mx.google.com with ESMTPSA id q1sm8361314lah.27.2015.06.26.12.24.18 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Jun 2015 12:24:18 -0700 (PDT) From: Tom Gundersen To: linux-usb@vger.kernel.org Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Tom Gundersen , Jiri Kosina , Greg Kroah-Hartman Subject: [PATCH][RFC] usbhid: enable autosuspend for internal devices Date: Fri, 26 Jun 2015 21:24:07 +0200 Message-Id: <1435346647-29473-1-git-send-email-teg@jklm.no> X-Mailer: git-send-email 2.4.3 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This policy used to be unconditionally applied by udev, but there is no reason to make userspace be involved in this and in the future udev will not be doing it by default. See: . Signed-off-by: Tom Gundersen Cc: Jiri Kosina Cc: Greg Kroah-Hartman Acked-by: Greg Kroah-Hartman --- Hi, I don't have the right hardware for this, so it has only been compile-tested. I'm therefore sending it as an RFC only. Mainly I want to bring it to people's attention that it would be great to get this feature into the kernel as we want to drop it from udev. Cheers, Tom drivers/hid/usbhid/hid-core.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c index bfbe1be..af80700 100644 --- a/drivers/hid/usbhid/hid-core.c +++ b/drivers/hid/usbhid/hid-core.c @@ -1358,6 +1358,9 @@ static int usbhid_probe(struct usb_interface *intf, const struct usb_device_id * setup_timer(&usbhid->io_retry, hid_retry_timeout, (unsigned long) hid); spin_lock_init(&usbhid->lock); + if (dev->removable == USB_DEVICE_FIXED) + usb_enable_autosuspend(dev); + ret = hid_add_device(hid); if (ret) { if (ret != -ENODEV)