Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp160695ybb; Thu, 19 Mar 2020 18:50:50 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvahCsLcdhbFIGp9KXkdbMMIZCHBQ033ftG7hLfuhhEXvhpm6oW5heuNSkZqevnD9A574q1 X-Received: by 2002:a05:6808:9ac:: with SMTP id e12mr4283277oig.149.1584669050037; Thu, 19 Mar 2020 18:50:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584669050; cv=none; d=google.com; s=arc-20160816; b=Awrri32I7/2Zcv33/+lEnG8R7eTxWCCWO13zA0rYnM2gJAnnMMS3mexzHzLZTOIZxL uyoy0MiUrXT4Mz+lGlVKxe3jTmrWTIaf2BZ5ZCMveQ/TDPvdK5WGwlFrNbcBojDWkQiM JxvSfLvXPDARGS5lNAA239GoaoU+6hnGbkaBK3NRP/4R/DDLRSjsVaWrOjsHFkjmHWFC D1xs93owdL044T+AlCU5/OrwyyiGv0rN2D0jxLj/tcXGVH9rHyOWX8VMic1BQZ3quw6g w7h70j5iL90vShQ/jYx4xXmDPpS+7NCc5G09TL014kZQDdMIFgQVhwSfYGuA9x6g5RmH EDcg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=PU9kgEpwwuugzuBur1kbsdnAZUff4cZ6r30c+t/EDPo=; b=YyVE+n6YtLC19RclCcVPvWlvFA/H/mQRE5JtiPq3mgRTWD33bNlykhv4pxrOCOqfBl CAo2H/7DQtIemvuZpsQaBpcjh4fPW43Fg3SNGEPj1W8DJE7wW6u5DU3fQ4P+GetjBGgo 7uG5gf9cydxkwMDBbbDCzXhOMTC0+xcwY9BAe74TFp/Ea68bX4AojGqY/tomKEuv1ovk eaX//or/GN0gzZ0vaV2XVwQQK2j3xMQmHJFEP5KBHouT2V+fwiWmS1Spgi4KU7nOHZCK OADXw+k1SMB+rOBey1Oq6W8UUOAohaSV3W1tgSLcFQF/vAbyZLMdlysCeGgLoOs5d+MF r48w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=htsh1BsI; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f6si2215028otq.50.2020.03.19.18.50.38; Thu, 19 Mar 2020 18:50:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-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=@chromium.org header.s=google header.b=htsh1BsI; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727257AbgCTBu2 (ORCPT + 99 others); Thu, 19 Mar 2020 21:50:28 -0400 Received: from mail-pg1-f179.google.com ([209.85.215.179]:33616 "EHLO mail-pg1-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727192AbgCTBu1 (ORCPT ); Thu, 19 Mar 2020 21:50:27 -0400 Received: by mail-pg1-f179.google.com with SMTP id d17so1696274pgo.0 for ; Thu, 19 Mar 2020 18:50:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=PU9kgEpwwuugzuBur1kbsdnAZUff4cZ6r30c+t/EDPo=; b=htsh1BsIw/p7dOlQFwSVIjtvBlNnQQBXdQHQTuQF3StdBMVFSVUxzIfacwg2jrIsJ+ eB2DXlJPRxuCzrGfnlxhGp2iyaekqTuAbvOvl8ZqRI0IgVhWsN9IRznxLnVgpcZDMxdN qGSTjoR+PG5aRIB8b5DYDkOmAa+mdOR/bKVb0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=PU9kgEpwwuugzuBur1kbsdnAZUff4cZ6r30c+t/EDPo=; b=AEeB/Wy8+A7yNBdOhoV3Ki/YAiHlAwH1N9vIgNgriHv8oLrMponh8kiW/ZTdqMxcQg xIDn4z1SMSxr1ypz2Iro3EjmTzwd0fO+9GFbv9bLq4RjqB62gh30NCruL7VO5hqgVUaF y0ZKqNmQN8pDn558yUuXdxiw9RsPxOdv9w1q7jQG2C9YoFJdc3OC3bR5ZgGFIcgSdh80 vSJ6ONkZpjYT1pHy8Kh3irFCWyHssP9+mg8D2w9RaU8EX+7DNKCnzIFfroem2rQEsubp 8jrzNejXKn2Fyy7Z/GrMg+BKia0QqMOptmpU6kw9waHQA8t/wltwiJKp6//S1JB8F1in k69Q== X-Gm-Message-State: ANhLgQ1FdUdo4S4Hl/Wql/jyggeQilysiKDgFUZ7W8EpWuYwfC2HtVbD L/ezMxCV6GjiDftBuXGu4hiQxQ== X-Received: by 2002:a63:c550:: with SMTP id g16mr6481154pgd.9.1584669026690; Thu, 19 Mar 2020 18:50:26 -0700 (PDT) Received: from apsdesk.mtv.corp.google.com ([2620:15c:202:1:e09a:8d06:a338:aafb]) by smtp.gmail.com with ESMTPSA id 136sm3410485pgh.26.2020.03.19.18.50.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Mar 2020 18:50:26 -0700 (PDT) From: Abhishek Pandit-Subedi To: luiz.dentz@gmail.com, marcel@holtmann.org Cc: alainm@chromium.org, chromeos-bluetooth-upstreaming@chromium.org, linux-bluetooth@vger.kernel.org, Abhishek Pandit-Subedi Subject: [BlueZ PATCH v4 0/5] device: Allow devices to be marked as wake capable Date: Thu, 19 Mar 2020 18:50:18 -0700 Message-Id: <20200320015023.85896-1-abhishekpandit@chromium.org> X-Mailer: git-send-email 2.25.1.696.g5e7596f4ac-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Luiz and Marcel, Please do not merge this until the accompanying kernel change is accepted. I am sending this series to show how I plan on using the changes to the Add Device management operation. Pending questions I have for this series: * Do I need to distinguish whether the kernel supports the updated Add Device structure? (It will probably reject it if the size isn't correct) * Can we allow HID devices to default to Wake Allowed? I think its preferable to allow newly paired HID devices to wake the system from sleep without any additional changes. -- This change accompanies a change in the kernel to allow marking devices as wakeable so they can wake the system from suspend. Currently, only HID devices support this and will be configured to allow this setting to be changed via the WakeAllowed property. In order to set this flag, Bluez must call the Add Device management operation with the DEVICE_FLAG_WAKEABLE flag mask and value set. This call can be made multiple times with the same address (the kernel will add the device the first time but only update the action or flags on subsequent calls). This change was tested with appropriate kernel changes on v4.19 (verified that HID devices were being marked as wake capable in the kernel). Thanks Abhishek Changes in v4: * Newly added support in Add Device for flags * Renamed wake_capable to wake_allowed * Removed set_wake_capable mgmt op and updated add_device to accept flags to set whether a device is wakeable * Refactored adapter_whitelist_add and adapter_auto_connect_add to call adapter_add_device * Renamed WakeCapable to WakeAllowed * Renamed WakeCapable to WakeAllowed * Renamed device_set_profile_wake_support to just device_set_wake_support Changes in v3: * Added profile_wake_support and made wake_capable dependent on it * Added documentation for WakeCapable * Mark HID device to support wake from suspend Changes in v2: * Added dbus api "WakeCapable" to set value * Update device_set_wake_capable to be called by adapter_set_wake_capable_complete so we can emit property changed * Newly added to show whether device is wake capable * Removed automatically setting wake capable for HID devices Abhishek Pandit-Subedi (5): mgmt: Update docs for Add Device device: Support marking a device with wake allowed client: Display wake allowed property with info doc/device-api: Add WakeAllowed input: Make HID devices support wake client/main.c | 1 + doc/device-api.txt | 5 ++ doc/mgmt-api.txt | 12 ++++ lib/mgmt.h | 3 + profiles/input/device.c | 1 + profiles/input/hog.c | 1 + src/adapter.c | 112 +++++++++++++---------------------- src/adapter.h | 1 + src/device.c | 125 ++++++++++++++++++++++++++++++++++++++++ src/device.h | 8 +++ 10 files changed, 197 insertions(+), 72 deletions(-) -- 2.25.1.696.g5e7596f4ac-goog